@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
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Removing what holds a CUBE path: on proof of what it is, by its id, and confirmed gone.
|
|
3
|
+
*
|
|
4
|
+
* What is removed is decided once, on a whole proof of the path
|
|
5
|
+
* (`pathHolders_answer`): one holder, of the kind the removal allows. That
|
|
6
|
+
* holder is then acted on as the proof named it, by its id (a link at
|
|
7
|
+
* CUBE's own address for that id), and never found again by listing its parent or by
|
|
8
|
+
* looking its id up in the last page of a collection.
|
|
9
|
+
*
|
|
10
|
+
* CUBE accepts a delete before it has done it (a folder's DELETE answers
|
|
11
|
+
* 202). A removal is called done only when the thing removed answers that it
|
|
12
|
+
* is gone, asked of that thing alone, once per interval until a deadline: a
|
|
13
|
+
* folder by id answering none, a link or a file answering 404. Something
|
|
14
|
+
* new at the same name is another thing, and does not count either way. Any
|
|
15
|
+
* other end is its own outcome, accepted and not confirmed: not removed, not
|
|
16
|
+
* failed before anything was asked, and never retried (one DELETE). A
|
|
17
|
+
* DELETE that got no reply was asked and is not known, and is followed the
|
|
18
|
+
* same way: seen gone, or not confirmed; never a refusal. The
|
|
19
|
+
* deadline holds during a question too: no question is begun after it, an
|
|
20
|
+
* answer that comes after it is not taken however it came, and one still
|
|
21
|
+
* out at the deadline is not waited for (its read is aborted).
|
|
22
|
+
*
|
|
23
|
+
* The proof, the delete and every question after it go to one client, the
|
|
24
|
+
* session's when the proof began, and the proof finds each parent fresh on
|
|
25
|
+
* it (never through the memo of folder lookups); a connection that changed before the
|
|
26
|
+
* delete refuses it. A folder removed only if empty is asked by its id,
|
|
27
|
+
* before and after its emptiness is read, whether it is still the folder at
|
|
28
|
+
* the path, and its emptiness is read of its own collections, by that id:
|
|
29
|
+
* never of whatever a path names now.
|
|
30
|
+
*
|
|
31
|
+
* Key components:
|
|
32
|
+
* - RemovalOutcome: removed, absent (proved), unconfirmed, or refused with an errno (RemovalDone, RemovalAbsent, RemovalUnconfirmed, RemovalRefused).
|
|
33
|
+
* - path_remove: prove a path, then remove its holder within a scope.
|
|
34
|
+
* - holder_remove: remove one proved holder and confirm it gone.
|
|
35
|
+
* - folderByPath_delete: the public folder removal by path, on the same rule.
|
|
36
|
+
*
|
|
37
|
+
* Typical usage:
|
|
38
|
+
* ```ts
|
|
39
|
+
* const removed: RemovalOutcome = await path_remove('/home/ada/scratch', 'tree');
|
|
40
|
+
* if (removed.kind === 'unconfirmed') say(removed.reason);
|
|
41
|
+
* ```
|
|
42
|
+
*
|
|
43
|
+
* Dependencies: the proofs of `./proof.js`, cumin's `chrisIO` (the session's
|
|
44
|
+
* client, bound as a `HolderClient`: a delete by id, a folder's place and
|
|
45
|
+
* emptiness by id, and whether a holder is gone), cumin's error stack,
|
|
46
|
+
* whose newest reason a refusal takes, and the path mapper, cleared by a
|
|
47
|
+
* removal asked. Paths are absolute CUBE paths.
|
|
48
|
+
*
|
|
49
|
+
* @module
|
|
50
|
+
*/
|
|
51
|
+
import { type HolderClient } from '@fnndsc/cumin';
|
|
52
|
+
import type { VfsErrno } from '@fnndsc/fond';
|
|
53
|
+
import { type PathHolderRecord } from './proof.js';
|
|
54
|
+
/**
|
|
55
|
+
* How long a removal waits to see what it removed gone, and how often it asks.
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const wait: RemovalWait = { timeoutMs: 15_000, pollMs: 400 };
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export interface RemovalWait {
|
|
63
|
+
/** The deadline, from the moment CUBE accepted the delete. */
|
|
64
|
+
readonly timeoutMs: number;
|
|
65
|
+
/** The interval between asks. */
|
|
66
|
+
readonly pollMs: number;
|
|
67
|
+
}
|
|
68
|
+
/** The wait a removal makes unless told otherwise. */
|
|
69
|
+
export declare const REMOVAL_WAIT: RemovalWait;
|
|
70
|
+
/**
|
|
71
|
+
* What a removal came to.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```ts
|
|
75
|
+
* const outcome: RemovalOutcome = { kind: 'refused', errno: 'EISDIR', holder: null };
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export type RemovalOutcome = RemovalDone | RemovalAbsent | RemovalUnconfirmed | RemovalRefused;
|
|
79
|
+
/**
|
|
80
|
+
* The holder was removed, and answered that it is gone.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const done: RemovalDone = { kind: 'removed', holder: { kind: 'file', id: 41, href: null } };
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
export interface RemovalDone {
|
|
88
|
+
/** The outcome's kind. */
|
|
89
|
+
readonly kind: 'removed';
|
|
90
|
+
/** What was removed. */
|
|
91
|
+
readonly holder: PathHolderRecord;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Nothing holds the path, proved: nothing was asked.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const none: RemovalAbsent = { kind: 'absent' };
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export interface RemovalAbsent {
|
|
102
|
+
/** The outcome's kind. */
|
|
103
|
+
readonly kind: 'absent';
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* CUBE accepted the delete, and the holder was not seen gone by the deadline.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const queued: RemovalUnconfirmed = { kind: 'unconfirmed', holder: { kind: 'dir', id: 7, href: null }, reason: 'not seen gone within 15s' };
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
export interface RemovalUnconfirmed {
|
|
114
|
+
/** The outcome's kind. */
|
|
115
|
+
readonly kind: 'unconfirmed';
|
|
116
|
+
/** What the delete was asked of. */
|
|
117
|
+
readonly holder: PathHolderRecord;
|
|
118
|
+
/** What was accepted, and what was not seen. */
|
|
119
|
+
readonly reason: string;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Nothing was removed, and why: the errno a disk would give, and the
|
|
123
|
+
* store's words when there are any.
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* ```ts
|
|
127
|
+
* const refused: RemovalRefused = { kind: 'refused', errno: 'EISDIR', holder: null };
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface RemovalRefused {
|
|
131
|
+
/** The outcome's kind. */
|
|
132
|
+
readonly kind: 'refused';
|
|
133
|
+
/** Why, as an errno. */
|
|
134
|
+
readonly errno: VfsErrno;
|
|
135
|
+
/** What was to be removed, when it was known. */
|
|
136
|
+
readonly holder: PathHolderRecord | null;
|
|
137
|
+
/** The store's words, when it gave any. */
|
|
138
|
+
readonly reason?: string;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* How {@link folderByPath_delete} waits.
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const options: FolderDeleteOptions = { timeoutMs: 5_000 };
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
export interface FolderDeleteOptions {
|
|
149
|
+
/** How long to wait to see the folder gone (default 10s). */
|
|
150
|
+
readonly timeoutMs?: number;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* What a removal may take: `entry` a file or a link (a folder is `EISDIR`),
|
|
154
|
+
* `tree` a folder with all it holds (anything else is `ENOTDIR`),
|
|
155
|
+
* `emptyFolder` a folder proved empty, `any` whichever of them holds the path.
|
|
156
|
+
*/
|
|
157
|
+
export type RemovalScope = 'entry' | 'tree' | 'emptyFolder' | 'any';
|
|
158
|
+
/**
|
|
159
|
+
* Removes one proved holder and waits, a bounded time, to see it gone.
|
|
160
|
+
*
|
|
161
|
+
* One delete is asked for, whatever comes after, on the client the proof
|
|
162
|
+
* was made with, and only while that is still the session's. Then the
|
|
163
|
+
* holder itself is asked whether it is gone, at once and once per interval
|
|
164
|
+
* until the deadline, which holds during a question: none is begun after
|
|
165
|
+
* it, an answer that came after it is not taken, and one still unanswered
|
|
166
|
+
* at the deadline is not waited for. CUBE's acceptance of the delete is not
|
|
167
|
+
* taken for its completion, and a delete that got no reply is followed
|
|
168
|
+
* the same way.
|
|
169
|
+
*
|
|
170
|
+
* @param acts - The client the proof was made with.
|
|
171
|
+
* @param holder - The holder, as its proof named it.
|
|
172
|
+
* @param target - Its path, for the words.
|
|
173
|
+
* @param wait - The deadline and the interval.
|
|
174
|
+
* @returns `removed` when it answered gone, `unconfirmed` when it did not by
|
|
175
|
+
* the deadline (after a delete accepted, or asked with no reply),
|
|
176
|
+
* `refused` when CUBE refused the delete or the connection changed.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const outcome: RemovalOutcome = await holder_remove(acts, { kind: 'dir', id: 7, href: null }, '/home/ada/old');
|
|
181
|
+
* ```
|
|
182
|
+
*/
|
|
183
|
+
export declare function holder_remove(acts: HolderClient, holder: PathHolderRecord, target: string, wait?: RemovalWait): Promise<RemovalOutcome>;
|
|
184
|
+
/**
|
|
185
|
+
* Removes what holds a path, on proof of what it is, within a scope.
|
|
186
|
+
*
|
|
187
|
+
* A path whose proof failed is `EIO` (`ENOTDIR` when a file stands where a
|
|
188
|
+
* folder is needed on the way); one held by more than one thing is `EPERM`,
|
|
189
|
+
* since CUBE's delete of either damages the other's record and every
|
|
190
|
+
* listing of the parent fails after (CUBE #732); one proved empty is
|
|
191
|
+
* `absent`. A connection that changed while the proof was made is `EIO`,
|
|
192
|
+
* and nothing is removed. One CUBE has no request for: a folder emptied
|
|
193
|
+
* only if empty, so a child that arrives between the proof and the delete
|
|
194
|
+
* goes with it.
|
|
195
|
+
*
|
|
196
|
+
* @param target - The absolute CUBE path.
|
|
197
|
+
* @param scope - What the removal may take ({@link RemovalScope}).
|
|
198
|
+
* @param wait - How long to wait to see it gone.
|
|
199
|
+
* @returns What the removal came to.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```ts
|
|
203
|
+
* const outcome: RemovalOutcome = await path_remove('/home/ada/notes.txt', 'entry');
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
export declare function path_remove(target: string, scope: RemovalScope, wait?: RemovalWait): Promise<RemovalOutcome>;
|
|
207
|
+
/**
|
|
208
|
+
* Deletes a folder (and its contents) addressed by CUBE path, on the same
|
|
209
|
+
* rule as every removal: proved a folder, deleted by its id, and done only
|
|
210
|
+
* once it answers that it is gone.
|
|
211
|
+
*
|
|
212
|
+
* @param target - The folder's CUBE path (e.g. `/home/alice/scratch`).
|
|
213
|
+
* @param options - How long to wait to see it gone.
|
|
214
|
+
* @returns True when the folder was seen gone, or was proved never there;
|
|
215
|
+
* false otherwise, with the reason on the error stack (an accepted
|
|
216
|
+
* removal not seen done is false, and says so).
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* ```ts
|
|
220
|
+
* const removed: boolean = await folderByPath_delete('/home/alice/scratch');
|
|
221
|
+
* ```
|
|
222
|
+
*/
|
|
223
|
+
export declare function folderByPath_delete(target: string, options?: FolderDeleteOptions): Promise<boolean>;
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @file Removing what holds a CUBE path: on proof of what it is, by its id, and confirmed gone.
|
|
4
|
+
*
|
|
5
|
+
* What is removed is decided once, on a whole proof of the path
|
|
6
|
+
* (`pathHolders_answer`): one holder, of the kind the removal allows. That
|
|
7
|
+
* holder is then acted on as the proof named it, by its id (a link at
|
|
8
|
+
* CUBE's own address for that id), and never found again by listing its parent or by
|
|
9
|
+
* looking its id up in the last page of a collection.
|
|
10
|
+
*
|
|
11
|
+
* CUBE accepts a delete before it has done it (a folder's DELETE answers
|
|
12
|
+
* 202). A removal is called done only when the thing removed answers that it
|
|
13
|
+
* is gone, asked of that thing alone, once per interval until a deadline: a
|
|
14
|
+
* folder by id answering none, a link or a file answering 404. Something
|
|
15
|
+
* new at the same name is another thing, and does not count either way. Any
|
|
16
|
+
* other end is its own outcome, accepted and not confirmed: not removed, not
|
|
17
|
+
* failed before anything was asked, and never retried (one DELETE). A
|
|
18
|
+
* DELETE that got no reply was asked and is not known, and is followed the
|
|
19
|
+
* same way: seen gone, or not confirmed; never a refusal. The
|
|
20
|
+
* deadline holds during a question too: no question is begun after it, an
|
|
21
|
+
* answer that comes after it is not taken however it came, and one still
|
|
22
|
+
* out at the deadline is not waited for (its read is aborted).
|
|
23
|
+
*
|
|
24
|
+
* The proof, the delete and every question after it go to one client, the
|
|
25
|
+
* session's when the proof began, and the proof finds each parent fresh on
|
|
26
|
+
* it (never through the memo of folder lookups); a connection that changed before the
|
|
27
|
+
* delete refuses it. A folder removed only if empty is asked by its id,
|
|
28
|
+
* before and after its emptiness is read, whether it is still the folder at
|
|
29
|
+
* the path, and its emptiness is read of its own collections, by that id:
|
|
30
|
+
* never of whatever a path names now.
|
|
31
|
+
*
|
|
32
|
+
* Key components:
|
|
33
|
+
* - RemovalOutcome: removed, absent (proved), unconfirmed, or refused with an errno (RemovalDone, RemovalAbsent, RemovalUnconfirmed, RemovalRefused).
|
|
34
|
+
* - path_remove: prove a path, then remove its holder within a scope.
|
|
35
|
+
* - holder_remove: remove one proved holder and confirm it gone.
|
|
36
|
+
* - folderByPath_delete: the public folder removal by path, on the same rule.
|
|
37
|
+
*
|
|
38
|
+
* Typical usage:
|
|
39
|
+
* ```ts
|
|
40
|
+
* const removed: RemovalOutcome = await path_remove('/home/ada/scratch', 'tree');
|
|
41
|
+
* if (removed.kind === 'unconfirmed') say(removed.reason);
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* Dependencies: the proofs of `./proof.js`, cumin's `chrisIO` (the session's
|
|
45
|
+
* client, bound as a `HolderClient`: a delete by id, a folder's place and
|
|
46
|
+
* emptiness by id, and whether a holder is gone), cumin's error stack,
|
|
47
|
+
* whose newest reason a refusal takes, and the path mapper, cleared by a
|
|
48
|
+
* removal asked. Paths are absolute CUBE paths.
|
|
49
|
+
*
|
|
50
|
+
* @module
|
|
51
|
+
*/
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.REMOVAL_WAIT = void 0;
|
|
54
|
+
exports.holder_remove = holder_remove;
|
|
55
|
+
exports.path_remove = path_remove;
|
|
56
|
+
exports.folderByPath_delete = folderByPath_delete;
|
|
57
|
+
const cumin_1 = require("@fnndsc/cumin");
|
|
58
|
+
const pathMapper_js_1 = require("./pathMapper.js");
|
|
59
|
+
const proof_js_1 = require("./proof.js");
|
|
60
|
+
/** The wait a removal makes unless told otherwise. */
|
|
61
|
+
exports.REMOVAL_WAIT = { timeoutMs: 15_000, pollMs: 400 };
|
|
62
|
+
/**
|
|
63
|
+
* A refusal, its reason the newest message on the error stack (taken off it).
|
|
64
|
+
*
|
|
65
|
+
* @param errno - Why.
|
|
66
|
+
* @param holder - What was to be removed, when it was known.
|
|
67
|
+
* @returns The outcome.
|
|
68
|
+
*/
|
|
69
|
+
function stackRefusal_take(errno, holder) {
|
|
70
|
+
const top = cumin_1.errorStack.stack_pop();
|
|
71
|
+
const reason = top?.message.replace(/^\[[^\]]*\]\s*\|\s*/, '');
|
|
72
|
+
return reason === undefined ? { kind: 'refused', errno, holder } : { kind: 'refused', errno, holder, reason };
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* The refusal of an act whose client is no longer the session's.
|
|
76
|
+
*
|
|
77
|
+
* @param holder - What was to be acted on, when it was known.
|
|
78
|
+
* @param target - Its path, for the words.
|
|
79
|
+
* @returns `EIO`, nothing having been asked.
|
|
80
|
+
*/
|
|
81
|
+
function connectionChanged_refuse(holder, target) {
|
|
82
|
+
return { kind: 'refused', errno: 'EIO', holder, reason: `the connection to CUBE changed after ${target} was proved: nothing was removed` };
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Asks CUBE to delete one holder, as its proof named it, on the client the
|
|
86
|
+
* proof was made with.
|
|
87
|
+
*
|
|
88
|
+
* @param acts - The client the proof was made with.
|
|
89
|
+
* @param holder - The holder.
|
|
90
|
+
* @param target - Its path, for the words.
|
|
91
|
+
* @returns What CUBE said of the delete (`accepted`, or `unanswered`: asked,
|
|
92
|
+
* no reply), to be followed until the holder is seen gone; the refusal
|
|
93
|
+
* when CUBE refused it, or has no such folder, or nothing was asked.
|
|
94
|
+
*/
|
|
95
|
+
async function delete_ask(acts, holder, target) {
|
|
96
|
+
if (!await acts.current_is())
|
|
97
|
+
return connectionChanged_refuse(holder, target);
|
|
98
|
+
const asked = holder.kind === 'dir'
|
|
99
|
+
? await acts.folder_deleteById(holder.id, holder.href)
|
|
100
|
+
: holder.kind === 'link' ? await acts.link_deleteById(holder.id, holder.href) : await acts.file_deleteById(holder.id, holder.href);
|
|
101
|
+
if (!asked.ok)
|
|
102
|
+
return stackRefusal_take('EIO', holder);
|
|
103
|
+
if (asked.value === 'absent')
|
|
104
|
+
return { kind: 'refused', errno: 'ENOENT', holder, reason: `${target} was proved a folder (id ${String(holder.id)}), and CUBE no longer has it` };
|
|
105
|
+
return asked.value;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* A question, answered within a time: what it answered, or null when the
|
|
109
|
+
* time ran out first. The question is begun here, after its time is set,
|
|
110
|
+
* and ended (its read aborted) when the time runs out.
|
|
111
|
+
*
|
|
112
|
+
* @param ask - Begins the question, given the signal that ends it.
|
|
113
|
+
* @param ms - The time left.
|
|
114
|
+
* @returns The answer, or null.
|
|
115
|
+
*/
|
|
116
|
+
async function answer_within(ask, ms) {
|
|
117
|
+
const ending = new AbortController();
|
|
118
|
+
let timer;
|
|
119
|
+
const late = new Promise((resolve) => {
|
|
120
|
+
timer = setTimeout(() => { ending.abort(); resolve(null); }, ms);
|
|
121
|
+
});
|
|
122
|
+
try {
|
|
123
|
+
return await Promise.race([ask(ending.signal), late]);
|
|
124
|
+
}
|
|
125
|
+
finally {
|
|
126
|
+
clearTimeout(timer);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Waits a while.
|
|
131
|
+
*
|
|
132
|
+
* @param ms - How long.
|
|
133
|
+
* @returns Once it has passed.
|
|
134
|
+
*/
|
|
135
|
+
async function interval_wait(ms) {
|
|
136
|
+
await new Promise((resolve) => { setTimeout(resolve, ms); });
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Removes one proved holder and waits, a bounded time, to see it gone.
|
|
140
|
+
*
|
|
141
|
+
* One delete is asked for, whatever comes after, on the client the proof
|
|
142
|
+
* was made with, and only while that is still the session's. Then the
|
|
143
|
+
* holder itself is asked whether it is gone, at once and once per interval
|
|
144
|
+
* until the deadline, which holds during a question: none is begun after
|
|
145
|
+
* it, an answer that came after it is not taken, and one still unanswered
|
|
146
|
+
* at the deadline is not waited for. CUBE's acceptance of the delete is not
|
|
147
|
+
* taken for its completion, and a delete that got no reply is followed
|
|
148
|
+
* the same way.
|
|
149
|
+
*
|
|
150
|
+
* @param acts - The client the proof was made with.
|
|
151
|
+
* @param holder - The holder, as its proof named it.
|
|
152
|
+
* @param target - Its path, for the words.
|
|
153
|
+
* @param wait - The deadline and the interval.
|
|
154
|
+
* @returns `removed` when it answered gone, `unconfirmed` when it did not by
|
|
155
|
+
* the deadline (after a delete accepted, or asked with no reply),
|
|
156
|
+
* `refused` when CUBE refused the delete or the connection changed.
|
|
157
|
+
*
|
|
158
|
+
* @example
|
|
159
|
+
* ```ts
|
|
160
|
+
* const outcome: RemovalOutcome = await holder_remove(acts, { kind: 'dir', id: 7, href: null }, '/home/ada/old');
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
async function holder_remove(acts, holder, target, wait = exports.REMOVAL_WAIT) {
|
|
164
|
+
if (holder.id === 0)
|
|
165
|
+
return { kind: 'refused', errno: 'EPERM', holder, reason: 'the root is not removed' };
|
|
166
|
+
const asked = await delete_ask(acts, holder, target);
|
|
167
|
+
if (typeof asked !== 'string')
|
|
168
|
+
return asked;
|
|
169
|
+
// Asked, and perhaps done: no mapping, under any name, may lead through what it was.
|
|
170
|
+
(0, pathMapper_js_1.linkCache_clear)();
|
|
171
|
+
const deadline = Date.now() + wait.timeoutMs;
|
|
172
|
+
let lastSaid = 'it gave no answer that says';
|
|
173
|
+
// No question is begun once the deadline has passed, and an answer counts only when it came before it.
|
|
174
|
+
while (Date.now() < deadline) {
|
|
175
|
+
const gone = await answer_within((signal) => acts.holder_isGone(holder, signal), deadline - Date.now());
|
|
176
|
+
if (gone === null || Date.now() > deadline) {
|
|
177
|
+
lastSaid = 'it had not answered by then';
|
|
178
|
+
break;
|
|
179
|
+
}
|
|
180
|
+
if (gone.ok && gone.value)
|
|
181
|
+
return { kind: 'removed', holder };
|
|
182
|
+
if (gone.ok)
|
|
183
|
+
lastSaid = 'it still answers';
|
|
184
|
+
const left = deadline - Date.now();
|
|
185
|
+
if (left <= 0)
|
|
186
|
+
break;
|
|
187
|
+
await interval_wait(Math.min(wait.pollMs, left));
|
|
188
|
+
}
|
|
189
|
+
const seconds = Math.round(wait.timeoutMs / 1000);
|
|
190
|
+
const said = asked === 'unanswered' ? `CUBE gave no reply to the removal of ${target}` : `CUBE accepted the removal of ${target}`;
|
|
191
|
+
return { kind: 'unconfirmed', holder, reason: `${said}, and it was not seen gone within ${String(seconds)}s (${lastSaid}): not counted as removed` };
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Whether the folder a proof named is still the one at its path, asked of
|
|
195
|
+
* it by its id.
|
|
196
|
+
*
|
|
197
|
+
* @param acts - The client the proof was made with.
|
|
198
|
+
* @param holder - The folder, as its proof named it.
|
|
199
|
+
* @param target - The path it was proved at.
|
|
200
|
+
* @returns Null when it is; the refusal otherwise.
|
|
201
|
+
*/
|
|
202
|
+
async function folderStill_check(acts, holder, target) {
|
|
203
|
+
const at = await acts.folder_pathById(holder.id);
|
|
204
|
+
if (!at.ok)
|
|
205
|
+
return stackRefusal_take('EIO', holder);
|
|
206
|
+
if (at.value === target)
|
|
207
|
+
return null;
|
|
208
|
+
if (at.value === null)
|
|
209
|
+
return { kind: 'refused', errno: 'ENOENT', holder, reason: `${target} was proved a folder (id ${String(holder.id)}), and CUBE no longer has it` };
|
|
210
|
+
return { kind: 'refused', errno: 'EIO', holder, reason: `${target} was proved a folder (id ${String(holder.id)}), and CUBE now has that folder at ${at.value}: nothing was removed` };
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Proves a proved folder empty, bound to its id: the folder at the path is
|
|
214
|
+
* asked by id to be the proved one before and after its own collections
|
|
215
|
+
* are read, by that id.
|
|
216
|
+
*
|
|
217
|
+
* @param acts - The client the proof was made with.
|
|
218
|
+
* @param holder - The folder.
|
|
219
|
+
* @param target - Its path.
|
|
220
|
+
* @returns Null when it is empty and still the proved folder; the refusal otherwise.
|
|
221
|
+
*/
|
|
222
|
+
async function folderEmpty_check(acts, holder, target) {
|
|
223
|
+
const before = await folderStill_check(acts, holder, target);
|
|
224
|
+
if (before !== null)
|
|
225
|
+
return before;
|
|
226
|
+
const empty = await (0, proof_js_1.folderEmptiness_prove)(acts, holder);
|
|
227
|
+
if (!empty.ok)
|
|
228
|
+
return stackRefusal_take('EIO', holder);
|
|
229
|
+
if (!empty.value)
|
|
230
|
+
return { kind: 'refused', errno: 'ENOTEMPTY', holder };
|
|
231
|
+
return folderStill_check(acts, holder, target);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Whether a proved holder is one the scope may take, and what the scope
|
|
235
|
+
* says when it is not.
|
|
236
|
+
*
|
|
237
|
+
* @param acts - The client the proof was made with.
|
|
238
|
+
* @param holder - The holder.
|
|
239
|
+
* @param scope - The removal's scope.
|
|
240
|
+
* @param target - Its path.
|
|
241
|
+
* @returns Null when it may go; the refusal otherwise.
|
|
242
|
+
*/
|
|
243
|
+
async function scope_check(acts, holder, scope, target) {
|
|
244
|
+
const folder = holder.kind === 'dir';
|
|
245
|
+
if (scope === 'entry' && folder)
|
|
246
|
+
return { kind: 'refused', errno: 'EISDIR', holder };
|
|
247
|
+
if ((scope === 'tree' || scope === 'emptyFolder') && !folder)
|
|
248
|
+
return { kind: 'refused', errno: 'ENOTDIR', holder };
|
|
249
|
+
if (scope !== 'emptyFolder')
|
|
250
|
+
return null;
|
|
251
|
+
return holder.id === 0 ? { kind: 'refused', errno: 'EPERM', holder, reason: 'the root is not removed' } : folderEmpty_check(acts, holder, target);
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Removes what holds a path, on proof of what it is, within a scope.
|
|
255
|
+
*
|
|
256
|
+
* A path whose proof failed is `EIO` (`ENOTDIR` when a file stands where a
|
|
257
|
+
* folder is needed on the way); one held by more than one thing is `EPERM`,
|
|
258
|
+
* since CUBE's delete of either damages the other's record and every
|
|
259
|
+
* listing of the parent fails after (CUBE #732); one proved empty is
|
|
260
|
+
* `absent`. A connection that changed while the proof was made is `EIO`,
|
|
261
|
+
* and nothing is removed. One CUBE has no request for: a folder emptied
|
|
262
|
+
* only if empty, so a child that arrives between the proof and the delete
|
|
263
|
+
* goes with it.
|
|
264
|
+
*
|
|
265
|
+
* @param target - The absolute CUBE path.
|
|
266
|
+
* @param scope - What the removal may take ({@link RemovalScope}).
|
|
267
|
+
* @param wait - How long to wait to see it gone.
|
|
268
|
+
* @returns What the removal came to.
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* ```ts
|
|
272
|
+
* const outcome: RemovalOutcome = await path_remove('/home/ada/notes.txt', 'entry');
|
|
273
|
+
* ```
|
|
274
|
+
*/
|
|
275
|
+
async function path_remove(target, scope, wait = exports.REMOVAL_WAIT) {
|
|
276
|
+
// The client the proof is made with is the one every act goes to.
|
|
277
|
+
const bound = await cumin_1.chrisIO.holderClient_bind();
|
|
278
|
+
if (!bound.ok)
|
|
279
|
+
return stackRefusal_take('EIO', null);
|
|
280
|
+
const acts = bound.value;
|
|
281
|
+
const answer = await (0, proof_js_1.pathHolders_answer)(target, acts);
|
|
282
|
+
if (answer.kind === 'error')
|
|
283
|
+
return stackRefusal_take(answer.notDirectory ? 'ENOTDIR' : 'EIO', null);
|
|
284
|
+
if (!await acts.current_is())
|
|
285
|
+
return connectionChanged_refuse(null, target);
|
|
286
|
+
if (answer.kind === 'absent')
|
|
287
|
+
return { kind: 'absent' };
|
|
288
|
+
if (answer.kind === 'ambiguous') {
|
|
289
|
+
return { kind: 'refused', errno: 'EPERM', holder: null, reason: `${(0, proof_js_1.holders_describe)(answer.holders)} share ${target}, and removing either would damage the other in CUBE` };
|
|
290
|
+
}
|
|
291
|
+
const refused = await scope_check(acts, answer.holder, scope, target);
|
|
292
|
+
return refused ?? holder_remove(acts, answer.holder, target, wait);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Deletes a folder (and its contents) addressed by CUBE path, on the same
|
|
296
|
+
* rule as every removal: proved a folder, deleted by its id, and done only
|
|
297
|
+
* once it answers that it is gone.
|
|
298
|
+
*
|
|
299
|
+
* @param target - The folder's CUBE path (e.g. `/home/alice/scratch`).
|
|
300
|
+
* @param options - How long to wait to see it gone.
|
|
301
|
+
* @returns True when the folder was seen gone, or was proved never there;
|
|
302
|
+
* false otherwise, with the reason on the error stack (an accepted
|
|
303
|
+
* removal not seen done is false, and says so).
|
|
304
|
+
*
|
|
305
|
+
* @example
|
|
306
|
+
* ```ts
|
|
307
|
+
* const removed: boolean = await folderByPath_delete('/home/alice/scratch');
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
async function folderByPath_delete(target, options = {}) {
|
|
311
|
+
const outcome = await path_remove(target, 'tree', { timeoutMs: options.timeoutMs ?? 10_000, pollMs: 500 });
|
|
312
|
+
if (outcome.kind === 'removed' || outcome.kind === 'absent')
|
|
313
|
+
return true;
|
|
314
|
+
const reason = outcome.kind === 'unconfirmed' ? outcome.reason : outcome.reason ?? `Cannot remove ${target}: ${outcome.errno}`;
|
|
315
|
+
cumin_1.errorStack.stack_push('error', reason);
|
|
316
|
+
return false;
|
|
317
|
+
}
|
|
318
|
+
//# sourceMappingURL=removal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"removal.js","sourceRoot":"","sources":["../../src/files/removal.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;;;AA+NH,sCAwBC;AA8ED,kCAcC;AAkBD,kDAMC;AAzWD,yCAA0H;AAG1H,mDAAkD;AAClD,yCAAiI;AAiBjI,sDAAsD;AACzC,QAAA,YAAY,GAAgB,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAiG5E;;;;;;GAMG;AACH,SAAS,iBAAiB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