@fnndsc/salsa 3.2.4
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/LICENSE +21 -0
- package/README.md +164 -0
- package/dist/compute/index.d.ts +17 -0
- package/dist/compute/index.js +33 -0
- package/dist/compute/index.js.map +1 -0
- package/dist/connect/index.d.ts +25 -0
- package/dist/connect/index.js +27 -0
- package/dist/connect/index.js.map +1 -0
- package/dist/context/index.d.ts +38 -0
- package/dist/context/index.js +58 -0
- package/dist/context/index.js.map +1 -0
- package/dist/feeds/index.d.ts +60 -0
- package/dist/feeds/index.js +101 -0
- package/dist/feeds/index.js.map +1 -0
- package/dist/files/index.d.ts +179 -0
- package/dist/files/index.js +562 -0
- package/dist/files/index.js.map +1 -0
- package/dist/files/pacs_content.d.ts +29 -0
- package/dist/files/pacs_content.js +121 -0
- package/dist/files/pacs_content.js.map +1 -0
- package/dist/files/pipeline_content.d.ts +22 -0
- package/dist/files/pipeline_content.js +31 -0
- package/dist/files/pipeline_content.js.map +1 -0
- package/dist/files/regular_content.d.ts +33 -0
- package/dist/files/regular_content.js +177 -0
- package/dist/files/regular_content.js.map +1 -0
- package/dist/groups/index.d.ts +21 -0
- package/dist/groups/index.js +37 -0
- package/dist/groups/index.js.map +1 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/index.d.ts +6 -0
- package/dist/jobs/index.js +17 -0
- package/dist/jobs/index.js.map +1 -0
- package/dist/jobs/jobOps.d.ts +108 -0
- package/dist/jobs/jobOps.js +307 -0
- package/dist/jobs/jobOps.js.map +1 -0
- package/dist/pacs/index.d.ts +64 -0
- package/dist/pacs/index.js +91 -0
- package/dist/pacs/index.js.map +1 -0
- package/dist/pacs/resultDecode.d.ts +13 -0
- package/dist/pacs/resultDecode.js +19 -0
- package/dist/pacs/resultDecode.js.map +1 -0
- package/dist/pipelines/index.d.ts +58 -0
- package/dist/pipelines/index.js +194 -0
- package/dist/pipelines/index.js.map +1 -0
- package/dist/plugininstances/index.d.ts +15 -0
- package/dist/plugininstances/index.js +27 -0
- package/dist/plugininstances/index.js.map +1 -0
- package/dist/pluginmetas/index.d.ts +21 -0
- package/dist/pluginmetas/index.js +37 -0
- package/dist/pluginmetas/index.js.map +1 -0
- package/dist/plugins/index.d.ts +118 -0
- package/dist/plugins/index.js +247 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/internal/plugin_executeContinueFeed.d.ts +17 -0
- package/dist/plugins/internal/plugin_executeContinueFeed.js +65 -0
- package/dist/plugins/internal/plugin_executeContinueFeed.js.map +1 -0
- package/dist/plugins/internal/plugin_executeNewFeed.d.ts +32 -0
- package/dist/plugins/internal/plugin_executeNewFeed.js +97 -0
- package/dist/plugins/internal/plugin_executeNewFeed.js.map +1 -0
- package/dist/plugins/peer_search.d.ts +65 -0
- package/dist/plugins/peer_search.js +94 -0
- package/dist/plugins/peer_search.js.map +1 -0
- package/dist/plugins/plugin_executeInPlace.d.ts +69 -0
- package/dist/plugins/plugin_executeInPlace.js +66 -0
- package/dist/plugins/plugin_executeInPlace.js.map +1 -0
- package/dist/plugins/plugin_register.d.ts +64 -0
- package/dist/plugins/plugin_register.js +121 -0
- package/dist/plugins/plugin_register.js.map +1 -0
- package/dist/plugins/store_import.d.ts +64 -0
- package/dist/plugins/store_import.js +196 -0
- package/dist/plugins/store_import.js.map +1 -0
- package/dist/store/index.d.ts +15 -0
- package/dist/store/index.js +37 -0
- package/dist/store/index.js.map +1 -0
- package/dist/tags/index.d.ts +21 -0
- package/dist/tags/index.js +37 -0
- package/dist/tags/index.js.map +1 -0
- package/dist/vfs/dispatcher.d.ts +83 -0
- package/dist/vfs/dispatcher.js +192 -0
- package/dist/vfs/dispatcher.js.map +1 -0
- package/dist/vfs/index.d.ts +9 -0
- package/dist/vfs/index.js +26 -0
- package/dist/vfs/index.js.map +1 -0
- package/dist/vfs/provider.d.ts +80 -0
- package/dist/vfs/provider.js +11 -0
- package/dist/vfs/provider.js.map +1 -0
- package/dist/vfs/providers/etc.d.ts +44 -0
- package/dist/vfs/providers/etc.js +119 -0
- package/dist/vfs/providers/etc.js.map +1 -0
- package/dist/vfs/providers/native.d.ts +34 -0
- package/dist/vfs/providers/native.js +168 -0
- package/dist/vfs/providers/native.js.map +1 -0
- package/dist/vfs/providers/pacs.d.ts +56 -0
- package/dist/vfs/providers/pacs.js +413 -0
- package/dist/vfs/providers/pacs.js.map +1 -0
- package/dist/vfs/providers/pacsHelpers.d.ts +27 -0
- package/dist/vfs/providers/pacsHelpers.js +108 -0
- package/dist/vfs/providers/pacsHelpers.js.map +1 -0
- package/dist/vfs/providers/pacs_content.d.ts +27 -0
- package/dist/vfs/providers/pacs_content.js +137 -0
- package/dist/vfs/providers/pacs_content.js.map +1 -0
- package/dist/vfs/providers/proc.d.ts +62 -0
- package/dist/vfs/providers/proc.js +478 -0
- package/dist/vfs/providers/proc.js.map +1 -0
- package/dist/workflows/index.d.ts +21 -0
- package/dist/workflows/index.js +37 -0
- package/dist/workflows/index.js.map +1 -0
- package/package.json +57 -0
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file File group resolution and content dispatch across file source types.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { ChRISEmbeddedResourceGroup, ListOptions, FilteredResourceData, Result } from "@fnndsc/cumin";
|
|
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>;
|
|
31
|
+
/**
|
|
32
|
+
* Uploads content to a specified ChRIS path, effectively creating or overwriting a file.
|
|
33
|
+
*
|
|
34
|
+
* @param content - The content to upload (string, Buffer, or Blob).
|
|
35
|
+
* @param pathStr - The ChRIS path for the new file.
|
|
36
|
+
* @returns A Promise resolving to true on success, false on failure.
|
|
37
|
+
*/
|
|
38
|
+
export declare function files_create(content: string | Buffer | Blob, pathStr: string): Promise<boolean>;
|
|
39
|
+
/**
|
|
40
|
+
* Creates a new empty file at the specified path (like Unix touch).
|
|
41
|
+
* Optionally creates the file with specified content.
|
|
42
|
+
*
|
|
43
|
+
* @param path - The ChRIS path for the new file.
|
|
44
|
+
* @param content - Optional content to write to the file (string, Buffer, or Blob).
|
|
45
|
+
* @returns A Promise resolving to true on success, false on failure.
|
|
46
|
+
*/
|
|
47
|
+
export declare function files_touch(path: string, content?: string | Buffer | Blob): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Copies a single file from one ChRIS path to another.
|
|
50
|
+
*
|
|
51
|
+
* @param srcPath - The full path to the source file.
|
|
52
|
+
* @param destPath - The full path to the destination file (including filename).
|
|
53
|
+
* @returns A Promise resolving to true on success, false on failure.
|
|
54
|
+
*/
|
|
55
|
+
export declare function files_copy(srcPath: string, destPath: string): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* Moves a file or directory by updating its path on the server.
|
|
58
|
+
*
|
|
59
|
+
* For directories, this performs a server-side rename without data transfer.
|
|
60
|
+
* For files, the file ID is resolved and the path is updated.
|
|
61
|
+
*
|
|
62
|
+
* @param srcPath - The source file or directory path.
|
|
63
|
+
* @param destPath - The target path. If an existing directory or trailing slash is provided,
|
|
64
|
+
* the source basename is appended.
|
|
65
|
+
* @returns Promise resolving to true on success, false on failure.
|
|
66
|
+
*/
|
|
67
|
+
export declare function files_move(srcPath: string, destPath: string): Promise<boolean>;
|
|
68
|
+
/**
|
|
69
|
+
* Uploads a local file or directory to ChRIS recursively.
|
|
70
|
+
*
|
|
71
|
+
* @param localPath - The local filesystem path.
|
|
72
|
+
* @param remotePath - The ChRIS destination path.
|
|
73
|
+
* @returns Promise<boolean> success.
|
|
74
|
+
*/
|
|
75
|
+
export declare function files_uploadPath(localPath: string, remotePath: string): Promise<boolean>;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new folder (directory) at the specified ChRIS path.
|
|
78
|
+
*
|
|
79
|
+
* @param folderPath - The full ChRIS path for the new folder.
|
|
80
|
+
* @returns A Promise resolving to true on success, false on failure.
|
|
81
|
+
*/
|
|
82
|
+
export declare function files_mkdir(folderPath: string): Promise<boolean>;
|
|
83
|
+
/**
|
|
84
|
+
* Interface for file sharing options.
|
|
85
|
+
*/
|
|
86
|
+
export interface FileShareOptions {
|
|
87
|
+
is_public?: boolean;
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a ChRISEmbeddedResourceGroup for a specific asset type (files, links, dirs).
|
|
92
|
+
* This function encapsulates the logic from `FileController.handler_create`.
|
|
93
|
+
*
|
|
94
|
+
* @param assetName - The type of asset ('files', 'links', 'dirs').
|
|
95
|
+
* @param path - Optional ChRIS path. Defaults to current folder context.
|
|
96
|
+
* @returns A Promise resolving to a ChRISEmbeddedResourceGroup instance, or null on error.
|
|
97
|
+
*/
|
|
98
|
+
export declare function files_getGroup(assetName: string, path?: string): Promise<ChRISEmbeddedResourceGroup<ChrisPathNode> | null>;
|
|
99
|
+
/**
|
|
100
|
+
* List files, links, or directories based on options.
|
|
101
|
+
*
|
|
102
|
+
* @param options - Search and pagination options.
|
|
103
|
+
* @param assetName - The type of asset to list ('files', 'links', 'dirs').
|
|
104
|
+
* @param path - Optional ChRIS path. Defaults to current folder context.
|
|
105
|
+
* @returns A Promise resolving to FilteredResourceData or null.
|
|
106
|
+
*/
|
|
107
|
+
export declare function files_list(options: ListOptions, assetName?: string, path?: string): Promise<FilteredResourceData | null>;
|
|
108
|
+
/**
|
|
109
|
+
* List *all* files, links, or directories by automatically handling pagination.
|
|
110
|
+
*
|
|
111
|
+
* @param options - Search options (limit and offset will be managed internally).
|
|
112
|
+
* @param assetName - The type of asset to list ('files', 'links', 'dirs').
|
|
113
|
+
* @param path - Optional ChRIS path. Defaults to current folder context.
|
|
114
|
+
* @returns A Promise resolving to FilteredResourceData containing all matching assets, or null.
|
|
115
|
+
*/
|
|
116
|
+
export declare function files_listAll(options: ListOptions, assetName?: string, path?: string): Promise<FilteredResourceData | null>;
|
|
117
|
+
/**
|
|
118
|
+
* Get the list of available fields for files, links, or directories.
|
|
119
|
+
*
|
|
120
|
+
* @param assetName - The type of asset ('files', 'links', 'dirs').
|
|
121
|
+
* @returns A Promise resolving to an array of field names or null.
|
|
122
|
+
*/
|
|
123
|
+
export declare function fileFields_get(assetName?: string): Promise<string[] | null>;
|
|
124
|
+
/**
|
|
125
|
+
* Deletes a file, link, or directory by its ID.
|
|
126
|
+
*
|
|
127
|
+
* @param id - The ID of the asset to delete.
|
|
128
|
+
* @param assetName - The type of asset ('files', 'links', 'dirs').
|
|
129
|
+
* @returns A Promise resolving to true on success, false on failure.
|
|
130
|
+
*/
|
|
131
|
+
export declare function files_delete(id: number, assetName?: string): Promise<boolean>;
|
|
132
|
+
/**
|
|
133
|
+
* Creates a ChRISEmbeddedResourceGroup for a single file.
|
|
134
|
+
* This function encapsulates the logic from `FileController.member_create`.
|
|
135
|
+
*
|
|
136
|
+
* @param path - The ChRIS path to the file.
|
|
137
|
+
* @returns A Promise resolving to a ChRISEmbeddedResourceGroup instance, or null on error.
|
|
138
|
+
*/
|
|
139
|
+
export declare function files_getSingle(path: string): Promise<ChRISEmbeddedResourceGroup<ChrisPathNode> | null>;
|
|
140
|
+
/**
|
|
141
|
+
* Shares files in ChRIS.
|
|
142
|
+
*
|
|
143
|
+
* @param fileId - The ID of the file to share.
|
|
144
|
+
* @param options - Options for sharing (e.g., user, permissions).
|
|
145
|
+
* @returns A Promise resolving to true.
|
|
146
|
+
*/
|
|
147
|
+
export declare function files_share(fileId: number, options: FileShareOptions): Promise<boolean>;
|
|
148
|
+
/**
|
|
149
|
+
* Retrieves the content of a file by its path.
|
|
150
|
+
*
|
|
151
|
+
* Router function that delegates to specialized handlers based on path type.
|
|
152
|
+
*
|
|
153
|
+
* @param filePath - The full ChRIS path to the file.
|
|
154
|
+
* @returns A Result containing the content string or error.
|
|
155
|
+
*/
|
|
156
|
+
export declare function fileContent_get(filePath: string): Promise<Result<string>>;
|
|
157
|
+
/**
|
|
158
|
+
* Retrieves the binary content of a file by its path.
|
|
159
|
+
*
|
|
160
|
+
* Router function that delegates to specialized handlers based on path type.
|
|
161
|
+
* Returns raw Buffer instead of converting to UTF-8 string.
|
|
162
|
+
*
|
|
163
|
+
* @param filePath - The full ChRIS path to the file.
|
|
164
|
+
* @returns A Result containing the content Buffer or error.
|
|
165
|
+
*/
|
|
166
|
+
export declare function fileContent_getBinary(filePath: string): Promise<Result<Buffer>>;
|
|
167
|
+
/**
|
|
168
|
+
* Retrieves the binary content of a file by its path as a stream/blob.
|
|
169
|
+
*
|
|
170
|
+
* Router function that delegates to specialized handlers based on path type.
|
|
171
|
+
*
|
|
172
|
+
* @param filePath - The full ChRIS path to the file.
|
|
173
|
+
* @returns A Result containing the stream/blob and metadata or error.
|
|
174
|
+
*/
|
|
175
|
+
export declare function fileContent_getBinaryStream(filePath: string): Promise<Result<{
|
|
176
|
+
stream: unknown;
|
|
177
|
+
size?: number;
|
|
178
|
+
filename?: string;
|
|
179
|
+
}>>;
|