@fnndsc/salsa 4.5.7 → 4.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/README.md +0 -2
  2. package/dist/compute/index.d.ts +0 -9
  3. package/dist/compute/index.js +0 -16
  4. package/dist/compute/index.js.map +1 -1
  5. package/dist/dag/feedData.js +166 -73
  6. package/dist/dag/feedData.js.map +1 -1
  7. package/dist/dag/feedLoad.d.ts +1 -1
  8. package/dist/dag/feedLoad.js +6 -4
  9. package/dist/dag/feedLoad.js.map +1 -1
  10. package/dist/dicom/pixels.js +95 -36
  11. package/dist/dicom/pixels.js.map +1 -1
  12. package/dist/dicom/series.d.ts +4 -1
  13. package/dist/dicom/series.js +80 -31
  14. package/dist/dicom/series.js.map +1 -1
  15. package/dist/dicom/tags.d.ts +28 -0
  16. package/dist/dicom/tags.js +30 -0
  17. package/dist/dicom/tags.js.map +1 -1
  18. package/dist/files/copy.d.ts +197 -0
  19. package/dist/files/copy.js +636 -0
  20. package/dist/files/copy.js.map +1 -0
  21. package/dist/files/copyFolder.d.ts +103 -0
  22. package/dist/files/copyFolder.js +199 -0
  23. package/dist/files/copyFolder.js.map +1 -0
  24. package/dist/files/create.d.ts +178 -0
  25. package/dist/files/create.js +444 -0
  26. package/dist/files/create.js.map +1 -0
  27. package/dist/files/download.d.ts +188 -0
  28. package/dist/files/download.js +541 -0
  29. package/dist/files/download.js.map +1 -0
  30. package/dist/files/index.d.ts +69 -141
  31. package/dist/files/index.js +184 -535
  32. package/dist/files/index.js.map +1 -1
  33. package/dist/files/listing.d.ts +132 -0
  34. package/dist/files/listing.js +179 -0
  35. package/dist/files/listing.js.map +1 -0
  36. package/dist/files/move.d.ts +125 -0
  37. package/dist/files/move.js +334 -0
  38. package/dist/files/move.js.map +1 -0
  39. package/dist/files/pathMapper.d.ts +24 -1
  40. package/dist/files/pathMapper.js +108 -47
  41. package/dist/files/pathMapper.js.map +1 -1
  42. package/dist/files/proof.d.ts +315 -0
  43. package/dist/files/proof.js +574 -0
  44. package/dist/files/proof.js.map +1 -0
  45. package/dist/files/removal.d.ts +223 -0
  46. package/dist/files/removal.js +318 -0
  47. package/dist/files/removal.js.map +1 -0
  48. package/dist/files/replace.d.ts +175 -0
  49. package/dist/files/replace.js +582 -0
  50. package/dist/files/replace.js.map +1 -0
  51. package/dist/files/upload.d.ts +205 -0
  52. package/dist/files/upload.js +478 -0
  53. package/dist/files/upload.js.map +1 -0
  54. package/dist/index.d.ts +14 -2
  55. package/dist/index.js +45 -32
  56. package/dist/index.js.map +1 -1
  57. package/dist/jobs/index.d.ts +1 -1
  58. package/dist/jobs/index.js +1 -2
  59. package/dist/jobs/index.js.map +1 -1
  60. package/dist/jobs/jobOps.d.ts +0 -13
  61. package/dist/jobs/jobOps.js +0 -37
  62. package/dist/jobs/jobOps.js.map +1 -1
  63. package/dist/pacs/anonymise.d.ts +17 -36
  64. package/dist/pacs/anonymise.js +29 -67
  65. package/dist/pacs/anonymise.js.map +1 -1
  66. package/dist/pipelines/index.d.ts +1 -13
  67. package/dist/pipelines/index.js +0 -38
  68. package/dist/pipelines/index.js.map +1 -1
  69. package/dist/pipelines/invocation.js +321 -167
  70. package/dist/pipelines/invocation.js.map +1 -1
  71. package/dist/pipelines/manifest.js.map +1 -1
  72. package/dist/pipelines/packages.d.ts +11 -8
  73. package/dist/pipelines/packages.js +253 -77
  74. package/dist/pipelines/packages.js.map +1 -1
  75. package/dist/plugins/adminToken.d.ts +67 -0
  76. package/dist/plugins/adminToken.js +77 -0
  77. package/dist/plugins/adminToken.js.map +1 -0
  78. package/dist/plugins/index.d.ts +0 -7
  79. package/dist/plugins/index.js +0 -16
  80. package/dist/plugins/index.js.map +1 -1
  81. package/dist/plugins/peer_search.d.ts +0 -15
  82. package/dist/plugins/peer_search.js +0 -25
  83. package/dist/plugins/peer_search.js.map +1 -1
  84. package/dist/plugins/plugin_add.d.ts +14 -2
  85. package/dist/plugins/plugin_add.js +42 -13
  86. package/dist/plugins/plugin_add.js.map +1 -1
  87. package/dist/plugins/plugin_docker.d.ts +25 -0
  88. package/dist/plugins/plugin_docker.js +33 -0
  89. package/dist/plugins/plugin_docker.js.map +1 -1
  90. package/dist/plugins/plugin_register.d.ts +0 -10
  91. package/dist/plugins/plugin_register.js +3 -54
  92. package/dist/plugins/plugin_register.js.map +1 -1
  93. package/dist/plugins/plugin_sync.js +45 -22
  94. package/dist/plugins/plugin_sync.js.map +1 -1
  95. package/dist/plugins/plugin_validate.js +47 -13
  96. package/dist/plugins/plugin_validate.js.map +1 -1
  97. package/dist/plugins/store_import.d.ts +0 -9
  98. package/dist/plugins/store_import.js +3 -29
  99. package/dist/plugins/store_import.js.map +1 -1
  100. package/dist/retrieve/task.d.ts +137 -0
  101. package/dist/retrieve/task.js +41 -0
  102. package/dist/retrieve/task.js.map +1 -0
  103. package/dist/retrieve/watch.d.ts +2 -118
  104. package/dist/retrieve/watch.js +452 -321
  105. package/dist/retrieve/watch.js.map +1 -1
  106. package/dist/vfs/providers/etc.d.ts +6 -4
  107. package/dist/vfs/providers/etc.js +12 -4
  108. package/dist/vfs/providers/etc.js.map +1 -1
  109. package/dist/vfs/providers/native.d.ts +116 -39
  110. package/dist/vfs/providers/native.js +291 -347
  111. package/dist/vfs/providers/native.js.map +1 -1
  112. package/dist/vfs/providers/pacs.d.ts +29 -3
  113. package/dist/vfs/providers/pacs.js +303 -73
  114. package/dist/vfs/providers/pacs.js.map +1 -1
  115. package/dist/vfs/providers/pacs_content.js +22 -6
  116. package/dist/vfs/providers/pacs_content.js.map +1 -1
  117. package/dist/vfs/providers/proc/backfill.d.ts +46 -0
  118. package/dist/vfs/providers/proc/backfill.js +147 -0
  119. package/dist/vfs/providers/proc/backfill.js.map +1 -0
  120. package/dist/vfs/providers/proc/book.d.ts +176 -0
  121. package/dist/vfs/providers/proc/book.js +73 -0
  122. package/dist/vfs/providers/proc/book.js.map +1 -0
  123. package/dist/vfs/providers/proc/catchup.d.ts +69 -0
  124. package/dist/vfs/providers/proc/catchup.js +125 -0
  125. package/dist/vfs/providers/proc/catchup.js.map +1 -0
  126. package/dist/vfs/providers/proc/feedIndex.d.ts +146 -0
  127. package/dist/vfs/providers/proc/feedIndex.js +354 -0
  128. package/dist/vfs/providers/proc/feedIndex.js.map +1 -0
  129. package/dist/vfs/providers/proc/feedTopology.d.ts +85 -0
  130. package/dist/vfs/providers/proc/feedTopology.js +192 -0
  131. package/dist/vfs/providers/proc/feedTopology.js.map +1 -0
  132. package/dist/vfs/providers/proc/locate.d.ts +60 -0
  133. package/dist/vfs/providers/proc/locate.js +103 -0
  134. package/dist/vfs/providers/proc/locate.js.map +1 -0
  135. package/dist/vfs/providers/proc/path.d.ts +50 -0
  136. package/dist/vfs/providers/proc/path.js +106 -0
  137. package/dist/vfs/providers/proc/path.js.map +1 -0
  138. package/dist/vfs/providers/proc/roster.d.ts +95 -0
  139. package/dist/vfs/providers/proc/roster.js +425 -0
  140. package/dist/vfs/providers/proc/roster.js.map +1 -0
  141. package/dist/vfs/providers/proc/rows.d.ts +120 -0
  142. package/dist/vfs/providers/proc/rows.js +181 -0
  143. package/dist/vfs/providers/proc/rows.js.map +1 -0
  144. package/dist/vfs/providers/proc/subtree.d.ts +73 -0
  145. package/dist/vfs/providers/proc/subtree.js +125 -0
  146. package/dist/vfs/providers/proc/subtree.js.map +1 -0
  147. package/dist/vfs/providers/proc/sweep.d.ts +89 -0
  148. package/dist/vfs/providers/proc/sweep.js +297 -0
  149. package/dist/vfs/providers/proc/sweep.js.map +1 -0
  150. package/dist/vfs/providers/proc.d.ts +47 -346
  151. package/dist/vfs/providers/proc.js +349 -1806
  152. package/dist/vfs/providers/proc.js.map +1 -1
  153. package/dist/vfs/providers/share.js +4 -1
  154. package/dist/vfs/providers/share.js.map +1 -1
  155. package/package.json +3 -3
  156. package/dist/pacs/resultDecode.d.ts +0 -13
  157. package/dist/pacs/resultDecode.js +0 -19
  158. package/dist/pacs/resultDecode.js.map +0 -1
@@ -3,31 +3,12 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { ChRISEmbeddedResourceGroup, ListOptions, FilteredResourceData, Result } from "@fnndsc/cumin";
6
+ import { ChRISEmbeddedResourceGroup, ListOptions, FilteredResourceData, Result, type WholeWalk } from "@fnndsc/cumin";
7
7
  import { ChrisPathNode } from "@fnndsc/cumin";
8
- /**
9
- * Represents a file or directory item in a recursive listing.
10
- */
11
- export interface FsItem {
12
- path: string;
13
- type: 'file' | 'dir';
14
- size?: number;
15
- }
16
- /**
17
- * Recursively lists all files and directories under a given ChRIS path.
18
- *
19
- * @param rootPath - The starting directory path.
20
- * @returns A Promise resolving to an array of FsItem objects.
21
- */
22
- export declare function files_listRecursive(rootPath: string): Promise<FsItem[]>;
23
- /**
24
- * Recursively copies a directory from source to destination within ChRIS.
25
- *
26
- * @param srcPath - The source directory path.
27
- * @param destPath - The destination directory path (the parent + new dir name).
28
- * @returns A Promise resolving to true on success, false on failure.
29
- */
30
- export declare function files_copyRecursively(srcPath: string, destPath: string): Promise<boolean>;
8
+ export { files_listRecursive, files_listRecursiveChecked, listedRow_name, storePath_bare, type CheckedListing, type FsItem, type ListedRow, type RefusedRow } from './listing.js';
9
+ export { file_place, files_create, files_mkdir, files_touch, path_mkdir, path_mkdirTree, type PlaceOptions, type PlaceReceipt } from './create.js';
10
+ export { path_copy, sourceTree_walk, type SourceEntry, type SourceFolder, type SourceTree, type SourceTwin } from './copy.js';
11
+ export { UploadPlan, files_uploadPath, uploadPlan_make, uploadPlanCreateOnly_make, type UploadConfirm } from './upload.js';
31
12
  /**
32
13
  * Determines whether a given ChRIS path refers to a directory.
33
14
  *
@@ -35,101 +16,8 @@ export declare function files_copyRecursively(srcPath: string, destPath: string)
35
16
  * @returns Promise resolving to true if the path is a directory, false otherwise.
36
17
  */
37
18
  export declare function files_path_isDirectory(targetPath: string): Promise<boolean>;
38
- /**
39
- * Uploads content to a specified ChRIS path, effectively creating or overwriting a file.
40
- *
41
- * @param content - The content to upload (string, Buffer, or Blob).
42
- * @param pathStr - The ChRIS path for the new file.
43
- * @returns A Promise resolving to true on success, false on failure.
44
- */
45
- export declare function files_create(content: string | Buffer | Blob, pathStr: string, options?: {
46
- folderClear?: boolean;
47
- }): Promise<boolean>;
48
- /**
49
- * Creates a new empty file at the specified path (like Unix touch).
50
- * Optionally creates the file with specified content.
51
- *
52
- * @param path - The ChRIS path for the new file.
53
- * @param content - Optional content to write to the file (string, Buffer, or Blob).
54
- * @returns A Promise resolving to true on success, false on failure.
55
- */
56
- export declare function files_touch(target: string, content?: string | Buffer | Blob): Promise<boolean>;
57
- /**
58
- * Copies a single file from one ChRIS path to another.
59
- *
60
- * @param srcPath - The full path to the source file.
61
- * @param destPath - The full path to the destination file (including filename).
62
- * @returns A Promise resolving to true on success, false on failure.
63
- */
64
- export declare function files_copy(srcPath: string, destPath: string, options?: {
65
- folderClear?: boolean;
66
- }): Promise<boolean>;
67
- /**
68
- * Moves a file or directory by updating its path on the server.
69
- *
70
- * For directories, this performs a server-side rename without data transfer.
71
- * For files, the file ID is resolved and the path is updated.
72
- *
73
- * @param srcPath - The source file or directory path.
74
- * @param destPath - The target path. If an existing directory or trailing slash is provided,
75
- * the source basename is appended.
76
- * @returns Promise resolving to true on success, false on failure.
77
- */
78
- export declare function files_move(srcPath: string, destPath: string): Promise<boolean>;
79
- /**
80
- * Uploads a local file or directory to ChRIS recursively.
81
- *
82
- * @param localPath - The local filesystem path.
83
- * @param remotePath - The ChRIS destination path.
84
- * @returns Promise<boolean> success.
85
- */
86
- export declare function files_uploadPath(localPath: string, remotePath: string): Promise<boolean>;
87
19
  /** What holds a CUBE path: folders, files and links may each hold the same one. */
88
20
  export type PathHolder = 'dir' | 'file' | 'link';
89
- /**
90
- * Every kind of entry that holds a path, from its parent's three listings.
91
- *
92
- * CUBE lets a folder and a file share one path, and that is a hazard: a
93
- * folder made over a file, then deleted, takes the file's record with it
94
- * and every listing of the parent fails (CUBE #732, mise #462). Writers ask
95
- * this first and refuse a path something else holds.
96
- *
97
- * @param target - The absolute CUBE path.
98
- * @returns The kinds holding it (none, one, or more than one), or Err when
99
- * the parent could not be read (the reason stacked): a probe that cannot
100
- * answer counts the path as taken.
101
- */
102
- export declare function pathHolders_find(target: string): Promise<Result<PathHolder[]>>;
103
- /** The first thing holding a folder path or one of its parents, walking up. */
104
- export interface FolderPathHolder {
105
- /** The path held. */
106
- path: string;
107
- /** What holds it. */
108
- holder: PathHolder;
109
- /** Whether that path is the folder asked about, not a parent of it. */
110
- atTarget: boolean;
111
- }
112
- /**
113
- * What already holds a folder path, or the nearest parent of it that is
114
- * held: a folder there ends the walk, as does a file or a link, which no
115
- * folder may be made over or under (CUBE would make one anyway, and
116
- * deleting it later takes the file's record with it, CUBE #732).
117
- *
118
- * @param folderPath - The folder's absolute path.
119
- * @returns The first holder walking up, null when nothing up to the root
120
- * holds any of it, or Err when a parent could not be read (stacked).
121
- */
122
- export declare function folderPath_holder(folderPath: string): Promise<Result<FolderPathHolder | null>>;
123
- /**
124
- * Creates a new folder (directory) at the specified ChRIS path.
125
- *
126
- * @param folderPath - The full ChRIS path for the new folder.
127
- * @param options - `cleared` when the caller has already found no file or link holding the path or a parent of it.
128
- * @returns A Promise resolving to true on success, false on failure.
129
- */
130
- export declare function files_mkdir(folderPath: string, options?: {
131
- cleared?: boolean;
132
- }): Promise<boolean>;
133
21
  /**
134
22
  * Interface for file sharing options.
135
23
  */
@@ -178,15 +66,15 @@ export type ListingOutcome =
178
66
  kind: "listing";
179
67
  data: FilteredResourceData;
180
68
  }
181
- /** The folder answered and holds nothing of this kind. */
69
+ /** The folder answered, its first page received whole, and holds nothing of this kind. */
182
70
  | {
183
71
  kind: "empty";
184
72
  }
185
- /** No such folder, or no context to resolve one against. */
73
+ /** No listing could be made for the path: no folder is there that CUBE's lookup found. Only a proof says whether one is. */
186
74
  | {
187
75
  kind: "missing";
188
76
  }
189
- /** The folder exists as far as anyone knows; the server would not say. */
77
+ /** The listing could not be read: the server refused, the lookup failed, or the answer was no whole list. */
190
78
  | {
191
79
  kind: "refused";
192
80
  error: Error;
@@ -198,6 +86,11 @@ export type ListingOutcome =
198
86
  * an empty folder, a missing one and a refusal are told apart. A caller that
199
87
  * renders a listing must use this — "nothing here" and "I could not read it"
200
88
  * look identical to an operator otherwise, and only one of them is true.
89
+ * `empty` is answered only for a first page actually received, a list
90
+ * carrying its items, with none in it; a walk that fetched no such page
91
+ * (never bound, or answered with no list) is `refused`. A lookup of the
92
+ * folder that failed (an error said on the way) is `refused`, never
93
+ * `missing`.
201
94
  *
202
95
  * @param options - Search options (limit and offset are managed internally).
203
96
  * @param assetName - The type of asset to list ('files', 'links', 'dirs').
@@ -205,6 +98,44 @@ export type ListingOutcome =
205
98
  * @returns Which answer the folder gave.
206
99
  */
207
100
  export declare function files_listOutcome(options: ListOptions, assetName?: string, path?: string): Promise<ListingOutcome>;
101
+ /**
102
+ * Whether a path is a projection's (a mount's, or a folder of mounts):
103
+ * no folder of CUBE's files stands behind it.
104
+ *
105
+ * @param path - The absolute path.
106
+ * @returns True when a mount owns it, or it is a parent of one.
107
+ *
108
+ * @example
109
+ * ```ts
110
+ * if (path_isProjection('/net')) return Ok([]);
111
+ * ```
112
+ */
113
+ export declare function path_isProjection(path: string): boolean;
114
+ /**
115
+ * Lists every file, link or directory of a folder, or says it could not.
116
+ *
117
+ * The strict counterpart of {@link files_listOutcome}, for an act that
118
+ * destroys or overwrites on the strength of what a folder holds. That
119
+ * listing is made for showing: a page it cannot read ends its walk with the
120
+ * rows it has, and an answer that is no list at all reads as `empty`. Here
121
+ * the whole collection is walked (cumin's `resources_getWhole`), and a page
122
+ * that could not be fetched, is not a list, or carries no items is `refused`.
123
+ *
124
+ * @param assetName - The type of asset to list ('files', 'links', 'dirs').
125
+ * @param path - The absolute ChRIS path of the folder.
126
+ * @param walk - `hrefs`: keep each row's own address, as `href`.
127
+ * @returns `listing` with every row (and `incomplete` when the server's
128
+ * count says rows are missing, even with none in hand), `empty` when the
129
+ * folder answered in full and holds none of this kind, `missing` when no
130
+ * listing could be made for the path, `refused` when the walk failed.
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * const files: ListingOutcome = await files_listWhole('files', '/home/ada/uploads');
135
+ * const proved: boolean = files.kind === 'listing' || files.kind === 'empty';
136
+ * ```
137
+ */
138
+ export declare function files_listWhole(assetName: string, path: string, walk?: WholeWalk): Promise<ListingOutcome>;
208
139
  /**
209
140
  * Get the list of available fields for files, links, or directories.
210
141
  *
@@ -213,27 +144,21 @@ export declare function files_listOutcome(options: ListOptions, assetName?: stri
213
144
  */
214
145
  export declare function fileFields_get(assetName?: string): Promise<string[] | null>;
215
146
  /**
216
- * Deletes a file, link, or directory by its ID.
147
+ * Deletes a file, link, or directory by its ID, at CUBE's own address for
148
+ * it, and waits to see it gone: done only once it answers that it is gone
149
+ * (`holder_remove`). Nothing is listed to find it.
217
150
  *
218
151
  * @param id - The ID of the asset to delete.
219
152
  * @param assetName - The type of asset ('files', 'links', 'dirs').
220
- * @returns A Promise resolving to true on success, false on failure.
221
- */
222
- export declare function files_delete(id: number, assetName?: string, parentPath?: string): Promise<boolean>;
223
- /**
224
- * Deletes a folder (and its contents) addressed by CUBE path.
225
- *
226
- * The path-addressed complement to `files_delete`: no id lookup, no ambient
227
- * folder context, and the call returns only once the CUBE confirms the
228
- * folder no longer resolves (server-side deletion is asynchronous).
153
+ * @returns True when it was seen gone; false otherwise, with the reason on
154
+ * the error stack (a delete accepted and not seen done is false).
229
155
  *
230
- * @param path - The folder's CUBE path (e.g. `/home/alice/scratch`).
231
- * @param options - `timeoutMs` bounds the disappearance poll (default 10s).
232
- * @returns True when the folder is verifiably gone (or never existed).
156
+ * @example
157
+ * ```ts
158
+ * const removed: boolean = await files_delete(41, 'files');
159
+ * ```
233
160
  */
234
- export declare function folderByPath_delete(path: string, options?: {
235
- timeoutMs?: number;
236
- }): Promise<boolean>;
161
+ export declare function files_delete(id: number, assetName?: string): Promise<boolean>;
237
162
  /**
238
163
  * Creates a ChRISEmbeddedResourceGroup for a single file.
239
164
  * This function encapsulates the logic from `FileController.member_create`.
@@ -243,13 +168,16 @@ export declare function folderByPath_delete(path: string, options?: {
243
168
  */
244
169
  export declare function files_getSingle(path: string): Promise<ChRISEmbeddedResourceGroup<ChrisPathNode> | null>;
245
170
  /**
246
- * Shares files in ChRIS.
171
+ * Answers that a file cannot be shared by its id from here.
172
+ *
173
+ * Sharing by file id is not offered: permissions are set through `setfacl`.
174
+ * This says so, and shares nothing.
247
175
  *
248
- * @param fileId - The ID of the file to share.
249
- * @param options - Options for sharing (e.g., user, permissions).
250
- * @returns A Promise resolving to true.
176
+ * @param fileId - The ID of the file asked about.
177
+ * @param _options - The sharing options asked for; none is acted on.
178
+ * @returns Always false, with the reason on the error stack.
251
179
  */
252
- export declare function files_share(fileId: number, options: FileShareOptions): Promise<boolean>;
180
+ export declare function files_share(fileId: number, _options: FileShareOptions): Promise<boolean>;
253
181
  /**
254
182
  * Retrieves the content of a file by its path.
255
183
  *