@js4cytoscape/ndex-client 0.6.0-alpha.2 → 0.6.0-alpha.3
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 +22 -7
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.mts +1148 -139
- package/dist/index.d.ts +1148 -139
- package/dist/index.global.js +7 -7
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -6
- package/src/CyNDEx.js +0 -178
- package/src/CyNDEx.js.bak +0 -178
- package/src/NDEx.js +0 -1107
- package/src/NDEx.js.bak +0 -1107
- package/src/index.ts +0 -230
- package/src/models/CX2Network.ts +0 -423
- package/src/services/AdminService.ts +0 -10
- package/src/services/CyNDExService.ts +0 -338
- package/src/services/FilesService.ts +0 -234
- package/src/services/HTTPService.ts +0 -442
- package/src/services/NetworkServiceV2.ts +0 -427
- package/src/services/NetworkServiceV3.ts +0 -288
- package/src/services/UnifiedNetworkService.ts +0 -641
- package/src/services/UserService.ts +0 -233
- package/src/services/WorkspaceService.ts +0 -159
- package/src/types/cytoscape.ts +0 -81
- package/src/types/index.ts +0 -524
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,134 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* NDEx Client Constants
|
|
5
|
+
*
|
|
6
|
+
* Centralized definition of all string literal constants used throughout the NDEx client library.
|
|
7
|
+
* Using the const + type pattern for better developer experience with autocomplete and type safety.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Authentication types supported by NDEx client
|
|
11
|
+
*/
|
|
12
|
+
declare const AuthType: {
|
|
13
|
+
readonly BASIC: "basic";
|
|
14
|
+
readonly OAUTH: "oauth";
|
|
15
|
+
};
|
|
16
|
+
declare type AuthType = (typeof AuthType)[keyof typeof AuthType];
|
|
17
|
+
/**
|
|
18
|
+
* Visibility settings for networks, folders, and shortcuts.
|
|
19
|
+
* Based on YouTube's permission model.
|
|
20
|
+
*
|
|
21
|
+
* ## Visibility Type Definitions:
|
|
22
|
+
*
|
|
23
|
+
* **PUBLIC**
|
|
24
|
+
* - Accessibility: Anyone can discover and view the content
|
|
25
|
+
* - Searchability: Appears in search results and can be found through search engines
|
|
26
|
+
* - Sharing: Can be shared freely with anyone
|
|
27
|
+
* - Visibility: Shows up on the owner's public profile
|
|
28
|
+
*
|
|
29
|
+
* **PRIVATE**
|
|
30
|
+
* - Accessibility: Only the owner and specifically invited users can view the content
|
|
31
|
+
* - Searchability: Does not appear in any search results (internal or external)
|
|
32
|
+
* - Sharing: Even with a direct link, uninvited users cannot access the content
|
|
33
|
+
* - Visibility: Does not appear on the owner's public profile
|
|
34
|
+
*
|
|
35
|
+
* **UNLISTED**
|
|
36
|
+
* - Accessibility: Anyone with the direct link can view the content
|
|
37
|
+
* - Searchability: Does not appear in search results unless added to a public collection
|
|
38
|
+
* - Sharing: Can be shared via direct link without requiring special permissions
|
|
39
|
+
* - Visibility: Does not appear on the owner's public profile
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const network: NetworkSummaryV3 = {
|
|
44
|
+
* externalId: "12345",
|
|
45
|
+
* name: "Sample Network",
|
|
46
|
+
* visibility: Visibility.UNLISTED // Only accessible via direct link
|
|
47
|
+
* };
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare const Visibility: {
|
|
51
|
+
readonly PUBLIC: "PUBLIC";
|
|
52
|
+
readonly PRIVATE: "PRIVATE";
|
|
53
|
+
readonly UNLISTED: "UNLISTED";
|
|
54
|
+
};
|
|
55
|
+
declare type Visibility = (typeof Visibility)[keyof typeof Visibility];
|
|
56
|
+
/**
|
|
57
|
+
* Permission levels for network and folder access control.
|
|
58
|
+
*
|
|
59
|
+
* ## Permission Level Definitions:
|
|
60
|
+
*
|
|
61
|
+
* **READ**
|
|
62
|
+
* - View the network/folder content
|
|
63
|
+
* - Download network data
|
|
64
|
+
* - Access network metadata and summary information
|
|
65
|
+
*
|
|
66
|
+
* **WRITE**
|
|
67
|
+
* - All READ permissions
|
|
68
|
+
* - Modify network content and metadata
|
|
69
|
+
* - Update network properties and attributes
|
|
70
|
+
*
|
|
71
|
+
* **ADMIN**
|
|
72
|
+
* - All WRITE permissions
|
|
73
|
+
* - Delete networks/folders
|
|
74
|
+
* - Manage permissions for other users
|
|
75
|
+
* - Transfer ownership
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```typescript
|
|
79
|
+
* const permission: NetworkPermission = {
|
|
80
|
+
* uuid: "permission-uuid",
|
|
81
|
+
* permission: Permission.WRITE,
|
|
82
|
+
* memberUUID: "user-uuid",
|
|
83
|
+
* resourceUUID: "network-uuid"
|
|
84
|
+
* };
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
declare const Permission: {
|
|
88
|
+
readonly READ: "READ";
|
|
89
|
+
readonly WRITE: "WRITE";
|
|
90
|
+
readonly ADMIN: "ADMIN";
|
|
91
|
+
};
|
|
92
|
+
declare type Permission = (typeof Permission)[keyof typeof Permission];
|
|
93
|
+
/**
|
|
94
|
+
* File types for NDEx objects
|
|
95
|
+
*/
|
|
96
|
+
declare const NDExFileType: {
|
|
97
|
+
readonly NETWORK: "NETWORK";
|
|
98
|
+
readonly FOLDER: "FOLDER";
|
|
99
|
+
readonly SHORTCUT: "SHORTCUT";
|
|
100
|
+
};
|
|
101
|
+
declare type NDExFileType = (typeof NDExFileType)[keyof typeof NDExFileType];
|
|
102
|
+
/**
|
|
103
|
+
* Visual Property Mapping Types for CX2 networks
|
|
104
|
+
*/
|
|
105
|
+
declare const VPMappingType: {
|
|
106
|
+
readonly DISCRETE: "DISCRETE";
|
|
107
|
+
readonly CONTINUOUS: "CONTINUOUS";
|
|
108
|
+
readonly PASSTHROUGH: "PASSTHROUGH";
|
|
109
|
+
};
|
|
110
|
+
declare type VPMappingType = (typeof VPMappingType)[keyof typeof VPMappingType];
|
|
111
|
+
/**
|
|
112
|
+
* CX data types for network properties and attributes
|
|
113
|
+
*/
|
|
114
|
+
declare const CXDataType: {
|
|
115
|
+
readonly STRING: "string";
|
|
116
|
+
readonly LONG: "long";
|
|
117
|
+
readonly INTEGER: "integer";
|
|
118
|
+
readonly DOUBLE: "double";
|
|
119
|
+
readonly BOOLEAN: "boolean";
|
|
120
|
+
readonly LIST_OF_STRING: "list_of_string";
|
|
121
|
+
readonly LIST_OF_LONG: "list_of_long";
|
|
122
|
+
readonly LIST_OF_INTEGER: "list_of_integer";
|
|
123
|
+
readonly LIST_OF_DOUBLE: "list_of_double";
|
|
124
|
+
readonly LIST_OF_BOOLEAN: "list_of_boolean";
|
|
125
|
+
};
|
|
126
|
+
declare type CXDataType = (typeof CXDataType)[keyof typeof CXDataType];
|
|
127
|
+
|
|
3
128
|
/**
|
|
4
129
|
* Type definitions for CyNDEx (Cytoscape-NDEx Bridge) operations
|
|
5
130
|
*/
|
|
131
|
+
|
|
6
132
|
/**
|
|
7
133
|
* Configuration for CyNDEx service
|
|
8
134
|
*/
|
|
@@ -19,7 +145,7 @@ interface CyNDExConfig {
|
|
|
19
145
|
* This is used as parameters passed to Cytoscape for NDEx authentication
|
|
20
146
|
*/
|
|
21
147
|
interface CyNDExAuthConfig {
|
|
22
|
-
type:
|
|
148
|
+
type: AuthType;
|
|
23
149
|
username?: string;
|
|
24
150
|
password?: string;
|
|
25
151
|
idToken?: string;
|
|
@@ -75,18 +201,612 @@ interface CX2ImportParams {
|
|
|
75
201
|
title?: string;
|
|
76
202
|
}
|
|
77
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Permission details for a file including its type and member permissions
|
|
206
|
+
*
|
|
207
|
+
* @description This interface represents the permission information for a single file,
|
|
208
|
+
* including what type of file it is and which users have what permissions on it.
|
|
209
|
+
*/
|
|
210
|
+
interface FilePermissionDetails {
|
|
211
|
+
/**
|
|
212
|
+
* The type of the file (NETWORK, FOLDER, or SHORTCUT)
|
|
213
|
+
*/
|
|
214
|
+
type: NDExFileType;
|
|
215
|
+
/**
|
|
216
|
+
* Map of user UUIDs to their permission levels on this file
|
|
217
|
+
*
|
|
218
|
+
* @description Each key represents a user's UUID, and the corresponding value
|
|
219
|
+
* indicates what permission level that user has on the file.
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```typescript
|
|
223
|
+
* {
|
|
224
|
+
* "user1-uuid-1234-5678-9abc-def012345678": "READ",
|
|
225
|
+
* "user2-uuid-8765-4321-fedc-ba0987654321": "WRITE",
|
|
226
|
+
* "user3-uuid-1111-2222-3333-444444444444": "ADMIN"
|
|
227
|
+
* }
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
members: Record<string, Permission>;
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* List of file permission records returned by listMembers
|
|
234
|
+
*
|
|
235
|
+
* @description Each element in the array is a record where the key is a file UUID
|
|
236
|
+
* and the value contains the file's type and member permissions.
|
|
237
|
+
*
|
|
238
|
+
* @example
|
|
239
|
+
* ```typescript
|
|
240
|
+
* [
|
|
241
|
+
* {
|
|
242
|
+
* "12345678-1234-1234-1234-123456789abc": {
|
|
243
|
+
* type: "NETWORK",
|
|
244
|
+
* members: {
|
|
245
|
+
* "user1-uuid": "READ",
|
|
246
|
+
* "user2-uuid": "WRITE"
|
|
247
|
+
* }
|
|
248
|
+
* }
|
|
249
|
+
* },
|
|
250
|
+
* {
|
|
251
|
+
* "87654321-4321-4321-4321-876543210fed": {
|
|
252
|
+
* type: "FOLDER",
|
|
253
|
+
* members: {
|
|
254
|
+
* "user3-uuid": "ADMIN"
|
|
255
|
+
* }
|
|
256
|
+
* }
|
|
257
|
+
* }
|
|
258
|
+
* ]
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
declare type FilePermissionList = Record<string, FilePermissionDetails>[];
|
|
262
|
+
/**
|
|
263
|
+
* Request object for sharing member operations
|
|
264
|
+
*
|
|
265
|
+
* This interface defines the structure for requests that manage file sharing permissions.
|
|
266
|
+
* It combines file identification with member permission management in a single request.
|
|
267
|
+
*/
|
|
268
|
+
interface SharingMemberRequest {
|
|
269
|
+
/**
|
|
270
|
+
* Object mapping file UUIDs to their corresponding file types
|
|
271
|
+
*
|
|
272
|
+
* @description Each key represents the UUID of a file to be shared, and the value
|
|
273
|
+
* indicates what type of file it is (NETWORK, FOLDER, or SHORTCUT)
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* ```typescript
|
|
277
|
+
* {
|
|
278
|
+
* "12345678-1234-1234-1234-123456789abc": "NETWORK",
|
|
279
|
+
* "87654321-4321-4321-4321-876543210fed": "FOLDER"
|
|
280
|
+
* }
|
|
281
|
+
* ```
|
|
282
|
+
*/
|
|
283
|
+
files: Record<string, NDExFileType>;
|
|
284
|
+
/**
|
|
285
|
+
* Object mapping member UUIDs to their permission levels
|
|
286
|
+
*
|
|
287
|
+
* @description Each key represents the UUID of a user or member who should receive
|
|
288
|
+
* explicit permissions, and the value is the type of permission they should have.
|
|
289
|
+
* If the permission value is null, the existing file permission for the member will be revoked.
|
|
290
|
+
*
|
|
291
|
+
* @example
|
|
292
|
+
* ```typescript
|
|
293
|
+
* {
|
|
294
|
+
* "user1-uuid-1234-5678-9abc-def012345678": "READ",
|
|
295
|
+
* "user2-uuid-8765-4321-fedc-ba0987654321": "WRITE",
|
|
296
|
+
* "user3-uuid-1111-2222-3333-444444444444": null // This will revoke permissions
|
|
297
|
+
* }
|
|
298
|
+
* ```
|
|
299
|
+
*/
|
|
300
|
+
members: Record<string, Permission | null>;
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Parameters for searching files in NDEx
|
|
304
|
+
*/
|
|
305
|
+
interface FileSearchParams {
|
|
306
|
+
/** Search terms as a string, supports Lucene syntax */
|
|
307
|
+
searchString?: string;
|
|
308
|
+
/** Username of the account to filter on, only files owned by that user will be returned */
|
|
309
|
+
accountName?: string;
|
|
310
|
+
/** Filter by permission level, only applicable to signed-in users */
|
|
311
|
+
permission?: Permission;
|
|
312
|
+
/** File type to filter on, if null or omitted all file types will be returned */
|
|
313
|
+
type?: NDExFileType | null;
|
|
314
|
+
/** Visibility filter, only supports "PRIVATE" or "PUBLIC" */
|
|
315
|
+
visibility: 'PRIVATE' | 'PUBLIC';
|
|
316
|
+
/** Starting index for pagination */
|
|
317
|
+
start?: number;
|
|
318
|
+
/** Number of results to return for pagination */
|
|
319
|
+
size?: number;
|
|
320
|
+
}
|
|
321
|
+
interface CreateShortcutOptions {
|
|
322
|
+
name: string;
|
|
323
|
+
target: string;
|
|
324
|
+
targetType: NDExFileType;
|
|
325
|
+
parent?: string;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* FilesService - NDEx file operations and task management
|
|
329
|
+
* Handles file uploads, downloads, exports, and asynchronous task tracking
|
|
330
|
+
*/
|
|
331
|
+
declare class FilesService {
|
|
332
|
+
private http;
|
|
333
|
+
constructor(http: HTTPService);
|
|
334
|
+
/**
|
|
335
|
+
* Copy a file to a different location
|
|
336
|
+
*
|
|
337
|
+
* Copies a network or shortcut to a target folder. Folder copying is not supported.
|
|
338
|
+
* The copied file will be placed in the specified target folder with the same name
|
|
339
|
+
* and properties as the original.
|
|
340
|
+
*
|
|
341
|
+
* @param options - Copy operation configuration
|
|
342
|
+
* @param options.fileId - UUID of the source file to copy
|
|
343
|
+
* @param options.targetId - UUID of the target folder where the file will be copied
|
|
344
|
+
* @param options.type - Type of file being copied (only NETWORK and SHORTCUT are supported)
|
|
345
|
+
* @param options.accessKey - Optional access key for accessing protected files
|
|
346
|
+
* @returns Promise resolving to the copied file's UUID and modification time
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* ```typescript
|
|
350
|
+
* // Copy a network to a specific folder
|
|
351
|
+
* await client.files.copyFile({
|
|
352
|
+
* fileId: "12345678-1234-1234-1234-123456789abc",
|
|
353
|
+
* targetId: "87654321-4321-4321-4321-876543210fed",
|
|
354
|
+
* type: "NETWORK"
|
|
355
|
+
* });
|
|
356
|
+
*
|
|
357
|
+
* // Copy a shortcut with access key
|
|
358
|
+
* await client.files.copyFile({
|
|
359
|
+
* fileId: "11111111-2222-3333-4444-555555555555",
|
|
360
|
+
* targetId: "66666666-7777-8888-9999-000000000000",
|
|
361
|
+
* type: "SHORTCUT",
|
|
362
|
+
* accessKey: "secret-key-123"
|
|
363
|
+
* });
|
|
364
|
+
* ```
|
|
365
|
+
*/
|
|
366
|
+
copyFile(options: {
|
|
367
|
+
fileId: string;
|
|
368
|
+
targetId: string;
|
|
369
|
+
type: NDExFileType;
|
|
370
|
+
accessKey?: string;
|
|
371
|
+
}): Promise<NDExObjectUpdateStatus>;
|
|
372
|
+
/** Get file count statistics for the current user */
|
|
373
|
+
getCount(): Promise<any>;
|
|
374
|
+
/** Get files in the trash for the current user */
|
|
375
|
+
getTrash(): Promise<any>;
|
|
376
|
+
/** Permanently delete all files in trash */
|
|
377
|
+
emptyTrash(): Promise<any>;
|
|
378
|
+
/**
|
|
379
|
+
* Permanently delete a file from trash
|
|
380
|
+
* @param fileId - File UUID to permanently delete
|
|
381
|
+
*/
|
|
382
|
+
permanentlyDeleteFile(fileId: string): Promise<any>;
|
|
383
|
+
/**
|
|
384
|
+
* Restore files from trash
|
|
385
|
+
* @param networkIds - Array of network UUIDs to restore
|
|
386
|
+
* @param folderIds - Array of folder UUIDs to restore
|
|
387
|
+
* @param shortcutIds - Array of shortcut UUIDs to restore
|
|
388
|
+
*/
|
|
389
|
+
restoreFile(networkIds: string[], folderIds: string[], shortcutIds: string[]): Promise<any>;
|
|
390
|
+
private _validateShareData;
|
|
391
|
+
private _validateMemberData;
|
|
392
|
+
/**
|
|
393
|
+
* Update member permissions for shared files
|
|
394
|
+
*
|
|
395
|
+
* This method allows you to grant, modify, or revoke permissions for specific members
|
|
396
|
+
* across multiple files in a single operation. It's particularly useful for bulk
|
|
397
|
+
* permission management and ensuring consistent access control.
|
|
398
|
+
*
|
|
399
|
+
* @param request - The sharing member request containing files and member permissions
|
|
400
|
+
* @param request.files - Object mapping file UUIDs to their file types
|
|
401
|
+
* @param request.members - Object mapping member UUIDs to their permission levels (or null to revoke)
|
|
402
|
+
*
|
|
403
|
+
* @returns Promise resolving to an object with file UUIDs as keys and permission status messages as values
|
|
404
|
+
*
|
|
405
|
+
* @example
|
|
406
|
+
* ```typescript
|
|
407
|
+
* // Grant permissions to multiple members for different files
|
|
408
|
+
* const result = await client.files.updateMember({
|
|
409
|
+
* files: {
|
|
410
|
+
* "network-uuid-123": "NETWORK",
|
|
411
|
+
* "folder-uuid-456": "FOLDER"
|
|
412
|
+
* },
|
|
413
|
+
* members: {
|
|
414
|
+
* "user1-uuid": "READ",
|
|
415
|
+
* "user2-uuid": "WRITE",
|
|
416
|
+
* "user3-uuid": null // Revoke permissions
|
|
417
|
+
* }
|
|
418
|
+
* });
|
|
419
|
+
*
|
|
420
|
+
* // Result example:
|
|
421
|
+
* // {
|
|
422
|
+
* // "network-uuid-123": "network permission granted",
|
|
423
|
+
* // "folder-uuid-456": "folder permission granted"
|
|
424
|
+
* // }
|
|
425
|
+
*
|
|
426
|
+
* // Revoke all permissions for a user
|
|
427
|
+
* await client.files.updateMember({
|
|
428
|
+
* files: {
|
|
429
|
+
* "network-uuid-789": "NETWORK"
|
|
430
|
+
* },
|
|
431
|
+
* members: {
|
|
432
|
+
* "user-to-remove-uuid": null
|
|
433
|
+
* }
|
|
434
|
+
* });
|
|
435
|
+
* ```
|
|
436
|
+
*
|
|
437
|
+
* @throws {Error} When file UUIDs have invalid format
|
|
438
|
+
* @throws {Error} When file types are invalid
|
|
439
|
+
* @throws {Error} When member UUIDs have invalid format
|
|
440
|
+
*/
|
|
441
|
+
updateMember(request: SharingMemberRequest): Promise<Record<string, string>>;
|
|
442
|
+
/**
|
|
443
|
+
* List members and their permissions for specified files
|
|
444
|
+
*
|
|
445
|
+
* Retrieves detailed permission information for the specified files, including
|
|
446
|
+
* the file type and a mapping of all users who have explicit permissions on each file.
|
|
447
|
+
* This is useful for auditing file access and understanding who has what level of
|
|
448
|
+
* access to your shared content.
|
|
449
|
+
*
|
|
450
|
+
* @param files - Object mapping file UUIDs to their file types
|
|
451
|
+
* @returns Promise resolving to a list of permission records for each file
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* ```typescript
|
|
455
|
+
* // Get permission details for multiple files
|
|
456
|
+
* const permissions = await client.files.listMembers({
|
|
457
|
+
* "12345678-1234-1234-1234-123456789abc": "NETWORK",
|
|
458
|
+
* "87654321-4321-4321-4321-876543210fed": "FOLDER",
|
|
459
|
+
* "11111111-2222-3333-4444-555555555555": "SHORTCUT"
|
|
460
|
+
* });
|
|
461
|
+
*
|
|
462
|
+
* // Result example:
|
|
463
|
+
* // [
|
|
464
|
+
* // {
|
|
465
|
+
* // "12345678-1234-1234-1234-123456789abc": {
|
|
466
|
+
* // type: "NETWORK",
|
|
467
|
+
* // members: {
|
|
468
|
+
* // "user1-uuid-1234-5678-9abc-def012345678": "READ",
|
|
469
|
+
* // "user2-uuid-8765-4321-fedc-ba0987654321": "WRITE",
|
|
470
|
+
* // "user3-uuid-1111-2222-3333-444444444444": "ADMIN"
|
|
471
|
+
* // }
|
|
472
|
+
* // }
|
|
473
|
+
* // },
|
|
474
|
+
* // {
|
|
475
|
+
* // "87654321-4321-4321-4321-876543210fed": {
|
|
476
|
+
* // type: "FOLDER",
|
|
477
|
+
* // members: {
|
|
478
|
+
* // "user4-uuid-aaaa-bbbb-cccc-dddddddddddd": "ADMIN",
|
|
479
|
+
* // "user5-uuid-eeee-ffff-0000-111111111111": "READ"
|
|
480
|
+
* // }
|
|
481
|
+
* // }
|
|
482
|
+
* // }
|
|
483
|
+
* // ]
|
|
484
|
+
*
|
|
485
|
+
* // Access specific file permissions
|
|
486
|
+
* const networkPermissions = permissions.find(record =>
|
|
487
|
+
* record["12345678-1234-1234-1234-123456789abc"]
|
|
488
|
+
* )?.["12345678-1234-1234-1234-123456789abc"];
|
|
489
|
+
*
|
|
490
|
+
* if (networkPermissions) {
|
|
491
|
+
* console.log('File type:', networkPermissions.type); // "NETWORK"
|
|
492
|
+
* console.log('Members:', networkPermissions.members);
|
|
493
|
+
*
|
|
494
|
+
* // Check if specific user has permission
|
|
495
|
+
* const userPermission = networkPermissions.members["user1-uuid-1234-5678-9abc-def012345678"];
|
|
496
|
+
* console.log('User permission:', userPermission); // "READ"
|
|
497
|
+
* }
|
|
498
|
+
* ```
|
|
499
|
+
*
|
|
500
|
+
* @throws {Error} When file UUIDs have invalid format
|
|
501
|
+
* @throws {Error} When file types are invalid
|
|
502
|
+
*/
|
|
503
|
+
listMembers(files: Record<string, NDExFileType>): Promise<FilePermissionList>;
|
|
504
|
+
/**
|
|
505
|
+
* Transfer ownership of networks to a new owner
|
|
506
|
+
*
|
|
507
|
+
* This method transfers ownership of multiple networks to a specified user.
|
|
508
|
+
* The current owner will lose ownership rights, and the new owner will gain
|
|
509
|
+
* full control over the specified networks.
|
|
510
|
+
*
|
|
511
|
+
* @param request - Transfer ownership request
|
|
512
|
+
* @param request.networks - Array of network UUIDs to transfer ownership for
|
|
513
|
+
* @param request.newOwner - UUID of the user who will become the new owner
|
|
514
|
+
* @returns Promise that resolves when the ownership transfer is complete
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* ```typescript
|
|
518
|
+
* // Transfer ownership of multiple networks to a new owner
|
|
519
|
+
* await client.files.transferOwnership({
|
|
520
|
+
* networks: [
|
|
521
|
+
* "12345678-1234-1234-1234-123456789abc",
|
|
522
|
+
* "87654321-4321-4321-4321-876543210fed"
|
|
523
|
+
* ],
|
|
524
|
+
* newOwner: "new-owner-uuid-1111-2222-3333-444444444444"
|
|
525
|
+
* });
|
|
526
|
+
* ```
|
|
527
|
+
*/
|
|
528
|
+
transferOwnership(request: {
|
|
529
|
+
networks: string[];
|
|
530
|
+
newOwner: string;
|
|
531
|
+
}): Promise<void>;
|
|
532
|
+
listShares(limit?: number): Promise<FileListItem[]>;
|
|
533
|
+
/**
|
|
534
|
+
* Share files with public access
|
|
535
|
+
*
|
|
536
|
+
* Makes specified files publicly accessible by generating access keys for each file.
|
|
537
|
+
* The generated access keys can be used by others to access the shared files without
|
|
538
|
+
* requiring explicit permissions.
|
|
539
|
+
*
|
|
540
|
+
* @param fileTable - Object mapping file UUIDs to their file types
|
|
541
|
+
* @returns Promise resolving to an object mapping file UUIDs to their generated access keys
|
|
542
|
+
*
|
|
543
|
+
* @example
|
|
544
|
+
* ```typescript
|
|
545
|
+
* // Share a network and a folder
|
|
546
|
+
* const result = await client.files.share({
|
|
547
|
+
* "e6fc6a72-59ea-4f1d-ad81-59eda2cb8dce": "NETWORK",
|
|
548
|
+
* "40c08b7b-a4dd-4f00-87b3-1b945991948a": "FOLDER"
|
|
549
|
+
* });
|
|
550
|
+
*
|
|
551
|
+
* // Result example:
|
|
552
|
+
* // {
|
|
553
|
+
* // "e6fc6a72-59ea-4f1d-ad81-59eda2cb8dce": "abc123def456",
|
|
554
|
+
* // "40c08b7b-a4dd-4f00-87b3-1b945991948a": "xyz789uvw012"
|
|
555
|
+
* // }
|
|
556
|
+
*
|
|
557
|
+
* // Use the access key to access shared content
|
|
558
|
+
* const sharedNetwork = await client.networks.getNetwork(
|
|
559
|
+
* "e6fc6a72-59ea-4f1d-ad81-59eda2cb8dce",
|
|
560
|
+
* { accessKey: result["e6fc6a72-59ea-4f1d-ad81-59eda2cb8dce"] }
|
|
561
|
+
* );
|
|
562
|
+
* ```
|
|
563
|
+
*/
|
|
564
|
+
share(fileTable: Record<string, NDExFileType>): Promise<Record<string, string>>;
|
|
565
|
+
unshare(fileTable: Record<string, NDExFileType>): Promise<void>;
|
|
566
|
+
getFolders(limit?: number): Promise<any>;
|
|
567
|
+
createFolder(name: string, parentFolderId?: string): Promise<any>;
|
|
568
|
+
getFolder(folderId: string, accessKey?: string): Promise<any>;
|
|
569
|
+
/**
|
|
570
|
+
* Update folder properties
|
|
571
|
+
*
|
|
572
|
+
* Updates the properties of an existing folder including name, description, and parent location.
|
|
573
|
+
* When parent is omitted, the folder remains in or is moved to the owner's home directory.
|
|
574
|
+
*
|
|
575
|
+
* @param folderId - The UUID of the folder to update
|
|
576
|
+
* @param folderData - Object containing folder properties to update
|
|
577
|
+
* @param folderData.name - The new name for the folder
|
|
578
|
+
* @param folderData.description - The new description for the folder
|
|
579
|
+
* @param folderData.parent - Optional UUID of the parent folder. If omitted, folder is placed in owner's home directory
|
|
580
|
+
* @returns Promise that resolves when the folder update is complete
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* ```typescript
|
|
584
|
+
* // Update folder name and description, keep in current location
|
|
585
|
+
* await client.files.updateFolder('folder-uuid', {
|
|
586
|
+
* name: 'Updated Folder Name',
|
|
587
|
+
* description: 'Updated folder description'
|
|
588
|
+
* });
|
|
589
|
+
*
|
|
590
|
+
* // Move folder to a different parent and update properties
|
|
591
|
+
* await client.files.updateFolder('folder-uuid', {
|
|
592
|
+
* name: 'Moved Folder',
|
|
593
|
+
* description: 'This folder has been moved',
|
|
594
|
+
* parent: 'parent-folder-uuid'
|
|
595
|
+
* });
|
|
596
|
+
*
|
|
597
|
+
* // Move folder to home directory by omitting parent
|
|
598
|
+
* await client.files.updateFolder('folder-uuid', {
|
|
599
|
+
* name: 'Home Folder',
|
|
600
|
+
* description: 'Moved to home directory'
|
|
601
|
+
* });
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
updateFolder(folderId: string, folderData: {
|
|
605
|
+
name: string;
|
|
606
|
+
description: string;
|
|
607
|
+
parent?: string;
|
|
608
|
+
}): Promise<void>;
|
|
609
|
+
deleteFolder(folderId: string): Promise<any>;
|
|
610
|
+
getFolderCount(folderId: string, accessKey?: string): Promise<any>;
|
|
611
|
+
getFolderList(folderId: string, accessKey?: string, format?: string, type?: string): Promise<FileListItem[]>;
|
|
612
|
+
/**
|
|
613
|
+
* Get folder access key
|
|
614
|
+
*
|
|
615
|
+
* Retrieves the access key for a folder if it has been enabled for public access.
|
|
616
|
+
* When a folder has an access key enabled, it can be accessed by others without
|
|
617
|
+
* explicit permissions using this key.
|
|
618
|
+
*
|
|
619
|
+
* @param folderId - The UUID of the folder to get the access key for
|
|
620
|
+
* @returns Promise resolving to an object with accessKey property when enabled,
|
|
621
|
+
* or null when access key is not enabled on this folder
|
|
622
|
+
*
|
|
623
|
+
* @example
|
|
624
|
+
* ```typescript
|
|
625
|
+
* // Check if folder has an access key
|
|
626
|
+
* const result = await client.files.getFolderAccessKey('12345678-1234-1234-1234-123456789abc');
|
|
627
|
+
*
|
|
628
|
+
* if (result) {
|
|
629
|
+
* console.log('Access key:', result.accessKey); // "sdfdfdfsdfdsfs"
|
|
630
|
+
* // Use the access key to access the folder
|
|
631
|
+
* const folderData = await client.files.getFolder(folderId, result.accessKey);
|
|
632
|
+
* } else {
|
|
633
|
+
* console.log('No access key enabled for this folder');
|
|
634
|
+
* }
|
|
635
|
+
* ```
|
|
636
|
+
*/
|
|
637
|
+
getFolderAccessKey(folderId: string): Promise<{
|
|
638
|
+
accessKey: string;
|
|
639
|
+
} | null>;
|
|
640
|
+
getShortcuts(limit?: number): Promise<any>;
|
|
641
|
+
/**
|
|
642
|
+
* Create a shortcut to an existing NDEx object
|
|
643
|
+
*
|
|
644
|
+
* Creates a shortcut (reference) to an existing network, folder, or shortcut.
|
|
645
|
+
* The shortcut can be placed in a specific folder or in the user's home directory.
|
|
646
|
+
*
|
|
647
|
+
* @param options - Shortcut creation options
|
|
648
|
+
* @param options.name - Display name for the shortcut
|
|
649
|
+
* @param options.target - UUID of the target object to create a shortcut to
|
|
650
|
+
* @param options.targetType - Type of the target object ('NETWORK', 'FOLDER', or 'SHORTCUT')
|
|
651
|
+
* @param options.parent - Optional UUID of the parent folder. If omitted, shortcut is created in user's home directory
|
|
652
|
+
* @returns Promise resolving to the created shortcut information
|
|
653
|
+
*
|
|
654
|
+
* @example
|
|
655
|
+
* ```typescript
|
|
656
|
+
* // Create shortcut to a network in home directory
|
|
657
|
+
* await client.files.createShortcut({
|
|
658
|
+
* name: "My Important Network Shortcut",
|
|
659
|
+
* target: "12345678-1234-1234-1234-123456789abc",
|
|
660
|
+
* targetType: "NETWORK"
|
|
661
|
+
* });
|
|
662
|
+
*
|
|
663
|
+
* // Create shortcut to a folder within another folder
|
|
664
|
+
* await client.files.createShortcut({
|
|
665
|
+
* name: "Research Folder Shortcut",
|
|
666
|
+
* target: "87654321-4321-4321-4321-876543210fed",
|
|
667
|
+
* targetType: "FOLDER",
|
|
668
|
+
* parent: "11111111-2222-3333-4444-555555555555"
|
|
669
|
+
* });
|
|
670
|
+
* ```
|
|
671
|
+
*/
|
|
672
|
+
createShortcut(options: CreateShortcutOptions): Promise<NDExObjectUpdateStatus>;
|
|
673
|
+
getShortcut(shortcutId: string, accessKey?: string): Promise<Shortcut>;
|
|
674
|
+
/**
|
|
675
|
+
* Update shortcut properties
|
|
676
|
+
*
|
|
677
|
+
* Updates the properties of an existing shortcut including name, parent location, target, and target type.
|
|
678
|
+
* The parent attribute is always included in the request payload - when parent is omitted from the shortcut object,
|
|
679
|
+
* parent is set to null to indicate the shortcut should be moved to the owner's home directory.
|
|
680
|
+
*
|
|
681
|
+
* @param shortcutId - The UUID of the shortcut to update
|
|
682
|
+
* @param shortcutObject - Object containing shortcut properties to update
|
|
683
|
+
* @param shortcutObject.name - The new name for the shortcut
|
|
684
|
+
* @param shortcutObject.target - UUID of the target object the shortcut points to
|
|
685
|
+
* @param shortcutObject.targetType - Type of the target object ('NETWORK', 'FOLDER', or 'SHORTCUT')
|
|
686
|
+
* @param shortcutObject.parent - Optional UUID of the parent folder. If omitted, shortcut is moved to home directory
|
|
687
|
+
* @returns Promise resolving when the shortcut update is complete
|
|
688
|
+
*
|
|
689
|
+
* @example
|
|
690
|
+
* ```typescript
|
|
691
|
+
* // Update shortcut name and target, move to home directory
|
|
692
|
+
* await client.files.updateShortcut('shortcut-uuid', {
|
|
693
|
+
* name: 'Updated Shortcut Name',
|
|
694
|
+
* target: 'target-network-uuid',
|
|
695
|
+
* targetType: 'NETWORK'
|
|
696
|
+
* });
|
|
697
|
+
*
|
|
698
|
+
* // Update shortcut and move to a specific folder
|
|
699
|
+
* await client.files.updateShortcut('shortcut-uuid', {
|
|
700
|
+
* name: 'Folder Shortcut',
|
|
701
|
+
* target: 'target-folder-uuid',
|
|
702
|
+
* targetType: 'FOLDER',
|
|
703
|
+
* parent: 'parent-folder-uuid'
|
|
704
|
+
* });
|
|
705
|
+
*
|
|
706
|
+
* // Update all shortcut properties
|
|
707
|
+
* await client.files.updateShortcut('shortcut-uuid', {
|
|
708
|
+
* name: 'Complete Update',
|
|
709
|
+
* target: 'target-network-uuid',
|
|
710
|
+
* targetType: 'NETWORK',
|
|
711
|
+
* parent: 'parent-folder-uuid'
|
|
712
|
+
* });
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
updateShortcut(shortcutId: string, shortcutObject: CreateShortcutOptions): Promise<any>;
|
|
716
|
+
deleteShortcut(shortcutId: string): Promise<any>;
|
|
717
|
+
/**
|
|
718
|
+
* Set visibility for multiple files
|
|
719
|
+
*
|
|
720
|
+
* Updates the visibility settings for the specified files, controlling who can
|
|
721
|
+
* access them based on the visibility level (public, private, etc.).
|
|
722
|
+
*
|
|
723
|
+
* @param options - Visibility update configuration
|
|
724
|
+
* @param options.files - Object mapping file UUIDs to their file types
|
|
725
|
+
* @param options.visibility - The visibility level to apply to all specified files
|
|
726
|
+
* @returns Promise that resolves when the visibility has been updated
|
|
727
|
+
*
|
|
728
|
+
* @example
|
|
729
|
+
* ```typescript
|
|
730
|
+
* // Make multiple files public
|
|
731
|
+
* await client.files.setVisibility({
|
|
732
|
+
* files: {
|
|
733
|
+
* "12345678-1234-1234-1234-123456789abc": "NETWORK",
|
|
734
|
+
* "87654321-4321-4321-4321-876543210fed": "FOLDER"
|
|
735
|
+
* },
|
|
736
|
+
* visibility: "PUBLIC"
|
|
737
|
+
* });
|
|
738
|
+
* ```
|
|
739
|
+
*/
|
|
740
|
+
setVisibility(options: {
|
|
741
|
+
files: Record<string, NDExFileType>;
|
|
742
|
+
visibility: Visibility;
|
|
743
|
+
}): Promise<void>;
|
|
744
|
+
/**
|
|
745
|
+
* Search for files in NDEx
|
|
746
|
+
*
|
|
747
|
+
* Searches for networks, folders, and shortcuts based on various criteria including
|
|
748
|
+
* search terms, ownership, permissions, file type, and visibility. Results are paginated
|
|
749
|
+
* and support Lucene query syntax for advanced search capabilities.
|
|
750
|
+
*
|
|
751
|
+
* @param params - Search parameters
|
|
752
|
+
* @param params.searchString - Search terms as a string, supports Lucene syntax
|
|
753
|
+
* @param params.accountName - Username to filter files by owner
|
|
754
|
+
* @param params.permission - Filter by permission level (only for signed-in users)
|
|
755
|
+
* @param params.type - File type filter (NETWORK, FOLDER, SHORTCUT, or null for all types)
|
|
756
|
+
* @param params.visibility - Visibility filter (required, "PRIVATE" or "PUBLIC")
|
|
757
|
+
* @param params.start - Starting index for pagination (default: 0)
|
|
758
|
+
* @param params.size - Number of results to return (default: varies by server)
|
|
759
|
+
* @returns Promise resolving to search results containing matching files
|
|
760
|
+
*
|
|
761
|
+
* @example
|
|
762
|
+
* ```typescript
|
|
763
|
+
* // Search for public networks containing "cancer"
|
|
764
|
+
* const results = await client.files.searchFiles({
|
|
765
|
+
* searchString: "cancer",
|
|
766
|
+
* type: "NETWORK",
|
|
767
|
+
* visibility: "PUBLIC",
|
|
768
|
+
* start: 0,
|
|
769
|
+
* size: 25
|
|
770
|
+
* });
|
|
771
|
+
*
|
|
772
|
+
* console.log(`Found ${results.numFound} total results`);
|
|
773
|
+
* console.log(`Showing results starting at ${results.start}`);
|
|
774
|
+
* results.ResultList.forEach(file => {
|
|
775
|
+
* console.log(`${file.name} (${file.type})`);
|
|
776
|
+
* });
|
|
777
|
+
*
|
|
778
|
+
* // Search with Lucene syntax for networks owned by specific user
|
|
779
|
+
* const userNetworks = await client.files.searchFiles({
|
|
780
|
+
* searchString: "name:pathway AND description:signaling",
|
|
781
|
+
* accountName: "john_doe",
|
|
782
|
+
* type: "NETWORK",
|
|
783
|
+
* visibility: "PUBLIC"
|
|
784
|
+
* });
|
|
785
|
+
*
|
|
786
|
+
* // Search for all private files the signed-in user has WRITE permission on
|
|
787
|
+
* const writableFiles = await client.files.searchFiles({
|
|
788
|
+
* permission: "WRITE",
|
|
789
|
+
* visibility: "PRIVATE",
|
|
790
|
+
* start: 0,
|
|
791
|
+
* size: 50
|
|
792
|
+
* });
|
|
793
|
+
* ```
|
|
794
|
+
*/
|
|
795
|
+
searchFiles(params: FileSearchParams): Promise<SearchResult<FileListItem>>;
|
|
796
|
+
}
|
|
797
|
+
|
|
78
798
|
/**
|
|
79
799
|
* Core type definitions for NDEx Client Library
|
|
80
800
|
* Pragmatic TypeScript types allowing flexibility with any types where needed
|
|
81
801
|
*/
|
|
82
802
|
|
|
83
803
|
interface BasicAuth {
|
|
84
|
-
type:
|
|
804
|
+
type: typeof AuthType.BASIC;
|
|
85
805
|
username: string;
|
|
86
806
|
password: string;
|
|
87
807
|
}
|
|
88
808
|
interface OAuthAuth {
|
|
89
|
-
type:
|
|
809
|
+
type: typeof AuthType.OAUTH;
|
|
90
810
|
idToken: string;
|
|
91
811
|
}
|
|
92
812
|
interface NDExAuthResponse {
|
|
@@ -124,14 +844,89 @@ interface CX1MetaDataResponse {
|
|
|
124
844
|
interface CX1NetworkProperty {
|
|
125
845
|
predicateString: string;
|
|
126
846
|
value: string;
|
|
127
|
-
dataType?:
|
|
847
|
+
dataType?: CXDataType;
|
|
128
848
|
}
|
|
849
|
+
/**
|
|
850
|
+
* CX2 network properties structure
|
|
851
|
+
*
|
|
852
|
+
* @description Represents network properties in CX2 format, where each property
|
|
853
|
+
* is defined with both its data type and value. This format allows for type-safe
|
|
854
|
+
* property handling and is the standard way properties are stored in CX2 networks.
|
|
855
|
+
*
|
|
856
|
+
* The key represents the name of the attribute, and the value contains both the
|
|
857
|
+
* data type specification and the actual value.
|
|
858
|
+
*
|
|
859
|
+
* @example
|
|
860
|
+
* ```typescript
|
|
861
|
+
* const networkProps: CX2NetworkProperties = {
|
|
862
|
+
* name: {
|
|
863
|
+
* t: "string",
|
|
864
|
+
* v: "My Network"
|
|
865
|
+
* },
|
|
866
|
+
* nodeCount: {
|
|
867
|
+
* t: "integer",
|
|
868
|
+
* v: 150
|
|
869
|
+
* },
|
|
870
|
+
* version: {
|
|
871
|
+
* t: "double",
|
|
872
|
+
* v: 1.5
|
|
873
|
+
* },
|
|
874
|
+
* tags: {
|
|
875
|
+
* t: "list_of_string",
|
|
876
|
+
* v: ["biology", "protein-interaction", "human"]
|
|
877
|
+
* },
|
|
878
|
+
* isPublic: {
|
|
879
|
+
* t: "boolean",
|
|
880
|
+
* v: true
|
|
881
|
+
* }
|
|
882
|
+
* };
|
|
883
|
+
*
|
|
884
|
+
* // Applications can use the value directly
|
|
885
|
+
* const networkName = networkProps.name.v; // "My Network"
|
|
886
|
+
* const nodeCount = networkProps.nodeCount.v; // 150
|
|
887
|
+
* ```
|
|
888
|
+
*/
|
|
129
889
|
interface CX2NetworkProperties {
|
|
890
|
+
/**
|
|
891
|
+
* Property definition indexed by attribute name
|
|
892
|
+
*
|
|
893
|
+
* @description Each key represents the name of a network attribute, and the
|
|
894
|
+
* corresponding value contains the type specification and actual value.
|
|
895
|
+
*/
|
|
130
896
|
[key: string]: {
|
|
131
|
-
|
|
897
|
+
/**
|
|
898
|
+
* Data type of the attribute
|
|
899
|
+
*
|
|
900
|
+
* @description Specifies the CX2 data type for this attribute. Common types include:
|
|
901
|
+
* - `"string"` - Text values
|
|
902
|
+
* - `"long"` - Long integer values
|
|
903
|
+
* - `"integer"` - Whole numbers
|
|
904
|
+
* - `"double"` - Decimal numbers
|
|
905
|
+
* - `"boolean"` - True/false values
|
|
906
|
+
* - `"list_of_string"` - Array of text values
|
|
907
|
+
* - `"list_of_long"` - Array of long integers
|
|
908
|
+
* - `"list_of_integer"` - Array of whole numbers
|
|
909
|
+
* - `"list_of_double"` - Array of decimal numbers
|
|
910
|
+
* - `"list_of_boolean"` - Array of boolean values
|
|
911
|
+
*
|
|
912
|
+
* @example CXDataType.STRING, CXDataType.INTEGER, CXDataType.DOUBLE, CXDataType.LIST_OF_STRING
|
|
913
|
+
*/
|
|
914
|
+
t: CXDataType;
|
|
915
|
+
/**
|
|
916
|
+
* Actual value of the attribute
|
|
917
|
+
*
|
|
918
|
+
* @description The concrete value for this attribute. Applications can
|
|
919
|
+
* typically use this value directly without additional processing. The
|
|
920
|
+
* type of this value should correspond to the data type specified in `t`.
|
|
921
|
+
*
|
|
922
|
+
* @example "My Network", 150, 1.5, true, ["tag1", "tag2"]
|
|
923
|
+
*/
|
|
132
924
|
v: any;
|
|
133
925
|
};
|
|
134
926
|
}
|
|
927
|
+
/**
|
|
928
|
+
* @deprecated Since NDEx version 3.0, all networks/folders and shortcuts are indexed in the system by default.
|
|
929
|
+
*/
|
|
135
930
|
declare enum NetworkIndexLevel {
|
|
136
931
|
NONE = "NONE",
|
|
137
932
|
BASIC = "BASIC",
|
|
@@ -143,7 +938,7 @@ interface NetworkSummaryV2 {
|
|
|
143
938
|
description?: string;
|
|
144
939
|
nodeCount: number;
|
|
145
940
|
edgeCount: number;
|
|
146
|
-
visibility:
|
|
941
|
+
visibility: Visibility;
|
|
147
942
|
owner: string;
|
|
148
943
|
ownerUUID: string;
|
|
149
944
|
creationTime: number;
|
|
@@ -217,7 +1012,7 @@ interface NetworkSummaryV3 extends Omit<NetworkSummaryV2, 'properties'> {
|
|
|
217
1012
|
}
|
|
218
1013
|
interface NetworkPermission {
|
|
219
1014
|
uuid: string;
|
|
220
|
-
permission:
|
|
1015
|
+
permission: Permission;
|
|
221
1016
|
memberUUID: string;
|
|
222
1017
|
memberAccountName?: string;
|
|
223
1018
|
resourceUUID: string;
|
|
@@ -280,10 +1075,6 @@ interface CX2EdgeBypass {
|
|
|
280
1075
|
id: number;
|
|
281
1076
|
v: VisualPropertyTable;
|
|
282
1077
|
}
|
|
283
|
-
/**
|
|
284
|
-
* Visual Property Mapping Types
|
|
285
|
-
*/
|
|
286
|
-
declare type VPMappingType = 'DISCRETE' | 'CONTINUOUS' | 'PASSTHROUGH';
|
|
287
1078
|
/**
|
|
288
1079
|
* Mapping Definition for visual property mappings
|
|
289
1080
|
* Note: Using flexible typing for mapping definitions as they vary by type
|
|
@@ -334,10 +1125,10 @@ interface CX2Status {
|
|
|
334
1125
|
error?: string;
|
|
335
1126
|
success?: boolean;
|
|
336
1127
|
}
|
|
337
|
-
interface SearchResult {
|
|
338
|
-
|
|
1128
|
+
interface SearchResult<T> {
|
|
1129
|
+
ResultList: T[];
|
|
339
1130
|
start: number;
|
|
340
|
-
|
|
1131
|
+
numFound: number;
|
|
341
1132
|
}
|
|
342
1133
|
interface SearchParameters {
|
|
343
1134
|
searchString?: string;
|
|
@@ -397,17 +1188,17 @@ interface APIError {
|
|
|
397
1188
|
* Base error class for all NDEx API errors
|
|
398
1189
|
*/
|
|
399
1190
|
declare class NDExError extends Error {
|
|
400
|
-
statusCode?: number;
|
|
401
|
-
errorCode?: string;
|
|
402
|
-
description?: string;
|
|
403
|
-
constructor(message: string, statusCode?: number, errorCode?: string, description?: string);
|
|
1191
|
+
statusCode?: number | undefined;
|
|
1192
|
+
errorCode?: string | undefined;
|
|
1193
|
+
description?: string | undefined;
|
|
1194
|
+
constructor(message: string, statusCode?: number | undefined, errorCode?: string | undefined, description?: string | undefined);
|
|
404
1195
|
}
|
|
405
1196
|
/**
|
|
406
1197
|
* Error thrown when network or request fails
|
|
407
1198
|
*/
|
|
408
1199
|
declare class NDExNetworkError extends NDExError {
|
|
409
|
-
originalError?: Error;
|
|
410
|
-
constructor(message: string, originalError?: Error);
|
|
1200
|
+
originalError?: Error | undefined;
|
|
1201
|
+
constructor(message: string, originalError?: Error | undefined);
|
|
411
1202
|
}
|
|
412
1203
|
/**
|
|
413
1204
|
* Error thrown when authentication fails
|
|
@@ -471,6 +1262,55 @@ interface NDExObjectUpdateStatus {
|
|
|
471
1262
|
uuid: string;
|
|
472
1263
|
modificationTime: number;
|
|
473
1264
|
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Items in a file list returned for a folder or user account
|
|
1267
|
+
*
|
|
1268
|
+
* @property uuid - Unique identifier of the file
|
|
1269
|
+
* @property type - Type of the file (folder, network, or shortcut)
|
|
1270
|
+
* @property name - Name of the file (optional for some items)
|
|
1271
|
+
* @property modificationTime - Last modification timestamp
|
|
1272
|
+
* @property updatedBy - Username of the user who last updated the file (optional)
|
|
1273
|
+
* @property attributes - Additional attributes associated with the file
|
|
1274
|
+
* @property isShared - Whether the file is shared (optional)
|
|
1275
|
+
* @property isReadOnly - Whether the file is read-only (networks only, optional)
|
|
1276
|
+
* @property warnings - Array of warning messages (networks only, optional)
|
|
1277
|
+
* @property isCompleted - Whether the file processing is completed (networks only, optional)
|
|
1278
|
+
* @property errorMessage - Error message if file has errors (optional)
|
|
1279
|
+
*/
|
|
1280
|
+
interface FileListItem {
|
|
1281
|
+
uuid: string;
|
|
1282
|
+
name?: string;
|
|
1283
|
+
type: NDExFileType;
|
|
1284
|
+
modificationTime: number;
|
|
1285
|
+
attributes: any;
|
|
1286
|
+
updatedBy?: string;
|
|
1287
|
+
owner?: string;
|
|
1288
|
+
ownerUUID?: string;
|
|
1289
|
+
visibility?: Visibility;
|
|
1290
|
+
edges?: number;
|
|
1291
|
+
permission?: Permission;
|
|
1292
|
+
isReadOnly?: boolean;
|
|
1293
|
+
isShared?: boolean;
|
|
1294
|
+
warnings?: string[];
|
|
1295
|
+
isCompleted?: boolean;
|
|
1296
|
+
errorMessage?: string;
|
|
1297
|
+
isValid?: boolean;
|
|
1298
|
+
DOI: string;
|
|
1299
|
+
}
|
|
1300
|
+
/**
|
|
1301
|
+
* Shortcut object structure returned from shortcut operations
|
|
1302
|
+
*
|
|
1303
|
+
* @property name - Name of the shortcut
|
|
1304
|
+
* @property parent - UUID of the parent folder (optional)
|
|
1305
|
+
* @property target - UUID of the target object
|
|
1306
|
+
* @property targetType - File type of the target object
|
|
1307
|
+
*/
|
|
1308
|
+
interface Shortcut {
|
|
1309
|
+
name: string;
|
|
1310
|
+
parent?: string;
|
|
1311
|
+
target: string;
|
|
1312
|
+
targetType: NDExFileType;
|
|
1313
|
+
}
|
|
474
1314
|
|
|
475
1315
|
/**
|
|
476
1316
|
* HTTPService - Core HTTP client for NDEx API communication
|
|
@@ -547,9 +1387,9 @@ declare class HTTPService {
|
|
|
547
1387
|
getConfig(): NDExClientConfig;
|
|
548
1388
|
/**
|
|
549
1389
|
* Get current authentication type
|
|
550
|
-
* @returns The type of authentication configured (
|
|
1390
|
+
* @returns The type of authentication configured (AuthType), or undefined if no auth is configured
|
|
551
1391
|
*/
|
|
552
|
-
getAuthType():
|
|
1392
|
+
getAuthType(): AuthType | undefined;
|
|
553
1393
|
/**
|
|
554
1394
|
* Get ID token from OAuth authentication
|
|
555
1395
|
* @returns The ID token if OAuth auth is configured, undefined otherwise
|
|
@@ -714,15 +1554,6 @@ declare class NetworkServiceV3 {
|
|
|
714
1554
|
* @returns Promise resolving to raw CX2 network data that may be fragmented
|
|
715
1555
|
*/
|
|
716
1556
|
getRawCX2Network(networkUUID: string, options?: AccessParams): Promise<CX2Network$1>;
|
|
717
|
-
/**
|
|
718
|
-
* Create network DOI
|
|
719
|
-
*
|
|
720
|
-
* @param networkUUID - The UUID of the network to create a DOI for
|
|
721
|
-
* @param key - DOI creation key
|
|
722
|
-
* @param email - Email address for DOI registration
|
|
723
|
-
* @returns Promise resolving to a confirmation message string from the server
|
|
724
|
-
*/
|
|
725
|
-
createNetworkDOI(networkUUID: string, key: string, email: string): Promise<string>;
|
|
726
1557
|
/**
|
|
727
1558
|
* Get attributes of selected nodes
|
|
728
1559
|
*
|
|
@@ -757,7 +1588,7 @@ declare class NetworkServiceV3 {
|
|
|
757
1588
|
/**
|
|
758
1589
|
* Search networks with V3 enhanced features
|
|
759
1590
|
*/
|
|
760
|
-
searchNetworks(searchParams?: SearchParameters): Promise<SearchResult
|
|
1591
|
+
searchNetworks(searchParams?: SearchParameters): Promise<SearchResult<NetworkSummaryV3>>;
|
|
761
1592
|
/**
|
|
762
1593
|
* Get network as CX2Network object with utilities
|
|
763
1594
|
*/
|
|
@@ -766,7 +1597,7 @@ declare class NetworkServiceV3 {
|
|
|
766
1597
|
* Create new network from CX2
|
|
767
1598
|
*/
|
|
768
1599
|
createNetworkFromCX2(cx2Data: CX2Network$1 | CX2Network, options?: {
|
|
769
|
-
visibility?:
|
|
1600
|
+
visibility?: Visibility;
|
|
770
1601
|
folderId?: string;
|
|
771
1602
|
}): Promise<NDExObjectUpdateStatus>;
|
|
772
1603
|
/**
|
|
@@ -774,16 +1605,29 @@ declare class NetworkServiceV3 {
|
|
|
774
1605
|
*/
|
|
775
1606
|
updateNetworkCX2(networkUUID: string, cx2Data: CX2Network$1 | CX2Network): Promise<NDExObjectUpdateStatus>;
|
|
776
1607
|
/**
|
|
777
|
-
* Upload
|
|
1608
|
+
* Upload CX2 network via multipart/form-data
|
|
1609
|
+
*
|
|
1610
|
+
* Server endpoint: POST /v3/networks
|
|
1611
|
+
* Consumes: multipart/form-data
|
|
1612
|
+
* Form field: 'CXNetworkStream' (the CX2 content)
|
|
1613
|
+
* Query params: visibility, folderId
|
|
1614
|
+
* Returns: NdexObjectUpdateStatus
|
|
778
1615
|
*/
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
name?: string;
|
|
1616
|
+
uploadCX2Network(cx2: File | Blob | Buffer | string | NodeJS.ReadableStream, options?: {
|
|
1617
|
+
visibility?: Visibility;
|
|
1618
|
+
folderId?: string;
|
|
783
1619
|
onProgress?: (progress: number) => void;
|
|
784
|
-
}): Promise<
|
|
785
|
-
|
|
786
|
-
|
|
1620
|
+
}): Promise<NDExObjectUpdateStatus>;
|
|
1621
|
+
/**
|
|
1622
|
+
* Upload network file (Deprecated convenience wrapper)
|
|
1623
|
+
*
|
|
1624
|
+
* Delegates to uploadCX2Network(). Kept for backward compatibility.
|
|
1625
|
+
*/
|
|
1626
|
+
uploadNetworkFile(file: File | Blob | Buffer | string | NodeJS.ReadableStream, options?: {
|
|
1627
|
+
visibility?: Visibility;
|
|
1628
|
+
onProgress?: (progress: number) => void;
|
|
1629
|
+
folderId?: string;
|
|
1630
|
+
}): Promise<NDExObjectUpdateStatus>;
|
|
787
1631
|
/**
|
|
788
1632
|
* Get network metadata (V3 enhanced)
|
|
789
1633
|
*/
|
|
@@ -796,6 +1640,12 @@ declare class NetworkServiceV3 {
|
|
|
796
1640
|
* Get network aspect (specific CX2 aspect)
|
|
797
1641
|
*/
|
|
798
1642
|
getNetworkAspect(networkUUID: string, aspectName: string, options?: AccessParams): Promise<any>;
|
|
1643
|
+
/**
|
|
1644
|
+
* Delete network
|
|
1645
|
+
* @param networkUUID - The UUID of the network to delete
|
|
1646
|
+
* @param permanent - If true, permanently delete the network. If false (default), soft delete to trash for 30 days
|
|
1647
|
+
*/
|
|
1648
|
+
deleteNetwork(networkUUID: string, permanent?: boolean): Promise<void>;
|
|
799
1649
|
}
|
|
800
1650
|
|
|
801
1651
|
/**
|
|
@@ -821,6 +1671,40 @@ declare class NetworkServiceV2 {
|
|
|
821
1671
|
* Get network summary by UUID
|
|
822
1672
|
*/
|
|
823
1673
|
getNetworkSummary(networkUUID: string, options?: AccessParams): Promise<NetworkSummaryV2>;
|
|
1674
|
+
/**
|
|
1675
|
+
* Update network summary
|
|
1676
|
+
*
|
|
1677
|
+
* Updates the summary information for an existing network. This allows modification
|
|
1678
|
+
* of network metadata such as name, description, visibility, and other summary properties
|
|
1679
|
+
* without updating the actual network content (nodes/edges).
|
|
1680
|
+
*
|
|
1681
|
+
* @param networkUUID - The UUID of the network to update
|
|
1682
|
+
* @param networkSummary - The updated network summary object containing the new metadata
|
|
1683
|
+
* @returns Promise that resolves when the update is complete
|
|
1684
|
+
*
|
|
1685
|
+
* @example
|
|
1686
|
+
* ```typescript
|
|
1687
|
+
* // Update network name and description
|
|
1688
|
+
* await networkService.updateNetworkSummary('12345678-1234-1234-1234-123456789abc', {
|
|
1689
|
+
* externalId: '12345678-1234-1234-1234-123456789abc',
|
|
1690
|
+
* name: 'Updated Network Name',
|
|
1691
|
+
* description: 'Updated network description',
|
|
1692
|
+
* nodeCount: 150,
|
|
1693
|
+
* edgeCount: 200,
|
|
1694
|
+
* visibility: 'PUBLIC',
|
|
1695
|
+
* owner: 'username',
|
|
1696
|
+
* ownerUUID: 'user-uuid',
|
|
1697
|
+
* creationTime: 1234567890,
|
|
1698
|
+
* modificationTime: 1234567890,
|
|
1699
|
+
* isReadOnly: false,
|
|
1700
|
+
* isValid: true,
|
|
1701
|
+
* hasLayout: true,
|
|
1702
|
+
* hasSample: false,
|
|
1703
|
+
* updatedBy: 'username'
|
|
1704
|
+
* });
|
|
1705
|
+
* ```
|
|
1706
|
+
*/
|
|
1707
|
+
updateNetworkSummary(networkUUID: string, networkSummary: NetworkSummaryV2): Promise<void>;
|
|
824
1708
|
/**
|
|
825
1709
|
* Copy network
|
|
826
1710
|
*
|
|
@@ -863,7 +1747,7 @@ declare class NetworkServiceV2 {
|
|
|
863
1747
|
* @returns Promise resolving to the UUID string of the newly created network
|
|
864
1748
|
*/
|
|
865
1749
|
createNetworkFromRawCX1(rawCX: any[], options?: {
|
|
866
|
-
visibility?:
|
|
1750
|
+
visibility?: Visibility;
|
|
867
1751
|
}): Promise<string>;
|
|
868
1752
|
/**
|
|
869
1753
|
* Update network from raw CX1 data
|
|
@@ -911,7 +1795,7 @@ declare class NetworkServiceV2 {
|
|
|
911
1795
|
/**
|
|
912
1796
|
* Grant network permission to user
|
|
913
1797
|
*/
|
|
914
|
-
grantNetworkPermission(networkUUID: string, userUUID: string, permission:
|
|
1798
|
+
grantNetworkPermission(networkUUID: string, userUUID: string, permission: Permission): Promise<void>;
|
|
915
1799
|
/**
|
|
916
1800
|
* Revoke network permission from user
|
|
917
1801
|
*/
|
|
@@ -1004,9 +1888,78 @@ declare class UnifiedNetworkService {
|
|
|
1004
1888
|
private v3Service;
|
|
1005
1889
|
constructor(http: HTTPService);
|
|
1006
1890
|
/**
|
|
1007
|
-
* Get network summary using
|
|
1891
|
+
* Get network summary using V3 API
|
|
1892
|
+
*
|
|
1893
|
+
* Retrieves comprehensive summary information for a network including metadata,
|
|
1894
|
+
* statistics, permissions, and other network properties using the V3 API.
|
|
1895
|
+
*
|
|
1896
|
+
* @param networkUUID - The UUID of the network to get summary for
|
|
1897
|
+
* @param options - Access options including optional access key for private networks
|
|
1898
|
+
* @returns Promise resolving to NetworkSummaryV3 object containing network summary information
|
|
1008
1899
|
*/
|
|
1009
1900
|
getNetworkSummary(networkUUID: string, options?: AccessParams): Promise<NetworkSummaryV3>;
|
|
1901
|
+
/**
|
|
1902
|
+
* Update network summary using V3 to V2 transformation
|
|
1903
|
+
*
|
|
1904
|
+
* Updates network summary information by accepting a NetworkSummaryV3 object,
|
|
1905
|
+
* transforming it to the V2 format, and calling the V2 API endpoint.
|
|
1906
|
+
* This provides a unified interface for updating network summaries while
|
|
1907
|
+
* maintaining compatibility with the existing V2 backend infrastructure.
|
|
1908
|
+
*
|
|
1909
|
+
* @param networkUUID - The UUID of the network to update
|
|
1910
|
+
* @param networkSummaryV3 - The updated network summary in V3 format
|
|
1911
|
+
* @returns Promise that resolves when the update is complete
|
|
1912
|
+
*
|
|
1913
|
+
* @example
|
|
1914
|
+
* ```typescript
|
|
1915
|
+
* // Update network summary using V3 format
|
|
1916
|
+
* const summaryV3: NetworkSummaryV3 = {
|
|
1917
|
+
* externalId: '12345678-1234-1234-1234-123456789abc',
|
|
1918
|
+
* name: 'Updated Network Name',
|
|
1919
|
+
* description: 'Updated network description',
|
|
1920
|
+
* nodeCount: 150,
|
|
1921
|
+
* edgeCount: 200,
|
|
1922
|
+
* visibility: 'PUBLIC',
|
|
1923
|
+
* owner: 'username',
|
|
1924
|
+
* ownerUUID: 'user-uuid',
|
|
1925
|
+
* creationTime: 1234567890,
|
|
1926
|
+
* modificationTime: 1234567890,
|
|
1927
|
+
* isReadOnly: false,
|
|
1928
|
+
* isValid: true,
|
|
1929
|
+
* hasLayout: true,
|
|
1930
|
+
* hasSample: false,
|
|
1931
|
+
* updatedBy: 'username',
|
|
1932
|
+
* properties: {
|
|
1933
|
+
* category: { t: 'string', v: 'biological' },
|
|
1934
|
+
* version: { t: 'double', v: 2.1 }
|
|
1935
|
+
* }
|
|
1936
|
+
* };
|
|
1937
|
+
*
|
|
1938
|
+
* await client.networks.updateNetworkSummary('network-uuid', summaryV3);
|
|
1939
|
+
* ```
|
|
1940
|
+
*/
|
|
1941
|
+
updateNetworkSummary(networkUUID: string, networkSummaryV3: NetworkSummaryV3): Promise<void>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Transform NetworkSummaryV3 to NetworkSummaryV2 format
|
|
1944
|
+
*
|
|
1945
|
+
* Converts V3 properties format (CX2-style object map) to V2 properties format (CX1-style array).
|
|
1946
|
+
* This transformation is necessary because the V2 API expects properties in the older array format.
|
|
1947
|
+
* Special handling for "version" attribute - moved to top-level version field.
|
|
1948
|
+
*
|
|
1949
|
+
* @param v3Summary - Network summary in V3 format with CX2-style properties
|
|
1950
|
+
* @returns Network summary in V2 format with CX1-style properties
|
|
1951
|
+
*/
|
|
1952
|
+
private transformV3ToV2;
|
|
1953
|
+
/**
|
|
1954
|
+
* Convert CX2 property values to strings
|
|
1955
|
+
*
|
|
1956
|
+
* For singleton values, converts to string directly.
|
|
1957
|
+
* For list type values, converts each element to string.
|
|
1958
|
+
*
|
|
1959
|
+
* @param value - The CX2 property value (can be any type or array)
|
|
1960
|
+
* @returns String representation of the value
|
|
1961
|
+
*/
|
|
1962
|
+
private convertValueToString;
|
|
1010
1963
|
/**
|
|
1011
1964
|
* Search networks using specified API version
|
|
1012
1965
|
* NOTE: This method is temporarily commented out as the V2 searchNetworks
|
|
@@ -1022,17 +1975,46 @@ declare class UnifiedNetworkService {
|
|
|
1022
1975
|
getRawCX2Network(networkUUID: string, options?: AccessParams): Promise<CX2Network$1>;
|
|
1023
1976
|
/**
|
|
1024
1977
|
* Delete network
|
|
1978
|
+
* @param networkUUID - The UUID of the network to delete
|
|
1979
|
+
* @param permanent - If true, permanently delete the network. If false (default), soft delete to trash for 30 days
|
|
1025
1980
|
*/
|
|
1026
|
-
deleteNetwork(networkUUID: string): Promise<void>;
|
|
1981
|
+
deleteNetwork(networkUUID: string, permanent?: boolean): Promise<void>;
|
|
1027
1982
|
/**
|
|
1028
1983
|
* Create network DOI
|
|
1029
1984
|
*
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
*
|
|
1033
|
-
*
|
|
1985
|
+
* Requests a DOI (Digital Object Identifier) for a network. A reference is not required to request a DOI.
|
|
1986
|
+
* If you want the ability to add or modify a reference later on, set `isCertified` to true.
|
|
1987
|
+
* When certified, the network will be permanently locked, made publicly visible, and no further changes
|
|
1988
|
+
* will be allowed.
|
|
1989
|
+
*
|
|
1990
|
+
* @param params - DOI request parameters
|
|
1991
|
+
* @param params.networkId - UUID of the network to create a DOI for
|
|
1992
|
+
* @param params.isCertified - If true, network will be permanently locked and made public with no further changes allowed
|
|
1993
|
+
* @param params.contactEmail - Email address that the DOI creation confirmation should be sent to
|
|
1994
|
+
* @returns Promise that resolves when the DOI request is submitted
|
|
1995
|
+
*
|
|
1996
|
+
* @example
|
|
1997
|
+
* ```typescript
|
|
1998
|
+
* // Request a DOI for a network without certification
|
|
1999
|
+
* await client.networks.createNetworkDOI({
|
|
2000
|
+
* networkId: '12345678-1234-1234-1234-123456789abc',
|
|
2001
|
+
* isCertified: false,
|
|
2002
|
+
* contactEmail: 'user@example.com'
|
|
2003
|
+
* });
|
|
2004
|
+
*
|
|
2005
|
+
* // Request a certified DOI (network will be permanently locked)
|
|
2006
|
+
* await client.networks.createNetworkDOI({
|
|
2007
|
+
* networkId: '12345678-1234-1234-1234-123456789abc',
|
|
2008
|
+
* isCertified: true,
|
|
2009
|
+
* contactEmail: 'user@example.com'
|
|
2010
|
+
* });
|
|
2011
|
+
* ```
|
|
1034
2012
|
*/
|
|
1035
|
-
createNetworkDOI(
|
|
2013
|
+
createNetworkDOI(params: {
|
|
2014
|
+
networkId: string;
|
|
2015
|
+
isCertified: boolean;
|
|
2016
|
+
contactEmail: string;
|
|
2017
|
+
}): Promise<void>;
|
|
1036
2018
|
/**
|
|
1037
2019
|
* Get attributes of selected nodes
|
|
1038
2020
|
*
|
|
@@ -1130,20 +2112,71 @@ declare class UnifiedNetworkService {
|
|
|
1130
2112
|
* @param folderId - Target folder ID to move networks to
|
|
1131
2113
|
* @returns Promise resolving when networks are moved
|
|
1132
2114
|
*/
|
|
1133
|
-
moveNetworks(networkIds: string[], folderId
|
|
2115
|
+
moveNetworks(networkIds: string[], folderId?: string): Promise<any>;
|
|
1134
2116
|
/**
|
|
1135
|
-
* Set
|
|
2117
|
+
* Set visibility for multiple files (networks, folders, shortcuts)
|
|
1136
2118
|
*
|
|
1137
|
-
* Changes visibility settings for multiple
|
|
1138
|
-
*
|
|
2119
|
+
* Changes visibility settings for multiple NDEx objects using the V3 API.
|
|
2120
|
+
* This function can update visibility for any combination of networks, folders, and shortcuts.
|
|
2121
|
+
* Files are validated to ensure proper UUID format and valid file types.
|
|
1139
2122
|
*
|
|
1140
|
-
* @param files - Object containing
|
|
1141
|
-
* @param
|
|
1142
|
-
* @
|
|
2123
|
+
* @param files - Object containing a 'files' property with UUID-to-filetype mappings
|
|
2124
|
+
* @param files.files - Record where keys are UUIDs and values are NDExFileType ('NETWORK', 'FOLDER', or 'SHORTCUT')
|
|
2125
|
+
* @param visibility - Visibility setting: 'PUBLIC', 'PRIVATE', or 'UNLISTED'
|
|
2126
|
+
* @returns Promise resolving when visibility is successfully updated
|
|
2127
|
+
* @throws Error if files validation fails or API request fails
|
|
2128
|
+
*
|
|
2129
|
+
* @example
|
|
2130
|
+
* ```typescript
|
|
2131
|
+
* // Set multiple files to public visibility
|
|
2132
|
+
* await client.networks.setNetworksVisibility({
|
|
2133
|
+
* files: {
|
|
2134
|
+
* '12345678-1234-1234-1234-123456789abc': 'NETWORK',
|
|
2135
|
+
* '87654321-4321-4321-4321-876543210fed': 'FOLDER',
|
|
2136
|
+
* '11111111-2222-3333-4444-555555555555': 'SHORTCUT'
|
|
2137
|
+
* }
|
|
2138
|
+
* }, 'PUBLIC');
|
|
2139
|
+
*
|
|
2140
|
+
* // Set networks to private visibility
|
|
2141
|
+
* await client.networks.setNetworksVisibility({
|
|
2142
|
+
* files: {
|
|
2143
|
+
* 'network-uuid-1': 'NETWORK',
|
|
2144
|
+
* 'network-uuid-2': 'NETWORK'
|
|
2145
|
+
* }
|
|
2146
|
+
* }, 'PRIVATE');
|
|
2147
|
+
* ```
|
|
1143
2148
|
*/
|
|
1144
2149
|
setNetworksVisibility(files: {
|
|
1145
|
-
files: Record<string,
|
|
1146
|
-
}, visibility:
|
|
2150
|
+
files: Record<string, NDExFileType>;
|
|
2151
|
+
}, visibility: Visibility): Promise<any>;
|
|
2152
|
+
/**
|
|
2153
|
+
* Get network access key
|
|
2154
|
+
*
|
|
2155
|
+
* Retrieves the access key for a network if it has been enabled for public access.
|
|
2156
|
+
* When a network has an access key enabled, it can be accessed by others without
|
|
2157
|
+
* explicit permissions using this key.
|
|
2158
|
+
*
|
|
2159
|
+
* @param networkUUID - The UUID of the network to get the access key for
|
|
2160
|
+
* @returns Promise resolving to an object with accessKey property when enabled,
|
|
2161
|
+
* or null when access key is not enabled on this network
|
|
2162
|
+
*
|
|
2163
|
+
* @example
|
|
2164
|
+
* ```typescript
|
|
2165
|
+
* // Check if network has an access key
|
|
2166
|
+
* const result = await client.networks.getNetworkAccessKey('12345678-1234-1234-1234-123456789abc');
|
|
2167
|
+
*
|
|
2168
|
+
* if (result) {
|
|
2169
|
+
* console.log('Access key:', result.accessKey); // "sdfdfdfsdfdsfs"
|
|
2170
|
+
* // Use the access key to access the network
|
|
2171
|
+
* const networkData = await client.networks.getRawCX2Network(networkUUID, { accessKey: result.accessKey });
|
|
2172
|
+
* } else {
|
|
2173
|
+
* console.log('No access key enabled for this network');
|
|
2174
|
+
* }
|
|
2175
|
+
* ```
|
|
2176
|
+
*/
|
|
2177
|
+
getNetworkAccessKey(networkUUID: string): Promise<{
|
|
2178
|
+
accessKey: string;
|
|
2179
|
+
} | null>;
|
|
1147
2180
|
/**
|
|
1148
2181
|
* Get random edges from network (migrated from original NDEx.js)
|
|
1149
2182
|
*
|
|
@@ -1158,13 +2191,13 @@ declare class UnifiedNetworkService {
|
|
|
1158
2191
|
*/
|
|
1159
2192
|
getRandomEdges(networkUUID: string, limit: number, accessKey?: string): Promise<CX2Edge[]>;
|
|
1160
2193
|
/**
|
|
1161
|
-
* Validate
|
|
2194
|
+
* Validate UUID format in file data (helper method for file operations)
|
|
1162
2195
|
*
|
|
1163
|
-
* Validates
|
|
1164
|
-
*
|
|
2196
|
+
* Validates that all UUID keys in the files object follow proper UUID format.
|
|
2197
|
+
* TypeScript ensures object structure and file type validity at compile time.
|
|
1165
2198
|
*
|
|
1166
|
-
* @param data - Data object
|
|
1167
|
-
* @throws Error if validation fails
|
|
2199
|
+
* @param data - Data object containing files property with UUID keys and NDExFileType values
|
|
2200
|
+
* @throws Error if UUID validation fails
|
|
1168
2201
|
*/
|
|
1169
2202
|
private validateShareData;
|
|
1170
2203
|
/**
|
|
@@ -1255,7 +2288,7 @@ declare class UnifiedNetworkService {
|
|
|
1255
2288
|
*
|
|
1256
2289
|
* @param cx2Data - Raw CX2 network data as an object or CX2Network instance
|
|
1257
2290
|
* @param options - Creation options including visibility and folderId
|
|
1258
|
-
* @param options.visibility - Network visibility: 'PUBLIC' or '
|
|
2291
|
+
* @param options.visibility - Network visibility: 'PUBLIC', 'PRIVATE', or 'UNLISTED' (default: 'PRIVATE')
|
|
1259
2292
|
* @param options.folderId - UUID of the folder to create the network in. If omitted, network is created in user's home directory
|
|
1260
2293
|
* @returns Promise resolving to NDExObjectUpdateStatus with uuid and modificationTime
|
|
1261
2294
|
*
|
|
@@ -1267,14 +2300,14 @@ declare class UnifiedNetworkService {
|
|
|
1267
2300
|
*
|
|
1268
2301
|
* // Create public network from raw CX2 data in a specific folder
|
|
1269
2302
|
* const publicResult = await client.networks.createNetworkFromRawCX2(cx2Data, {
|
|
1270
|
-
* visibility: 'PUBLIC',
|
|
2303
|
+
* visibility: 'PUBLIC' as Visibility,
|
|
1271
2304
|
* folderId: '87654321-4321-4321-4321-876543210fed'
|
|
1272
2305
|
* });
|
|
1273
2306
|
* console.log(publicResult.uuid);
|
|
1274
2307
|
* ```
|
|
1275
2308
|
*/
|
|
1276
2309
|
createNetworkFromRawCX2(cx2Data: CX2Network$1 | CX2Network, options?: {
|
|
1277
|
-
visibility?:
|
|
2310
|
+
visibility?: Visibility;
|
|
1278
2311
|
folderId?: string;
|
|
1279
2312
|
}): Promise<NDExObjectUpdateStatus>;
|
|
1280
2313
|
/**
|
|
@@ -1294,6 +2327,26 @@ declare class UnifiedNetworkService {
|
|
|
1294
2327
|
* ```
|
|
1295
2328
|
*/
|
|
1296
2329
|
updateNetworkFromRawCX2(networkUUID: string, rawCX2: CX2Network$1 | any): Promise<void>;
|
|
2330
|
+
/**
|
|
2331
|
+
* Set read-only flag on a network
|
|
2332
|
+
*
|
|
2333
|
+
* Sets or unsets the read-only flag for a network using the V2 API.
|
|
2334
|
+
* When a network is marked as read-only, it cannot be modified.
|
|
2335
|
+
*
|
|
2336
|
+
* @param networkId - The UUID of the network to modify
|
|
2337
|
+
* @param readOnly - true to set the network as read-only, false to allow modifications
|
|
2338
|
+
* @returns Promise resolving when the read-only status is updated
|
|
2339
|
+
*
|
|
2340
|
+
* @example
|
|
2341
|
+
* ```typescript
|
|
2342
|
+
* // Set network as read-only
|
|
2343
|
+
* await client.networks.setReadOnly('network-uuid', true);
|
|
2344
|
+
*
|
|
2345
|
+
* // Allow network modifications
|
|
2346
|
+
* await client.networks.setReadOnly('network-uuid', false);
|
|
2347
|
+
* ```
|
|
2348
|
+
*/
|
|
2349
|
+
setReadOnly(networkId: string, readOnly: boolean): Promise<void>;
|
|
1297
2350
|
/**
|
|
1298
2351
|
* Access to underlying service instances for advanced usage
|
|
1299
2352
|
*/
|
|
@@ -1301,67 +2354,6 @@ declare class UnifiedNetworkService {
|
|
|
1301
2354
|
get v3(): NetworkServiceV3;
|
|
1302
2355
|
}
|
|
1303
2356
|
|
|
1304
|
-
interface ShareData {
|
|
1305
|
-
files: Record<string, 'NETWORK' | 'FOLDER' | 'SHORTCUT'>;
|
|
1306
|
-
}
|
|
1307
|
-
interface MemberData {
|
|
1308
|
-
members: Record<string, 'READ' | 'WRITE'>;
|
|
1309
|
-
}
|
|
1310
|
-
/**
|
|
1311
|
-
* FilesService - NDEx file operations and task management
|
|
1312
|
-
* Handles file uploads, downloads, exports, and asynchronous task tracking
|
|
1313
|
-
*/
|
|
1314
|
-
declare class FilesService {
|
|
1315
|
-
private http;
|
|
1316
|
-
constructor(http: HTTPService);
|
|
1317
|
-
/**
|
|
1318
|
-
* Copy a file to a different location
|
|
1319
|
-
* @param fromUuid - Source file UUID
|
|
1320
|
-
* @param toPath - Target path
|
|
1321
|
-
* @param type - File type (NETWORK, FOLDER, SHORTCUT)
|
|
1322
|
-
* @param accessKey - Optional access key for protected files
|
|
1323
|
-
*/
|
|
1324
|
-
copyFile(fromUuid: string, toPath: string, type: string, accessKey?: string): Promise<any>;
|
|
1325
|
-
/** Get file count statistics for the current user */
|
|
1326
|
-
getCount(): Promise<any>;
|
|
1327
|
-
/** Get files in the trash for the current user */
|
|
1328
|
-
getTrash(): Promise<any>;
|
|
1329
|
-
/** Permanently delete all files in trash */
|
|
1330
|
-
emptyTrash(): Promise<any>;
|
|
1331
|
-
/**
|
|
1332
|
-
* Permanently delete a file from trash
|
|
1333
|
-
* @param fileId - File UUID to permanently delete
|
|
1334
|
-
*/
|
|
1335
|
-
permanentlyDeleteFile(fileId: string): Promise<any>;
|
|
1336
|
-
/**
|
|
1337
|
-
* Restore files from trash
|
|
1338
|
-
* @param networkIds - Array of network UUIDs to restore
|
|
1339
|
-
* @param folderIds - Array of folder UUIDs to restore
|
|
1340
|
-
* @param shortcutIds - Array of shortcut UUIDs to restore
|
|
1341
|
-
*/
|
|
1342
|
-
restoreFile(networkIds: string[], folderIds: string[], shortcutIds: string[]): Promise<any>;
|
|
1343
|
-
private _validateShareData;
|
|
1344
|
-
private _validateMemberData;
|
|
1345
|
-
updateMember(files: ShareData['files'], members: MemberData['members']): Promise<any>;
|
|
1346
|
-
listMembers(files: any): Promise<any>;
|
|
1347
|
-
transferOwnership(files: ShareData['files'], newOwner: string): Promise<any>;
|
|
1348
|
-
listShares(limit?: number): Promise<any>;
|
|
1349
|
-
share(files: ShareData['files']): Promise<any>;
|
|
1350
|
-
unshare(files: ShareData['files']): Promise<any>;
|
|
1351
|
-
getFolders(limit?: number): Promise<any>;
|
|
1352
|
-
createFolder(name: string, parentFolderId?: string): Promise<any>;
|
|
1353
|
-
getFolder(folderId: string, accessKey?: string): Promise<any>;
|
|
1354
|
-
updateFolder(folderId: string, name: string, parentFolderId?: string): Promise<any>;
|
|
1355
|
-
deleteFolder(folderId: string): Promise<any>;
|
|
1356
|
-
getFolderCount(folderId: string, accessKey?: string): Promise<any>;
|
|
1357
|
-
getFolderList(folderId: string, accessKey?: string, format?: string, type?: string): Promise<any>;
|
|
1358
|
-
getShortcuts(limit?: number): Promise<any>;
|
|
1359
|
-
createShortcut(name: string, parentFolderId?: string, targetId?: string, targetType?: string): Promise<any>;
|
|
1360
|
-
getShortcut(shortcutId: string, accessKey?: string): Promise<any>;
|
|
1361
|
-
updateShortcut(shortcutId: string, name: string, parentFolderId?: string, targetId?: string, targetType?: string): Promise<any>;
|
|
1362
|
-
deleteShortcut(shortcutId: string): Promise<any>;
|
|
1363
|
-
}
|
|
1364
|
-
|
|
1365
2357
|
/**
|
|
1366
2358
|
* WorkspaceService - NDEx CyWeb workspace operations
|
|
1367
2359
|
*
|
|
@@ -1563,9 +2555,9 @@ declare class UserService {
|
|
|
1563
2555
|
* @param searchTerms - Search string to find users
|
|
1564
2556
|
* @param start - Starting offset for pagination (optional)
|
|
1565
2557
|
* @param size - Maximum number of results to return (optional)
|
|
1566
|
-
* @returns
|
|
2558
|
+
* @returns Search result containing users matching the search criteria
|
|
1567
2559
|
*/
|
|
1568
|
-
searchUsers(searchTerms: string, start?: number, size?: number): Promise<NDExUser
|
|
2560
|
+
searchUsers(searchTerms: string, start?: number, size?: number): Promise<SearchResult<NDExUser>>;
|
|
1569
2561
|
/**
|
|
1570
2562
|
* Get networks for a user's account page (equivalent to getAccountPageNetworks from legacy client)
|
|
1571
2563
|
*
|
|
@@ -1576,6 +2568,17 @@ declare class UserService {
|
|
|
1576
2568
|
* @note This function requires authentication. The auth attribute must be set in the client configuration.
|
|
1577
2569
|
*/
|
|
1578
2570
|
getAccountPageNetworks(userUUID: string, offset?: number, limit?: number): Promise<NetworkSummaryV2[]>;
|
|
2571
|
+
/**
|
|
2572
|
+
* Get User's Home Content
|
|
2573
|
+
* Returns the content of a user's home folder including networks, folders, and shortcuts.
|
|
2574
|
+
* Shows different content based on authentication status and relationship to the user.
|
|
2575
|
+
*
|
|
2576
|
+
* @param userUuid - User UUID to get home content for
|
|
2577
|
+
* @param format - Format parameter: 'update' or 'compact' (default: "update")
|
|
2578
|
+
* @returns List of file items in the user's home folder
|
|
2579
|
+
* @note This function requires authentication. The auth attribute must be set in the client configuration.
|
|
2580
|
+
*/
|
|
2581
|
+
getUserHomeContent(userUuid: string, format?: 'update' | 'compact'): Promise<FileListItem[]>;
|
|
1579
2582
|
/**
|
|
1580
2583
|
* Delete user account (server validates userid matches authenticated user)
|
|
1581
2584
|
* @param userUUID - User UUID to delete (must match authenticated user)
|
|
@@ -1590,8 +2593,7 @@ declare class UserService {
|
|
|
1590
2593
|
* Handles system administration and user management for admin users
|
|
1591
2594
|
*/
|
|
1592
2595
|
declare class AdminService {
|
|
1593
|
-
|
|
1594
|
-
constructor(http: HTTPService);
|
|
2596
|
+
constructor();
|
|
1595
2597
|
}
|
|
1596
2598
|
|
|
1597
2599
|
/**
|
|
@@ -1777,7 +2779,7 @@ declare class CyNDExService {
|
|
|
1777
2779
|
* @param uuid - Target NDEx network UUID to update
|
|
1778
2780
|
* @returns Promise resolving to update result
|
|
1779
2781
|
*/
|
|
1780
|
-
putCytoscapeNetworkInNDEx(suid: string, uuid: string): Promise<any>;
|
|
2782
|
+
putCytoscapeNetworkInNDEx(suid: string | undefined, uuid: string): Promise<any>;
|
|
1781
2783
|
}
|
|
1782
2784
|
|
|
1783
2785
|
/**
|
|
@@ -1794,14 +2796,14 @@ declare class CyNDExService {
|
|
|
1794
2796
|
* debug: true
|
|
1795
2797
|
* });
|
|
1796
2798
|
*
|
|
1797
|
-
* // Authenticate
|
|
1798
|
-
* await client.user.authenticate(
|
|
2799
|
+
* // Authenticate (requires auth config in constructor)
|
|
2800
|
+
* const user = await client.user.authenticate();
|
|
1799
2801
|
*
|
|
1800
2802
|
* // Search networks
|
|
1801
2803
|
* const results = await client.networks.searchNetworks({ searchString: 'pathway' });
|
|
1802
2804
|
*
|
|
1803
2805
|
* // Get network as CX2
|
|
1804
|
-
* const network = await client.networks.
|
|
2806
|
+
* const network = await client.networks.getRawCX2Network('network-uuid');
|
|
1805
2807
|
*
|
|
1806
2808
|
* // User operations
|
|
1807
2809
|
* const profile = await client.user.getCurrentUser();
|
|
@@ -1865,9 +2867,16 @@ declare class NDExClient {
|
|
|
1865
2867
|
*/
|
|
1866
2868
|
getConfig(): NDExClientConfig;
|
|
1867
2869
|
/**
|
|
1868
|
-
*
|
|
2870
|
+
* Get current authentication type
|
|
2871
|
+
* @returns The type of authentication configured (AuthType), or undefined if no auth is configured
|
|
1869
2872
|
*/
|
|
1870
|
-
|
|
2873
|
+
getAuthType(): AuthType | undefined;
|
|
2874
|
+
/**
|
|
2875
|
+
* Set ID token for OAuth authentication
|
|
2876
|
+
* Creates OAuth auth configuration if no auth is currently configured
|
|
2877
|
+
* @param idToken - The ID token to set
|
|
2878
|
+
*/
|
|
2879
|
+
setIdToken(idToken: string): void;
|
|
1871
2880
|
/**
|
|
1872
2881
|
* Access to version-specific network services for advanced usage
|
|
1873
2882
|
*/
|
|
@@ -1903,4 +2912,4 @@ declare class NDExClient {
|
|
|
1903
2912
|
*/
|
|
1904
2913
|
declare const version: string;
|
|
1905
2914
|
|
|
1906
|
-
export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, type SearchParameters, type SearchResult, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService,
|
|
2915
|
+
export { type APIError, type APIResponse, type AccessKeyAction, type AccessKeyResponse, type AccessParams, AdminService, AuthType, type BasicAuth, type CX1Edge, type CX1MetaDataItem, type CX1MetaDataResponse, type CX1NetworkProperty, type CX2AttributeDeclarations, type CX2AttributeSpec, type CX2Edge, type CX2EdgeBypass, type CX2ImportParams, type CX2MetaData, CX2Network, type CX2NetworkAttribute, type CX2NetworkProperties, type CX2Node, type CX2NodeBypass, type CX2Status, type CX2VisualProperty, CXDataType, CyNDExService as CyNDEx, type CyNDExAuthConfig, type CyNDExConfig, CyNDExService, type CyNDExStatusResponse, type CyWebWorkspace, type CytoscapeNetworkSummary, type DefaultVisualProperties, type ExportFormat, type ExportRequest, type FileListItem, type FilePermissionDetails, type FilePermissionList, type FileSearchParams, FilesService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, NDExFileType, type NDExImportParams, NDExNetworkError, NDExNotFoundError, type NDExObjectUpdateStatus, NDExServerError, type NDExUser, NDExValidationError, NetworkIndexLevel, type NetworkPermission, NetworkServiceV2, NetworkServiceV3, type NetworkSummaryV2, type NetworkSummaryV3, type OAuthAuth, type PaginationParams, Permission, type SearchParameters, type SearchResult, type SharingMemberRequest, type Shortcut, type TableColumnVisualStyle, type Task, type Timestamp, type UUID, UnifiedNetworkService, UserService, VPMappingType, Visibility, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };
|