@fnndsc/salsa 4.5.7 → 4.6.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.
- package/README.md +0 -2
- package/dist/compute/index.d.ts +0 -9
- package/dist/compute/index.js +0 -16
- package/dist/compute/index.js.map +1 -1
- package/dist/dag/feedData.js +166 -73
- package/dist/dag/feedData.js.map +1 -1
- package/dist/dag/feedLoad.d.ts +1 -1
- package/dist/dag/feedLoad.js +6 -4
- package/dist/dag/feedLoad.js.map +1 -1
- package/dist/dicom/pixels.js +95 -36
- package/dist/dicom/pixels.js.map +1 -1
- package/dist/dicom/series.d.ts +4 -1
- package/dist/dicom/series.js +80 -31
- package/dist/dicom/series.js.map +1 -1
- package/dist/dicom/tags.d.ts +28 -0
- package/dist/dicom/tags.js +30 -0
- package/dist/dicom/tags.js.map +1 -1
- package/dist/files/copy.d.ts +197 -0
- package/dist/files/copy.js +636 -0
- package/dist/files/copy.js.map +1 -0
- package/dist/files/copyFolder.d.ts +103 -0
- package/dist/files/copyFolder.js +199 -0
- package/dist/files/copyFolder.js.map +1 -0
- package/dist/files/create.d.ts +178 -0
- package/dist/files/create.js +444 -0
- package/dist/files/create.js.map +1 -0
- package/dist/files/download.d.ts +188 -0
- package/dist/files/download.js +541 -0
- package/dist/files/download.js.map +1 -0
- package/dist/files/index.d.ts +69 -141
- package/dist/files/index.js +184 -535
- package/dist/files/index.js.map +1 -1
- package/dist/files/listing.d.ts +132 -0
- package/dist/files/listing.js +179 -0
- package/dist/files/listing.js.map +1 -0
- package/dist/files/move.d.ts +125 -0
- package/dist/files/move.js +334 -0
- package/dist/files/move.js.map +1 -0
- package/dist/files/pathMapper.d.ts +24 -1
- package/dist/files/pathMapper.js +108 -47
- package/dist/files/pathMapper.js.map +1 -1
- package/dist/files/proof.d.ts +315 -0
- package/dist/files/proof.js +574 -0
- package/dist/files/proof.js.map +1 -0
- package/dist/files/removal.d.ts +223 -0
- package/dist/files/removal.js +318 -0
- package/dist/files/removal.js.map +1 -0
- package/dist/files/replace.d.ts +175 -0
- package/dist/files/replace.js +582 -0
- package/dist/files/replace.js.map +1 -0
- package/dist/files/upload.d.ts +205 -0
- package/dist/files/upload.js +478 -0
- package/dist/files/upload.js.map +1 -0
- package/dist/index.d.ts +14 -2
- package/dist/index.js +45 -32
- package/dist/index.js.map +1 -1
- package/dist/jobs/index.d.ts +1 -1
- package/dist/jobs/index.js +1 -2
- package/dist/jobs/index.js.map +1 -1
- package/dist/jobs/jobOps.d.ts +0 -13
- package/dist/jobs/jobOps.js +0 -37
- package/dist/jobs/jobOps.js.map +1 -1
- package/dist/pacs/anonymise.d.ts +17 -36
- package/dist/pacs/anonymise.js +29 -67
- package/dist/pacs/anonymise.js.map +1 -1
- package/dist/pipelines/index.d.ts +1 -13
- package/dist/pipelines/index.js +0 -38
- package/dist/pipelines/index.js.map +1 -1
- package/dist/pipelines/invocation.js +321 -167
- package/dist/pipelines/invocation.js.map +1 -1
- package/dist/pipelines/manifest.js.map +1 -1
- package/dist/pipelines/packages.d.ts +11 -8
- package/dist/pipelines/packages.js +253 -77
- package/dist/pipelines/packages.js.map +1 -1
- package/dist/plugins/adminToken.d.ts +67 -0
- package/dist/plugins/adminToken.js +77 -0
- package/dist/plugins/adminToken.js.map +1 -0
- package/dist/plugins/index.d.ts +0 -7
- package/dist/plugins/index.js +0 -16
- package/dist/plugins/index.js.map +1 -1
- package/dist/plugins/peer_search.d.ts +0 -15
- package/dist/plugins/peer_search.js +0 -25
- package/dist/plugins/peer_search.js.map +1 -1
- package/dist/plugins/plugin_add.d.ts +14 -2
- package/dist/plugins/plugin_add.js +42 -13
- package/dist/plugins/plugin_add.js.map +1 -1
- package/dist/plugins/plugin_docker.d.ts +25 -0
- package/dist/plugins/plugin_docker.js +33 -0
- package/dist/plugins/plugin_docker.js.map +1 -1
- package/dist/plugins/plugin_register.d.ts +0 -10
- package/dist/plugins/plugin_register.js +3 -54
- package/dist/plugins/plugin_register.js.map +1 -1
- package/dist/plugins/plugin_sync.js +45 -22
- package/dist/plugins/plugin_sync.js.map +1 -1
- package/dist/plugins/plugin_validate.js +47 -13
- package/dist/plugins/plugin_validate.js.map +1 -1
- package/dist/plugins/store_import.d.ts +0 -9
- package/dist/plugins/store_import.js +3 -29
- package/dist/plugins/store_import.js.map +1 -1
- package/dist/retrieve/task.d.ts +137 -0
- package/dist/retrieve/task.js +41 -0
- package/dist/retrieve/task.js.map +1 -0
- package/dist/retrieve/watch.d.ts +2 -118
- package/dist/retrieve/watch.js +452 -321
- package/dist/retrieve/watch.js.map +1 -1
- package/dist/vfs/providers/etc.d.ts +6 -4
- package/dist/vfs/providers/etc.js +12 -4
- package/dist/vfs/providers/etc.js.map +1 -1
- package/dist/vfs/providers/native.d.ts +116 -39
- package/dist/vfs/providers/native.js +291 -347
- package/dist/vfs/providers/native.js.map +1 -1
- package/dist/vfs/providers/pacs.d.ts +29 -3
- package/dist/vfs/providers/pacs.js +303 -73
- package/dist/vfs/providers/pacs.js.map +1 -1
- package/dist/vfs/providers/pacs_content.js +22 -6
- package/dist/vfs/providers/pacs_content.js.map +1 -1
- package/dist/vfs/providers/proc/backfill.d.ts +46 -0
- package/dist/vfs/providers/proc/backfill.js +147 -0
- package/dist/vfs/providers/proc/backfill.js.map +1 -0
- package/dist/vfs/providers/proc/book.d.ts +176 -0
- package/dist/vfs/providers/proc/book.js +73 -0
- package/dist/vfs/providers/proc/book.js.map +1 -0
- package/dist/vfs/providers/proc/catchup.d.ts +69 -0
- package/dist/vfs/providers/proc/catchup.js +125 -0
- package/dist/vfs/providers/proc/catchup.js.map +1 -0
- package/dist/vfs/providers/proc/feedIndex.d.ts +146 -0
- package/dist/vfs/providers/proc/feedIndex.js +354 -0
- package/dist/vfs/providers/proc/feedIndex.js.map +1 -0
- package/dist/vfs/providers/proc/feedTopology.d.ts +85 -0
- package/dist/vfs/providers/proc/feedTopology.js +192 -0
- package/dist/vfs/providers/proc/feedTopology.js.map +1 -0
- package/dist/vfs/providers/proc/locate.d.ts +60 -0
- package/dist/vfs/providers/proc/locate.js +103 -0
- package/dist/vfs/providers/proc/locate.js.map +1 -0
- package/dist/vfs/providers/proc/path.d.ts +50 -0
- package/dist/vfs/providers/proc/path.js +106 -0
- package/dist/vfs/providers/proc/path.js.map +1 -0
- package/dist/vfs/providers/proc/roster.d.ts +95 -0
- package/dist/vfs/providers/proc/roster.js +425 -0
- package/dist/vfs/providers/proc/roster.js.map +1 -0
- package/dist/vfs/providers/proc/rows.d.ts +120 -0
- package/dist/vfs/providers/proc/rows.js +181 -0
- package/dist/vfs/providers/proc/rows.js.map +1 -0
- package/dist/vfs/providers/proc/subtree.d.ts +73 -0
- package/dist/vfs/providers/proc/subtree.js +125 -0
- package/dist/vfs/providers/proc/subtree.js.map +1 -0
- package/dist/vfs/providers/proc/sweep.d.ts +89 -0
- package/dist/vfs/providers/proc/sweep.js +297 -0
- package/dist/vfs/providers/proc/sweep.js.map +1 -0
- package/dist/vfs/providers/proc.d.ts +47 -346
- package/dist/vfs/providers/proc.js +349 -1806
- package/dist/vfs/providers/proc.js.map +1 -1
- package/dist/vfs/providers/share.js +4 -1
- package/dist/vfs/providers/share.js.map +1 -1
- package/package.json +3 -3
- package/dist/pacs/resultDecode.d.ts +0 -13
- package/dist/pacs/resultDecode.js +0 -19
- package/dist/pacs/resultDecode.js.map +0 -1
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Downloading ChRIS files to this machine: planning where each lands, and writing it there.
|
|
4
|
+
*
|
|
5
|
+
* Every local place comes from fond: the destination the operator named is placed as theirs
|
|
6
|
+
* (`operatorFolder_place` / `operatorFile_place`), and every name that came from CUBE (a source's own name, a row
|
|
7
|
+
* inside a folder downloaded, a parent's name for two sources that share one) is placed under it with
|
|
8
|
+
* `placed_child`. Rows are held to the folder they were listed in (./listing) before anything is walked or
|
|
9
|
+
* fetched. Bytes are written only by fond's writer, owner-only (0600). A name that cannot be placed is refused,
|
|
10
|
+
* counted failed with its reason, and the rest of the batch goes on.
|
|
11
|
+
*
|
|
12
|
+
* The behaviour is chili's (which now calls this): an existing local file is not replaced without `force` or the
|
|
13
|
+
* operator's yes; a folder source keeps its own name below the destination unless it ends with `/` (its contents
|
|
14
|
+
* merge into the destination); several sources go into one folder, two that share a name each under their
|
|
15
|
+
* parent's name; a file that fails is tried once more and the rest continue.
|
|
16
|
+
*
|
|
17
|
+
* Key components:
|
|
18
|
+
* - download_one: one source to a destination (a file, or a folder kept or merged).
|
|
19
|
+
* - download_many: several sources into one folder.
|
|
20
|
+
* - DownloadOptions, DownloadSummary, DownloadProgressEvent: the contract callers render.
|
|
21
|
+
*
|
|
22
|
+
* Typical usage:
|
|
23
|
+
* ```ts
|
|
24
|
+
* const summary: DownloadSummary = await download_one('/home/me/study', './study', { confirm, onNotice });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* Dependencies: fond (places, writer), cumin (transfer pool), ./listing, ./index (streams), ./fileLookup.
|
|
28
|
+
*
|
|
29
|
+
* @module
|
|
30
|
+
*/
|
|
31
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
+
exports.download_one = download_one;
|
|
33
|
+
exports.download_many = download_many;
|
|
34
|
+
exports.deliveryRows_list = deliveryRows_list;
|
|
35
|
+
const node_stream_1 = require("node:stream");
|
|
36
|
+
const cumin_1 = require("@fnndsc/cumin");
|
|
37
|
+
const fond_1 = require("@fnndsc/fond");
|
|
38
|
+
const fileLookup_js_1 = require("./fileLookup.js");
|
|
39
|
+
const index_js_1 = require("./index.js");
|
|
40
|
+
const listing_js_1 = require("./listing.js");
|
|
41
|
+
/**
|
|
42
|
+
* Takes a local place for one file of a batch, once: a second file to the same place is refused (two sources
|
|
43
|
+
* that would land at one name never silently become one file).
|
|
44
|
+
*
|
|
45
|
+
* @param plan - The plan.
|
|
46
|
+
* @param remote - The store path.
|
|
47
|
+
* @param placed - Its place.
|
|
48
|
+
* @param kind - A file, or a folder.
|
|
49
|
+
* @returns True when taken; false when refused (said in the plan).
|
|
50
|
+
*/
|
|
51
|
+
function place_take(plan, remote, placed, kind = 'file') {
|
|
52
|
+
const clash = placeClash_find(plan.taken, placed.place, kind);
|
|
53
|
+
if (clash !== null) {
|
|
54
|
+
plan.refused.push({ remote, reason: `another part of this download already ${clash}` });
|
|
55
|
+
return false;
|
|
56
|
+
}
|
|
57
|
+
plan.taken.set(placed.place, kind);
|
|
58
|
+
// A file or folder's folders are folders: a file at one of them later is a clash.
|
|
59
|
+
for (let at = placed.place.slice(0, placed.place.lastIndexOf('/')); at.length > 0 && !plan.taken.has(at); at = at.slice(0, at.lastIndexOf('/')))
|
|
60
|
+
plan.taken.set(at, 'folder');
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Whether a place clashes with what a batch already takes, first come first kept: a file where anything is, or
|
|
65
|
+
* where something is below it; a folder where a file is, or below a file.
|
|
66
|
+
*
|
|
67
|
+
* @param taken - The places taken.
|
|
68
|
+
* @param place - The place.
|
|
69
|
+
* @param kind - What would be there.
|
|
70
|
+
* @returns What it clashes with, said, or null.
|
|
71
|
+
*/
|
|
72
|
+
function placeClash_find(taken, place, kind) {
|
|
73
|
+
const there = taken.get(place);
|
|
74
|
+
if (kind === 'file' && there !== undefined)
|
|
75
|
+
return there === 'file' ? `goes to ${JSON.stringify(place)}` : `puts something below ${JSON.stringify(place)}`;
|
|
76
|
+
if (kind === 'folder' && there === 'file')
|
|
77
|
+
return `writes a file at ${JSON.stringify(place)}`;
|
|
78
|
+
// Something below a place marks it a folder (place_take records every folder on the way), so a file there is
|
|
79
|
+
// seen by the lookup above.
|
|
80
|
+
for (let at = place.slice(0, place.lastIndexOf('/')); at.length > 0; at = at.slice(0, at.lastIndexOf('/'))) {
|
|
81
|
+
if (taken.get(at) === 'file')
|
|
82
|
+
return `writes a file at ${JSON.stringify(at)}`;
|
|
83
|
+
}
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A fresh plan.
|
|
88
|
+
*
|
|
89
|
+
* @returns It.
|
|
90
|
+
*/
|
|
91
|
+
function plan_make() {
|
|
92
|
+
return { folders: [], files: [], refused: [], taken: new Map() };
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A fresh summary.
|
|
96
|
+
*
|
|
97
|
+
* @returns It.
|
|
98
|
+
*/
|
|
99
|
+
function summary_make() {
|
|
100
|
+
return { startTime: Date.now(), endTime: 0, totalFiles: 0, transferredCount: 0, failedCount: 0, transferSize: 0, duration: 0, speed: 0, failedPaths: [], cancelledCount: 0 };
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Closes a summary's timing.
|
|
104
|
+
*
|
|
105
|
+
* @param summary - The summary.
|
|
106
|
+
* @returns It.
|
|
107
|
+
*/
|
|
108
|
+
function summary_close(summary) {
|
|
109
|
+
summary.endTime = Date.now();
|
|
110
|
+
summary.duration = (summary.endTime - summary.startTime) / 1000;
|
|
111
|
+
summary.speed = summary.duration > 0 ? summary.transferSize / summary.duration : 0;
|
|
112
|
+
return summary;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Says a notice where the caller asked, or on the error stack.
|
|
116
|
+
*
|
|
117
|
+
* @param options - The options.
|
|
118
|
+
* @param message - The notice.
|
|
119
|
+
* @param channel - Its channel.
|
|
120
|
+
*/
|
|
121
|
+
function notice_say(options, message, channel) {
|
|
122
|
+
if (options.onNotice)
|
|
123
|
+
options.onNotice(message, channel);
|
|
124
|
+
else
|
|
125
|
+
cumin_1.errorStack.stack_push(channel === 'err' ? 'error' : 'warning', message);
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Asks the caller's yes, or refuses where there is no one to ask.
|
|
129
|
+
*
|
|
130
|
+
* @param options - The options.
|
|
131
|
+
* @param message - The question.
|
|
132
|
+
* @throws {Error} When declined, or when there is no one to ask.
|
|
133
|
+
*/
|
|
134
|
+
async function confirmation_ask(options, message) {
|
|
135
|
+
if (!options.confirm)
|
|
136
|
+
throw new Error(`${message.replace(/\s*\(y\/N\)\s*$/, '')}: no one to confirm; use -f`);
|
|
137
|
+
await options.confirm(message);
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Opens one CUBE file as a stream, or throws with the kernel's own reason.
|
|
141
|
+
*
|
|
142
|
+
* @param remotePath - The resolved ChRIS path.
|
|
143
|
+
* @returns The stream and its size when CUBE gave one.
|
|
144
|
+
* @throws {Error} Naming why the file could not be opened.
|
|
145
|
+
*/
|
|
146
|
+
async function remoteStream_open(remotePath) {
|
|
147
|
+
const since = cumin_1.errorStack.checkpoint_mark();
|
|
148
|
+
const result = await (0, index_js_1.fileContent_getBinaryStream)(remotePath);
|
|
149
|
+
const notes = cumin_1.errorStack.checkpoint_drain(since);
|
|
150
|
+
if (!result.ok) {
|
|
151
|
+
const reasons = notes
|
|
152
|
+
.map((note) => note.message.replace(/^\[[^\]]*\]\s*\|\s*/, '').trim())
|
|
153
|
+
.filter((line) => line.length > 0)
|
|
154
|
+
.join('; ');
|
|
155
|
+
throw new Error(reasons.length > 0 ? reasons : `could not open ${remotePath}`);
|
|
156
|
+
}
|
|
157
|
+
const given = result.value.stream;
|
|
158
|
+
// A projection or a pipeline answers with the bytes whole: written as one chunk.
|
|
159
|
+
const stream = given instanceof Uint8Array ? node_stream_1.Readable.from([given]) : given;
|
|
160
|
+
return { stream, ...(result.value.size !== undefined ? { size: result.value.size } : {}) };
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Writes one planned file: its folder made, its bytes from CUBE through fond's writer.
|
|
164
|
+
*
|
|
165
|
+
* @param file - The file and its place.
|
|
166
|
+
* @param signal - The pool's signal.
|
|
167
|
+
* @returns The bytes written (CUBE's size when it gave one).
|
|
168
|
+
*/
|
|
169
|
+
async function plannedFile_fetch(file, signal) {
|
|
170
|
+
const { stream, size } = await remoteStream_open(file.remote);
|
|
171
|
+
const folder = (0, fond_1.placed_parent)(file.placed);
|
|
172
|
+
if (folder !== null)
|
|
173
|
+
(0, fond_1.placedFolder_make)(folder);
|
|
174
|
+
try {
|
|
175
|
+
const written = await (0, fond_1.placedFile_write)(file.placed, stream, { mode: 0o600, signal });
|
|
176
|
+
return { bytes: size ?? written };
|
|
177
|
+
}
|
|
178
|
+
catch (error) {
|
|
179
|
+
// Published, but not confirmed: never tried again (a second write would publish twice); said to the caller.
|
|
180
|
+
if ((0, fond_1.publication_isUnconfirmed)(error))
|
|
181
|
+
return { unconfirmed: error instanceof Error ? error.message : String(error) };
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Counts the refused names of a plan into the summary, each said once.
|
|
187
|
+
*
|
|
188
|
+
* @param plan - The plan.
|
|
189
|
+
* @param options - The options.
|
|
190
|
+
* @param summary - The summary.
|
|
191
|
+
*/
|
|
192
|
+
function refusals_count(plan, options, summary) {
|
|
193
|
+
for (const refused of plan.refused) {
|
|
194
|
+
summary.failedCount++;
|
|
195
|
+
summary.failedPaths.push(refused.remote);
|
|
196
|
+
notice_say(options, `Refused ${refused.remote}: ${refused.reason}`, 'err');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Fetches planned files through the transfer pool, several at once, counting each into the summary and the
|
|
201
|
+
* progress as it ends.
|
|
202
|
+
*
|
|
203
|
+
* @param files - The files.
|
|
204
|
+
* @param options - The options.
|
|
205
|
+
* @param summary - The summary.
|
|
206
|
+
* @param label - The progress label.
|
|
207
|
+
*/
|
|
208
|
+
async function files_fetch(files, options, summary, label) {
|
|
209
|
+
let settledCount = 0;
|
|
210
|
+
const file_settle = (settled) => {
|
|
211
|
+
settledCount++;
|
|
212
|
+
if (settled.ok && 'bytes' in settled.value) {
|
|
213
|
+
summary.transferredCount++;
|
|
214
|
+
summary.transferSize += settled.value.bytes;
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
// Failed after its retry, or published but not confirmed (never retried).
|
|
218
|
+
summary.failedCount++;
|
|
219
|
+
summary.failedPaths.push(settled.item.remote);
|
|
220
|
+
const reason = settled.ok ? ('unconfirmed' in settled.value ? settled.value.unconfirmed : '') : settled.reason;
|
|
221
|
+
notice_say(options, `Error downloading ${settled.item.remote}: ${reason}`, 'err');
|
|
222
|
+
}
|
|
223
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'transferring', label, current: settledCount, total: files.length, percent: files.length === 0 ? 100 : (settledCount / files.length) * 100, unit: 'files', status: 'running' });
|
|
224
|
+
};
|
|
225
|
+
// One listing per folder for the whole transfer: each file's id comes from its folder's listing, made once.
|
|
226
|
+
const result = await (0, fileLookup_js_1.fileIds_memoRun)(() => (0, cumin_1.transferPool_run)(files, plannedFile_fetch, {
|
|
227
|
+
jobs: options.jobs ?? cumin_1.TRANSFER_JOBS_DEFAULT,
|
|
228
|
+
...(options.signal !== undefined ? { signal: options.signal } : {}),
|
|
229
|
+
onSettled: file_settle,
|
|
230
|
+
}));
|
|
231
|
+
summary.cancelledCount = result.cancelled.length;
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A store path's last name (a source's own name), or null when it has none that is a plain name.
|
|
235
|
+
*
|
|
236
|
+
* @param remote - The store path.
|
|
237
|
+
* @returns Its name.
|
|
238
|
+
*/
|
|
239
|
+
function remoteName_read(remote) {
|
|
240
|
+
const name = remote.replace(/\/+$/, '').split('/').pop();
|
|
241
|
+
// The structure only; what it may be here is judged where it is placed (fond, for this machine).
|
|
242
|
+
return name === undefined || name === '' || name === '.' || name === '..' || name.includes('\0') ? null : name;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Places a folder source's rows under its local folder: files to fetch, folders to make, refusals.
|
|
246
|
+
*
|
|
247
|
+
* @param remote - The source folder.
|
|
248
|
+
* @param folder - Its local place.
|
|
249
|
+
* @param plan - Where the plan goes.
|
|
250
|
+
*/
|
|
251
|
+
async function folderRows_plan(remote, folder, plan) {
|
|
252
|
+
const listed = await (0, listing_js_1.files_listRecursiveChecked)(remote);
|
|
253
|
+
for (const refused of listed.refused)
|
|
254
|
+
plan.refused.push({ remote: refused.path, reason: refused.reason });
|
|
255
|
+
for (const row of listed.rows) {
|
|
256
|
+
const placing = (0, fond_1.placed_child)(folder, row.relative);
|
|
257
|
+
if (!placing.ok) {
|
|
258
|
+
plan.refused.push({ remote: row.path, reason: placing.reason });
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
if (row.type === 'dir') {
|
|
262
|
+
if (place_take(plan, row.path, placing.placed, 'folder'))
|
|
263
|
+
plan.folders.push({ remote: row.path, placed: placing.placed });
|
|
264
|
+
}
|
|
265
|
+
else if (place_take(plan, row.path, placing.placed))
|
|
266
|
+
plan.files.push({ remote: row.path, placed: placing.placed });
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Downloads one ChRIS file or folder to the local destination.
|
|
271
|
+
*
|
|
272
|
+
* @param remote - The resolved ChRIS path (a trailing `/` on a folder merges its contents into the destination).
|
|
273
|
+
* @param destination - The local destination as the operator typed it.
|
|
274
|
+
* @param options - Download options.
|
|
275
|
+
* @returns The summary.
|
|
276
|
+
* @throws {Error} When the destination cannot be used, the operator declines, or a single file fails.
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* ```ts
|
|
280
|
+
* await download_one('/home/me/study', './study', { confirm, onNotice });
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
async function download_one(remote, destination, options = {}) {
|
|
284
|
+
const standing = (0, fond_1.localPath_kind)(destination);
|
|
285
|
+
if (standing === 'file' && options.force !== true)
|
|
286
|
+
throw new Error(`Local path already exists: ${destination}. Use -f flag to overwrite.`);
|
|
287
|
+
if (!(await (0, index_js_1.files_path_isDirectory)(remote)))
|
|
288
|
+
return remoteFile_download(remote, destination, standing, options);
|
|
289
|
+
return remoteFolder_download(remote, destination, options);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Downloads one ChRIS file: into the destination folder by its own name, or as the file the destination names.
|
|
293
|
+
*
|
|
294
|
+
* @param remote - The file.
|
|
295
|
+
* @param destination - The destination.
|
|
296
|
+
* @param standing - What stands at the destination.
|
|
297
|
+
* @param options - Download options.
|
|
298
|
+
* @returns The summary.
|
|
299
|
+
* @throws {Error} When the place is refused, the operator declines, or the file fails.
|
|
300
|
+
*/
|
|
301
|
+
async function remoteFile_download(remote, destination, standing, options) {
|
|
302
|
+
const summary = summary_make();
|
|
303
|
+
summary.totalFiles = 1;
|
|
304
|
+
try {
|
|
305
|
+
const name = remoteName_read(remote);
|
|
306
|
+
if (name === null)
|
|
307
|
+
throw new Error(`refused: ${JSON.stringify(remote)} has no plain name to be written by`);
|
|
308
|
+
const placing = standing === 'folder' ? (0, fond_1.placed_child)(placed_take((0, fond_1.operatorFolder_place)(destination, false)), name) : (0, fond_1.operatorFile_place)(destination);
|
|
309
|
+
const placed = placed_take(placing);
|
|
310
|
+
const existing = (0, fond_1.localPath_kind)(placed.place);
|
|
311
|
+
if (existing !== null && options.force !== true) {
|
|
312
|
+
await confirmation_ask(options, existing === 'folder' ? `Target directory exists. Download into existing folder: ${placed.place}? (y/N)` : `Local file exists at ${placed.place}. Overwrite? (y/N)`);
|
|
313
|
+
}
|
|
314
|
+
let transferred = 0;
|
|
315
|
+
const label = `Downloading ${placed.place.split('/').pop() ?? name}`;
|
|
316
|
+
const { stream, size } = await remoteStream_open(remote);
|
|
317
|
+
const folder = (0, fond_1.placed_parent)(placed);
|
|
318
|
+
if (folder !== null)
|
|
319
|
+
(0, fond_1.placedFolder_make)(folder);
|
|
320
|
+
const written = await (0, fond_1.placedFile_write)(placed, stream, {
|
|
321
|
+
mode: 0o600,
|
|
322
|
+
...(options.signal !== undefined ? { signal: options.signal } : {}),
|
|
323
|
+
bytes_add: (count) => {
|
|
324
|
+
transferred += count;
|
|
325
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'transferring', label, current: transferred, total: size, percent: typeof size === 'number' && size > 0 ? (Math.min(transferred, size) / size) * 100 : undefined, unit: 'bytes', status: 'running' });
|
|
326
|
+
},
|
|
327
|
+
});
|
|
328
|
+
summary.transferredCount = 1;
|
|
329
|
+
summary.transferSize = written;
|
|
330
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'complete', label: 'Download complete', current: written, total: size, percent: typeof size === 'number' && size > 0 ? 100 : undefined, unit: 'bytes', status: 'done' });
|
|
331
|
+
return summary_close(summary);
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
summary.failedCount = 1;
|
|
335
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'failed', label: `Download failed: ${error instanceof Error ? error.message : String(error)}`, status: 'error' });
|
|
336
|
+
throw error;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* The token of a placing that must succeed, or its refusal thrown.
|
|
341
|
+
*
|
|
342
|
+
* @param placing - The placing.
|
|
343
|
+
* @returns The token.
|
|
344
|
+
* @throws {Error} With the refusal.
|
|
345
|
+
*/
|
|
346
|
+
function placed_take(placing) {
|
|
347
|
+
if (!placing.ok)
|
|
348
|
+
throw new Error(placing.reason);
|
|
349
|
+
return placing.placed;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Downloads one ChRIS folder: under its own name below the destination, or merged into it (a trailing `/`).
|
|
353
|
+
*
|
|
354
|
+
* @param remote - The folder.
|
|
355
|
+
* @param destination - The destination.
|
|
356
|
+
* @param options - Download options.
|
|
357
|
+
* @returns The summary.
|
|
358
|
+
* @throws {Error} When the destination is refused or the operator declines.
|
|
359
|
+
*/
|
|
360
|
+
async function remoteFolder_download(remote, destination, options) {
|
|
361
|
+
const summary = summary_make();
|
|
362
|
+
notice_say(options, 'Scanning files to download...', 'status');
|
|
363
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'scanning', label: 'Scanning files to download', status: 'running' });
|
|
364
|
+
const merge = remote.endsWith('/');
|
|
365
|
+
const name = merge ? '' : remoteName_read(remote);
|
|
366
|
+
if (name === null)
|
|
367
|
+
throw new Error(`refused: ${JSON.stringify(remote)} has no plain name to be written by`);
|
|
368
|
+
const shown = merge ? destination : `${destination.replace(/\/+$/, '')}/${name}`;
|
|
369
|
+
const target = (0, fond_1.localPath_kind)(shown);
|
|
370
|
+
if (target !== null && options.force !== true) {
|
|
371
|
+
await confirmation_ask(options, target === 'folder' ? `Target directory exists (will merge contents): ${shown}. Continue? (y/N)` : `Local file exists at ${shown}. Overwrite? (y/N)`);
|
|
372
|
+
}
|
|
373
|
+
// The operator's folder is made, then held by its own identity before any name from CUBE is placed under it.
|
|
374
|
+
(0, fond_1.placedFolder_make)(placed_take((0, fond_1.operatorFolder_place)(destination, true)));
|
|
375
|
+
const root = placed_take((0, fond_1.operatorFolder_place)(destination, false));
|
|
376
|
+
const folder = merge ? root : placed_take((0, fond_1.placed_child)(root, name));
|
|
377
|
+
(0, fond_1.placedFolder_make)(folder);
|
|
378
|
+
const plan = plan_make();
|
|
379
|
+
await folderRows_plan(remote, folder, plan);
|
|
380
|
+
return batch_run(plan, options, summary, 'Downloading files');
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Makes a plan's folders, counts its refusals, fetches its files, and closes the summary.
|
|
384
|
+
*
|
|
385
|
+
* @param plan - The plan.
|
|
386
|
+
* @param options - Download options.
|
|
387
|
+
* @param summary - The summary.
|
|
388
|
+
* @param label - The progress label.
|
|
389
|
+
* @returns The summary.
|
|
390
|
+
*/
|
|
391
|
+
async function batch_run(plan, options, summary, label) {
|
|
392
|
+
summary.totalFiles = plan.files.length + plan.refused.length;
|
|
393
|
+
for (const folder of plan.folders) {
|
|
394
|
+
try {
|
|
395
|
+
(0, fond_1.placedFolder_make)(folder.placed);
|
|
396
|
+
}
|
|
397
|
+
catch (error) {
|
|
398
|
+
// A folder that could not be made is a failure, said and counted, like a file.
|
|
399
|
+
summary.failedCount++;
|
|
400
|
+
summary.failedPaths.push(folder.remote);
|
|
401
|
+
notice_say(options, `Error downloading ${folder.remote}: ${error instanceof Error ? error.message : String(error)}`, 'err');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
refusals_count(plan, options, summary);
|
|
405
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'transferring', label, current: 0, total: plan.files.length, percent: plan.files.length === 0 ? 100 : 0, unit: 'files', status: 'running' });
|
|
406
|
+
await files_fetch(plan.files, options, summary, label);
|
|
407
|
+
summary_close(summary);
|
|
408
|
+
const clean = summary.failedCount === 0 && summary.cancelledCount === 0;
|
|
409
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: clean ? 'complete' : 'failed', label: 'Download complete', current: summary.transferredCount, total: summary.totalFiles, percent: summary.totalFiles === 0 ? 100 : (summary.transferredCount / summary.totalFiles) * 100, unit: 'files', status: clean ? 'done' : 'error' });
|
|
410
|
+
return summary;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Downloads several exact ChRIS paths into one local folder: a folder keeps its own name below it, a file goes
|
|
414
|
+
* in by its own name, and two that share a name each go under their parent's name (said).
|
|
415
|
+
*
|
|
416
|
+
* @param sources - The resolved ChRIS paths.
|
|
417
|
+
* @param destination - The local folder.
|
|
418
|
+
* @param options - Download options.
|
|
419
|
+
* @returns The summary.
|
|
420
|
+
* @throws {Error} When no sources are given, the destination is not a folder, or the operator declines.
|
|
421
|
+
*
|
|
422
|
+
* @example
|
|
423
|
+
* ```ts
|
|
424
|
+
* await download_many(['/home/me/a.nii', '/home/me/b.nii'], './out', { confirm, onNotice });
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
async function download_many(sources, destination, options = {}) {
|
|
428
|
+
if (sources.length === 0)
|
|
429
|
+
throw new Error('No CFS paths were provided for download');
|
|
430
|
+
const summary = summary_make();
|
|
431
|
+
options.onProgress?.({ operation: 'download', kind: 'transfer', phase: 'scanning', label: 'Scanning CFS files to download', status: 'running' });
|
|
432
|
+
const standing = (0, fond_1.localPath_kind)(destination);
|
|
433
|
+
if (standing !== null && standing !== 'folder')
|
|
434
|
+
throw new Error(`Wildcard download requires a local directory target: ${destination}`);
|
|
435
|
+
(0, fond_1.placedFolder_make)(placed_take((0, fond_1.operatorFolder_place)(destination, true)));
|
|
436
|
+
const root = placed_take((0, fond_1.operatorFolder_place)(destination, false));
|
|
437
|
+
const plan = plan_make();
|
|
438
|
+
const names = sharedNames_place(sources, options);
|
|
439
|
+
for (const source of sources)
|
|
440
|
+
await source_plan(source, names.get(source) ?? null, root, plan);
|
|
441
|
+
if (options.force !== true) {
|
|
442
|
+
const conflicts = plan.files.filter((file) => (0, fond_1.localPath_kind)(file.placed.place) !== null).length;
|
|
443
|
+
if (conflicts > 0)
|
|
444
|
+
await confirmation_ask(options, `${String(conflicts)} local file(s) already exist below ${destination}. Overwrite? (y/N)`);
|
|
445
|
+
}
|
|
446
|
+
return batch_run(plan, options, summary, 'Downloading matching files');
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Each source's local name: its own, or parent/own when two sources share one (said once).
|
|
450
|
+
*
|
|
451
|
+
* @param sources - The sources.
|
|
452
|
+
* @param options - Download options, for the notice.
|
|
453
|
+
* @returns The local name for each (null when it has no plain name).
|
|
454
|
+
*/
|
|
455
|
+
function sharedNames_place(sources, options) {
|
|
456
|
+
const own = sources.map(remoteName_read);
|
|
457
|
+
const shared = new Set(own.filter((name, at) => name !== null && own.indexOf(name) !== at));
|
|
458
|
+
const names = new Map();
|
|
459
|
+
sources.forEach((source, at) => {
|
|
460
|
+
const name = own[at] ?? null;
|
|
461
|
+
if (name === null)
|
|
462
|
+
return;
|
|
463
|
+
if (!shared.has(name)) {
|
|
464
|
+
names.set(source, name);
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
// A shared name goes under its parent's; a source whose parent has no plain name has no place (refused).
|
|
468
|
+
const parent = remoteName_read(source.replace(/\/+$/, '').split('/').slice(0, -1).join('/'));
|
|
469
|
+
if (parent !== null)
|
|
470
|
+
names.set(source, `${parent}/${name}`);
|
|
471
|
+
});
|
|
472
|
+
if (shared.size > 0) {
|
|
473
|
+
const told = sources.filter((source) => shared.has(remoteName_read(source) ?? '')).map((source) => names.get(source) ?? source).join(', ');
|
|
474
|
+
notice_say(options, `${[...shared].map((name) => `'${name}'`).join(', ')} named more than once: each lands under its parent's name (${told})`, 'status');
|
|
475
|
+
}
|
|
476
|
+
return names;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* Classifies one batch source as a folder or file, recording any parent-listing refusal in `plan.refused`.
|
|
480
|
+
*
|
|
481
|
+
* @param source - The source path.
|
|
482
|
+
* @param plan - Where any refusal is recorded.
|
|
483
|
+
* @returns `true` for a folder, `false` for a file, or `null` when classification failed.
|
|
484
|
+
*/
|
|
485
|
+
async function source_isFolder(source, plan) {
|
|
486
|
+
try {
|
|
487
|
+
return await (0, index_js_1.files_path_isDirectory)(source);
|
|
488
|
+
}
|
|
489
|
+
catch (error) {
|
|
490
|
+
plan.refused.push({ remote: source, reason: error instanceof Error ? error.message : String(error) });
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Plans one source of several: a folder's rows below its local name, or the file at its local name.
|
|
496
|
+
*
|
|
497
|
+
* @param source - The source.
|
|
498
|
+
* @param name - Its local name, or null when it has no plain name.
|
|
499
|
+
* @param root - The destination's place.
|
|
500
|
+
* @param plan - Where the plan goes.
|
|
501
|
+
*/
|
|
502
|
+
async function source_plan(source, name, root, plan) {
|
|
503
|
+
if (name === null) {
|
|
504
|
+
plan.refused.push({ remote: source, reason: 'it has no plain name to be written by (nor a parent whose name it could go under)' });
|
|
505
|
+
return;
|
|
506
|
+
}
|
|
507
|
+
const placing = (0, fond_1.placed_child)(root, name);
|
|
508
|
+
if (!placing.ok) {
|
|
509
|
+
plan.refused.push({ remote: source, reason: placing.reason });
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
const isFolder = await source_isFolder(source, plan);
|
|
513
|
+
if (isFolder === null)
|
|
514
|
+
return;
|
|
515
|
+
if (!isFolder) {
|
|
516
|
+
if (place_take(plan, source, placing.placed))
|
|
517
|
+
plan.files.push({ remote: source, placed: placing.placed });
|
|
518
|
+
return;
|
|
519
|
+
}
|
|
520
|
+
if (!place_take(plan, source, placing.placed, 'folder'))
|
|
521
|
+
return;
|
|
522
|
+
plan.folders.push({ remote: source, placed: placing.placed });
|
|
523
|
+
await folderRows_plan(source, placing.placed, plan);
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* The rows of a folder a surface on another machine is handed (it places them itself): each with its name inside
|
|
527
|
+
* the folder, held to the listing rule; refusals returned.
|
|
528
|
+
*
|
|
529
|
+
* @param remote - The folder.
|
|
530
|
+
* @returns The rows and the refusals.
|
|
531
|
+
*
|
|
532
|
+
* @example
|
|
533
|
+
* ```ts
|
|
534
|
+
* const { rows, refused } = await deliveryRows_list('/home/me/study');
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
async function deliveryRows_list(remote) {
|
|
538
|
+
const listed = await (0, listing_js_1.files_listRecursiveChecked)(remote);
|
|
539
|
+
return { rows: listed.rows.filter((row) => row.type === 'file'), refused: listed.refused.map((one) => ({ remote: one.path, reason: one.reason })) };
|
|
540
|
+
}
|
|
541
|
+
//# sourceMappingURL=download.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"download.js","sourceRoot":"","sources":["../../src/files/download.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;;AAyZH,oCAKC;AAwID,sCAgBC;AAwFD,8CAGC;AA/oBD,6CAAuC;AAEvC,yCAAsJ;AACtJ,uCAAoO;AAEpO,mDAAkD;AAClD,yCAAiF;AACjF,6CAAgH;AAyIhH;;;;;;;;;GASG;AACH,SAAS,UAAU,CAAC,IAAe,EAAE,MAAc,EAAE,MAAkB,EAAE,O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