@fnndsc/cumin 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.
Files changed (123) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +78 -0
  3. package/dist/activities/chrisActivity.d.ts +19 -0
  4. package/dist/activities/chrisActivity.js +29 -0
  5. package/dist/activities/chrisActivity.js.map +1 -0
  6. package/dist/cache/index.d.ts +9 -0
  7. package/dist/cache/index.js +15 -0
  8. package/dist/cache/index.js.map +1 -0
  9. package/dist/cache/listCache.d.ts +182 -0
  10. package/dist/cache/listCache.js +266 -0
  11. package/dist/cache/listCache.js.map +1 -0
  12. package/dist/cache/procCache.d.ts +150 -0
  13. package/dist/cache/procCache.js +257 -0
  14. package/dist/cache/procCache.js.map +1 -0
  15. package/dist/cli.d.ts +7 -0
  16. package/dist/cli.js +43 -0
  17. package/dist/cli.js.map +1 -0
  18. package/dist/compute/computeResources.d.ts +65 -0
  19. package/dist/compute/computeResources.js +113 -0
  20. package/dist/compute/computeResources.js.map +1 -0
  21. package/dist/config/config.d.ts +221 -0
  22. package/dist/config/config.js +350 -0
  23. package/dist/config/config.js.map +1 -0
  24. package/dist/connect/chrisConnection.d.ts +121 -0
  25. package/dist/connect/chrisConnection.js +303 -0
  26. package/dist/connect/chrisConnection.js.map +1 -0
  27. package/dist/context/chrisContext.d.ts +110 -0
  28. package/dist/context/chrisContext.js +324 -0
  29. package/dist/context/chrisContext.js.map +1 -0
  30. package/dist/error/errorStack.d.ts +115 -0
  31. package/dist/error/errorStack.js +175 -0
  32. package/dist/error/errorStack.js.map +1 -0
  33. package/dist/feeds/chrisFeed.d.ts +188 -0
  34. package/dist/feeds/chrisFeed.js +432 -0
  35. package/dist/feeds/chrisFeed.js.map +1 -0
  36. package/dist/filebrowser/chrisFileBrowser.d.ts +77 -0
  37. package/dist/filebrowser/chrisFileBrowser.js +134 -0
  38. package/dist/filebrowser/chrisFileBrowser.js.map +1 -0
  39. package/dist/filebrowser/chrisFiles.d.ts +67 -0
  40. package/dist/filebrowser/chrisFiles.js +130 -0
  41. package/dist/filebrowser/chrisFiles.js.map +1 -0
  42. package/dist/filebrowser/chrisPACS.d.ts +43 -0
  43. package/dist/filebrowser/chrisPACS.js +103 -0
  44. package/dist/filebrowser/chrisPACS.js.map +1 -0
  45. package/dist/filebrowser/chrisPipeline.d.ts +47 -0
  46. package/dist/filebrowser/chrisPipeline.js +118 -0
  47. package/dist/filebrowser/chrisPipeline.js.map +1 -0
  48. package/dist/groups/chrisGroups.d.ts +11 -0
  49. package/dist/groups/chrisGroups.js +18 -0
  50. package/dist/groups/chrisGroups.js.map +1 -0
  51. package/dist/index.d.ts +68 -0
  52. package/dist/index.js +86 -0
  53. package/dist/index.js.map +1 -0
  54. package/dist/io/browser_io.d.ts +97 -0
  55. package/dist/io/browser_io.js +149 -0
  56. package/dist/io/browser_io.js.map +1 -0
  57. package/dist/io/chrisIO.d.ts +110 -0
  58. package/dist/io/chrisIO.js +415 -0
  59. package/dist/io/chrisIO.js.map +1 -0
  60. package/dist/io/io.d.ts +21 -0
  61. package/dist/io/io.js +6 -0
  62. package/dist/io/io.js.map +1 -0
  63. package/dist/io/node_io.d.ts +30 -0
  64. package/dist/io/node_io.js +188 -0
  65. package/dist/io/node_io.js.map +1 -0
  66. package/dist/jobs/chrisJob.d.ts +43 -0
  67. package/dist/jobs/chrisJob.js +169 -0
  68. package/dist/jobs/chrisJob.js.map +1 -0
  69. package/dist/jobs/index.d.ts +7 -0
  70. package/dist/jobs/index.js +24 -0
  71. package/dist/jobs/index.js.map +1 -0
  72. package/dist/jobs/jobMonitor.d.ts +46 -0
  73. package/dist/jobs/jobMonitor.js +102 -0
  74. package/dist/jobs/jobMonitor.js.map +1 -0
  75. package/dist/pacs/chrisPACS.d.ts +200 -0
  76. package/dist/pacs/chrisPACS.js +562 -0
  77. package/dist/pacs/chrisPACS.js.map +1 -0
  78. package/dist/path/chrisPath.d.ts +78 -0
  79. package/dist/path/chrisPath.js +190 -0
  80. package/dist/path/chrisPath.js.map +1 -0
  81. package/dist/pipelines/chrisPipeline.d.ts +86 -0
  82. package/dist/pipelines/chrisPipeline.js +180 -0
  83. package/dist/pipelines/chrisPipeline.js.map +1 -0
  84. package/dist/pluginmetas/chrisPluginMetas.d.ts +11 -0
  85. package/dist/pluginmetas/chrisPluginMetas.js +18 -0
  86. package/dist/pluginmetas/chrisPluginMetas.js.map +1 -0
  87. package/dist/plugins/chrisPluginMetaPlugins.d.ts +12 -0
  88. package/dist/plugins/chrisPluginMetaPlugins.js +19 -0
  89. package/dist/plugins/chrisPluginMetaPlugins.js.map +1 -0
  90. package/dist/plugins/chrisPlugins.d.ts +127 -0
  91. package/dist/plugins/chrisPlugins.js +528 -0
  92. package/dist/plugins/chrisPlugins.js.map +1 -0
  93. package/dist/resources/chrisEmbeddedResourceGroup.d.ts +73 -0
  94. package/dist/resources/chrisEmbeddedResourceGroup.js +148 -0
  95. package/dist/resources/chrisEmbeddedResourceGroup.js.map +1 -0
  96. package/dist/resources/chrisObjContext.d.ts +16 -0
  97. package/dist/resources/chrisObjContext.js +109 -0
  98. package/dist/resources/chrisObjContext.js.map +1 -0
  99. package/dist/resources/chrisResourceGroup.d.ts +30 -0
  100. package/dist/resources/chrisResourceGroup.js +47 -0
  101. package/dist/resources/chrisResourceGroup.js.map +1 -0
  102. package/dist/resources/chrisResources.d.ts +163 -0
  103. package/dist/resources/chrisResources.js +415 -0
  104. package/dist/resources/chrisResources.js.map +1 -0
  105. package/dist/tags/chrisTags.d.ts +11 -0
  106. package/dist/tags/chrisTags.js +18 -0
  107. package/dist/tags/chrisTags.js.map +1 -0
  108. package/dist/users/chrisUsers.d.ts +34 -0
  109. package/dist/users/chrisUsers.js +57 -0
  110. package/dist/users/chrisUsers.js.map +1 -0
  111. package/dist/utils/keypair.d.ts +77 -0
  112. package/dist/utils/keypair.js +144 -0
  113. package/dist/utils/keypair.js.map +1 -0
  114. package/dist/utils/result.d.ts +77 -0
  115. package/dist/utils/result.js +58 -0
  116. package/dist/utils/result.js.map +1 -0
  117. package/dist/utils/searchable.d.ts +143 -0
  118. package/dist/utils/searchable.js +212 -0
  119. package/dist/utils/searchable.js.map +1 -0
  120. package/dist/workflows/chrisWorkflows.d.ts +11 -0
  121. package/dist/workflows/chrisWorkflows.js +18 -0
  122. package/dist/workflows/chrisWorkflows.js.map +1 -0
  123. package/package.json +55 -0
@@ -0,0 +1,77 @@
1
+ /**
2
+ * @file ChRIS File Browser
3
+ *
4
+ * This module provides the ChRISFileBrowser class for browsing files, directories, and links
5
+ * within the ChRIS filesystem.
6
+ *
7
+ * @module
8
+ */
9
+ import Client from "@fnndsc/chrisapi";
10
+ import { FileBrowserFolder } from "@fnndsc/chrisapi";
11
+ import { ChRISResource } from "../resources/chrisResources.js";
12
+ /**
13
+ * Interface for boolean operations with a descriptive message.
14
+ */
15
+ export interface BoolString {
16
+ status: boolean;
17
+ message: string;
18
+ }
19
+ /**
20
+ * Enum defining the types of ChRIS browsers.
21
+ */
22
+ export declare enum BrowserType {
23
+ Files = "Files",
24
+ Links = "Links",
25
+ Dirs = "Dirs"
26
+ }
27
+ /**
28
+ * Class for browsing ChRIS filesystem objects.
29
+ */
30
+ export declare class ChRISFileBrowser {
31
+ private _client;
32
+ private _chrisFileBrowserFolder;
33
+ private _resource;
34
+ private _bindOp;
35
+ constructor(variant: BrowserType | undefined, chrisObj: FileBrowserFolder);
36
+ /**
37
+ * Retrieves the ChRIS client instance asynchronously.
38
+ * @returns A Promise resolving to the Client instance or null.
39
+ */
40
+ client_get(): Promise<Client | null>;
41
+ /**
42
+ * Gets the status of the binding operation.
43
+ * @returns The binding operation status.
44
+ */
45
+ get bindOp_get(): BoolString;
46
+ /**
47
+ * Binds the `getFiles` method to the ChRIS resource.
48
+ * @returns The status of the binding operation.
49
+ */
50
+ files_bind(): BoolString;
51
+ /**
52
+ * Binds the `getLinkFiles` method to the ChRIS resource.
53
+ * @returns The status of the binding operation.
54
+ */
55
+ links_bind(): BoolString;
56
+ /**
57
+ * Binds the `getChildren` (dirs) method to the ChRIS resource.
58
+ * @returns The status of the binding operation.
59
+ */
60
+ dirs_bind(): BoolString;
61
+ /**
62
+ * Binds the appropriate method based on the browser variant.
63
+ * @param variant - The browser type (Files, Links, Dirs).
64
+ * @returns The status of the binding operation.
65
+ */
66
+ method_bind(variant: BrowserType): BoolString;
67
+ /**
68
+ * Gets the associated ChRIS resource.
69
+ * @returns The ChRISResource instance or null.
70
+ */
71
+ get resource_get(): ChRISResource | null;
72
+ /**
73
+ * Gets the underlying FileBrowserFolder object.
74
+ * @returns The FileBrowserFolder instance or null.
75
+ */
76
+ get fileBrowserFolder_get(): FileBrowserFolder | null;
77
+ }
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ /**
3
+ * @file ChRIS File Browser
4
+ *
5
+ * This module provides the ChRISFileBrowser class for browsing files, directories, and links
6
+ * within the ChRIS filesystem.
7
+ *
8
+ * @module
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ChRISFileBrowser = exports.BrowserType = void 0;
12
+ const chrisConnection_js_1 = require("../connect/chrisConnection.js");
13
+ const chrisResources_js_1 = require("../resources/chrisResources.js");
14
+ /**
15
+ * Enum defining the types of ChRIS browsers.
16
+ */
17
+ var BrowserType;
18
+ (function (BrowserType) {
19
+ BrowserType["Files"] = "Files";
20
+ BrowserType["Links"] = "Links";
21
+ BrowserType["Dirs"] = "Dirs";
22
+ })(BrowserType || (exports.BrowserType = BrowserType = {}));
23
+ ;
24
+ /**
25
+ * Class for browsing ChRIS filesystem objects.
26
+ */
27
+ class ChRISFileBrowser {
28
+ constructor(variant = BrowserType.Files, chrisObj) {
29
+ this._client = null;
30
+ this._chrisFileBrowserFolder = null;
31
+ this._resource = null;
32
+ this._bindOp = { "status": false, "message": "" };
33
+ this._chrisFileBrowserFolder = chrisObj;
34
+ this._resource = new chrisResources_js_1.ChRISResource();
35
+ this._bindOp = this.method_bind(variant);
36
+ }
37
+ /**
38
+ * Retrieves the ChRIS client instance asynchronously.
39
+ * @returns A Promise resolving to the Client instance or null.
40
+ */
41
+ async client_get() {
42
+ if (!this._client) {
43
+ this._client = await chrisConnection_js_1.chrisConnection.client_get();
44
+ }
45
+ return this._client;
46
+ }
47
+ /**
48
+ * Gets the status of the binding operation.
49
+ * @returns The binding operation status.
50
+ */
51
+ get bindOp_get() {
52
+ return this._bindOp;
53
+ }
54
+ /**
55
+ * Binds the `getFiles` method to the ChRIS resource.
56
+ * @returns The status of the binding operation.
57
+ */
58
+ files_bind() {
59
+ let bindOp = { "status": false, "message": "getFiles not bound" };
60
+ if (this._resource && this._chrisFileBrowserFolder) {
61
+ this._resource.binding_applyGet(this._chrisFileBrowserFolder, this._chrisFileBrowserFolder.getFiles, BrowserType.Files);
62
+ bindOp.status = true;
63
+ bindOp.message = "ChRISFileBrowser bound to fileBrowserFolder.getFiles";
64
+ }
65
+ return bindOp;
66
+ }
67
+ /**
68
+ * Binds the `getLinkFiles` method to the ChRIS resource.
69
+ * @returns The status of the binding operation.
70
+ */
71
+ links_bind() {
72
+ let bindOp = { "status": false, "message": "getLinks not bound" };
73
+ if (this._resource && this._chrisFileBrowserFolder) {
74
+ this._resource.binding_applyGet(this._chrisFileBrowserFolder, this._chrisFileBrowserFolder.getLinkFiles, BrowserType.Links);
75
+ bindOp.status = true;
76
+ bindOp.message = "ChRISFileBrowser bound to fileBrowserFolder.getLinkFiles";
77
+ }
78
+ return bindOp;
79
+ }
80
+ /**
81
+ * Binds the `getChildren` (dirs) method to the ChRIS resource.
82
+ * @returns The status of the binding operation.
83
+ */
84
+ dirs_bind() {
85
+ let bindOp = { "status": false, "message": "getDirs not bound" };
86
+ if (this._resource && this._chrisFileBrowserFolder) {
87
+ this._resource.binding_applyGet(this._chrisFileBrowserFolder, this._chrisFileBrowserFolder.getChildren, BrowserType.Dirs);
88
+ bindOp.status = true;
89
+ bindOp.message = "ChRISFileBrowser bound to fileBrowserFolder.getChildren";
90
+ }
91
+ return bindOp;
92
+ }
93
+ /**
94
+ * Binds the appropriate method based on the browser variant.
95
+ * @param variant - The browser type (Files, Links, Dirs).
96
+ * @returns The status of the binding operation.
97
+ */
98
+ method_bind(variant) {
99
+ let bindOp = { "status": false, "message": "" };
100
+ if (!this._resource || !this._chrisFileBrowserFolder) {
101
+ bindOp.message = "ChRISFileBrowesr resource or fileBrowserFolder is null";
102
+ return bindOp;
103
+ }
104
+ bindOp.status = true;
105
+ switch (variant) {
106
+ case BrowserType.Files:
107
+ bindOp = this.files_bind();
108
+ break;
109
+ case BrowserType.Links:
110
+ bindOp = this.links_bind();
111
+ break;
112
+ case BrowserType.Dirs:
113
+ bindOp = this.dirs_bind();
114
+ break;
115
+ }
116
+ return bindOp;
117
+ }
118
+ /**
119
+ * Gets the associated ChRIS resource.
120
+ * @returns The ChRISResource instance or null.
121
+ */
122
+ get resource_get() {
123
+ return this._resource;
124
+ }
125
+ /**
126
+ * Gets the underlying FileBrowserFolder object.
127
+ * @returns The FileBrowserFolder instance or null.
128
+ */
129
+ get fileBrowserFolder_get() {
130
+ return this._chrisFileBrowserFolder;
131
+ }
132
+ }
133
+ exports.ChRISFileBrowser = ChRISFileBrowser;
134
+ //# sourceMappingURL=chrisFileBrowser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrisFileBrowser.js","sourceRoot":"","sources":["../../src/filebrowser/chrisFileBrowser.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAIH,sEAAgE;AAChE,sEAA+D;AAU/D;;GAEG;AACH,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAAA,CAAC;AAEF;;GAEG;AACH,MAAa,gBAAgB;IAM3B,YAAY,UAAuB,WAAW,CAAC,KAAK,EAAE,QAA2B;QALzE,YAAO,GAAkB,IAAI,CAAC;QAC9B,4BAAuB,GAA6B,IAAI,CAA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CAAC,UAAU,EAAE,CAAC;gBAC3B,MAAM;YACR,KAAK,WAAW,CAAC,IAAI;gBACnB,MAAM,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC1B,MAAM;QACV,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACH,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED;;;OAGG;IACH,IAAI,qBAAqB;QACvB,OAAO,IAAI,CAAC,uBAAuB,CAAC;IACtC,CAAC;CACF;AA9HD,4CA8HC"}
@@ -0,0 +1,67 @@
1
+ /**
2
+ * @file ChRIS Inode Management
3
+ *
4
+ * This module provides the ChRISinode class for managing inodes (files, directories, links)
5
+ * within the ChRIS filesystem. It acts as a facade for different browser types.
6
+ *
7
+ * @module
8
+ */
9
+ import { ChRISFileBrowser, BrowserType } from "./chrisFileBrowser.js";
10
+ import { FileBrowserFolder } from "@fnndsc/chrisapi";
11
+ type ChRISBrowser = ChRISFileBrowser | null;
12
+ /**
13
+ * Class representing an inode in the ChRIS filesystem.
14
+ */
15
+ export declare class ChRISinode {
16
+ private _client;
17
+ private _fileBrowserFolderObj;
18
+ private _path;
19
+ private _browsers;
20
+ private constructor();
21
+ /**
22
+ * Factory method to create a new ChRISinode instance.
23
+ * @param path - The path to the inode.
24
+ * @returns A Promise resolving to a new ChRISinode instance.
25
+ */
26
+ static inode_create(path?: string): Promise<ChRISinode>;
27
+ /**
28
+ * Gets the file browser instance for this inode.
29
+ * @returns The file browser or null.
30
+ */
31
+ get fileBrowser_get(): ChRISFileBrowser | null;
32
+ /**
33
+ * Gets the link browser instance for this inode.
34
+ * @returns The link browser or null.
35
+ */
36
+ get linkBrowser_get(): ChRISFileBrowser | null;
37
+ /**
38
+ * Gets the directory browser instance for this inode.
39
+ * @returns The directory browser or null.
40
+ */
41
+ get dirBrowser_get(): ChRISFileBrowser | null;
42
+ /**
43
+ * Gets the path of this inode.
44
+ * @returns The path string.
45
+ */
46
+ get path_get(): string;
47
+ /**
48
+ * Gets the underlying FileBrowserFolder object.
49
+ * @returns The FileBrowserFolder instance or null.
50
+ */
51
+ get fileBrowserFolder_get(): FileBrowserFolder | null;
52
+ /**
53
+ * Retrieves a specific browser type for this inode.
54
+ * @param type - The type of browser to retrieve.
55
+ * @returns The requested browser or null.
56
+ */
57
+ browser_get(type: BrowserType): ChRISBrowser;
58
+ /**
59
+ * Initializes the inode and binds browsers.
60
+ */
61
+ private initAndBind;
62
+ }
63
+ /**
64
+ * @deprecated Use ChRISinode.inode_create instead.
65
+ */
66
+ export declare function ChRISinode_create(path?: string): Promise<ChRISinode | null>;
67
+ export {};
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ /**
3
+ * @file ChRIS Inode Management
4
+ *
5
+ * This module provides the ChRISinode class for managing inodes (files, directories, links)
6
+ * within the ChRIS filesystem. It acts as a facade for different browser types.
7
+ *
8
+ * @module
9
+ */
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.ChRISinode = void 0;
12
+ exports.ChRISinode_create = ChRISinode_create;
13
+ const chrisFileBrowser_js_1 = require("./chrisFileBrowser.js");
14
+ const chrisConnection_js_1 = require("../connect/chrisConnection.js");
15
+ class ChRISConnectionError extends Error {
16
+ constructor(message) {
17
+ super(message);
18
+ this.name = "ChRISConnectionError";
19
+ }
20
+ }
21
+ class ChRISInitializationError extends Error {
22
+ constructor(message) {
23
+ super(message);
24
+ this.name = "ChRISInitializationError";
25
+ }
26
+ }
27
+ /**
28
+ * Class representing an inode in the ChRIS filesystem.
29
+ */
30
+ class ChRISinode {
31
+ constructor(path = "") {
32
+ this._client = null;
33
+ this._fileBrowserFolderObj = null;
34
+ this._browsers = new Map();
35
+ this._path = path;
36
+ }
37
+ /**
38
+ * Factory method to create a new ChRISinode instance.
39
+ * @param path - The path to the inode.
40
+ * @returns A Promise resolving to a new ChRISinode instance.
41
+ */
42
+ static async inode_create(path = "") {
43
+ const instance = new ChRISinode(path);
44
+ await instance.initAndBind();
45
+ return instance;
46
+ }
47
+ /**
48
+ * Gets the file browser instance for this inode.
49
+ * @returns The file browser or null.
50
+ */
51
+ get fileBrowser_get() {
52
+ return this.browser_get(chrisFileBrowser_js_1.BrowserType.Files);
53
+ }
54
+ /**
55
+ * Gets the link browser instance for this inode.
56
+ * @returns The link browser or null.
57
+ */
58
+ get linkBrowser_get() {
59
+ return this.browser_get(chrisFileBrowser_js_1.BrowserType.Links);
60
+ }
61
+ /**
62
+ * Gets the directory browser instance for this inode.
63
+ * @returns The directory browser or null.
64
+ */
65
+ get dirBrowser_get() {
66
+ return this.browser_get(chrisFileBrowser_js_1.BrowserType.Dirs);
67
+ }
68
+ /**
69
+ * Gets the path of this inode.
70
+ * @returns The path string.
71
+ */
72
+ get path_get() {
73
+ return this._path;
74
+ }
75
+ /**
76
+ * Gets the underlying FileBrowserFolder object.
77
+ * @returns The FileBrowserFolder instance or null.
78
+ */
79
+ get fileBrowserFolder_get() {
80
+ return this._fileBrowserFolderObj;
81
+ }
82
+ /**
83
+ * Retrieves a specific browser type for this inode.
84
+ * @param type - The type of browser to retrieve.
85
+ * @returns The requested browser or null.
86
+ */
87
+ browser_get(type) {
88
+ return this._browsers.get(type) ?? null;
89
+ }
90
+ /**
91
+ * Initializes the inode and binds browsers.
92
+ */
93
+ async initAndBind() {
94
+ this._client = await chrisConnection_js_1.chrisConnection.client_get();
95
+ if (!this._client) {
96
+ throw new ChRISConnectionError("Could not access ChRIS. Have you connected with the 'connect' command?");
97
+ }
98
+ try {
99
+ this._fileBrowserFolderObj = await this._client.getFileBrowserFolderByPath(this._path);
100
+ }
101
+ catch (error) {
102
+ throw new ChRISInitializationError('Failed to get FileBrowserFolder: ' + (error instanceof Error ? error.message : String(error)));
103
+ }
104
+ if (!this._fileBrowserFolderObj) {
105
+ throw new ChRISInitializationError("Failed to initialize FileBrowserFolder");
106
+ }
107
+ this._browsers.set(chrisFileBrowser_js_1.BrowserType.Files, new chrisFileBrowser_js_1.ChRISFileBrowser(chrisFileBrowser_js_1.BrowserType.Files, this._fileBrowserFolderObj));
108
+ this._browsers.set(chrisFileBrowser_js_1.BrowserType.Links, new chrisFileBrowser_js_1.ChRISFileBrowser(chrisFileBrowser_js_1.BrowserType.Links, this._fileBrowserFolderObj));
109
+ this._browsers.set(chrisFileBrowser_js_1.BrowserType.Dirs, new chrisFileBrowser_js_1.ChRISFileBrowser(chrisFileBrowser_js_1.BrowserType.Dirs, this._fileBrowserFolderObj));
110
+ for (const [_, browser] of this._browsers) {
111
+ if (browser && !browser.bindOp_get.status) {
112
+ throw new ChRISInitializationError(`Failed to bind browser: ${browser.bindOp_get.message}`);
113
+ }
114
+ }
115
+ }
116
+ }
117
+ exports.ChRISinode = ChRISinode;
118
+ /**
119
+ * @deprecated Use ChRISinode.inode_create instead.
120
+ */
121
+ async function ChRISinode_create(path) {
122
+ try {
123
+ return await ChRISinode.inode_create(path);
124
+ }
125
+ catch (error) {
126
+ console.error("Failed to create ChRISinode:", error);
127
+ return null;
128
+ }
129
+ }
130
+ //# sourceMappingURL=chrisFiles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrisFiles.js","sourceRoot":"","sources":["../../src/filebrowser/chrisFiles.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAkIH,8CAOC;AAvID,+DAAkF;AAGlF,sEAAgE;AAEhE,MAAM,oBAAqB,SAAQ,KAAK;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED,MAAM,wBAAyB,SAAQ,KAAK;IAC1C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACzC,CAAC;CACF;AAID;;GAEG;AACH,MAAa,UAAU;IAMrB,YAAoB,OAAe,EAAE;QAL7B,YAAO,GAAkB,IAAI,CAAC;QAC9B,0BAAqB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H,OAAO,MAAM,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,OAAO,CAAC,KAAK,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;QACrD,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * @file ChRIS PACS File Operations
3
+ *
4
+ * This module provides functions for retrieving PACS files (DICOM medical imaging files)
5
+ * from the ChRIS backend. PACS files use a specialized API endpoint that differs from
6
+ * regular file downloads.
7
+ *
8
+ * @module
9
+ */
10
+ import { Result } from "../utils/result.js";
11
+ /**
12
+ * Downloads a PACS file (DICOM) by file ID and returns the raw binary content.
13
+ *
14
+ * PACS files must be downloaded using the PACSFile API instead of regular
15
+ * file download endpoints. This function handles binary data correctly,
16
+ * preserving DICOM file integrity.
17
+ *
18
+ * @param fileId - The numeric ID of the PACS file in ChRIS.
19
+ * @returns A Result containing the file content as a Buffer, or an error.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const result = await pacsFile_getBlob(12345);
24
+ * if (result.ok) {
25
+ * const buffer: Buffer = result.value;
26
+ * // Process DICOM data
27
+ * }
28
+ * ```
29
+ */
30
+ export declare function pacsFile_getBlob(fileId: number): Promise<Result<Buffer>>;
31
+ /**
32
+ * Downloads a PACS file and returns it as a UTF-8 string.
33
+ *
34
+ * **WARNING:** This function converts binary DICOM data to a UTF-8 string,
35
+ * which may corrupt the file if it contains non-text binary data.
36
+ * Use `pacsFile_getBlob()` instead for DICOM files to preserve data integrity.
37
+ *
38
+ * This function is provided for legacy compatibility only.
39
+ *
40
+ * @param fileId - The numeric ID of the PACS file in ChRIS.
41
+ * @returns A Result containing the file content as a string, or an error.
42
+ */
43
+ export declare function pacsFile_getText(fileId: number): Promise<Result<string>>;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /**
3
+ * @file ChRIS PACS File Operations
4
+ *
5
+ * This module provides functions for retrieving PACS files (DICOM medical imaging files)
6
+ * from the ChRIS backend. PACS files use a specialized API endpoint that differs from
7
+ * regular file downloads.
8
+ *
9
+ * @module
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.pacsFile_getBlob = pacsFile_getBlob;
13
+ exports.pacsFile_getText = pacsFile_getText;
14
+ const chrisConnection_js_1 = require("../connect/chrisConnection.js");
15
+ const errorStack_js_1 = require("../error/errorStack.js");
16
+ const result_js_1 = require("../utils/result.js");
17
+ /**
18
+ * Downloads a PACS file (DICOM) by file ID and returns the raw binary content.
19
+ *
20
+ * PACS files must be downloaded using the PACSFile API instead of regular
21
+ * file download endpoints. This function handles binary data correctly,
22
+ * preserving DICOM file integrity.
23
+ *
24
+ * @param fileId - The numeric ID of the PACS file in ChRIS.
25
+ * @returns A Result containing the file content as a Buffer, or an error.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const result = await pacsFile_getBlob(12345);
30
+ * if (result.ok) {
31
+ * const buffer: Buffer = result.value;
32
+ * // Process DICOM data
33
+ * }
34
+ * ```
35
+ */
36
+ async function pacsFile_getBlob(fileId) {
37
+ const client = await chrisConnection_js_1.chrisConnection.client_get();
38
+ if (!client) {
39
+ errorStack_js_1.errorStack.stack_push("error", "Not connected to ChRIS. Cannot fetch PACS file.");
40
+ return (0, result_js_1.Err)();
41
+ }
42
+ try {
43
+ const pacsFile = await client.getPACSFile(fileId);
44
+ if (!pacsFile) {
45
+ errorStack_js_1.errorStack.stack_push("error", `Could not retrieve PACSFile resource for ID ${fileId}`);
46
+ return (0, result_js_1.Err)();
47
+ }
48
+ // Download the file blob using the PACS-specific method
49
+ const blob = await pacsFile.getFileBlob();
50
+ if (!blob) {
51
+ errorStack_js_1.errorStack.stack_push("error", `PACS file ID ${fileId} exists but returned no content/blob.`);
52
+ return (0, result_js_1.Err)();
53
+ }
54
+ // Convert blob to Buffer (handle different blob types)
55
+ // Note: In Node.js, chrisapi may return string/ArrayBuffer/Blob depending on axios config
56
+ let buffer;
57
+ if (typeof blob === "string") {
58
+ // Use 'binary' encoding to preserve binary data integrity
59
+ // This handles the case where axios returns a string in Node.js
60
+ buffer = Buffer.from(blob, 'binary');
61
+ }
62
+ else if (blob instanceof ArrayBuffer) {
63
+ buffer = Buffer.from(blob);
64
+ }
65
+ else if (blob instanceof Blob) {
66
+ const arrayBuffer = await blob.arrayBuffer();
67
+ buffer = Buffer.from(arrayBuffer);
68
+ }
69
+ else if (Buffer.isBuffer(blob)) {
70
+ buffer = blob;
71
+ }
72
+ else {
73
+ throw new Error(`Unexpected blob type for PACS file: ${typeof blob}`);
74
+ }
75
+ return (0, result_js_1.Ok)(buffer);
76
+ }
77
+ catch (error) {
78
+ const msg = error instanceof Error ? error.message : String(error);
79
+ errorStack_js_1.errorStack.stack_push("error", `Failed to fetch PACS file for ID ${fileId}: ${msg}`);
80
+ return (0, result_js_1.Err)();
81
+ }
82
+ }
83
+ /**
84
+ * Downloads a PACS file and returns it as a UTF-8 string.
85
+ *
86
+ * **WARNING:** This function converts binary DICOM data to a UTF-8 string,
87
+ * which may corrupt the file if it contains non-text binary data.
88
+ * Use `pacsFile_getBlob()` instead for DICOM files to preserve data integrity.
89
+ *
90
+ * This function is provided for legacy compatibility only.
91
+ *
92
+ * @param fileId - The numeric ID of the PACS file in ChRIS.
93
+ * @returns A Result containing the file content as a string, or an error.
94
+ */
95
+ async function pacsFile_getText(fileId) {
96
+ const result = await pacsFile_getBlob(fileId);
97
+ if (!result.ok) {
98
+ return (0, result_js_1.Err)();
99
+ }
100
+ // WARNING: This may corrupt binary DICOM data
101
+ return (0, result_js_1.Ok)(result.value.toString('utf-8'));
102
+ }
103
+ //# sourceMappingURL=chrisPACS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrisPACS.js","sourceRoot":"","sources":["../../src/filebrowser/chrisPACS.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AA0BH,4CAgDC;AAcD,4CASC;AA9FD,sEAAgE;AAChE,0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D,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACpC,CAAC;aAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,MAAM,GAAG,IAAI,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,uCAAuC,OAAO,IAAI,EAAE,CAAC,CAAC;QACxE,CAAC;QAED,OAAO,IAAA,cAAE,EAAC,MAAM,CAAC,CAAC;IAEpB,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,MAAM,GAAG,GAAW,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3E,0BAAU,CAAC,UAAU,CAAC,OAAO,EAAE,oCAAoC,MAAM,KAAK,GAAG,EAAE,CAAC,CAAC;QACrF,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,gBAAgB,CAAC,MAAc;IACnD,MAAM,MAAM,GAAmB,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAE9D,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,IAAA,eAAG,GAAE,CAAC;IACf,CAAC;IAED,8CAA8C;IAC9C,OAAO,IAAA,cAAE,EAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @file ChRIS Pipeline Source File Operations
3
+ *
4
+ * This module provides functions for retrieving pipeline source files (YAML configuration files)
5
+ * from the ChRIS backend. Pipeline files are stored under /PIPELINES/<owner>/<filename>.
6
+ *
7
+ * @module
8
+ */
9
+ import { Result } from "../utils/result.js";
10
+ /**
11
+ * Downloads a pipeline source file by path and returns the raw binary content.
12
+ *
13
+ * Pipeline source files are typically YAML configuration files stored under /PIPELINES/<owner>/<filename>.
14
+ * The API returns fname as the full path like "PIPELINES/user/file.yml" (without leading slash).
15
+ *
16
+ * @param filePath - The full path to the pipeline file, e.g., /PIPELINES/user/pipeline.yml
17
+ * @returns A Result containing the file content as a Buffer, or an error.
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const result = await pipelineFile_getByPath('/PIPELINES/user/config.yml');
22
+ * if (result.ok) {
23
+ * const buffer: Buffer = result.value;
24
+ * const yamlContent = buffer.toString('utf-8');
25
+ * }
26
+ * ```
27
+ */
28
+ export declare function pipelineFile_getByPath(filePath: string): Promise<Result<Buffer>>;
29
+ /**
30
+ * Downloads a pipeline source file and returns it as a UTF-8 string.
31
+ *
32
+ * This is a convenience wrapper around `pipelineFile_getByPath()` that converts
33
+ * the Buffer to a string. Suitable for YAML/text files.
34
+ *
35
+ * @param filePath - The full path to the pipeline file, e.g., /PIPELINES/user/pipeline.yml
36
+ * @returns A Result containing the file content as a string, or an error.
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * const result = await pipelineFile_getTextByPath('/PIPELINES/user/config.yml');
41
+ * if (result.ok) {
42
+ * const yamlContent: string = result.value;
43
+ * // Parse YAML content
44
+ * }
45
+ * ```
46
+ */
47
+ export declare function pipelineFile_getTextByPath(filePath: string): Promise<Result<string>>;