@fnndsc/fond 0.6.0 → 0.6.1

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 CHANGED
@@ -10,7 +10,7 @@ npm install @fnndsc/fond
10
10
 
11
11
  ## Why it exists
12
12
 
13
- A backend such as ChRIS (CUBE) brings its own client and its own world. The pieces every layer needs, whatever the backend, live here rather than in a backend's package, so a layer that is not about CUBE can use them without loading CUBE (see [docs/backend-neutral.adoc](https://github.com/FNNDSC/mise/blob/main/docs/backend-neutral.adoc)).
13
+ A backend such as ChRIS (CUBE) brings its own client and its own world. The pieces every layer needs, whatever the backend, live here rather than in a backend's package, so a layer that is not about CUBE can use them without loading CUBE (see [docs/backend-neutral.adoc](https://github.com/HARBOR-Medical-AI/mise/blob/main/docs/backend-neutral.adoc)).
14
14
 
15
15
  fond's one rule: **it depends on nothing in `@fnndsc`**. CI holds it to that (`npm run lint:fond`). Its one dependency is `chalk`, for the listing views.
16
16
 
@@ -100,7 +100,7 @@ await dispatcher.list('/proc'); // the mounts beneath it ('jobs'), beside
100
100
  await dispatcher.read('/notes/today'); // notesMount.read('/notes/today')
101
101
  ```
102
102
 
103
- Every operation a mount does not offer is refused by name (`mkdir: cannot create directory '/x': Read-only file system`), never silently ignored. A dispatcher built without a fallback refuses any path no mount claims, rather than answering with an empty folder. `pathResolver_register` adds a hook that maps a path to the fallback's own form before the fallback sees it; a copy whose path cannot be resolved fails rather than guessing.
103
+ Every operation a mount does not offer is refused by name (`mkdir: cannot create directory '/x': Read-only file system`), never silently ignored. A dispatcher built without a fallback refuses any path no mount claims, rather than answering with an empty folder. `pathResolver_register` adds a hook that maps a path to the fallback's own form before the fallback sees it; a copy whose path cannot be resolved fails rather than guessing. A mount that stands for a folder of the fallback (a job's `data` under `/proc/jobs` is that job's output folder) says so with `storePath_resolve`: the fallback path a path under it means, or null for a path the mount holds itself. A session asks it, and the fallback's links on the answer, before every read and listing (brasa's `storePath_resolve`).
104
104
 
105
105
  ## One instance, whoever loads it
106
106
 
@@ -120,4 +120,4 @@ The error stack only works if the whole process shares one. fond is built as Com
120
120
 
121
121
  ## License
122
122
 
123
- MIT. Part of [mise](https://github.com/FNNDSC/mise).
123
+ MIT. Part of [mise](https://github.com/HARBOR-Medical-AI/mise).
@@ -173,6 +173,19 @@ export interface VFSProvider {
173
173
  * @returns The target path, or an error when the provider cannot resolve it.
174
174
  */
175
175
  linkTarget_resolve?(path: string): Promise<Result<string>>;
176
+ /**
177
+ * The path in the backend's store a path under this mount stands for:
178
+ * where the mount's own link leads, with the rest of the path after it
179
+ * (`/proc/jobs/feed_1/pl-x_2/data/a.txt` is the job's output folder and
180
+ * `a.txt` in it). Null when the mount holds the path itself (a file it
181
+ * makes, a folder of its own). The session's path resolver asks it, then
182
+ * follows the store's links on what it answers.
183
+ *
184
+ * @param path - Absolute path under this mount.
185
+ * @returns The store path, null when the mount holds the path, or an error
186
+ * (its reason stacked) when the link leads nowhere.
187
+ */
188
+ storePath_resolve?(path: string): Promise<Result<string | null>>;
176
189
  /**
177
190
  * Answers everything beneath a path at once, from what the mount already
178
191
  * holds, so a walk (`find`) need not list it folder by folder. Null when
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@fnndsc/fond",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "The pieces every layer of mise needs, whatever the backend. Depends on nothing in @fnndsc.",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+https://github.com/FNNDSC/mise.git",
7
+ "url": "git+https://github.com/HARBOR-Medical-AI/mise.git",
8
8
  "directory": "packages/fond"
9
9
  },
10
- "homepage": "https://github.com/FNNDSC/mise/tree/main/packages/fond#readme",
10
+ "homepage": "https://github.com/HARBOR-Medical-AI/mise/tree/main/packages/fond#readme",
11
11
  "bugs": {
12
- "url": "https://github.com/FNNDSC/mise/issues"
12
+ "url": "https://github.com/HARBOR-Medical-AI/mise/issues"
13
13
  },
14
14
  "main": "dist/index.js",
15
15
  "types": "dist/index.d.ts",