@fnndsc/salsa 4.4.4 → 4.5.0

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.
@@ -145,3 +145,10 @@ export * from './plugin_register.js';
145
145
  export * from './peer_search.js';
146
146
  export * from './store_import.js';
147
147
  export * from './plugin_executeInPlace.js';
148
+ export * from './plugin_add.js';
149
+ export * from './plugin_docker.js';
150
+ export * from './plugin_index.js';
151
+ export * from './plugin_sync.js';
152
+ export * from './plugin_validate.js';
153
+ export * from './pool.js';
154
+ export * from './tar_read.js';
@@ -285,4 +285,11 @@ __exportStar(require("./plugin_register.js"), exports);
285
285
  __exportStar(require("./peer_search.js"), exports);
286
286
  __exportStar(require("./store_import.js"), exports);
287
287
  __exportStar(require("./plugin_executeInPlace.js"), exports);
288
+ __exportStar(require("./plugin_add.js"), exports);
289
+ __exportStar(require("./plugin_docker.js"), exports);
290
+ __exportStar(require("./plugin_index.js"), exports);
291
+ __exportStar(require("./plugin_sync.js"), exports);
292
+ __exportStar(require("./plugin_validate.js"), exports);
293
+ __exportStar(require("./pool.js"), exports);
294
+ __exportStar(require("./tar_read.js"), exports);
288
295
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/plugins/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;AAyBH,oCAQC;AAQD,0CAIC;AAOD,4CASC;AAQD,oDAQC;AAiCD,wDAQC;AAWD,gCAGC;AAQD,0DAOC;AAWD,sEAGC;AAQD,4EA0BC;AAWD,gEAsBC;AAQD,wEAUC;AAWD,sEAiBC;AAQD,sCAQC;AAQD,4CAEC;AAQD,sCAGC;AArTD,yCAYuB;AACvB,kDAA0B;AAE1B,8BAA8B;AAE9B;;;;;GAKG;AACI,KAAK,UAAU,YAAY,CAAC,OAAoB;IACrD,MAAM,WAAW,GAAqB,IAAI,wBAAgB,EAAE,CAAC;IAE7D,IAAI,C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,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,QAAgB;IAClD,MAAM,QAAQ,GAAgC,MAAM,0BAA0B,CAAC,QAAQ,CAAC,CAAC;IACzF,OAAO,QAAQ,EAAE,OAAO,IAAI,IAAI,CAAC;AACnC,CAAC;AAED,mFAAmF;AACnF,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC;AAClC,6DAA2C;AAC3C,kDAAgC;AAChC,qDAAmC;AACnC,oDAAkC;AAClC,mDAAiC;AACjC,uDAAqC;AACrC,4CAA0B;AAC1B,gDAA8B"}
@@ -0,0 +1,173 @@
1
+ /**
2
+ * @file Registering one plugin in the connected CUBE: `plugin add`.
3
+ *
4
+ * One verb, four ways in:
5
+ *
6
+ * - **a descriptor** (`plugin add --json <file>`): the descriptor's text goes
7
+ * straight to CUBE's administrative upload, unless that name and version
8
+ * are already registered;
9
+ * - **a URL** of a plugin in another CUBE: passed through as the upload's
10
+ * `plugin_store_url`, and CUBE fetches the plugin itself;
11
+ * - **a name** or **an image**: registered already? then nothing to do;
12
+ * else looked up in the peer store and imported from it; else the
13
+ * image's own descriptor is read out of it with docker and uploaded.
14
+ *
15
+ * Every path registers through one upload ({@link plugin_addDescriptor}
16
+ * for descriptors), which `plugin sync` shares, and every refusal carries
17
+ * CUBE's own reason. Compute resources default to all the CUBE has, as
18
+ * `plugin add` always did; a failed read of them is a failure, never a
19
+ * guess at `host`.
20
+ *
21
+ * Key components:
22
+ * - PluginAddOutcome / PluginAddResult: what an add did.
23
+ * - PluginAddOptions: compute resources, peer store, administrator credentials.
24
+ * - pluginInput_detect: whether an input is a URL, an image or a name.
25
+ * - computeNames_resolve: the compute resources a plugin is registered on.
26
+ * - plugin_addDescriptor: upload one descriptor's text (shared with sync).
27
+ * - plugin_addJson: `plugin add --json`.
28
+ * - plugin_add: `plugin add <name|image|url>`.
29
+ *
30
+ * Typical usage:
31
+ * ```ts
32
+ * const result: PluginAddResult = await plugin_add('pl-dircopy', { store: storeUrl }, (line: string): void => sink(line));
33
+ * ```
34
+ *
35
+ * Dependencies: cumin (CUBE reads and the administrative upload), the peer
36
+ * store search, and docker on the host for the image path.
37
+ *
38
+ * @module
39
+ */
40
+ import { type Result } from '@fnndsc/cumin';
41
+ import { type DockerRun } from './plugin_docker.js';
42
+ import { type AdminCredentials } from './store_import.js';
43
+ /** What an add did. */
44
+ export type PluginAddOutcome = 'installed' | 'already_exists' | 'failed';
45
+ /** Writes one progress line where the operator can see it. */
46
+ export type PluginAddNote = (line: string) => void;
47
+ /**
48
+ * What `plugin add` was asked to do it with.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const options: PluginAddOptions = { compute: 'host,gpu', store: 'https://cube.chrisproject.org/api/v1/' };
53
+ * ```
54
+ */
55
+ export interface PluginAddOptions {
56
+ /** Compute resources, comma-separated; all the CUBE has when absent. */
57
+ readonly compute?: string;
58
+ /** The peer store to search; the caller's configured store. */
59
+ readonly store?: string;
60
+ /** Administrator username, for a non-interactive upload. */
61
+ readonly adminUser?: string;
62
+ /** Administrator password, for a non-interactive upload. */
63
+ readonly adminPassword?: string;
64
+ /** The plugin's repository, when an image's descriptor leaves it out. */
65
+ readonly publicRepo?: string;
66
+ }
67
+ /**
68
+ * What an add did, and to which plugin.
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const result: PluginAddResult = { outcome: 'installed', name: 'pl-dircopy', version: '2.1.1' };
73
+ * ```
74
+ */
75
+ export interface PluginAddResult {
76
+ /** The outcome. */
77
+ readonly outcome: PluginAddOutcome;
78
+ /** The plugin's name, when known. */
79
+ readonly name?: string;
80
+ /** The plugin's version, when known. */
81
+ readonly version?: string;
82
+ /** Why it failed, when it did (also on the error stack). */
83
+ readonly reason?: string;
84
+ }
85
+ /**
86
+ * What an input names.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * pluginInput_detect('fnndsc/pl-dircopy:2.1.1'); // { kind: 'image', value: …, name: 'pl-dircopy', version: '2.1.1' }
91
+ * ```
92
+ */
93
+ export interface PluginInput {
94
+ /** A plugin URL in another CUBE, an image reference, or a plugin name. */
95
+ readonly kind: 'url' | 'image' | 'name';
96
+ /** The input, trimmed. */
97
+ readonly value: string;
98
+ /** The plugin name it implies. */
99
+ readonly name: string;
100
+ /** The version it implies, when it names one. */
101
+ readonly version?: string;
102
+ }
103
+ /**
104
+ * Detects what an input names.
105
+ *
106
+ * A URL starts with `http://` or `https://`; an image holds `/` or `:`;
107
+ * anything else is a plugin name, `pl-x-v1.2.3` naming a version.
108
+ *
109
+ * @param input - The input as typed.
110
+ * @returns What it names.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * pluginInput_detect('pl-dircopy-v2.1.1'); // { kind: 'name', value: 'pl-dircopy', name: 'pl-dircopy', version: '2.1.1' }
115
+ * ```
116
+ */
117
+ export declare function pluginInput_detect(input: string): PluginInput;
118
+ /**
119
+ * Resolves the compute resources a plugin is registered on.
120
+ *
121
+ * @param compute - Comma-separated names; all the CUBE's resources when absent.
122
+ * @returns The names, or an error on the error stack (an unknown name, or the
123
+ * CUBE's resources could not be read — never a guess).
124
+ *
125
+ * @example
126
+ * ```ts
127
+ * const names: Result<string[]> = await computeNames_resolve('host');
128
+ * ```
129
+ */
130
+ export declare function computeNames_resolve(compute?: string): Promise<Result<string[]>>;
131
+ /**
132
+ * Uploads one descriptor's text through CUBE's administrative upload.
133
+ *
134
+ * @param descriptor - The descriptor's JSON text.
135
+ * @param computeNames - Compute resources to register it on.
136
+ * @param creds - Administrator credentials; the session when absent.
137
+ * @returns The registered plugin's fields, or an error on the error stack.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * const added: Result<Record<string, unknown>> = await plugin_addDescriptor(text, ['host']);
142
+ * ```
143
+ */
144
+ export declare function plugin_addDescriptor(descriptor: string, computeNames: string[], creds?: AdminCredentials): Promise<Result<Record<string, unknown>>>;
145
+ /**
146
+ * Registers one descriptor file's plugin: `plugin add --json`.
147
+ *
148
+ * @param text - The descriptor's JSON text.
149
+ * @param options - Compute resources and credentials.
150
+ * @param note - Where progress lines go.
151
+ * @returns What the add did.
152
+ *
153
+ * @example
154
+ * ```ts
155
+ * const result: PluginAddResult = await plugin_addJson(readFileSync('pl-x.json', 'utf8'), {}, console.log);
156
+ * ```
157
+ */
158
+ export declare function plugin_addJson(text: string, options: PluginAddOptions, note: PluginAddNote): Promise<PluginAddResult>;
159
+ /**
160
+ * Registers a plugin named by a URL, an image or a name: `plugin add`.
161
+ *
162
+ * @param input - The URL, image reference or plugin name.
163
+ * @param options - Compute resources, peer store and credentials.
164
+ * @param note - Where progress lines go.
165
+ * @param run - The docker seam, for the image path.
166
+ * @returns What the add did.
167
+ *
168
+ * @example
169
+ * ```ts
170
+ * const result: PluginAddResult = await plugin_add('fnndsc/pl-dircopy:2.1.1', {}, console.log);
171
+ * ```
172
+ */
173
+ export declare function plugin_add(input: string, options: PluginAddOptions, note: PluginAddNote, run?: DockerRun): Promise<PluginAddResult>;
@@ -0,0 +1,325 @@
1
+ "use strict";
2
+ /**
3
+ * @file Registering one plugin in the connected CUBE: `plugin add`.
4
+ *
5
+ * One verb, four ways in:
6
+ *
7
+ * - **a descriptor** (`plugin add --json <file>`): the descriptor's text goes
8
+ * straight to CUBE's administrative upload, unless that name and version
9
+ * are already registered;
10
+ * - **a URL** of a plugin in another CUBE: passed through as the upload's
11
+ * `plugin_store_url`, and CUBE fetches the plugin itself;
12
+ * - **a name** or **an image**: registered already? then nothing to do;
13
+ * else looked up in the peer store and imported from it; else the
14
+ * image's own descriptor is read out of it with docker and uploaded.
15
+ *
16
+ * Every path registers through one upload ({@link plugin_addDescriptor}
17
+ * for descriptors), which `plugin sync` shares, and every refusal carries
18
+ * CUBE's own reason. Compute resources default to all the CUBE has, as
19
+ * `plugin add` always did; a failed read of them is a failure, never a
20
+ * guess at `host`.
21
+ *
22
+ * Key components:
23
+ * - PluginAddOutcome / PluginAddResult: what an add did.
24
+ * - PluginAddOptions: compute resources, peer store, administrator credentials.
25
+ * - pluginInput_detect: whether an input is a URL, an image or a name.
26
+ * - computeNames_resolve: the compute resources a plugin is registered on.
27
+ * - plugin_addDescriptor: upload one descriptor's text (shared with sync).
28
+ * - plugin_addJson: `plugin add --json`.
29
+ * - plugin_add: `plugin add <name|image|url>`.
30
+ *
31
+ * Typical usage:
32
+ * ```ts
33
+ * const result: PluginAddResult = await plugin_add('pl-dircopy', { store: storeUrl }, (line: string): void => sink(line));
34
+ * ```
35
+ *
36
+ * Dependencies: cumin (CUBE reads and the administrative upload), the peer
37
+ * store search, and docker on the host for the image path.
38
+ *
39
+ * @module
40
+ */
41
+ Object.defineProperty(exports, "__esModule", { value: true });
42
+ exports.pluginInput_detect = pluginInput_detect;
43
+ exports.computeNames_resolve = computeNames_resolve;
44
+ exports.plugin_addDescriptor = plugin_addDescriptor;
45
+ exports.plugin_addJson = plugin_addJson;
46
+ exports.plugin_add = plugin_add;
47
+ const cumin_1 = require("@fnndsc/cumin");
48
+ const plugin_docker_js_1 = require("./plugin_docker.js");
49
+ const peer_search_js_1 = require("./peer_search.js");
50
+ const plugin_register_js_1 = require("./plugin_register.js");
51
+ const store_import_js_1 = require("./store_import.js");
52
+ /**
53
+ * Detects what an input names.
54
+ *
55
+ * A URL starts with `http://` or `https://`; an image holds `/` or `:`;
56
+ * anything else is a plugin name, `pl-x-v1.2.3` naming a version.
57
+ *
58
+ * @param input - The input as typed.
59
+ * @returns What it names.
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * pluginInput_detect('pl-dircopy-v2.1.1'); // { kind: 'name', value: 'pl-dircopy', name: 'pl-dircopy', version: '2.1.1' }
64
+ * ```
65
+ */
66
+ function pluginInput_detect(input) {
67
+ const value = input.trim();
68
+ if (/^https?:\/\//.test(value))
69
+ return { kind: 'url', value, name: value };
70
+ if (value.includes('/') || value.includes(':')) {
71
+ const last = value.split('@')[0]?.split('/').pop() ?? value;
72
+ const colon = last.indexOf(':');
73
+ const name = colon === -1 ? last : last.slice(0, colon);
74
+ return colon === -1 ? { kind: 'image', value, name } : { kind: 'image', value, name, version: last.slice(colon + 1) };
75
+ }
76
+ const marker = value.lastIndexOf('-v');
77
+ if (marker > 0 && /^[0-9.]+$/.test(value.slice(marker + 2))) {
78
+ const name = value.slice(0, marker);
79
+ return { kind: 'name', value: name, name, version: value.slice(marker + 2) };
80
+ }
81
+ return { kind: 'name', value, name: value };
82
+ }
83
+ /**
84
+ * Resolves the compute resources a plugin is registered on.
85
+ *
86
+ * @param compute - Comma-separated names; all the CUBE's resources when absent.
87
+ * @returns The names, or an error on the error stack (an unknown name, or the
88
+ * CUBE's resources could not be read — never a guess).
89
+ *
90
+ * @example
91
+ * ```ts
92
+ * const names: Result<string[]> = await computeNames_resolve('host');
93
+ * ```
94
+ */
95
+ async function computeNames_resolve(compute) {
96
+ if (compute !== undefined && compute.trim() !== '') {
97
+ const names = (0, cumin_1.computeResourceNames_parse)(compute);
98
+ const valid = await (0, cumin_1.computeResources_validate)(names);
99
+ return valid.ok ? (0, cumin_1.Ok)(names) : (0, cumin_1.Err)();
100
+ }
101
+ const all = await (0, cumin_1.computeResources_getAll)();
102
+ if (!all.ok) {
103
+ cumin_1.errorStack.stack_push('error', 'Could not read the compute resources; not guessing. Name them with --compute.');
104
+ return (0, cumin_1.Err)();
105
+ }
106
+ if (all.value.length === 0) {
107
+ cumin_1.errorStack.stack_push('error', 'This CUBE has no compute resources to register plugins on.');
108
+ return (0, cumin_1.Err)();
109
+ }
110
+ return (0, cumin_1.Ok)(all.value.map((resource) => resource.name));
111
+ }
112
+ /**
113
+ * Uploads one descriptor's text through CUBE's administrative upload.
114
+ *
115
+ * @param descriptor - The descriptor's JSON text.
116
+ * @param computeNames - Compute resources to register it on.
117
+ * @param creds - Administrator credentials; the session when absent.
118
+ * @returns The registered plugin's fields, or an error on the error stack.
119
+ *
120
+ * @example
121
+ * ```ts
122
+ * const added: Result<Record<string, unknown>> = await plugin_addDescriptor(text, ['host']);
123
+ * ```
124
+ */
125
+ async function plugin_addDescriptor(descriptor, computeNames, creds) {
126
+ const token = await adminToken_get(creds);
127
+ return (0, cumin_1.pluginAdmin_upload)({ descriptor }, computeNames, token);
128
+ }
129
+ /**
130
+ * Registers one descriptor file's plugin: `plugin add --json`.
131
+ *
132
+ * @param text - The descriptor's JSON text.
133
+ * @param options - Compute resources and credentials.
134
+ * @param note - Where progress lines go.
135
+ * @returns What the add did.
136
+ *
137
+ * @example
138
+ * ```ts
139
+ * const result: PluginAddResult = await plugin_addJson(readFileSync('pl-x.json', 'utf8'), {}, console.log);
140
+ * ```
141
+ */
142
+ async function plugin_addJson(text, options, note) {
143
+ let data;
144
+ try {
145
+ data = JSON.parse(text);
146
+ }
147
+ catch (error) {
148
+ return addFailure_record(`the descriptor is not JSON: ${error instanceof Error ? error.message : String(error)}`);
149
+ }
150
+ const record = data !== null && typeof data === 'object' && !Array.isArray(data) ? data : {};
151
+ const name = typeof record['name'] === 'string' ? record['name'] : undefined;
152
+ const version = typeof record['version'] === 'string' ? record['version'] : undefined;
153
+ if (name === undefined || version === undefined)
154
+ return addFailure_record('the descriptor names no plugin name and version');
155
+ const computes = await computeNames_resolve(options.compute);
156
+ if (!computes.ok)
157
+ return { outcome: 'failed', name, version };
158
+ if (await pluginVersion_isRegistered(name, version))
159
+ return { outcome: 'already_exists', name, version };
160
+ note(`Registering ${name} ${version} on ${computes.value.join(', ')}…`);
161
+ const added = await plugin_addDescriptor(text, computes.value, creds_build(options));
162
+ return added.ok ? { outcome: 'installed', name, version } : { outcome: 'failed', name, version };
163
+ }
164
+ /**
165
+ * Registers a plugin named by a URL, an image or a name: `plugin add`.
166
+ *
167
+ * @param input - The URL, image reference or plugin name.
168
+ * @param options - Compute resources, peer store and credentials.
169
+ * @param note - Where progress lines go.
170
+ * @param run - The docker seam, for the image path.
171
+ * @returns What the add did.
172
+ *
173
+ * @example
174
+ * ```ts
175
+ * const result: PluginAddResult = await plugin_add('fnndsc/pl-dircopy:2.1.1', {}, console.log);
176
+ * ```
177
+ */
178
+ async function plugin_add(input, options, note, run = plugin_docker_js_1.docker_run) {
179
+ const detected = pluginInput_detect(input);
180
+ const computes = await computeNames_resolve(options.compute);
181
+ if (!computes.ok)
182
+ return { outcome: 'failed' };
183
+ if (detected.kind === 'url') {
184
+ note(`Asking CUBE to register the plugin at ${detected.value}…`);
185
+ const token = await adminToken_get(creds_build(options));
186
+ const added = await (0, cumin_1.pluginAdmin_upload)({ storeUrl: detected.value }, computes.value, token);
187
+ if (!added.ok)
188
+ return { outcome: 'failed' };
189
+ return pluginRegistered_result(added.value);
190
+ }
191
+ const existing = await (0, plugin_register_js_1.plugin_checkExists)(detected.kind === 'image' ? detected.value : detected.name);
192
+ if (existing !== null && (detected.version === undefined || existing['version'] === detected.version)) {
193
+ return { outcome: 'already_exists', name: detected.name, ...(detected.version === undefined ? {} : { version: detected.version }) };
194
+ }
195
+ note(`Searching the peer store for ${detected.name}…`);
196
+ const peerStores = options.store === undefined ? undefined : [options.store];
197
+ const found = await (0, peer_search_js_1.plugins_searchPeers)(detected.name, detected.version, peerStores);
198
+ if (found !== null) {
199
+ note(`Found in ${found.storeName}; importing.`);
200
+ const imported = await (0, store_import_js_1.plugin_importFromStore)('', found.plugin, computes.value, creds_build(options));
201
+ if (imported.success)
202
+ return pluginRegistered_result(imported.plugin ?? {});
203
+ return addFailure_record(imported.errorMessage ?? 'the peer store import failed', detected);
204
+ }
205
+ const image = detected.kind === 'image' ? detected.value : `${detected.name}:latest`;
206
+ note(`Not in the peer store; reading the descriptor out of ${image}.`);
207
+ return pluginFromImage_add(image, computes.value, options, run);
208
+ }
209
+ /**
210
+ * Registers a plugin from its image's own descriptor.
211
+ *
212
+ * @param image - The image reference.
213
+ * @param computeNames - Compute resources to register it on.
214
+ * @param options - Credentials and the repository to fill in.
215
+ * @param run - The docker seam.
216
+ * @returns What the add did.
217
+ */
218
+ async function pluginFromImage_add(image, computeNames, options, run) {
219
+ if (!await (0, plugin_docker_js_1.docker_isAvailable)(run))
220
+ return addFailure_record('docker is not installed or not running on this host');
221
+ const missing = await (0, plugin_docker_js_1.dockerImage_ensure)(image, run);
222
+ if (missing !== null)
223
+ return addFailure_record(missing);
224
+ const descriptor = await (0, plugin_docker_js_1.descriptorFromImage_extract)(image, options.publicRepo, run);
225
+ if (descriptor === null)
226
+ return addFailure_record(`${image} printed no plugin descriptor (is it a ChRIS plugin?)`);
227
+ descriptorGaps_fill(descriptor, image, options.publicRepo);
228
+ const added = await plugin_addDescriptor(JSON.stringify(descriptor), computeNames, creds_build(options));
229
+ if (!added.ok)
230
+ return { outcome: 'failed', name: String(descriptor['name']) };
231
+ return pluginRegistered_result(added.value);
232
+ }
233
+ /**
234
+ * Fills what an image's descriptor may leave out: its name, image and repository.
235
+ *
236
+ * @param descriptor - The descriptor, changed in place.
237
+ * @param image - The image it came from.
238
+ * @param publicRepo - The repository the operator named, when any.
239
+ */
240
+ function descriptorGaps_fill(descriptor, image, publicRepo) {
241
+ if (typeof descriptor['name'] !== 'string' || descriptor['name'] === '')
242
+ descriptor['name'] = pluginInput_detect(image).name;
243
+ if (typeof descriptor['dock_image'] !== 'string' || descriptor['dock_image'] === '')
244
+ descriptor['dock_image'] = image;
245
+ if (typeof descriptor['public_repo'] !== 'string' || descriptor['public_repo'] === '') {
246
+ if (publicRepo !== undefined)
247
+ descriptor['public_repo'] = publicRepo;
248
+ }
249
+ }
250
+ /**
251
+ * Reports whether a name and version are registered in the connected CUBE.
252
+ *
253
+ * @param name - The plugin name.
254
+ * @param version - The version.
255
+ * @returns True when CUBE holds that version.
256
+ */
257
+ async function pluginVersion_isRegistered(name, version) {
258
+ const client = await cumin_1.chrisConnection.client_get();
259
+ if (client === null)
260
+ return false;
261
+ try {
262
+ return (await (0, cumin_1.plugin_find)(client, name, version)) !== null;
263
+ }
264
+ catch {
265
+ // A failed read is not "registered": the upload that follows answers
266
+ // with CUBE's own refusal if the version is there after all.
267
+ return false;
268
+ }
269
+ }
270
+ /**
271
+ * Builds the result of a registration from CUBE's answer.
272
+ *
273
+ * @param plugin - The registered plugin's fields.
274
+ * @returns An installed result naming it.
275
+ */
276
+ function pluginRegistered_result(plugin) {
277
+ const name = plugin['name'];
278
+ const version = plugin['version'];
279
+ return {
280
+ outcome: 'installed',
281
+ ...(typeof name === 'string' ? { name } : {}),
282
+ ...(typeof version === 'string' ? { version } : {}),
283
+ };
284
+ }
285
+ /**
286
+ * Records a failure on the error stack and as a result.
287
+ *
288
+ * @param reason - Why the add failed.
289
+ * @param input - The input, for the plugin's name.
290
+ * @returns A failed result carrying the reason.
291
+ */
292
+ function addFailure_record(reason, input) {
293
+ cumin_1.errorStack.stack_push('error', reason);
294
+ return { outcome: 'failed', reason, ...(input === undefined ? {} : { name: input.name }) };
295
+ }
296
+ /**
297
+ * Builds administrator credentials from the options, when both halves are given.
298
+ *
299
+ * @param options - The add options.
300
+ * @returns The credentials, or undefined to upload as the session.
301
+ */
302
+ function creds_build(options) {
303
+ return options.adminUser && options.adminPassword ? { username: options.adminUser, password: options.adminPassword } : undefined;
304
+ }
305
+ /**
306
+ * Gets an administrator token for credentials.
307
+ *
308
+ * @param creds - The credentials; none means the session uploads.
309
+ * @returns The token, or undefined when there are no credentials or the login failed (a warning says so).
310
+ */
311
+ async function adminToken_get(creds) {
312
+ if (creds?.username === undefined || creds.password === undefined)
313
+ return undefined;
314
+ const url = await cumin_1.chrisConnection.chrisURL_get();
315
+ if (!url)
316
+ return undefined;
317
+ try {
318
+ return await cumin_1.Client.getAuthToken(`${url.endsWith('/') ? url : `${url}/`}auth-token/`, creds.username, creds.password);
319
+ }
320
+ catch (error) {
321
+ cumin_1.errorStack.stack_push('warning', `Failed to get admin token: ${error instanceof Error ? error.message : String(error)}`);
322
+ return undefined;
323
+ }
324
+ }
325
+ //# sourceMappingURL=plugin_add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin_add.js","sourceRoot":"","sources":["../../src/plugins/plugin_add.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;;AAqGH,gDA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SAAS,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AACnI,CAAC;AAED;;;;;GAKG;AACH,KAAK,UAAU,cAAc,CAAC,KAAwB;IACpD,IAAI,KAAK,EAAE,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACpF,MAAM,GAAG,GAAkB,MAAM,uBAAe,CAAC,YAAY,EAAE,CAAC;IAChE,IAAI,CAAC,GAAG;QAAE,OAAO,SAAS,CAAC;IAC3B,IAAI,CAAC;QACH,OAAO,MAAM,cAAM,CAAC,YAAY,CAAC,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,aAAa,EAAE,KAAK,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxH,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,kBAAU,CAAC,UAAU,CAAC,SAAS,EAAE,8BAA8B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QACzH,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
@@ -0,0 +1,90 @@
1
+ /**
2
+ * @file Reading a plugin's descriptor out of its container image.
3
+ *
4
+ * The last way `plugin add` finds a descriptor: pull the image (or use the
5
+ * local copy) and ask it, trying the three ways ChRIS plugins have printed
6
+ * one over the years, in chrisomatic's order — `chris_plugin_info` with the
7
+ * image named, `chris_plugin_info` bare, and the old chrisapp `<CMD> --json`.
8
+ *
9
+ * Every docker call is an argument vector run without a shell: an image
10
+ * reference is operator input and never reaches a command line as text.
11
+ *
12
+ * Key components:
13
+ * - DockerRun: the seam that runs one docker command (tests stub it).
14
+ * - docker_isAvailable: whether a docker daemon answers.
15
+ * - dockerImage_ensure: the image locally, pulled when absent.
16
+ * - descriptorFromImage_extract: the image's descriptor JSON, by the three ways.
17
+ *
18
+ * Typical usage:
19
+ * ```ts
20
+ * if (await docker_isAvailable() && await dockerImage_ensure(image)) {
21
+ * const descriptor: Record<string, unknown> | null = await descriptorFromImage_extract(image);
22
+ * }
23
+ * ```
24
+ *
25
+ * Dependencies: Node.js `child_process`; a `docker` CLI on the host.
26
+ *
27
+ * @module
28
+ */
29
+ /** What one docker command answered. */
30
+ export interface DockerAnswer {
31
+ /** True when the command exited zero. */
32
+ readonly ok: boolean;
33
+ /** Its standard output, trimmed. */
34
+ readonly stdout: string;
35
+ /** Its standard error or failure message, trimmed. */
36
+ readonly stderr: string;
37
+ }
38
+ /** Runs one docker command from its argument vector. */
39
+ export type DockerRun = (args: readonly string[]) => Promise<DockerAnswer>;
40
+ /**
41
+ * Runs `docker` with an argument vector, no shell.
42
+ *
43
+ * @param args - The arguments after `docker`.
44
+ * @returns What it answered; never throws.
45
+ *
46
+ * @example
47
+ * ```ts
48
+ * const answer: DockerAnswer = await docker_run(['image', 'inspect', 'alpine']);
49
+ * ```
50
+ */
51
+ export declare const docker_run: DockerRun;
52
+ /**
53
+ * Reports whether a docker daemon answers.
54
+ *
55
+ * @param run - The docker seam.
56
+ * @returns True when `docker info` succeeds.
57
+ *
58
+ * @example
59
+ * ```ts
60
+ * await docker_isAvailable(); // false on a host without docker
61
+ * ```
62
+ */
63
+ export declare function docker_isAvailable(run?: DockerRun): Promise<boolean>;
64
+ /**
65
+ * Makes sure an image is present locally, pulling it when it is not.
66
+ *
67
+ * @param image - The image reference.
68
+ * @param run - The docker seam.
69
+ * @returns Null when the image is present; else why it could not be had.
70
+ *
71
+ * @example
72
+ * ```ts
73
+ * await dockerImage_ensure('fnndsc/pl-dircopy:2.1.1'); // null
74
+ * ```
75
+ */
76
+ export declare function dockerImage_ensure(image: string, run?: DockerRun): Promise<string | null>;
77
+ /**
78
+ * Reads a plugin's descriptor out of its image.
79
+ *
80
+ * @param image - The image reference.
81
+ * @param publicRepo - The plugin's repository, passed to `chris_plugin_info` when known.
82
+ * @param run - The docker seam.
83
+ * @returns The descriptor, or null when none of the three ways printed one.
84
+ *
85
+ * @example
86
+ * ```ts
87
+ * const descriptor: Record<string, unknown> | null = await descriptorFromImage_extract('fnndsc/pl-dircopy:2.1.1');
88
+ * ```
89
+ */
90
+ export declare function descriptorFromImage_extract(image: string, publicRepo?: string, run?: DockerRun): Promise<Record<string, unknown> | null>;