@fnndsc/salsa 4.5.6 → 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 +2 -2
- package/dist/jobs/index.js.map +1 -1
- package/dist/jobs/jobOps.d.ts +20 -13
- package/dist/jobs/jobOps.js +41 -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
package/dist/files/pathMapper.js
CHANGED
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
*
|
|
12
12
|
* This eliminates redundant tree walking and API calls for paths with common prefixes.
|
|
13
13
|
*
|
|
14
|
+
* What a link leads to is what one identity is shown: the mappings are the
|
|
15
|
+
* session's identity's, emptied when it changes, and neither read nor kept
|
|
16
|
+
* by work done as another user (`sudo`) or begun under an identity since
|
|
17
|
+
* replaced.
|
|
18
|
+
*
|
|
14
19
|
* It is CUBE's own mechanics (a `.chrislink` is a file CUBE lists among a
|
|
15
20
|
* folder's links), so it lives with the file reads. The kernel asks it
|
|
16
21
|
* through one door: the ChRIS backend's link walk, which brasa's
|
|
@@ -60,6 +65,50 @@ const cumin_1 = require("@fnndsc/cumin");
|
|
|
60
65
|
const index_js_1 = require("./index.js");
|
|
61
66
|
const path = __importStar(require("path"));
|
|
62
67
|
const cumin_2 = require("@fnndsc/cumin");
|
|
68
|
+
/**
|
|
69
|
+
* What the session's cached listing of a path's parent says of the path:
|
|
70
|
+
* its target when it is a link with one, null when it is anything else,
|
|
71
|
+
* and undefined when the parent is not cached as a list or does not hold
|
|
72
|
+
* the name (hidden, or newly made), so CUBE is asked instead.
|
|
73
|
+
*
|
|
74
|
+
* @param candidateLogical - The logical path asked about.
|
|
75
|
+
* @returns The link's target, null, or undefined when the cache cannot say.
|
|
76
|
+
*/
|
|
77
|
+
function cachedLink_find(candidateLogical) {
|
|
78
|
+
const logicalParent = path.dirname(candidateLogical);
|
|
79
|
+
const itemName = path.basename(candidateLogical);
|
|
80
|
+
const listCache = (0, cumin_2.listCache_get)();
|
|
81
|
+
const cached = listCache.cache_get(logicalParent);
|
|
82
|
+
if (!(cached && cached.data && Array.isArray(cached.data)))
|
|
83
|
+
return undefined;
|
|
84
|
+
const item = cached.data.find((i) => i.name === itemName);
|
|
85
|
+
if (!item)
|
|
86
|
+
return undefined;
|
|
87
|
+
// Found but not a link (or has no target): no link.
|
|
88
|
+
return item.type === 'link' && item.target ? item.target : null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The target of one row of a parent's links when the row is the link at
|
|
92
|
+
* the path asked: its `fname`, rooted and without CUBE's `.chrislink`
|
|
93
|
+
* mark, is that path.
|
|
94
|
+
*
|
|
95
|
+
* @param linkRaw - One row of the parent's links.
|
|
96
|
+
* @param normalizedCandidate - The path asked, rooted.
|
|
97
|
+
* @returns The link's target, rooted, or null when the row is another's.
|
|
98
|
+
*/
|
|
99
|
+
function linkRow_resolve(linkRaw, normalizedCandidate) {
|
|
100
|
+
const linkFname = linkRaw.fname || '';
|
|
101
|
+
const linkPath = linkRaw.path || '';
|
|
102
|
+
const normalizedLinkFname = linkFname.startsWith('/')
|
|
103
|
+
? linkFname
|
|
104
|
+
: `/${linkFname}`;
|
|
105
|
+
if (!normalizedLinkFname.endsWith('.chrislink'))
|
|
106
|
+
return null;
|
|
107
|
+
const logicalPath = normalizedLinkFname.slice(0, -10);
|
|
108
|
+
if (logicalPath !== normalizedCandidate)
|
|
109
|
+
return null;
|
|
110
|
+
return linkPath.startsWith('/') ? linkPath : `/${linkPath}`;
|
|
111
|
+
}
|
|
63
112
|
/**
|
|
64
113
|
* Singleton PathMapper class for logical-to-physical path resolution.
|
|
65
114
|
*
|
|
@@ -148,24 +197,26 @@ class PathMapper {
|
|
|
148
197
|
const normalizedPath = logicalPath.startsWith('/')
|
|
149
198
|
? logicalPath
|
|
150
199
|
: `/${logicalPath}`;
|
|
200
|
+
// The identity this walk is begun under: what it finds is kept only while that is still who is connected.
|
|
201
|
+
const began = (0, cumin_1.identityEpoch_get)();
|
|
151
202
|
// 3. Check exact cache hit
|
|
152
203
|
const exactMatch = this.cache_get(normalizedPath);
|
|
153
204
|
if (exactMatch !== null) {
|
|
154
205
|
this.stats.hits++;
|
|
155
|
-
this.blind_note(normalizedPath);
|
|
206
|
+
this.blind_note(normalizedPath, began);
|
|
156
207
|
return (0, cumin_1.Ok)(exactMatch);
|
|
157
208
|
}
|
|
158
209
|
// 4. Find longest cached prefix
|
|
159
210
|
const prefixMatch = this.longestCachedPrefix_find(normalizedPath);
|
|
160
211
|
// 5. Resolve suffix incrementally
|
|
161
|
-
const resolvedPhysical = await this.suffix_resolve(prefixMatch.suffix, prefixMatch.prefixPhysical, prefixMatch.prefixLogical);
|
|
162
|
-
this.blind_note(normalizedPath);
|
|
212
|
+
const resolvedPhysical = await this.suffix_resolve(prefixMatch.suffix, prefixMatch.prefixPhysical, prefixMatch.prefixLogical, began);
|
|
213
|
+
this.blind_note(normalizedPath, began);
|
|
163
214
|
if (!resolvedPhysical.ok) {
|
|
164
215
|
this.stats.misses++;
|
|
165
216
|
return (0, cumin_1.Err)();
|
|
166
217
|
}
|
|
167
218
|
// 6. Cache the full resolution
|
|
168
|
-
this.cache_set(normalizedPath, resolvedPhysical.value);
|
|
219
|
+
this.cache_set(normalizedPath, resolvedPhysical.value, began);
|
|
169
220
|
this.stats.misses++;
|
|
170
221
|
return (0, cumin_1.Ok)(resolvedPhysical.value);
|
|
171
222
|
}
|
|
@@ -224,9 +275,10 @@ class PathMapper {
|
|
|
224
275
|
* @param suffix - The path suffix to resolve (e.g., 'feed_4/files').
|
|
225
276
|
* @param physicalBase - The physical base path to build upon.
|
|
226
277
|
* @param logicalBase - The logical base path (for caching intermediate results).
|
|
278
|
+
* @param began - The identity epoch the resolution was begun under.
|
|
227
279
|
* @returns Result containing the resolved physical path.
|
|
228
280
|
*/
|
|
229
|
-
async suffix_resolve(suffix, physicalBase, logicalBase) {
|
|
281
|
+
async suffix_resolve(suffix, physicalBase, logicalBase, began) {
|
|
230
282
|
if (!suffix || suffix.length === 0) {
|
|
231
283
|
return (0, cumin_1.Ok)(physicalBase);
|
|
232
284
|
}
|
|
@@ -242,20 +294,20 @@ class PathMapper {
|
|
|
242
294
|
? `/${part}`
|
|
243
295
|
: `${logicalCurrent}/${part}`;
|
|
244
296
|
try {
|
|
245
|
-
const linkTarget = await this.link_checkAndResolve(candidatePhysical, candidateLogical);
|
|
297
|
+
const linkTarget = await this.link_checkAndResolve(candidatePhysical, candidateLogical, began);
|
|
246
298
|
if (linkTarget) {
|
|
247
299
|
// It's a link! Jump to target
|
|
248
300
|
physicalCurrent = linkTarget;
|
|
249
301
|
logicalCurrent = candidateLogical;
|
|
250
302
|
// Cache this intermediate mapping
|
|
251
|
-
this.cache_set(candidateLogical, linkTarget);
|
|
303
|
+
this.cache_set(candidateLogical, linkTarget, began);
|
|
252
304
|
}
|
|
253
305
|
else {
|
|
254
306
|
// Not a link, continue building path
|
|
255
307
|
physicalCurrent = candidatePhysical;
|
|
256
308
|
logicalCurrent = candidateLogical;
|
|
257
309
|
// Cache this intermediate mapping
|
|
258
|
-
this.cache_set(candidateLogical, candidatePhysical);
|
|
310
|
+
this.cache_set(candidateLogical, candidatePhysical, began);
|
|
259
311
|
}
|
|
260
312
|
}
|
|
261
313
|
catch (error) {
|
|
@@ -265,7 +317,7 @@ class PathMapper {
|
|
|
265
317
|
// Assume it's not a link and continue
|
|
266
318
|
physicalCurrent = candidatePhysical;
|
|
267
319
|
logicalCurrent = candidateLogical;
|
|
268
|
-
this.cache_set(candidateLogical, candidatePhysical);
|
|
320
|
+
this.cache_set(candidateLogical, candidatePhysical, began);
|
|
269
321
|
}
|
|
270
322
|
}
|
|
271
323
|
return (0, cumin_1.Ok)(physicalCurrent);
|
|
@@ -279,29 +331,14 @@ class PathMapper {
|
|
|
279
331
|
*
|
|
280
332
|
* @param candidatePhysical - The physical path to check.
|
|
281
333
|
* @param candidateLogical - The logical path (used for cache lookup).
|
|
334
|
+
* @param began - The identity epoch the resolution was begun under.
|
|
282
335
|
* @returns The link target if it's a link, null otherwise.
|
|
283
336
|
*/
|
|
284
|
-
async link_checkAndResolve(candidatePhysical, candidateLogical) {
|
|
337
|
+
async link_checkAndResolve(candidatePhysical, candidateLogical, began) {
|
|
285
338
|
// 1. Fast Path: Check ListCache using logical path
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
const listCache = (0, cumin_2.listCache_get)();
|
|
290
|
-
const cached = listCache.cache_get(logicalParent);
|
|
291
|
-
if (cached && cached.data && Array.isArray(cached.data)) {
|
|
292
|
-
// Look for the item in the cached listing
|
|
293
|
-
const item = cached.data.find((i) => i.name === itemName);
|
|
294
|
-
if (item) {
|
|
295
|
-
// Item found in cache!
|
|
296
|
-
if (item.type === 'link' && item.target) {
|
|
297
|
-
return item.target;
|
|
298
|
-
}
|
|
299
|
-
// Found but not a link (or has no target) -> return null
|
|
300
|
-
return null;
|
|
301
|
-
}
|
|
302
|
-
// Item not found in cache.
|
|
303
|
-
// It might be hidden or newly created. Fall back to API.
|
|
304
|
-
}
|
|
339
|
+
const fromCache = cachedLink_find(candidateLogical);
|
|
340
|
+
if (fromCache !== undefined)
|
|
341
|
+
return fromCache;
|
|
305
342
|
// 2. Slow Path: Check API using physical path
|
|
306
343
|
const parts = candidatePhysical.split('/');
|
|
307
344
|
parts.pop(); // Remove filename
|
|
@@ -326,25 +363,20 @@ class PathMapper {
|
|
|
326
363
|
refused = true;
|
|
327
364
|
}
|
|
328
365
|
const said = cumin_1.errorStack.checkpoint_drain(probeMark);
|
|
366
|
+
// What a probe could not read is the session's identity's diagnosis only when the walk is its current work.
|
|
367
|
+
const noted = this.walk_current(began);
|
|
329
368
|
if (refused || (linksResult === null && said.some((message) => message.type === 'error'))) {
|
|
330
|
-
|
|
369
|
+
if (noted)
|
|
370
|
+
this.blind.set(candidateLogical, parentDir);
|
|
331
371
|
return null;
|
|
332
372
|
}
|
|
333
|
-
|
|
373
|
+
if (noted)
|
|
374
|
+
this.blind.delete(candidateLogical);
|
|
334
375
|
if (linksResult && linksResult.tableData) {
|
|
335
376
|
for (const linkRaw of linksResult.tableData) {
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
? linkFname
|
|
340
|
-
: `/${linkFname}`;
|
|
341
|
-
if (normalizedLinkFname.endsWith('.chrislink')) {
|
|
342
|
-
const logicalPath = normalizedLinkFname.slice(0, -10);
|
|
343
|
-
if (logicalPath === normalizedCandidate) {
|
|
344
|
-
const target = linkPath.startsWith('/') ? linkPath : `/${linkPath}`;
|
|
345
|
-
return target;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
377
|
+
const target = linkRow_resolve(linkRaw, normalizedCandidate);
|
|
378
|
+
if (target !== null)
|
|
379
|
+
return target;
|
|
348
380
|
}
|
|
349
381
|
}
|
|
350
382
|
return null;
|
|
@@ -354,8 +386,11 @@ class PathMapper {
|
|
|
354
386
|
* seeing their links.
|
|
355
387
|
*
|
|
356
388
|
* @param logicalPath - The path just resolved.
|
|
389
|
+
* @param began - The identity epoch the resolution was begun under.
|
|
357
390
|
*/
|
|
358
|
-
blind_note(logicalPath) {
|
|
391
|
+
blind_note(logicalPath, began) {
|
|
392
|
+
if (!this.walk_current(began))
|
|
393
|
+
return;
|
|
359
394
|
for (const [walked, parent] of this.blind) {
|
|
360
395
|
if (logicalPath === walked || logicalPath.startsWith(walked + '/')) {
|
|
361
396
|
this.blindSeen.add(parent);
|
|
@@ -367,9 +402,14 @@ class PathMapper {
|
|
|
367
402
|
* last call, emptied by the call. A command whose answer failed reports
|
|
368
403
|
* them: a link in one of them, had it been seen, would have led elsewhere.
|
|
369
404
|
*
|
|
405
|
+
* Work done as another user, or begun under an identity since replaced,
|
|
406
|
+
* is told none and empties nothing: they are the session's identity's.
|
|
407
|
+
*
|
|
370
408
|
* @returns The parents, in the order first met.
|
|
371
409
|
*/
|
|
372
410
|
blindParents_take() {
|
|
411
|
+
if (!(0, cumin_1.identityCache_usable)())
|
|
412
|
+
return [];
|
|
373
413
|
const parents = [...this.blindSeen];
|
|
374
414
|
this.blindSeen.clear();
|
|
375
415
|
return parents;
|
|
@@ -381,6 +421,9 @@ class PathMapper {
|
|
|
381
421
|
* @returns The cached physical path, or null if not cached or expired.
|
|
382
422
|
*/
|
|
383
423
|
cache_get(logicalPath) {
|
|
424
|
+
// Work done as another user, or begun under an identity since replaced, walks CUBE itself.
|
|
425
|
+
if (!(0, cumin_1.identityCache_usable)())
|
|
426
|
+
return null;
|
|
384
427
|
const cached = this.cache.get(logicalPath);
|
|
385
428
|
if (!cached) {
|
|
386
429
|
return null;
|
|
@@ -397,17 +440,33 @@ class PathMapper {
|
|
|
397
440
|
/**
|
|
398
441
|
* Caches a logical-to-physical path mapping.
|
|
399
442
|
*
|
|
443
|
+
* Kept only from the session's own identity's work, and only when the
|
|
444
|
+
* identity has not changed since the resolution began.
|
|
445
|
+
*
|
|
400
446
|
* @param logicalPath - The logical path.
|
|
401
447
|
* @param physicalPath - The corresponding physical path.
|
|
402
|
-
* @param
|
|
448
|
+
* @param began - The identity epoch the resolution was begun under.
|
|
403
449
|
*/
|
|
404
|
-
cache_set(logicalPath, physicalPath,
|
|
450
|
+
cache_set(logicalPath, physicalPath, began) {
|
|
451
|
+
if (!this.walk_current(began))
|
|
452
|
+
return;
|
|
405
453
|
this.cache.set(logicalPath, {
|
|
406
454
|
physicalPath,
|
|
407
455
|
timestamp: Date.now(),
|
|
408
|
-
ttl
|
|
456
|
+
ttl: this.defaultTTL
|
|
409
457
|
});
|
|
410
458
|
}
|
|
459
|
+
/**
|
|
460
|
+
* Whether a resolution may still change what the session's identity is
|
|
461
|
+
* told: it is not another user's work, and the identity has not changed
|
|
462
|
+
* since it began.
|
|
463
|
+
*
|
|
464
|
+
* @param began - The identity epoch the resolution was begun under.
|
|
465
|
+
* @returns True while the resolution is the session's current work.
|
|
466
|
+
*/
|
|
467
|
+
walk_current(began) {
|
|
468
|
+
return (0, cumin_1.identityCache_usable)() && (0, cumin_1.identityEpoch_get)() === began;
|
|
469
|
+
}
|
|
411
470
|
/**
|
|
412
471
|
* Invalidates all cached mappings with a given logical path prefix.
|
|
413
472
|
*
|
|
@@ -500,4 +559,6 @@ async function logicalPath_resolve(logicalPath) {
|
|
|
500
559
|
function linkCache_clear() {
|
|
501
560
|
pathMapper_get().cache_clear();
|
|
502
561
|
}
|
|
562
|
+
// Where a link leads is what one identity is shown: at a change of identity every mapping goes.
|
|
563
|
+
(0, cumin_1.identityChange_listen)(() => { linkCache_clear(); });
|
|
503
564
|
//# sourceMappingURL=pathMapper.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pathMapper.js","sourceRoot":"","sources":["../../src/files/pathMapper.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAugBH,wCAEC;AAgBD,kDAEC;AAUD,0CAEC;AAriBD,yCAA+E;AAC/E,yCAA2C;AAC3C,2CAA6B;AAC7B,yCAA8C;AAwC9C;;;;;;;;;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AC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC;QAElE,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;YACzB,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI;YACrB,OAAO;SACR,CAAC;IACJ,CAAC;;AAzbH,gCA0bC;AAED;;;;GAIG;AACH,SAAgB,cAAc;IAC5B,OAAO,UAAU,CAAC,YAAY,EAAE,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,mBAAmB,CAAC,WAAmB;IAC3D,OAAO,cAAc,EAAE,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;GAOG;AACH,SAAgB,eAAe;IAC7B,cAAc,EAAE,CAAC,WAAW,EAAE,CAAC;AACjC,CAAC;AAED,gGAAgG;AAChG,IAAA,6BAAqB,EAAC,GAAS,EAAE,GAAG,eAAe,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Proof of what holds a CUBE path, and of a folder's emptiness.
|
|
3
|
+
*
|
|
4
|
+
* A listing made for showing keeps the rows it has when part of it fails, and
|
|
5
|
+
* the lookups a writer uses to avoid a collision treat a parent that would
|
|
6
|
+
* not list as holding nothing. Both are right for their purpose and neither
|
|
7
|
+
* is proof. An act that destroys or overwrites (removing a folder taken to be
|
|
8
|
+
* empty, uploading over a place taken to be free, swapping a file into a
|
|
9
|
+
* name) needs proof, and this module is where proof is defined, once.
|
|
10
|
+
*
|
|
11
|
+
* A proof reads every row of the parent's three listings and trusts none it
|
|
12
|
+
* cannot place. A proof an act will be made on is given the client the act
|
|
13
|
+
* is bound to: the parent is then found fresh on that client (never
|
|
14
|
+
* through the session's memo of folder lookups, which may name a folder
|
|
15
|
+
* since replaced at the path), and its three collections are read by that
|
|
16
|
+
* folder's id. A proof made only for showing may use the memo: a row that is not directly inside the parent, one with no
|
|
17
|
+
* name, or one with no usable id fails the whole proof, since any of them
|
|
18
|
+
* could be the entry asked about. A row CUBE lists twice is one holder; one
|
|
19
|
+
* listed twice at two addresses fails the proof.
|
|
20
|
+
*
|
|
21
|
+
* Key components:
|
|
22
|
+
* - PathHolderRecord: one entry holding a path: its kind, CUBE id and address.
|
|
23
|
+
* - PathProof: what a strict lookup proved: `held`, `ambiguous` or `absent` (HeldProof, AmbiguousProof, AbsentProof).
|
|
24
|
+
* - PathAnswer: a proof, or the failure to make one (ProofFailure, a file on the way told apart).
|
|
25
|
+
* - pathHolders_answer / pathHolders_prove: prove what holds a path, or that nothing does (fresh, on a bound client, for an act).
|
|
26
|
+
* - holders_describe: the holders of an ambiguous path, in words.
|
|
27
|
+
* - folderEmptiness_prove: prove whether a proved folder holds nothing, asked of it by its id.
|
|
28
|
+
* - folderHolders_prove: one whole proof of every name a folder holds, for an act that writes many into it.
|
|
29
|
+
* - listingRows_place: one whole listing's rows placed, or nothing proved.
|
|
30
|
+
* - freshListingRows_place: the same, of a folder opened by its id (a copy's source walk).
|
|
31
|
+
* - pathProof_convertToHolderProof: a proof as a mount hands it on.
|
|
32
|
+
*
|
|
33
|
+
* Typical usage:
|
|
34
|
+
* ```ts
|
|
35
|
+
* const proof: Result<PathProof> = await pathHolders_prove('/home/ada/uploads/scan');
|
|
36
|
+
* if (!proof.ok) return refuse(); // could not be proved
|
|
37
|
+
* if (proof.value.kind === 'absent') create(); // nothing is there
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* Dependencies: `files_listWhole` of `./index.js`, the strict listing, for
|
|
41
|
+
* the three listings a folder has (dirs, files, links) in a proof for
|
|
42
|
+
* showing; a bound `HolderClient` of cumin's, for a parent found fresh and
|
|
43
|
+
* its listings read by id in a proof for an act, and for a proved folder's
|
|
44
|
+
* own collections; `listedRow_name` of `./listing.js`, the one rule for a
|
|
45
|
+
* row directly inside its folder; and cumin's error stack, where the
|
|
46
|
+
* reason a proof failed is left. Paths are absolute CUBE paths.
|
|
47
|
+
*
|
|
48
|
+
* @module
|
|
49
|
+
*/
|
|
50
|
+
import { type FreshFolder, type HolderClient, type Result } from '@fnndsc/cumin';
|
|
51
|
+
import type { HolderProof } from '@fnndsc/fond';
|
|
52
|
+
import { type ListingOutcome, type PathHolder } from './index.js';
|
|
53
|
+
/**
|
|
54
|
+
* One thing holding a path: what it is, the id CUBE knows it by, and the
|
|
55
|
+
* address its listing row gave it.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const holder: PathHolderRecord = { kind: 'dir', id: 7, href: 'https://cube/api/v1/filebrowser/7/' };
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export interface PathHolderRecord {
|
|
63
|
+
/** What kind of entry holds the path. */
|
|
64
|
+
readonly kind: PathHolder;
|
|
65
|
+
/** Its id in CUBE; 0 for the root, which has none. */
|
|
66
|
+
readonly id: number;
|
|
67
|
+
/** Its own REST address, as its row carried it; null when the row carried none (a link never lacks one). */
|
|
68
|
+
readonly href: string | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* One thing holds the path, and no part of the lookup went unread.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const held: HeldProof = { kind: 'held', holder: { kind: 'file', id: 41, href: null } };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export interface HeldProof {
|
|
79
|
+
/** The proof's kind. */
|
|
80
|
+
readonly kind: 'held';
|
|
81
|
+
/** The one holder. */
|
|
82
|
+
readonly holder: PathHolderRecord;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Distinct things hold the path: distinct kinds, or distinct ids of one
|
|
86
|
+
* kind. Nothing may choose between them.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const twins: AmbiguousProof = { kind: 'ambiguous', holders: [{ kind: 'dir', id: 7, href: null }, { kind: 'file', id: 8, href: null }] };
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
export interface AmbiguousProof {
|
|
94
|
+
/** The proof's kind. */
|
|
95
|
+
readonly kind: 'ambiguous';
|
|
96
|
+
/** Every distinct holder, folders first. */
|
|
97
|
+
readonly holders: readonly PathHolderRecord[];
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Nothing holds the path, and every listing that says so answered in full.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const free: AbsentProof = { kind: 'absent' };
|
|
105
|
+
* const noFolder: AbsentProof = { kind: 'absent', folderAbsent: true };
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
export interface AbsentProof {
|
|
109
|
+
/** The proof's kind. */
|
|
110
|
+
readonly kind: 'absent';
|
|
111
|
+
/** True when the folder the path would be in is itself proved absent: a write there makes that folder too. */
|
|
112
|
+
readonly folderAbsent?: boolean;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* What a strict lookup of a path proved.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const proof: PathProof = { kind: 'held', holder: { kind: 'file', id: 41, href: null } };
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
export type PathProof = HeldProof | AmbiguousProof | AbsentProof;
|
|
123
|
+
/**
|
|
124
|
+
* A lookup that proved nothing, its reason on the error stack.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* const failed: ProofFailure = { kind: 'error', notDirectory: true };
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export interface ProofFailure {
|
|
132
|
+
/** The answer's kind. */
|
|
133
|
+
readonly kind: 'error';
|
|
134
|
+
/** The one failure with a name of its own: a file stands where a folder is needed on the way. */
|
|
135
|
+
readonly notDirectory: boolean;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* A proof, or the failure to make one.
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* const answer: PathAnswer = { kind: 'error', notDirectory: true };
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
export type PathAnswer = PathProof | ProofFailure;
|
|
146
|
+
/**
|
|
147
|
+
* Each name a folder holds, with what holds it: a name not in it is free.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```ts
|
|
151
|
+
* const held: FolderHolders = new Map([['scan.dcm', [{ kind: 'file', id: 41, href: null }]]]);
|
|
152
|
+
* ```
|
|
153
|
+
*/
|
|
154
|
+
export type FolderHolders = ReadonlyMap<string, readonly PathHolderRecord[]>;
|
|
155
|
+
/**
|
|
156
|
+
* One row of a folder's listing, placed: its name in the folder (a link's
|
|
157
|
+
* `.chrislink` mark dropped) and the holder it is.
|
|
158
|
+
*
|
|
159
|
+
* @example
|
|
160
|
+
* ```ts
|
|
161
|
+
* const row: PlacedRow = { name: 'scan.dcm', holder: { kind: 'file', id: 41, href: null } };
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
export interface PlacedRow {
|
|
165
|
+
/** Its name directly inside the folder listed. */
|
|
166
|
+
readonly name: string;
|
|
167
|
+
/** What it is, by its id and address. */
|
|
168
|
+
readonly holder: PathHolderRecord;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Proves what holds a path, or that nothing does, and says which failure it
|
|
172
|
+
* met when it could not.
|
|
173
|
+
*
|
|
174
|
+
* A refused listing of the parent, or one cut short, is a failure, and so is
|
|
175
|
+
* a row the proof cannot place. A listing that could not be made at all
|
|
176
|
+
* proves absence only when the parent is itself proved absent, one level up,
|
|
177
|
+
* and so on to the root: a parent that is there and will not list has
|
|
178
|
+
* proved nothing, and one that a file holds is `notDirectory`.
|
|
179
|
+
*
|
|
180
|
+
* Given the client an act is bound to, every parent on the way is found
|
|
181
|
+
* fresh on it and read by its id; without one, through the strict
|
|
182
|
+
* listing, which may use the session's memo of folder lookups.
|
|
183
|
+
*
|
|
184
|
+
* @param target - The CUBE path; one written without its leading slash is
|
|
185
|
+
* read from the root.
|
|
186
|
+
* @param acts - The client an act on the proof is bound to; omitted for a
|
|
187
|
+
* proof made only for showing.
|
|
188
|
+
* @returns The proof, or the failure (its reason on the error stack).
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```ts
|
|
192
|
+
* const answer: PathAnswer = await pathHolders_answer('/home/ada/report.txt/x', acts);
|
|
193
|
+
* const notDirectory: boolean = answer.kind === 'error' && answer.notDirectory;
|
|
194
|
+
* ```
|
|
195
|
+
*/
|
|
196
|
+
export declare function pathHolders_answer(target: string, acts?: HolderClient): Promise<PathAnswer>;
|
|
197
|
+
/**
|
|
198
|
+
* Proves what holds a path, or that nothing does ({@link pathHolders_answer},
|
|
199
|
+
* its failures as one).
|
|
200
|
+
*
|
|
201
|
+
* @param target - The CUBE path; one written without its leading slash is
|
|
202
|
+
* read from the root.
|
|
203
|
+
* @param acts - The client an act on the proof is bound to; omitted for a
|
|
204
|
+
* proof made only for showing.
|
|
205
|
+
* @returns What holds it, or that nothing does; Err when neither could be
|
|
206
|
+
* proved, with the reason on the error stack.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* const proof: Result<PathProof> = await pathHolders_prove('/home/ada/uploads/scan', acts);
|
|
211
|
+
* const free: boolean = proof.ok && proof.value.kind === 'absent';
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
export declare function pathHolders_prove(target: string, acts?: HolderClient): Promise<Result<PathProof>>;
|
|
215
|
+
/**
|
|
216
|
+
* Every row of one whole listing of a folder, placed: the listing must have
|
|
217
|
+
* answered, in full, for a folder that is there. A refused listing, one
|
|
218
|
+
* that could not be made, one cut short, or a row that cannot be placed
|
|
219
|
+
* fails it (the reason stacked).
|
|
220
|
+
*
|
|
221
|
+
* @param outcome - The listing, as the strict listing answers it.
|
|
222
|
+
* @param asset - Which listing.
|
|
223
|
+
* @param folder - The folder listed.
|
|
224
|
+
* @returns The rows placed; Err when the listing proves nothing.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* const files: Result<readonly PlacedRow[]> = listingRows_place(await files_listWhole('files', '/home/ada'), 'files', '/home/ada');
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
export declare function listingRows_place(outcome: ListingOutcome, asset: 'dirs' | 'files' | 'links', folder: string): Result<readonly PlacedRow[]>;
|
|
232
|
+
/**
|
|
233
|
+
* Every row of one listing of a folder known by its id, read whole on the
|
|
234
|
+
* client that folder was opened on, and placed directly inside its path.
|
|
235
|
+
*
|
|
236
|
+
* @param folder - The folder, opened by its id.
|
|
237
|
+
* @param asset - Which listing.
|
|
238
|
+
* @param folderPath - The folder's path, which every row must be directly inside.
|
|
239
|
+
* @returns The rows placed; Err when the listing proves nothing (the reason stacked).
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```ts
|
|
243
|
+
* const files: Result<readonly PlacedRow[]> = await freshListingRows_place(acts.folder_openById(70), 'files', '/home/ada/src/sub');
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
export declare function freshListingRows_place(folder: FreshFolder, asset: 'dirs' | 'files' | 'links', folderPath: string): Promise<Result<readonly PlacedRow[]>>;
|
|
247
|
+
/**
|
|
248
|
+
* What every name in a folder is held by: one whole proof of the folder,
|
|
249
|
+
* for an act that writes many names into it (a copy's children). The folder
|
|
250
|
+
* is found fresh on the act's client, never through the memo of lookups,
|
|
251
|
+
* and its three listings are read whole by its id; a folder that is not
|
|
252
|
+
* there, a listing refused or cut short, or a row that cannot be placed
|
|
253
|
+
* proves nothing. A name's holders are told apart as a path's proof tells
|
|
254
|
+
* them ({@link holders_distinct}): a row listed twice is one holder, and
|
|
255
|
+
* one listed at two addresses proves nothing.
|
|
256
|
+
*
|
|
257
|
+
* @param acts - The client the act is bound to.
|
|
258
|
+
* @param folder - The folder's absolute CUBE path.
|
|
259
|
+
* @returns Each name held, with its holders (a name absent is free); Err
|
|
260
|
+
* when the folder could not be proved whole (the reason stacked).
|
|
261
|
+
*
|
|
262
|
+
* @example
|
|
263
|
+
* ```ts
|
|
264
|
+
* const held: Result<FolderHolders> = await folderHolders_prove(acts, '/home/ada/copy');
|
|
265
|
+
* const free: boolean = held.ok && !held.value.has('scan.dcm');
|
|
266
|
+
* ```
|
|
267
|
+
*/
|
|
268
|
+
export declare function folderHolders_prove(acts: HolderClient, folder: string): Promise<Result<FolderHolders>>;
|
|
269
|
+
/**
|
|
270
|
+
* The holders of an ambiguous path, in an operator's words.
|
|
271
|
+
*
|
|
272
|
+
* @param holders - The holders.
|
|
273
|
+
* @returns `a folder and a file`, `two links`, and the like.
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```ts
|
|
277
|
+
* holders_describe([{ kind: 'dir', id: 1, href: null }, { kind: 'file', id: 2, href: null }]); // 'a folder and a file'
|
|
278
|
+
* ```
|
|
279
|
+
*/
|
|
280
|
+
export declare function holders_describe(holders: readonly PathHolderRecord[]): string;
|
|
281
|
+
/**
|
|
282
|
+
* A proof as a mount hands it on: the holders' kinds, without their ids.
|
|
283
|
+
*
|
|
284
|
+
* @param proof - The proof.
|
|
285
|
+
* @returns The same proof, in fond's words.
|
|
286
|
+
*
|
|
287
|
+
* @example
|
|
288
|
+
* ```ts
|
|
289
|
+
* pathProof_convertToHolderProof({ kind: 'held', holder: { kind: 'dir', id: 7, href: null } }); // { kind: 'held', holder: 'dir' }
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
export declare function pathProof_convertToHolderProof(proof: PathProof): HolderProof;
|
|
293
|
+
/**
|
|
294
|
+
* Proves whether a proved folder holds nothing, asked of the folder itself:
|
|
295
|
+
* its own three collections, by its id, on the client the proof was made
|
|
296
|
+
* with. A path is never listed for it: whatever a path names now may be
|
|
297
|
+
* another folder than the one proved.
|
|
298
|
+
*
|
|
299
|
+
* Every one of the folder's three collections must answer, in full: one
|
|
300
|
+
* refused, one with no count, or one cut short leaves the question open,
|
|
301
|
+
* and an open question is not "empty".
|
|
302
|
+
*
|
|
303
|
+
* @param acts - The client the folder was proved with.
|
|
304
|
+
* @param folder - The folder, as its proof named it.
|
|
305
|
+
* @returns True when all three answered in full and hold nothing, false
|
|
306
|
+
* when any holds a row; Err when the question stays open, with the
|
|
307
|
+
* reason on the error stack.
|
|
308
|
+
*
|
|
309
|
+
* @example
|
|
310
|
+
* ```ts
|
|
311
|
+
* const empty: Result<boolean> = await folderEmptiness_prove(acts, { kind: 'dir', id: 7, href: null });
|
|
312
|
+
* const removable: boolean = empty.ok && empty.value;
|
|
313
|
+
* ```
|
|
314
|
+
*/
|
|
315
|
+
export declare function folderEmptiness_prove(acts: HolderClient, folder: PathHolderRecord): Promise<Result<boolean>>;
|