@fnndsc/fond 0.2.0 → 0.3.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 +4 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/vfs/contract.d.ts +26 -0
- package/dist/vfs/contract.js +195 -0
- package/dist/vfs/contract.js.map +1 -0
- package/dist/vfs/dispatcher.d.ts +92 -34
- package/dist/vfs/dispatcher.js +174 -87
- package/dist/vfs/dispatcher.js.map +1 -1
- package/dist/vfs/fsViews.d.ts +39 -0
- package/dist/vfs/fsViews.js +91 -0
- package/dist/vfs/fsViews.js.map +1 -0
- package/dist/vfs/memory.d.ts +66 -0
- package/dist/vfs/memory.js +282 -0
- package/dist/vfs/memory.js.map +1 -0
- package/dist/vfs/outcome.d.ts +98 -0
- package/dist/vfs/outcome.js +151 -0
- package/dist/vfs/outcome.js.map +1 -0
- package/dist/vfs/provider.d.ts +54 -23
- package/dist/vfs/render.d.ts +73 -0
- package/dist/vfs/render.js +203 -0
- package/dist/vfs/render.js.map +1 -0
- package/package.json +4 -1
package/dist/vfs/dispatcher.js
CHANGED
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.VFSDispatcher = void 0;
|
|
17
17
|
const result_js_1 = require("../result.js");
|
|
18
18
|
const errorStack_js_1 = require("../errorStack.js");
|
|
19
|
+
const outcome_js_1 = require("./outcome.js");
|
|
19
20
|
/**
|
|
20
21
|
* The fallback when none is given: it holds nothing, and says so by name
|
|
21
22
|
* rather than answering with an empty folder.
|
|
@@ -27,8 +28,7 @@ const VFS_FALLBACK_NONE = {
|
|
|
27
28
|
return (0, result_js_1.Err)();
|
|
28
29
|
},
|
|
29
30
|
async cp(src) {
|
|
30
|
-
|
|
31
|
-
return false;
|
|
31
|
+
return (0, outcome_js_1.vfs_fail)("ENOENT", `cp: no mount serves ${src}`);
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
/**
|
|
@@ -147,7 +147,12 @@ class VFSDispatcher {
|
|
|
147
147
|
// contrast cp(), where a guessed path could write wrongly.
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
+
// The store holding nothing here is an answer: the mounts are the
|
|
151
|
+
// listing, and what the store said is not left to fail the command.
|
|
152
|
+
const mark = errorStack_js_1.errorStack.checkpoint_mark();
|
|
150
153
|
const fallbackResult = await this.defaultProvider.list(resolvedPathStr, options);
|
|
154
|
+
if (!fallbackResult.ok)
|
|
155
|
+
errorStack_js_1.errorStack.checkpoint_drain(mark);
|
|
151
156
|
if (fallbackResult.ok && fallbackResult.value) {
|
|
152
157
|
const fallbackItems = fallbackResult.value;
|
|
153
158
|
for (const item of fallbackItems) {
|
|
@@ -172,132 +177,214 @@ class VFSDispatcher {
|
|
|
172
177
|
return provider.list(pathStr, options);
|
|
173
178
|
}
|
|
174
179
|
/**
|
|
175
|
-
*
|
|
180
|
+
* The path a provider is asked with: as given for a mount, and through
|
|
181
|
+
* the path resolver for the fallback, when one is registered. An
|
|
182
|
+
* operation never proceeds on a guessed path: a path that does not
|
|
183
|
+
* resolve fails the operation.
|
|
184
|
+
*
|
|
185
|
+
* @param provider - The provider the path belongs to.
|
|
186
|
+
* @param pathStr - The path as asked.
|
|
187
|
+
* @param what - How a resolution failure names the path (`source path`, `path`).
|
|
188
|
+
* @param operation - The verb, for the failure's words.
|
|
189
|
+
* @returns The path to ask with, or why the operation cannot proceed.
|
|
190
|
+
*/
|
|
191
|
+
async pathFor_provider(provider, pathStr, what, operation) {
|
|
192
|
+
if (provider !== this.defaultProvider || !this.pathResolver)
|
|
193
|
+
return (0, outcome_js_1.vfs_ok)(pathStr);
|
|
194
|
+
try {
|
|
195
|
+
return (0, outcome_js_1.vfs_ok)(await this.pathResolver(pathStr));
|
|
196
|
+
}
|
|
197
|
+
catch (e) {
|
|
198
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
199
|
+
return (0, outcome_js_1.vfs_fail)('EIO', `${operation}: cannot resolve ${what} ${pathStr}: ${msg}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Copies within or between paths, through the provider that owns the source.
|
|
176
204
|
*
|
|
177
205
|
* @param src - Source path.
|
|
178
206
|
* @param dest - Destination path.
|
|
179
207
|
* @param options - Copy options.
|
|
180
|
-
* @returns
|
|
208
|
+
* @returns Done, or why not.
|
|
181
209
|
*/
|
|
182
210
|
async cp(src, dest, options) {
|
|
183
211
|
const provider = this.provider_get(src);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
resolvedSrc = await this.pathResolver(src);
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
195
|
-
errorStack_js_1.errorStack.stack_push("error", `cp: cannot resolve source path ${src}: ${msg}`);
|
|
196
|
-
return false;
|
|
197
|
-
}
|
|
198
|
-
try {
|
|
199
|
-
resolvedDest = await this.pathResolver(dest);
|
|
200
|
-
}
|
|
201
|
-
catch (e) {
|
|
202
|
-
const msg = e instanceof Error ? e.message : String(e);
|
|
203
|
-
errorStack_js_1.errorStack.stack_push("error", `cp: cannot resolve destination path ${dest}: ${msg}`);
|
|
204
|
-
return false;
|
|
205
|
-
}
|
|
206
|
-
return provider.cp(resolvedSrc, resolvedDest, options);
|
|
207
|
-
}
|
|
208
|
-
return provider.cp(src, dest, options);
|
|
212
|
+
const from = await this.pathFor_provider(provider, src, 'source path', 'cp');
|
|
213
|
+
if (!from.ok)
|
|
214
|
+
return from;
|
|
215
|
+
const to = await this.pathFor_provider(provider, dest, 'destination path', 'cp');
|
|
216
|
+
if (!to.ok)
|
|
217
|
+
return to;
|
|
218
|
+
return provider.cp(from.value, to.value, options);
|
|
209
219
|
}
|
|
210
220
|
/**
|
|
211
|
-
*
|
|
221
|
+
* Reads a file whole, as text, through the provider that owns it.
|
|
212
222
|
*
|
|
213
|
-
* @param pathStr - The absolute
|
|
214
|
-
* @returns
|
|
223
|
+
* @param pathStr - The absolute path of the file.
|
|
224
|
+
* @returns Its content, or why not (`EROFS` where no read is offered).
|
|
215
225
|
*/
|
|
216
226
|
async read(pathStr) {
|
|
217
227
|
const provider = this.provider_get(pathStr);
|
|
218
|
-
if (provider
|
|
219
|
-
return
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
228
|
+
if (!provider.read)
|
|
229
|
+
return this.readFailure_classify(pathStr, (0, outcome_js_1.vfs_fail)('EROFS'));
|
|
230
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'read');
|
|
231
|
+
return this.readFailure_classify(pathStr, at.ok ? await provider.read(at.value) : at);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* A failed read of a folder says so: whatever the owning mount answered
|
|
235
|
+
* (CUBE's "File not found", a projection's own words, a mount that reads
|
|
236
|
+
* nothing), a path its parent lists as a folder is a directory, as a
|
|
237
|
+
* disk says.
|
|
238
|
+
*
|
|
239
|
+
* @param pathStr - The path read.
|
|
240
|
+
* @param outcome - The read's answer.
|
|
241
|
+
* @returns The answer, or `EISDIR` when it failed on a folder.
|
|
242
|
+
*/
|
|
243
|
+
async readFailure_classify(pathStr, outcome) {
|
|
244
|
+
if (outcome.ok || outcome.errno === 'EISDIR')
|
|
245
|
+
return outcome;
|
|
246
|
+
const clean = pathStr.length > 1 && pathStr.endsWith('/') ? pathStr.slice(0, -1) : pathStr;
|
|
247
|
+
if (clean === '/')
|
|
248
|
+
return (0, outcome_js_1.vfs_fail)('EISDIR');
|
|
249
|
+
const slash = clean.lastIndexOf('/');
|
|
250
|
+
const name = clean.slice(slash + 1);
|
|
251
|
+
const mark = errorStack_js_1.errorStack.checkpoint_mark();
|
|
252
|
+
const siblings = await this.list(clean.slice(0, slash) || '/');
|
|
253
|
+
errorStack_js_1.errorStack.checkpoint_drain(mark);
|
|
254
|
+
const folder = siblings.ok && siblings.value.some((item) => item.name === name && (item.type === 'dir' || item.type === 'vfs'));
|
|
255
|
+
return folder ? (0, outcome_js_1.vfs_fail)('EISDIR') : outcome;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Reads a file whole, as bytes, through the provider that owns it.
|
|
259
|
+
*
|
|
260
|
+
* @param pathStr - The absolute path of the file.
|
|
261
|
+
* @returns Its bytes, or why not.
|
|
262
|
+
*/
|
|
263
|
+
async readBinary(pathStr) {
|
|
264
|
+
const provider = this.provider_get(pathStr);
|
|
265
|
+
if (!provider.readBinary)
|
|
266
|
+
return this.readFailure_classify(pathStr, (0, outcome_js_1.vfs_fail)('EROFS'));
|
|
267
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'read');
|
|
268
|
+
return this.readFailure_classify(pathStr, at.ok ? await provider.readBinary(at.value) : at);
|
|
223
269
|
}
|
|
224
270
|
/**
|
|
225
|
-
*
|
|
226
|
-
*
|
|
227
|
-
* path is refused by name rather than written somewhere it does not live.
|
|
271
|
+
* Writes a file whole, through the provider that owns it; a mount that
|
|
272
|
+
* holds no writable files answers `EROFS`.
|
|
228
273
|
*
|
|
229
|
-
* @param pathStr - The absolute
|
|
230
|
-
* @param content - The
|
|
231
|
-
* @returns
|
|
274
|
+
* @param pathStr - The absolute path of the file.
|
|
275
|
+
* @param content - The new content, whole.
|
|
276
|
+
* @returns Done, or why not.
|
|
232
277
|
*/
|
|
278
|
+
async write(pathStr, content) {
|
|
279
|
+
const provider = this.provider_get(pathStr);
|
|
280
|
+
if (!provider.write)
|
|
281
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
282
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'write');
|
|
283
|
+
return at.ok ? provider.write(at.value, content) : at;
|
|
284
|
+
}
|
|
233
285
|
/**
|
|
234
|
-
*
|
|
235
|
-
* makes no folders refuses by name.
|
|
286
|
+
* Makes a folder, through the provider that owns its path.
|
|
236
287
|
*
|
|
237
|
-
* @param pathStr - The absolute
|
|
238
|
-
* @returns
|
|
288
|
+
* @param pathStr - The absolute path of the new folder.
|
|
289
|
+
* @returns Done, or why not.
|
|
239
290
|
*/
|
|
240
291
|
async mkdir(pathStr) {
|
|
241
292
|
const provider = this.provider_get(pathStr);
|
|
242
|
-
if (provider
|
|
243
|
-
return
|
|
244
|
-
|
|
245
|
-
return
|
|
293
|
+
if (!provider.mkdir)
|
|
294
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
295
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'mkdir');
|
|
296
|
+
return at.ok ? provider.mkdir(at.value) : at;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Whether the provider that owns a folder makes it and its parents in one step.
|
|
300
|
+
*
|
|
301
|
+
* @param pathStr - The absolute path of the folder.
|
|
302
|
+
* @returns True when `mkdirTree` is offered there.
|
|
303
|
+
*/
|
|
304
|
+
mkdirTree_offered(pathStr) {
|
|
305
|
+
return this.provider_get(pathStr).mkdirTree !== undefined;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Makes a folder and any missing parents in one step, where the owning
|
|
309
|
+
* provider can; elsewhere `EROFS`, and `mkdir -p` walks instead.
|
|
310
|
+
*
|
|
311
|
+
* @param pathStr - The absolute path of the folder.
|
|
312
|
+
* @returns Done, or why not.
|
|
313
|
+
*/
|
|
314
|
+
async mkdirTree(pathStr) {
|
|
315
|
+
const provider = this.provider_get(pathStr);
|
|
316
|
+
if (!provider.mkdirTree)
|
|
317
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
318
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'mkdir');
|
|
319
|
+
return at.ok ? provider.mkdirTree(at.value) : at;
|
|
246
320
|
}
|
|
247
321
|
/**
|
|
248
|
-
*
|
|
249
|
-
* mount that removes no folders refuses by name.
|
|
322
|
+
* Removes an empty folder, through the provider that owns it.
|
|
250
323
|
*
|
|
251
|
-
* @param pathStr - The absolute
|
|
252
|
-
* @returns
|
|
324
|
+
* @param pathStr - The absolute path of the folder.
|
|
325
|
+
* @returns Done, or why not.
|
|
253
326
|
*/
|
|
254
327
|
async rmdir(pathStr) {
|
|
255
328
|
const provider = this.provider_get(pathStr);
|
|
256
|
-
if (provider
|
|
257
|
-
return
|
|
258
|
-
|
|
259
|
-
return
|
|
329
|
+
if (!provider.rmdir)
|
|
330
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
331
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rmdir');
|
|
332
|
+
return at.ok ? provider.rmdir(at.value) : at;
|
|
260
333
|
}
|
|
261
334
|
/**
|
|
262
|
-
*
|
|
263
|
-
* mount that renames nothing, is refused by name.
|
|
335
|
+
* Renames within one mount; a rename across mounts answers `EXDEV`.
|
|
264
336
|
*
|
|
265
|
-
* @param src - The absolute
|
|
266
|
-
* @param dest - The absolute
|
|
267
|
-
* @returns
|
|
337
|
+
* @param src - The absolute path now.
|
|
338
|
+
* @param dest - The absolute path it takes.
|
|
339
|
+
* @returns Done, or why not.
|
|
268
340
|
*/
|
|
269
341
|
async rename(src, dest) {
|
|
270
342
|
const provider = this.provider_get(src);
|
|
271
|
-
if (provider !== this.provider_get(dest))
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
343
|
+
if (provider !== this.provider_get(dest))
|
|
344
|
+
return (0, outcome_js_1.vfs_fail)('EXDEV');
|
|
345
|
+
if (!provider.rename)
|
|
346
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
347
|
+
const from = await this.pathFor_provider(provider, src, 'source path', 'mv');
|
|
348
|
+
if (!from.ok)
|
|
349
|
+
return from;
|
|
350
|
+
const to = await this.pathFor_provider(provider, dest, 'destination path', 'mv');
|
|
351
|
+
return to.ok ? provider.rename(from.value, to.value) : to;
|
|
279
352
|
}
|
|
280
|
-
|
|
353
|
+
/**
|
|
354
|
+
* Removes a file or a link, through the provider that owns it.
|
|
355
|
+
*
|
|
356
|
+
* @param pathStr - The absolute path of the entry.
|
|
357
|
+
* @returns Done, or why not.
|
|
358
|
+
*/
|
|
359
|
+
async rm(pathStr) {
|
|
281
360
|
const provider = this.provider_get(pathStr);
|
|
282
|
-
if (provider
|
|
283
|
-
return
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
return false;
|
|
361
|
+
if (!provider.rm)
|
|
362
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
363
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rm');
|
|
364
|
+
return at.ok ? provider.rm(at.value) : at;
|
|
287
365
|
}
|
|
288
366
|
/**
|
|
289
|
-
*
|
|
367
|
+
* Whether the provider that owns a folder removes it whole in one step.
|
|
290
368
|
*
|
|
291
|
-
* @param pathStr - The absolute
|
|
292
|
-
* @returns
|
|
369
|
+
* @param pathStr - The absolute path of the folder.
|
|
370
|
+
* @returns True when `rmTree` is offered there.
|
|
293
371
|
*/
|
|
294
|
-
|
|
372
|
+
rmTree_offered(pathStr) {
|
|
373
|
+
return this.provider_get(pathStr).rmTree !== undefined;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Removes a folder and everything under it in one step, where the
|
|
377
|
+
* owning provider can; elsewhere `EROFS`, and `rm -r` walks instead.
|
|
378
|
+
*
|
|
379
|
+
* @param pathStr - The absolute path of the folder.
|
|
380
|
+
* @returns Done, or why not.
|
|
381
|
+
*/
|
|
382
|
+
async rmTree(pathStr) {
|
|
295
383
|
const provider = this.provider_get(pathStr);
|
|
296
|
-
if (provider
|
|
297
|
-
return
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
return (0, result_js_1.Err)();
|
|
384
|
+
if (!provider.rmTree)
|
|
385
|
+
return (0, outcome_js_1.vfs_fail)('EROFS');
|
|
386
|
+
const at = await this.pathFor_provider(provider, pathStr, 'path', 'rm');
|
|
387
|
+
return at.ok ? provider.rmTree(at.value) : at;
|
|
301
388
|
}
|
|
302
389
|
/**
|
|
303
390
|
* Resolves a lazy link through the provider that owns it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/vfs/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,4CAA+C;AAC/C,oDAA8C;AAG9C;;;GAGG;AACH,MAAM,iBAAiB,GAAgB;IACrC,MAAM,EAAE,EAAE;IACV,KAAK,CAAC,IAAI,CAAC,IAAY;QACrB,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,mBAAmB,IAAI,GAAG,CAAC,CAAC;QAC3D,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;IACD,KAAK,CAAC,EAAE,CAAC,GAAW;QAClB,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,uBAAuB,GAAG,EAAE,CAAC,CAAC;QAC7D,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC;AAEF;;;GAGG;AACH,MAAa,aAAa;IAKxB;;;OAGG;IACH,YAAY,WAAwB,iBAAiB;QAR7C,cAAS,GAAkB,EAAE,CAAC;QASpC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,qBAAqB,CAAC,QAA2C;QAC/D,IAAI,CAAC,YAAY,GAAG,QAAQ,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,iBAAiB,CAAC,QAAqB;QACrC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC9B,uEAAuE;QACvE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAc,EAAE,CAAc,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC7F,CAAC;IAED;;;OAGG;IACH,aAAa;QACX,OAAO,CAAC,GAAG,IAAI,C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K,CAAC,kBAAkB,CAAC,OAAe;QACtC,MAAM,QAAQ,GAAgB,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACzD,IAAI,QAAQ,CAAC,kBAAkB,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAC9C,CAAC;QACD,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,2CAA2C,OAAO,EAAE,CAAC,CAAC;QACrF,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;CACF;AAtYD,sCAsYC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Renders the result of a mkdir operation.
|
|
3
|
+
* @param path - The path created.
|
|
4
|
+
* @param success - Whether the operation succeeded.
|
|
5
|
+
*/
|
|
6
|
+
export declare function mkdir_render(path: string, success: boolean): string;
|
|
7
|
+
/**
|
|
8
|
+
* Renders the result of a touch operation.
|
|
9
|
+
* @param path - The path created.
|
|
10
|
+
* @param success - Whether the operation succeeded.
|
|
11
|
+
* @param wrote - Whether content was written, rather than an empty file made.
|
|
12
|
+
*/
|
|
13
|
+
export declare function touch_render(path: string, success: boolean, wrote?: boolean): string;
|
|
14
|
+
/**
|
|
15
|
+
* Renders the result of a copy operation.
|
|
16
|
+
* @param src - Source path.
|
|
17
|
+
* @param dest - Destination path.
|
|
18
|
+
* @param success - Whether the operation succeeded.
|
|
19
|
+
*/
|
|
20
|
+
export declare function cp_render(src: string, dest: string, success: boolean): string;
|
|
21
|
+
/**
|
|
22
|
+
* Renders the result of a move operation.
|
|
23
|
+
* @param src - Source path.
|
|
24
|
+
* @param dest - Destination path.
|
|
25
|
+
* @param success - Whether the operation succeeded.
|
|
26
|
+
*/
|
|
27
|
+
export declare function mv_render(src: string, dest: string, success: boolean): string;
|
|
28
|
+
/**
|
|
29
|
+
* Renders the outcome of an rm operation for terminal display.
|
|
30
|
+
*
|
|
31
|
+
* @param result - The rm result.
|
|
32
|
+
* @returns Formatted status string.
|
|
33
|
+
*/
|
|
34
|
+
export declare function rm_render(result: {
|
|
35
|
+
success: boolean;
|
|
36
|
+
path: string;
|
|
37
|
+
type: 'file' | 'dir' | 'link' | null;
|
|
38
|
+
error?: string;
|
|
39
|
+
}): string;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mkdir_render = mkdir_render;
|
|
7
|
+
exports.touch_render = touch_render;
|
|
8
|
+
exports.cp_render = cp_render;
|
|
9
|
+
exports.mv_render = mv_render;
|
|
10
|
+
exports.rm_render = rm_render;
|
|
11
|
+
/**
|
|
12
|
+
* @file What the file tools say when they are done: a folder made, a file
|
|
13
|
+
* written, a copy or a move, an entry removed.
|
|
14
|
+
*
|
|
15
|
+
* @module
|
|
16
|
+
*/
|
|
17
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
18
|
+
/**
|
|
19
|
+
* Renders the result of a mkdir operation.
|
|
20
|
+
* @param path - The path created.
|
|
21
|
+
* @param success - Whether the operation succeeded.
|
|
22
|
+
*/
|
|
23
|
+
function mkdir_render(path, success) {
|
|
24
|
+
if (success) {
|
|
25
|
+
return chalk_1.default.green(`Created directory: ${path}`);
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return chalk_1.default.red(`Failed to create directory: ${path}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Renders the result of a touch operation.
|
|
33
|
+
* @param path - The path created.
|
|
34
|
+
* @param success - Whether the operation succeeded.
|
|
35
|
+
* @param wrote - Whether content was written, rather than an empty file made.
|
|
36
|
+
*/
|
|
37
|
+
function touch_render(path, success, wrote = false) {
|
|
38
|
+
if (success) {
|
|
39
|
+
// A touch that carried content WROTE the file, and may have replaced one
|
|
40
|
+
// that was already there: reporting "Created" for a rewrite told the
|
|
41
|
+
// operator a file was new when their old content had just been replaced.
|
|
42
|
+
return chalk_1.default.green(`${wrote ? 'Wrote' : 'Created'} file: ${path}`);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return chalk_1.default.red(`Failed to ${wrote ? 'write' : 'create'} file: ${path}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Renders the result of a copy operation.
|
|
50
|
+
* @param src - Source path.
|
|
51
|
+
* @param dest - Destination path.
|
|
52
|
+
* @param success - Whether the operation succeeded.
|
|
53
|
+
*/
|
|
54
|
+
function cp_render(src, dest, success) {
|
|
55
|
+
if (success) {
|
|
56
|
+
return chalk_1.default.green(`Copied ${src} to ${dest}`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
return chalk_1.default.red(`Failed to copy ${src} to ${dest}`);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Renders the result of a move operation.
|
|
64
|
+
* @param src - Source path.
|
|
65
|
+
* @param dest - Destination path.
|
|
66
|
+
* @param success - Whether the operation succeeded.
|
|
67
|
+
*/
|
|
68
|
+
function mv_render(src, dest, success) {
|
|
69
|
+
if (success) {
|
|
70
|
+
return chalk_1.default.green(`Moved ${src} to ${dest}`);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
return chalk_1.default.red(`Failed to move ${src} to ${dest}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Renders the outcome of an rm operation for terminal display.
|
|
78
|
+
*
|
|
79
|
+
* @param result - The rm result.
|
|
80
|
+
* @returns Formatted status string.
|
|
81
|
+
*/
|
|
82
|
+
function rm_render(result) {
|
|
83
|
+
if (result.success) {
|
|
84
|
+
const typeStr = result.type || 'item';
|
|
85
|
+
return chalk_1.default.green(`Removed ${typeStr}: ${result.path}`);
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return chalk_1.default.red(result.error || `Failed to remove: ${result.path}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=fsViews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fsViews.js","sourceRoot":"","sources":["../../src/vfs/fsViews.ts"],"names":[],"mappings":";;;;;AAaA,oCAMC;AAQD,oCASC;AAQD,8BAMC;AAQD,8BAMC;AAQD,8BAOC;AA/ED;;;;;GAKG;AACH,kDAA0B;AAE1B;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,OAAgB;IACzD,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,sBAAsB,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,OAAgB,EAAE,QAAiB,KAAK;IACjF,IAAI,OAAO,EAAE,CAAC;QACZ,yEAAyE;QACzE,qEAAqE;QACrE,yEAAyE;QACzE,OAAO,eAAK,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,UAAU,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,UAAU,IAAI,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,OAAgB;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,UAAU,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACjD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,GAAW,EAAE,IAAY,EAAE,OAAgB;IACnE,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,eAAK,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IAChD,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,kBAAkB,GAAG,OAAO,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,MAAgG;IACxH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,OAAO,GAAW,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC;QAC9C,OAAO,eAAK,CAAC,KAAK,CAAC,WAAW,OAAO,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,OAAO,eAAK,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,qBAAqB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Result } from '../result.js';
|
|
2
|
+
import type { VFSProvider, VFSItem, CpOptions } from './provider.js';
|
|
3
|
+
import { type VfsOutcome } from './outcome.js';
|
|
4
|
+
/**
|
|
5
|
+
* What to put in a memory filesystem before it is used: each path with the
|
|
6
|
+
* text of its file, or null for a folder. Parents are made as needed.
|
|
7
|
+
*/
|
|
8
|
+
export type MemorySeed = Readonly<Record<string, string | null>>;
|
|
9
|
+
/** A filesystem held in memory, answering every operation the contract names. */
|
|
10
|
+
export declare class MemoryVfsProvider implements VFSProvider {
|
|
11
|
+
/** The prefix it claims; empty for a session's whole filesystem. */
|
|
12
|
+
prefix: string;
|
|
13
|
+
/** Who owns what it holds, as a listing says. */
|
|
14
|
+
private readonly owner;
|
|
15
|
+
/** Every entry, by absolute path; the root always exists. */
|
|
16
|
+
private readonly nodes;
|
|
17
|
+
/**
|
|
18
|
+
* Makes an empty filesystem, or one already holding what the seed names.
|
|
19
|
+
*
|
|
20
|
+
* @param prefix - The prefix it claims (`''` for the whole tree).
|
|
21
|
+
* @param seed - Paths to make first.
|
|
22
|
+
* @param owner - The owner its listings show.
|
|
23
|
+
*/
|
|
24
|
+
constructor(prefix?: string, seed?: MemorySeed, owner?: string);
|
|
25
|
+
/**
|
|
26
|
+
* Puts one seeded entry, making its parents.
|
|
27
|
+
*
|
|
28
|
+
* @param where - The path.
|
|
29
|
+
* @param text - The file's text, or null for a folder.
|
|
30
|
+
*/
|
|
31
|
+
seed_put(where: string, text: string | null): void;
|
|
32
|
+
/** The root of what it holds. */
|
|
33
|
+
private root_get;
|
|
34
|
+
/**
|
|
35
|
+
* A path in the form entries are kept under.
|
|
36
|
+
*
|
|
37
|
+
* @param where - The path asked.
|
|
38
|
+
* @returns It, normalised, without a trailing slash.
|
|
39
|
+
*/
|
|
40
|
+
private key_of;
|
|
41
|
+
/**
|
|
42
|
+
* The entries directly in a folder.
|
|
43
|
+
*
|
|
44
|
+
* @param folder - The folder's key.
|
|
45
|
+
* @returns Their keys.
|
|
46
|
+
*/
|
|
47
|
+
private children_of;
|
|
48
|
+
/**
|
|
49
|
+
* Whether a new entry may be made at a path: its parent is a folder.
|
|
50
|
+
*
|
|
51
|
+
* @param key - The new entry's key.
|
|
52
|
+
* @returns Null when it may, else why not.
|
|
53
|
+
*/
|
|
54
|
+
private parent_check;
|
|
55
|
+
list(where: string): Promise<Result<VFSItem[]>>;
|
|
56
|
+
read(where: string): Promise<VfsOutcome<string>>;
|
|
57
|
+
readBinary(where: string): Promise<VfsOutcome<Buffer>>;
|
|
58
|
+
write(where: string, content: string | Buffer): Promise<VfsOutcome>;
|
|
59
|
+
mkdir(where: string): Promise<VfsOutcome>;
|
|
60
|
+
mkdirTree(where: string): Promise<VfsOutcome>;
|
|
61
|
+
rmdir(where: string): Promise<VfsOutcome>;
|
|
62
|
+
rename(src: string, dest: string): Promise<VfsOutcome>;
|
|
63
|
+
rm(where: string): Promise<VfsOutcome>;
|
|
64
|
+
rmTree(where: string): Promise<VfsOutcome>;
|
|
65
|
+
cp(src: string, dest: string, options: CpOptions): Promise<VfsOutcome>;
|
|
66
|
+
}
|