@js4cytoscape/ndex-client 0.5.0-alpha.8 → 0.6.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1931 @@
1
+ import { AxiosRequestConfig } from 'axios';
2
+
3
+ /**
4
+ * Type definitions for CyNDEx (Cytoscape-NDEx Bridge) operations
5
+ */
6
+ /**
7
+ * Configuration for CyNDEx service
8
+ */
9
+ interface CyNDExConfig {
10
+ /** Port number for Cytoscape REST API (default: 1234) */
11
+ port?: number;
12
+ /** Base URL for Cytoscape REST API (default: 'http://127.0.0.1') */
13
+ cyRestBaseURL?: string;
14
+ /** NDEx server base URL (default: 'https://www.ndexbio.org') */
15
+ ndexBaseURL?: string;
16
+ }
17
+ /**
18
+ * Authentication configuration for NDEx operations
19
+ * This is used as parameters passed to Cytoscape for NDEx authentication
20
+ */
21
+ interface CyNDExAuthConfig {
22
+ type: 'basic' | 'oauth';
23
+ username?: string;
24
+ password?: string;
25
+ idToken?: string;
26
+ }
27
+ /**
28
+ * Parameters for importing NDEx network to Cytoscape
29
+ */
30
+ interface NDExImportParams {
31
+ serverUrl: string;
32
+ uuid: string;
33
+ accessKey?: string;
34
+ createView?: boolean;
35
+ username?: string;
36
+ password?: string;
37
+ idToken?: string;
38
+ }
39
+ /**
40
+ * Parameters for exporting Cytoscape network to NDEx
41
+ */
42
+ interface NDExExportParams {
43
+ serverUrl: string;
44
+ uuid?: string;
45
+ username?: string;
46
+ password?: string;
47
+ idToken?: string;
48
+ }
49
+ /**
50
+ * Cytoscape network summary response
51
+ */
52
+ interface CytoscapeNetworkSummary {
53
+ suid?: string;
54
+ title?: string;
55
+ name?: string;
56
+ nodeCount?: number;
57
+ edgeCount?: number;
58
+ selected?: boolean;
59
+ [key: string]: any;
60
+ }
61
+ /**
62
+ * CyNDEx status response
63
+ */
64
+ interface CyNDExStatusResponse {
65
+ version?: string;
66
+ status?: string;
67
+ [key: string]: any;
68
+ }
69
+ /**
70
+ * CX2 import parameters for Cytoscape
71
+ */
72
+ interface CX2ImportParams {
73
+ format: 'cx2';
74
+ collection?: string;
75
+ title?: string;
76
+ }
77
+
78
+ /**
79
+ * Core type definitions for NDEx Client Library
80
+ * Pragmatic TypeScript types allowing flexibility with any types where needed
81
+ */
82
+
83
+ interface BasicAuth {
84
+ type: 'basic';
85
+ username: string;
86
+ password: string;
87
+ }
88
+ interface OAuthAuth {
89
+ type: 'oauth';
90
+ idToken: string;
91
+ }
92
+ interface NDExAuthResponse {
93
+ token?: string;
94
+ userId?: string;
95
+ userName?: string;
96
+ isAdmin?: boolean;
97
+ permissions?: string[];
98
+ expirationTime?: number;
99
+ }
100
+ interface NDExUser {
101
+ externalId: string;
102
+ userName: string;
103
+ firstName?: string;
104
+ lastName?: string;
105
+ emailAddress?: string;
106
+ website?: string;
107
+ description?: string;
108
+ image?: string;
109
+ isIndividual?: boolean;
110
+ isVerified?: boolean;
111
+ creationTime?: number;
112
+ modificationTime?: number;
113
+ }
114
+ interface CX1MetaDataItem {
115
+ name: string;
116
+ elementCount: number;
117
+ version: string;
118
+ idCounter?: number;
119
+ [key: string]: any;
120
+ }
121
+ interface CX1MetaDataResponse {
122
+ metaData: CX1MetaDataItem[];
123
+ }
124
+ interface CX1NetworkProperty {
125
+ predicateString: string;
126
+ value: string;
127
+ dataType?: 'string' | 'integer' | 'double' | 'boolean' | 'list_of_string';
128
+ }
129
+ interface CX2NetworkProperties {
130
+ [key: string]: {
131
+ t: string;
132
+ v: any;
133
+ };
134
+ }
135
+ declare enum NetworkIndexLevel {
136
+ NONE = "NONE",
137
+ BASIC = "BASIC",
138
+ FULL = "FULL"
139
+ }
140
+ interface NetworkSummaryV2 {
141
+ externalId: string;
142
+ name: string;
143
+ description?: string;
144
+ nodeCount: number;
145
+ edgeCount: number;
146
+ visibility: 'PUBLIC' | 'PRIVATE';
147
+ owner: string;
148
+ ownerUUID: string;
149
+ creationTime: number;
150
+ modificationTime: number;
151
+ version?: string;
152
+ properties?: CX1NetworkProperty[];
153
+ isReadOnly: boolean;
154
+ isValid: boolean;
155
+ warnings?: string[];
156
+ hasLayout: boolean;
157
+ hasSample: boolean;
158
+ updatedBy: string;
159
+ errorMessage?: string;
160
+ cxFormat?: string;
161
+ cxFileSize?: number;
162
+ cx2FileSize?: number;
163
+ isShowcase?: boolean;
164
+ isCompleted?: boolean;
165
+ doi?: string;
166
+ isCertified?: boolean;
167
+ indexLevel?: NetworkIndexLevel;
168
+ parentDirUUID?: string;
169
+ showInTrash?: boolean;
170
+ subnetworkIds?: string[];
171
+ reference?: string;
172
+ organism?: string;
173
+ disease?: string;
174
+ tissue?: string;
175
+ networkType?: string[];
176
+ rightsHolder?: string;
177
+ rights?: string;
178
+ sourceFormat?: string;
179
+ }
180
+ /**
181
+ * NetworkSummaryV3 - Network summary for NDEx API v3
182
+ *
183
+ * Extends NetworkSummaryV2 but uses CX2-style properties format instead of CX1 format.
184
+ * The main difference is in how network properties are structured:
185
+ *
186
+ * | Aspect | NetworkSummaryV2 | NetworkSummaryV3 |
187
+ * |--------|------------------|------------------|
188
+ * | **Properties Format** | `CX1NetworkProperty[]` (array) | `CX2NetworkProperties` (object) |
189
+ * | **Structure** | CX1-style array of property objects | CX2-style key-value map |
190
+ * | **Example** | `[{predicateString: "name", value: "My Network"}]` | `{name: {t: "string", v: "My Network"}}` |
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * // V2 properties format (array of objects)
195
+ * const v2Summary: NetworkSummaryV2 = {
196
+ * externalId: "12345",
197
+ * name: "Sample Network",
198
+ * properties: [
199
+ * { predicateString: "description", value: "A sample network", dataType: "string" },
200
+ * { predicateString: "nodeCount", value: "100", dataType: "integer" }
201
+ * ]
202
+ * };
203
+ *
204
+ * // V3 properties format (object map)
205
+ * const v3Summary: NetworkSummaryV3 = {
206
+ * externalId: "12345",
207
+ * name: "Sample Network",
208
+ * properties: {
209
+ * description: { t: "string", v: "A sample network" },
210
+ * nodeCount: { t: "integer", v: 100 }
211
+ * }
212
+ * };
213
+ * ```
214
+ */
215
+ interface NetworkSummaryV3 extends Omit<NetworkSummaryV2, 'properties'> {
216
+ properties?: CX2NetworkProperties;
217
+ }
218
+ interface NetworkPermission {
219
+ uuid: string;
220
+ permission: 'READ' | 'WRITE' | 'ADMIN';
221
+ memberUUID: string;
222
+ memberAccountName?: string;
223
+ resourceUUID: string;
224
+ }
225
+ interface CX2Network$1 {
226
+ CXVersion: string;
227
+ hasFragments: boolean;
228
+ metaData: CX2MetaData[];
229
+ attributeDeclarations?: CX2AttributeDeclarations;
230
+ networkAttributes?: CX2NetworkAttribute[];
231
+ nodes?: CX2Node[];
232
+ edges?: CX2Edge[];
233
+ nodeBypass?: CX2NodeBypass[];
234
+ edgeBypass?: CX2EdgeBypass[];
235
+ visualProperties?: CX2VisualProperty;
236
+ status?: CX2Status[];
237
+ }
238
+ interface CX2MetaData {
239
+ name: string;
240
+ elementCount?: number;
241
+ }
242
+ interface CX2AttributeDeclarations {
243
+ [aspectName: string]: {
244
+ [attributeName: string]: {
245
+ d: string;
246
+ a?: string;
247
+ v?: any;
248
+ };
249
+ };
250
+ }
251
+ interface CX2AttributeSpec {
252
+ d: string;
253
+ v?: any;
254
+ s?: boolean;
255
+ }
256
+ interface CX2NetworkAttribute {
257
+ [key: string]: any;
258
+ }
259
+ interface CX2Node {
260
+ id: number;
261
+ x?: number;
262
+ y?: number;
263
+ z?: number;
264
+ v?: Record<string, any>;
265
+ }
266
+ interface CX2Edge {
267
+ id: number;
268
+ s: number;
269
+ t: number;
270
+ v?: Record<string, any>;
271
+ }
272
+ interface CX1Edge {
273
+ [key: string]: any;
274
+ }
275
+ interface CX2NodeBypass {
276
+ id: number;
277
+ v: VisualPropertyTable;
278
+ }
279
+ interface CX2EdgeBypass {
280
+ id: number;
281
+ v: VisualPropertyTable;
282
+ }
283
+ /**
284
+ * Visual Property Mapping Types
285
+ */
286
+ declare type VPMappingType = 'DISCRETE' | 'CONTINUOUS' | 'PASSTHROUGH';
287
+ /**
288
+ * Mapping Definition for visual property mappings
289
+ * Note: Using flexible typing for mapping definitions as they vary by type
290
+ */
291
+ interface MappingDefinition {
292
+ mapppingList?: Array<Record<string, any>>;
293
+ [key: string]: any;
294
+ }
295
+ /**
296
+ * Visual Property Mapping structure
297
+ */
298
+ interface VisualPropertyMapping {
299
+ type: VPMappingType;
300
+ definition: MappingDefinition;
301
+ }
302
+ /**
303
+ * Visual Property Table - holds visual property values
304
+ * Equivalent to server-side VisualPropertyTable class
305
+ */
306
+ interface VisualPropertyTable {
307
+ [visualPropertyName: string]: any;
308
+ }
309
+ /**
310
+ * Table Column Visual Style - for individual visual properties
311
+ */
312
+ interface TableColumnVisualStyle {
313
+ default?: any;
314
+ mapping?: VisualPropertyMapping;
315
+ }
316
+ /**
317
+ * Default Visual Properties structure
318
+ */
319
+ interface DefaultVisualProperties {
320
+ edge?: VisualPropertyTable;
321
+ network?: Record<string, any>;
322
+ node?: VisualPropertyTable;
323
+ }
324
+ /**
325
+ * CX2 Visual Property - Main visual properties aspect
326
+ * Equivalent to server-side CxVisualProperty class
327
+ */
328
+ interface CX2VisualProperty {
329
+ default?: DefaultVisualProperties;
330
+ edgeMapping?: Record<string, VisualPropertyMapping>;
331
+ nodeMapping?: Record<string, VisualPropertyMapping>;
332
+ }
333
+ interface CX2Status {
334
+ error?: string;
335
+ success?: boolean;
336
+ }
337
+ interface SearchResult {
338
+ numFound: number;
339
+ start: number;
340
+ networks: NetworkSummaryV2[] | NetworkSummaryV3[];
341
+ }
342
+ interface SearchParameters {
343
+ searchString?: string;
344
+ accountName?: string;
345
+ permission?: string;
346
+ includeGroups?: boolean;
347
+ admin?: string;
348
+ start?: number;
349
+ size?: number;
350
+ source?: string;
351
+ }
352
+ interface ExportFormat {
353
+ format: 'CX' | 'CX2' | 'XGMML' | 'SIF' | 'GRAPHML';
354
+ version?: string;
355
+ }
356
+ interface ExportRequest {
357
+ networkUUID: string;
358
+ format: ExportFormat;
359
+ accesskey?: string;
360
+ }
361
+ interface Task {
362
+ externalId: string;
363
+ taskType: string;
364
+ status: 'submitted' | 'processing' | 'completed' | 'failed';
365
+ progress?: number;
366
+ message?: string;
367
+ resource?: string;
368
+ startTime?: number;
369
+ finishTime?: number;
370
+ attributes?: Record<string, any>;
371
+ }
372
+ interface NDExClientConfig {
373
+ baseURL?: string;
374
+ timeout?: number;
375
+ retries?: number;
376
+ retryDelay?: number;
377
+ debug?: boolean;
378
+ headers?: Record<string, string>;
379
+ auth?: BasicAuth | OAuthAuth;
380
+ }
381
+ interface APIResponse<T = any> {
382
+ data?: T;
383
+ errorCode?: string;
384
+ message?: string;
385
+ description?: string;
386
+ stackTrace?: string;
387
+ timeStamp?: number;
388
+ }
389
+ interface APIError {
390
+ errorCode: string;
391
+ message: string;
392
+ description?: string;
393
+ stackTrace?: string;
394
+ timeStamp?: number;
395
+ }
396
+ /**
397
+ * Base error class for all NDEx API errors
398
+ */
399
+ declare class NDExError extends Error {
400
+ statusCode?: number;
401
+ errorCode?: string;
402
+ description?: string;
403
+ constructor(message: string, statusCode?: number, errorCode?: string, description?: string);
404
+ }
405
+ /**
406
+ * Error thrown when network or request fails
407
+ */
408
+ declare class NDExNetworkError extends NDExError {
409
+ originalError?: Error;
410
+ constructor(message: string, originalError?: Error);
411
+ }
412
+ /**
413
+ * Error thrown when authentication fails
414
+ */
415
+ declare class NDExAuthError extends NDExError {
416
+ constructor(message?: string, statusCode?: number);
417
+ }
418
+ /**
419
+ * Error thrown when requested resource is not found
420
+ */
421
+ declare class NDExNotFoundError extends NDExError {
422
+ constructor(message?: string, statusCode?: number);
423
+ }
424
+ /**
425
+ * Error thrown when request validation fails
426
+ */
427
+ declare class NDExValidationError extends NDExError {
428
+ constructor(message: string, statusCode?: number);
429
+ }
430
+ /**
431
+ * Error thrown when server encounters an internal error
432
+ */
433
+ declare class NDExServerError extends NDExError {
434
+ constructor(message?: string, statusCode?: number);
435
+ }
436
+ declare type UUID = string;
437
+ declare type Timestamp = number;
438
+ declare type NDExAny = any;
439
+ interface PaginationParams {
440
+ start?: number;
441
+ size?: number;
442
+ }
443
+ interface AccessParams {
444
+ accesskey?: string;
445
+ }
446
+ /**
447
+ * CyWeb workspace object structure
448
+ */
449
+ interface CyWebWorkspace {
450
+ externalId?: string;
451
+ name: string;
452
+ description?: string;
453
+ networkIds?: string[];
454
+ [key: string]: any;
455
+ }
456
+ /**
457
+ * Network access key response structure
458
+ */
459
+ interface AccessKeyResponse {
460
+ accessKey: string | null;
461
+ }
462
+ /**
463
+ * Valid actions for updating access keys
464
+ */
465
+ declare type AccessKeyAction = 'enable' | 'disable';
466
+
467
+ /**
468
+ * HTTPService - Core HTTP client for NDEx API communication
469
+ * Handles v2/v3 endpoint routing, authentication, and error handling
470
+ *
471
+ * @note User-Agent header is set to 'NDEx-JS-Client/${version}' but only works in Node.js.
472
+ * Browsers will ignore custom User-Agent headers for security reasons.
473
+ */
474
+ declare class HTTPService {
475
+ private axiosInstance;
476
+ private config;
477
+ constructor(config?: NDExClientConfig);
478
+ /**
479
+ * Get authentication headers based on config.auth
480
+ */
481
+ private getAuthHeaders;
482
+ /**
483
+ * Build API endpoint URL with version routing
484
+ */
485
+ private buildUrl;
486
+ /**
487
+ * Generic GET request with intelligent version routing
488
+ */
489
+ get<T = any>(endpoint: string, config?: AxiosRequestConfig & {
490
+ version?: 'v2' | 'v3';
491
+ }): Promise<T>;
492
+ /**
493
+ * Generic POST request with intelligent version routing
494
+ */
495
+ post<T = any>(endpoint: string, data?: any, config?: AxiosRequestConfig & {
496
+ version?: 'v2' | 'v3';
497
+ }): Promise<T>;
498
+ /**
499
+ * Generic PUT request with intelligent version routing
500
+ */
501
+ put<T = any>(endpoint: string, data?: any, config?: AxiosRequestConfig & {
502
+ version?: 'v2' | 'v3';
503
+ }): Promise<T>;
504
+ /**
505
+ * Generic DELETE request with intelligent version routing
506
+ */
507
+ delete<T = any>(endpoint: string, config?: AxiosRequestConfig & {
508
+ version?: 'v2' | 'v3';
509
+ }): Promise<T>;
510
+ /**
511
+ * Upload a file to the NDEx API with progress tracking support
512
+ *
513
+ * This method handles file uploads using multipart/form-data encoding and supports
514
+ * various input types for maximum flexibility across different environments.
515
+ *
516
+ * @template T - The expected response type from the API
517
+ * @param endpoint - API endpoint path (e.g., 'networks' for network upload)
518
+ * @param file - File data to upload. Supports multiple input types:
519
+ * - `File` (browser): HTML5 File object from file input or drag-and-drop
520
+ * - `Blob` (browser): Binary data as Blob object
521
+ * - `Buffer` (Node.js): Binary data as Buffer for server-side uploads
522
+ * - `string`: Text content that will be converted to Blob (useful for CX/CX2 JSON)
523
+ * @param options - Upload configuration options
524
+ * @param options.filename - Custom filename for the upload. Defaults:
525
+ * - File objects: uses `file.name`
526
+ * - Other types: 'file.cx2'
527
+ * @param options.contentType - MIME type for string content (default: 'application/json')
528
+ * @param options.onProgress - Progress callback that receives percentage (0-100)
529
+ * Called periodically during upload with current progress
530
+ * @param options.version - API version to use ('v2' or 'v3', defaults to 'v2')
531
+ * @param options.config - Additional Axios configuration options
532
+ *
533
+ * @returns Promise resolving to upload result
534
+ *
535
+ * @example
536
+ * ```typescript
537
+ * // Upload a File object from file input (browser)
538
+ * const fileInput = document.getElementById('file') as HTMLInputElement;
539
+ * const file = fileInput.files[0];
540
+ * const result = await httpService.uploadFile('networks', file, {
541
+ * filename: 'my-network.cx2',
542
+ * onProgress: (progress) => console.log(`Upload: ${progress}%`),
543
+ * version: 'v3'
544
+ * });
545
+ *
546
+ * // Upload CX2 network data as string
547
+ * const cx2Data = JSON.stringify({ CXVersion: '2.0', networks: [...] });
548
+ * const result = await httpService.uploadFile('networks', cx2Data, {
549
+ * filename: 'network.cx2',
550
+ * contentType: 'application/json',
551
+ * version: 'v3'
552
+ * });
553
+ *
554
+ * // Upload with progress tracking
555
+ * const result = await httpService.uploadFile('networks', file, {
556
+ * onProgress: (progress) => {
557
+ * progressBar.style.width = `${progress}%`;
558
+ * console.log(`Uploading: ${progress}%`);
559
+ * }
560
+ * });
561
+ * ```
562
+ *
563
+ * @throws Will throw NDExError on network errors,
564
+ * server errors, or invalid file data
565
+ *
566
+ * @note The Content-Type header is automatically set to 'multipart/form-data'
567
+ * and Axios will handle the boundary parameter automatically
568
+ */
569
+ uploadFile<T = any>(endpoint: string, file: File | Blob | Buffer | string, options?: {
570
+ filename?: string;
571
+ contentType?: string;
572
+ onProgress?: (progress: number) => void;
573
+ version?: 'v2' | 'v3';
574
+ }): Promise<T>;
575
+ /**
576
+ * Setup axios interceptors for debugging and retry logic
577
+ */
578
+ private setupInterceptors;
579
+ /**
580
+ * Handle successful API responses
581
+ */
582
+ private handleResponse;
583
+ /**
584
+ * Handle API errors by throwing appropriate NDEx error types
585
+ */
586
+ private handleError;
587
+ /**
588
+ * Throw appropriate NDEx error based on status code
589
+ */
590
+ private throwNDExError;
591
+ /**
592
+ * Update client configuration
593
+ */
594
+ updateConfig(newConfig: Partial<NDExClientConfig>): void;
595
+ /**
596
+ * Get current configuration
597
+ */
598
+ getConfig(): NDExClientConfig;
599
+ /**
600
+ * Get current authentication type
601
+ * @returns The type of authentication configured ('basic' | 'oauth'), or undefined if no auth is configured
602
+ */
603
+ getAuthType(): 'basic' | 'oauth' | undefined;
604
+ /**
605
+ * Get ID token from OAuth authentication
606
+ * @returns The ID token if OAuth auth is configured, undefined otherwise
607
+ */
608
+ getIdToken(): string | undefined;
609
+ /**
610
+ * Set ID token for OAuth authentication
611
+ * Creates OAuth auth configuration if no auth is currently configured
612
+ * @param idToken - The ID token to set
613
+ */
614
+ setIdToken(idToken: string): void;
615
+ }
616
+
617
+ /**
618
+ * CX2Network - Modern representation of CX2 format networks
619
+ * Provides utilities for creating, manipulating, and validating CX2 networks
620
+ */
621
+ declare class CX2Network implements CX2Network$1 {
622
+ CXVersion: string;
623
+ hasFragments: boolean;
624
+ metaData: CX2MetaData[];
625
+ attributeDeclarations?: CX2AttributeDeclarations;
626
+ networkAttributes?: CX2NetworkAttribute[];
627
+ nodes?: CX2Node[];
628
+ edges?: CX2Edge[];
629
+ nodeBypass?: CX2NodeBypass[];
630
+ edgeBypass?: CX2EdgeBypass[];
631
+ visualProperties?: CX2VisualProperty;
632
+ status?: any[];
633
+ constructor(data?: Partial<CX2Network$1>);
634
+ /**
635
+ * Create a new empty CX2Network
636
+ */
637
+ static createEmpty(): CX2Network;
638
+ /**
639
+ * Create CX2Network from raw JSON data
640
+ */
641
+ static fromJSON(json: string | object): CX2Network;
642
+ /**
643
+ * Create CX2Network from NetworkSummary (for compatibility)
644
+ */
645
+ static fromNetworkSummary(summary: NetworkSummaryV3): CX2Network;
646
+ /**
647
+ * Add a node to the network
648
+ */
649
+ addNode(id: number, attributes?: Record<string, any>): CX2Node;
650
+ /**
651
+ * Add an edge to the network
652
+ */
653
+ addEdge(id: number, sourceId: number, targetId: number, attributes?: Record<string, any>): CX2Edge;
654
+ /**
655
+ * Add an individual node attribute
656
+ */
657
+ addNodeAttribute(nodeId: number, attributeName: string, value: any): void;
658
+ /**
659
+ * Add edge attributes (bulk)
660
+ */
661
+ addEdgeAttribute(edgeId: number, attributeName: string, value: any): void;
662
+ /**
663
+ * Set node coordinates
664
+ */
665
+ setNodeCoordinates(nodeId: number, x: number, y: number, z?: number): void;
666
+ /**
667
+ * Get node by ID
668
+ */
669
+ getNode(id: number): CX2Node | undefined;
670
+ /**
671
+ * Get edge by ID
672
+ */
673
+ getEdge(id: number): CX2Edge | undefined;
674
+ /**
675
+ * Get all nodes
676
+ */
677
+ getNodes(): CX2Node[];
678
+ /**
679
+ * Get all edges
680
+ */
681
+ getEdges(): CX2Edge[];
682
+ /**
683
+ * Get node count
684
+ */
685
+ getNodeCount(): number;
686
+ /**
687
+ * Get edge count
688
+ */
689
+ getEdgeCount(): number;
690
+ /**
691
+ * Get network name from attributes
692
+ */
693
+ getNetworkName(): string | undefined;
694
+ /**
695
+ * Set network name
696
+ */
697
+ setNetworkName(name: string): void;
698
+ /**
699
+ * Get network attribute by key
700
+ */
701
+ getNetworkAttribute(key: string): any;
702
+ /**
703
+ * Set network attribute
704
+ */
705
+ setNetworkAttribute(key: string, value: any): void;
706
+ /**
707
+ * Validate the CX2 network structure
708
+ */
709
+ validate(): {
710
+ isValid: boolean;
711
+ errors: string[];
712
+ };
713
+ /**
714
+ * Convert to JSON string
715
+ */
716
+ toJSON(): string;
717
+ /**
718
+ * Create a deep copy of the network
719
+ */
720
+ clone(): CX2Network;
721
+ /**
722
+ * Get basic statistics about the network
723
+ */
724
+ getStatistics(): {
725
+ nodeCount: number;
726
+ edgeCount: number;
727
+ hasCoordinates: boolean;
728
+ hasVisualProperties: boolean;
729
+ };
730
+ /**
731
+ * Ensure required metadata is present
732
+ */
733
+ private ensureRequiredMetadata;
734
+ /**
735
+ * Update node count in metadata
736
+ */
737
+ private updateNodeCount;
738
+ /**
739
+ * Update edge count in metadata
740
+ */
741
+ private updateEdgeCount;
742
+ }
743
+
744
+ /**
745
+ * NetworkServiceV3 - NDEx API v3 network operations
746
+ * Handles modern v3 endpoints with native CX2 support
747
+ */
748
+ declare class NetworkServiceV3 {
749
+ private http;
750
+ constructor(http: HTTPService);
751
+ /**
752
+ * Get network summary by UUID
753
+ */
754
+ getNetworkSummary(networkUUID: string, options?: AccessParams): Promise<NetworkSummaryV3>;
755
+ /**
756
+ * Get raw network in CX2 format (native V3)
757
+ *
758
+ * Returns raw CX2 data which may contain fragmented aspects that need to be assembled
759
+ * into a complete CX2 network model for proper usage. The returned data follows the
760
+ * CX2 specification but may have aspects split across multiple fragments.
761
+ * For a fully assembled network object with utility methods, use getNetworkAsCX2Object() instead.
762
+ *
763
+ * @param networkUUID - The UUID of the network to retrieve
764
+ * @param options - Access options including optional access key
765
+ * @returns Promise resolving to raw CX2 network data that may be fragmented
766
+ */
767
+ getRawCX2Network(networkUUID: string, options?: AccessParams): Promise<CX2Network$1>;
768
+ /**
769
+ * Create network DOI
770
+ *
771
+ * @param networkUUID - The UUID of the network to create a DOI for
772
+ * @param key - DOI creation key
773
+ * @param email - Email address for DOI registration
774
+ * @returns Promise resolving to a confirmation message string from the server
775
+ */
776
+ createNetworkDOI(networkUUID: string, key: string, email: string): Promise<string>;
777
+ /**
778
+ * Get attributes of selected nodes
779
+ *
780
+ * Retrieves specific attributes for a set of nodes in a network. The server will return
781
+ * a 404 error if the network has no attributes on nodes.
782
+ *
783
+ * @param networkUUID - The UUID of the network
784
+ * @param nodeSelection - Object containing node IDs and attribute names to retrieve
785
+ * @param nodeSelection.ids - Array of node IDs (long numbers) to get attributes for
786
+ * @param nodeSelection.attributeNames - Array of attribute names to retrieve
787
+ * @param options - Access options including optional access key
788
+ * @returns Promise resolving to a JSON object where keys are stringified node IDs
789
+ * and values are the selected attributes for that node
790
+ * @throws {404} When the network has no attributes on nodes
791
+ */
792
+ getAttributesOfSelectedNodes(networkUUID: string, nodeSelection: {
793
+ ids: number[];
794
+ attributeNames: string[];
795
+ }, options?: AccessParams): Promise<Record<string, any>>;
796
+ /**
797
+ * Get network summaries by UUIDs using V3 API (migrated from original NDEx.js)
798
+ *
799
+ * Retrieves network summaries for multiple networks in a single batch request using V3 API.
800
+ * Uses the V3 API batch endpoint with format parameter support.
801
+ *
802
+ * @param uuidList - Array of network UUIDs to retrieve summaries for
803
+ * @param accessKey - Optional access key for private networks
804
+ * @param format - Summary format ("FULL" by default, can be "BASIC" or other supported formats)
805
+ * @returns Promise resolving to array of V3 network summaries
806
+ */
807
+ getNetworkSummariesV3ByUUIDs(uuidList: string[], accessKey?: string, format?: string): Promise<NetworkSummaryV3[]>;
808
+ /**
809
+ * Search networks with V3 enhanced features
810
+ */
811
+ searchNetworks(searchParams?: SearchParameters): Promise<SearchResult>;
812
+ /**
813
+ * Get network as CX2Network object with utilities
814
+ */
815
+ getNetworkAsCX2Object(networkUUID: string, options?: AccessParams): Promise<CX2Network>;
816
+ /**
817
+ * Create new network from CX2
818
+ */
819
+ createNetworkFromCX2(cx2Data: CX2Network$1 | CX2Network, options?: {
820
+ visibility?: 'PUBLIC' | 'PRIVATE';
821
+ name?: string;
822
+ }): Promise<{
823
+ uuid: string;
824
+ }>;
825
+ /**
826
+ * Update network with CX2 data
827
+ */
828
+ updateNetworkCX2(networkUUID: string, cx2Data: CX2Network$1 | CX2Network): Promise<void>;
829
+ /**
830
+ * Upload network file (CX2, CX, or other formats)
831
+ */
832
+ uploadNetworkFile(file: File | Blob | string, options?: {
833
+ filename?: string;
834
+ visibility?: 'PUBLIC' | 'PRIVATE';
835
+ name?: string;
836
+ onProgress?: (progress: number) => void;
837
+ }): Promise<{
838
+ uuid: string;
839
+ }>;
840
+ /**
841
+ * Get network metadata (V3 enhanced)
842
+ */
843
+ getNetworkMetadata(networkUUID: string): Promise<any>;
844
+ /**
845
+ * Update network metadata
846
+ */
847
+ updateNetworkMetadata(networkUUID: string, metadata: Record<string, any>): Promise<void>;
848
+ /**
849
+ * Get network aspect (specific CX2 aspect)
850
+ */
851
+ getNetworkAspect(networkUUID: string, aspectName: string, options?: AccessParams): Promise<any>;
852
+ }
853
+
854
+ /**
855
+ * NetworkServiceV2 - NDEx API v2 network operations
856
+ * Handles legacy v2 endpoints with modern TypeScript interface
857
+ */
858
+ declare class NetworkServiceV2 {
859
+ private http;
860
+ constructor(http: HTTPService);
861
+ /**
862
+ * Get raw network in CX1 format
863
+ *
864
+ * Returns raw CX1 data as an array of aspects. This data may contain fragmented aspects
865
+ * that need to be assembled into a complete CX1 network model for proper usage.
866
+ * For a fully assembled network object, consider using getNetworkAsCX2Object() instead.
867
+ *
868
+ * @param networkUUID - The UUID of the network to retrieve
869
+ * @param options - Access options including optional access key
870
+ * @returns Promise resolving to raw CX1 data as an array of aspects
871
+ */
872
+ getRawCX1Network(networkUUID: string, options?: AccessParams): Promise<any[]>;
873
+ /**
874
+ * Get network summary by UUID
875
+ */
876
+ getNetworkSummary(networkUUID: string, options?: AccessParams): Promise<NetworkSummaryV2>;
877
+ /**
878
+ * Copy network
879
+ *
880
+ * Creates a copy of an existing network using the server's copy endpoint.
881
+ * The copied network will have the same content but will be assigned a new UUID
882
+ * and will be owned by the authenticated user.
883
+ *
884
+ * @param networkUUID - The UUID of the network to copy
885
+ * @returns Promise resolving to the URL of the cloned CX1 network
886
+ */
887
+ copyNetwork(networkUUID: string): Promise<string>;
888
+ /**
889
+ * Search networks (migrated from original NDEx.js)
890
+ *
891
+ * Searches networks using POST request with search parameters in the request body.
892
+ * This implementation matches the original NDEx.js searchNetworks function.
893
+ *
894
+ * @param searchTerms - Search string to find networks
895
+ * @param start - Starting offset for pagination (optional)
896
+ * @param size - Maximum number of results to return (optional)
897
+ * @param optionalParameters - Additional search filters
898
+ * @param optionalParameters.permission - Filter by permission level
899
+ * @param optionalParameters.includeGroups - Whether to include group networks
900
+ * @param optionalParameters.accountName - Filter by account name
901
+ * @returns Promise resolving to search results
902
+ */
903
+ searchNetworks(searchTerms: string, start?: number, size?: number, optionalParameters?: {
904
+ permission?: string;
905
+ includeGroups?: boolean;
906
+ accountName?: string;
907
+ }): Promise<any>;
908
+ /**
909
+ * Create new network from raw CX1 data
910
+ *
911
+ * Creates a new network in NDEx from raw CX1 network data. This method handles
912
+ * the server response parsing to extract the network UUID from the location header.
913
+ *
914
+ * @param rawCX - Raw CX1 network data as an array of aspects
915
+ * @param options - Optional options for network creation (visibility settings)
916
+ * @returns Promise resolving to the UUID string of the newly created network
917
+ */
918
+ createNetworkFromRawCX1(rawCX: any[], options?: {
919
+ visibility?: 'PUBLIC' | 'PRIVATE';
920
+ }): Promise<string>;
921
+ /**
922
+ * Update network from raw CX1 data
923
+ *
924
+ * Updates an existing network in NDEx with new raw CX1 network data.
925
+ * This completely replaces the network content with the provided CX1 data.
926
+ * Uses the legacy v2 endpoint format from the original NDEx.js implementation.
927
+ *
928
+ * @param networkUUID - The UUID of the network to update
929
+ * @param rawCX - Raw CX1 network data as an array of aspects
930
+ * @returns Promise resolving when the update is complete
931
+ */
932
+ updateNetworkFromRawCX1(networkUUID: string, rawCX: any[]): Promise<void>;
933
+ /**
934
+ * Delete network
935
+ */
936
+ deleteNetwork(networkUUID: string): Promise<void>;
937
+ /**
938
+ * Get network summaries by UUIDs (migrated from original NDEx.js)
939
+ *
940
+ * Retrieves network summaries for multiple networks in a single batch request.
941
+ * Uses the V2 API batch endpoint for efficient bulk operations.
942
+ *
943
+ * @param uuidList - Array of network UUIDs to retrieve summaries for
944
+ * @param accessKey - Optional access key for private networks
945
+ * @returns Promise resolving to array of network summaries
946
+ */
947
+ getNetworkSummariesByUUIDs(uuidList: string[], accessKey?: string): Promise<NetworkSummaryV2[]>;
948
+ /**
949
+ * Get user's networks
950
+ */
951
+ getUserNetworks(accountName: string, options?: PaginationParams): Promise<NetworkSummaryV2[]>;
952
+ /**
953
+ * Set network system properties
954
+ */
955
+ setNetworkSystemProperties(networkUUID: string, properties: Record<string, any>): Promise<void>;
956
+ /**
957
+ * Get network permissions
958
+ */
959
+ getNetworkPermissions(networkUUID: string): Promise<NetworkPermission[]>;
960
+ /**
961
+ * Set network permissions
962
+ */
963
+ setNetworkPermissions(networkUUID: string, permissions: NetworkPermission[]): Promise<void>;
964
+ /**
965
+ * Grant network permission to user
966
+ */
967
+ grantNetworkPermission(networkUUID: string, userUUID: string, permission: 'READ' | 'WRITE' | 'ADMIN'): Promise<void>;
968
+ /**
969
+ * Revoke network permission from user
970
+ */
971
+ revokeNetworkPermission(networkUUID: string, userUUID: string): Promise<void>;
972
+ /**
973
+ * Get network profile (additional metadata)
974
+ */
975
+ getNetworkProfile(networkUUID: string): Promise<any>;
976
+ /**
977
+ * Set network profile
978
+ */
979
+ setNetworkProfile(networkUUID: string, profile: any): Promise<void>;
980
+ /**
981
+ * Make network public
982
+ */
983
+ makeNetworkPublic(networkUUID: string): Promise<void>;
984
+ /**
985
+ * Make network private
986
+ */
987
+ makeNetworkPrivate(networkUUID: string): Promise<void>;
988
+ /**
989
+ * Get network sample (if available)
990
+ */
991
+ getNetworkSample(networkUUID: string, options?: AccessParams): Promise<any[]>;
992
+ /**
993
+ * Get network metadata (migrated from original NDEx.js)
994
+ *
995
+ * Retrieves metadata information about network aspects including element counts,
996
+ * versions, and ID counters for each aspect in the network. This provides
997
+ * an overview of the network's structure and content organization.
998
+ *
999
+ * @param networkUUID - The UUID of the network to get metadata for
1000
+ * @param accessKey - Optional access key for private networks
1001
+ * @returns Promise resolving to metadata containing aspect information
1002
+ * @example
1003
+ * ```typescript
1004
+ * const metadata = await networkService.getMetaData('network-uuid');
1005
+ * // Returns: { metaData: [{ name: 'nodes', elementCount: 330, version: '1.0' }, ...] }
1006
+ * ```
1007
+ */
1008
+ getMetaData(networkUUID: string, accessKey?: string): Promise<CX1MetaDataResponse>;
1009
+ /**
1010
+ * Get network access key (migrated from original NDEx.js)
1011
+ *
1012
+ * Retrieves the current access key for a network. Access keys allow
1013
+ * users to share private networks without requiring individual permissions.
1014
+ *
1015
+ * @param networkUUID - The UUID of the network to get access key for
1016
+ * @returns Promise resolving to access key response object
1017
+ *
1018
+ * @example
1019
+ * ```typescript
1020
+ * const response = await networkService.getAccessKey('network-uuid');
1021
+ * console.log(response.accessKey); // "acialdfeoa03430023" or null
1022
+ * ```
1023
+ */
1024
+ getAccessKey(networkUUID: string): Promise<AccessKeyResponse>;
1025
+ /**
1026
+ * Update network access key (migrated from original NDEx.js)
1027
+ *
1028
+ * Enables or disables the access key for a network. When enabled, creates
1029
+ * a new access key that can be shared. When disabled, invalidates the
1030
+ * current access key.
1031
+ *
1032
+ * @param networkUUID - The UUID of the network to update access key for
1033
+ * @param action - Action to perform: 'enable' creates/updates key, 'disable' removes it
1034
+ * @returns Promise resolving to access key response (accessKey will be null when disabled)
1035
+ *
1036
+ * @example
1037
+ * ```typescript
1038
+ * // Enable access key
1039
+ * const enabled = await networkService.updateAccessKey('network-uuid', 'enable');
1040
+ * console.log(enabled.accessKey); // "new-access-key-string"
1041
+ *
1042
+ * // Disable access key
1043
+ * const disabled = await networkService.updateAccessKey('network-uuid', 'disable');
1044
+ * console.log(disabled.accessKey); // null
1045
+ * ```
1046
+ */
1047
+ updateAccessKey(networkUUID: string, action: AccessKeyAction): Promise<AccessKeyResponse>;
1048
+ }
1049
+
1050
+ /**
1051
+ * UnifiedNetworkService - Provides access to both V2/V3 network services
1052
+ * Allows individual function calls to choose between v2 and v3 APIs
1053
+ */
1054
+ declare class UnifiedNetworkService {
1055
+ private http;
1056
+ private v2Service;
1057
+ private v3Service;
1058
+ constructor(http: HTTPService);
1059
+ /**
1060
+ * Get network summary using specified API version
1061
+ */
1062
+ getNetworkSummary(networkUUID: string, options?: AccessParams): Promise<NetworkSummaryV3>;
1063
+ /**
1064
+ * Search networks using specified API version
1065
+ * NOTE: This method is temporarily commented out as the V2 searchNetworks
1066
+ * signature has been migrated from NDEx.js and needs separate integration
1067
+ */
1068
+ /**
1069
+ * Get network in CX1 format (V2 API)
1070
+ */
1071
+ getRawCX1Network(networkUUID: string, options?: AccessParams): Promise<any[]>;
1072
+ /**
1073
+ * Get network in CX2 format (V3 API)
1074
+ */
1075
+ getRawCX2Network(networkUUID: string, options?: AccessParams): Promise<CX2Network$1>;
1076
+ /**
1077
+ * Delete network
1078
+ */
1079
+ deleteNetwork(networkUUID: string): Promise<void>;
1080
+ /**
1081
+ * Create network DOI
1082
+ *
1083
+ * @param networkUUID - The UUID of the network to create a DOI for
1084
+ * @param key - DOI creation key
1085
+ * @param email - Email address for DOI registration
1086
+ * @returns Promise resolving to a confirmation message string from the server
1087
+ */
1088
+ createNetworkDOI(networkUUID: string, key: string, email: string): Promise<string>;
1089
+ /**
1090
+ * Get attributes of selected nodes
1091
+ *
1092
+ * Retrieves specific attributes for a set of nodes in a network. The server will return
1093
+ * a 404 error if the network has no attributes on nodes.
1094
+ *
1095
+ * @param networkUUID - The UUID of the network
1096
+ * @param nodeSelection - Object containing node IDs and attribute names to retrieve
1097
+ * @param nodeSelection.ids - Array of node IDs (long numbers) to get attributes for
1098
+ * @param nodeSelection.attributeNames - Array of attribute names to retrieve
1099
+ * @param options - Access options including optional access key
1100
+ * @returns Promise resolving to a JSON object where keys are stringified node IDs
1101
+ * and values are the selected attributes for that node
1102
+ * @throws {404} When the network has no attributes on nodes
1103
+ */
1104
+ getAttributesOfSelectedNodes(networkUUID: string, nodeSelection: {
1105
+ ids: number[];
1106
+ attributeNames: string[];
1107
+ }, options?: AccessParams): Promise<Record<string, any>>;
1108
+ /**
1109
+ * Neighborhood query (migrated from original NDEx.js)
1110
+ *
1111
+ * Performs a neighborhood search within a network, returning nodes and edges
1112
+ * within the specified search depth from nodes matching the search terms.
1113
+ * Can return either raw CX1 or CX2 format based on outputCX2 parameter.
1114
+ *
1115
+ * @param networkUUID - The UUID of the network to search
1116
+ * @param searchTerms - Search string to find starting nodes
1117
+ * @param saveResult - Whether to save the query result as a new network
1118
+ * @param parameters - Additional query parameters
1119
+ * @param parameters.searchDepth - How many hops to search (default: 1)
1120
+ * @param parameters.edgeLimit - Maximum number of edges to return
1121
+ * @param parameters.errorWhenLimitIsOver - Throw error if edge limit exceeded
1122
+ * @param parameters.directOnly - Only include direct connections
1123
+ * @param parameters.nodeIds - Specific node IDs to start search from
1124
+ * @param outputCX2 - If true, return CX2 format via V3 API; if false, return CX1 format via V2 API
1125
+ * @returns Promise resolving to raw CX1 or CX2 network data
1126
+ */
1127
+ neighborhoodQuery(networkUUID: string, searchTerms: string, saveResult?: boolean, parameters?: {
1128
+ searchDepth?: number;
1129
+ edgeLimit?: number;
1130
+ errorWhenLimitIsOver?: boolean;
1131
+ directOnly?: boolean;
1132
+ nodeIds?: number[];
1133
+ }, outputCX2?: boolean): Promise<any[] | CX2Network$1>;
1134
+ /**
1135
+ * Interconnect query (migrated from original NDEx.js)
1136
+ *
1137
+ * Finds connections between nodes matching the search terms within a network.
1138
+ * Returns the interconnected subnetwork as either raw CX1 or CX2 format.
1139
+ * Can return either raw CX1 or CX2 format based on outputCX2 parameter.
1140
+ *
1141
+ * @param networkUUID - The UUID of the network to search
1142
+ * @param searchTerms - Search string to find nodes to interconnect
1143
+ * @param saveResult - Whether to save the query result as a new network
1144
+ * @param parameters - Additional query parameters
1145
+ * @param parameters.edgeLimit - Maximum number of edges to return
1146
+ * @param parameters.errorWhenLimitIsOver - Throw error if edge limit exceeded
1147
+ * @param parameters.nodeIds - Specific node IDs to find connections between
1148
+ * @param outputCX2 - If true, return CX2 format via V3 API; if false, return CX1 format via V2 API
1149
+ * @returns Promise resolving to raw CX1 or CX2 network data
1150
+ */
1151
+ interConnectQuery(networkUUID: string, searchTerms: string, saveResult?: boolean, parameters?: {
1152
+ edgeLimit?: number;
1153
+ errorWhenLimitIsOver?: boolean;
1154
+ nodeIds?: number[];
1155
+ }, outputCX2?: boolean): Promise<any[] | CX2Network$1>;
1156
+ /**
1157
+ * Get network permissions by UUIDs (migrated from original NDEx.js)
1158
+ *
1159
+ * Retrieves network permissions for multiple networks in a single batch request.
1160
+ * Uses the V2 API batch endpoint to efficiently get permission information.
1161
+ *
1162
+ * @param uuidList - Array of network UUIDs to retrieve permissions for
1163
+ * @returns Promise resolving to permission information for the specified networks
1164
+ */
1165
+ getNetworkPermissionsByUUIDs(uuidList: string[]): Promise<any[]>;
1166
+ /**
1167
+ * Export networks (migrated from original NDEx.js)
1168
+ *
1169
+ * Creates an export job for networks using the V2 batch export endpoint.
1170
+ * This allows exporting multiple networks in various formats.
1171
+ *
1172
+ * @param exportJob - Export job configuration specifying networks and format
1173
+ * @returns Promise resolving to export job result
1174
+ */
1175
+ exportNetworks(exportJob: any): Promise<any>;
1176
+ /**
1177
+ * Move networks to folder (migrated from original NDEx.js)
1178
+ *
1179
+ * Moves multiple networks to a specified folder using the V3 API.
1180
+ * This is a V3-specific feature for organizing networks in folders.
1181
+ *
1182
+ * @param networkIds - Array of network IDs to move
1183
+ * @param folderId - Target folder ID to move networks to
1184
+ * @returns Promise resolving when networks are moved
1185
+ */
1186
+ moveNetworks(networkIds: string[], folderId: string): Promise<any>;
1187
+ /**
1188
+ * Set networks visibility (migrated from original NDEx.js)
1189
+ *
1190
+ * Changes visibility settings for multiple networks using the V3 API.
1191
+ * Requires proper file validation to ensure data integrity.
1192
+ *
1193
+ * @param files - Object containing files with their types (must have 'files' property)
1194
+ * @param visibility - Visibility setting (e.g., 'PUBLIC', 'PRIVATE')
1195
+ * @returns Promise resolving when visibility is updated
1196
+ */
1197
+ setNetworksVisibility(files: {
1198
+ files: Record<string, 'NETWORK' | 'FOLDER' | 'SHORTCUT'>;
1199
+ }, visibility: string): Promise<any>;
1200
+ /**
1201
+ * Get random edges from network (migrated from original NDEx.js)
1202
+ *
1203
+ * Retrieves a random sample of edges from a network using the V3 API.
1204
+ * This is useful for previewing large networks or sampling edge data.
1205
+ *
1206
+ * @param networkUUID - The UUID of the network to get edges from
1207
+ * @param limit - Number of random edges to retrieve (must be greater than 0)
1208
+ * @param accessKey - Optional access key for private networks
1209
+ * @returns Promise resolving to array of CX2Edge objects
1210
+ * @throws Error if limit is less than or equal to 0
1211
+ */
1212
+ getRandomEdges(networkUUID: string, limit: number, accessKey?: string): Promise<CX2Edge[]>;
1213
+ /**
1214
+ * Validate share data format (helper method for file operations)
1215
+ *
1216
+ * Validates the structure and content of file data used in sharing operations.
1217
+ * Ensures proper UUID format and valid file types.
1218
+ *
1219
+ * @param data - Data object to validate (must contain 'files' property)
1220
+ * @throws Error if validation fails
1221
+ */
1222
+ private validateShareData;
1223
+ /**
1224
+ * Get aspect elements (migrated from original NDEx.js)
1225
+ *
1226
+ * Retrieves elements from a specific aspect of a network using the V3 API.
1227
+ * This function can be used to get nodes, edges, or other aspect data
1228
+ * with optional size limiting and access key support for private networks.
1229
+ *
1230
+ * @param networkUUID - The UUID of the network to get aspect elements from
1231
+ * @param aspectName - Name of the aspect to retrieve (e.g., 'nodes', 'edges', 'networkAttributes')
1232
+ * @param limit - Optional maximum number of elements to return
1233
+ * @param accessKey - Optional access key for private networks
1234
+ * @returns Promise resolving to array of aspect elements
1235
+ * @example
1236
+ * ```typescript
1237
+ * // Get first 100 nodes from a network
1238
+ * const nodes = await client.networks.getAspectElements('network-uuid', 'nodes', 100);
1239
+ *
1240
+ * // Get all edges from a network
1241
+ * const edges = await client.networks.getAspectElements('network-uuid', 'edges');
1242
+ * ```
1243
+ */
1244
+ getAspectElements(networkUUID: string, aspectName: string, limit?: number, accessKey?: string): Promise<any[]>;
1245
+ /**
1246
+ * Get filtered edges (migrated from original NDEx.js)
1247
+ *
1248
+ * Retrieves edges from a network that match specific filtering criteria on a column value.
1249
+ * The function supports both CX1 and CX2 formats based on the format parameter, with CX2
1250
+ * being the default format used by the server.
1251
+ *
1252
+ * @param networkUUID - The UUID of the network to get filtered edges from
1253
+ * @param columnName - Name of the edge attribute column to filter on
1254
+ * @param valueString - Value to filter by (converted to string for comparison)
1255
+ * @param operator - Filtering operation: '>' | '<' | '=' | '!='
1256
+ * @param limit - Optional maximum number of edges to return (default: -1 = all matching edges)
1257
+ * @param order - Optional sort order for edges before applying limit: 'asc' | 'desc' (default: 'desc')
1258
+ * @param format - Optional output format: 'cx' | 'cx2' (default: 'cx2')
1259
+ * @param accessKey - Optional access key for private networks
1260
+ * @returns Promise resolving to array of edges in the specified format
1261
+ *
1262
+ * @example
1263
+ * ```typescript
1264
+ * // Get edges with weight > 0.5 in CX2 format (default)
1265
+ * const cx2Edges = await client.networks.getFilteredEdges(
1266
+ * 'network-uuid', 'weight', '0.5', '>'
1267
+ * );
1268
+ *
1269
+ * // Get top 10 edges with highest score in CX1 format
1270
+ * const cx1Edges = await client.networks.getFilteredEdges(
1271
+ * 'network-uuid', 'score', '0', '>', 10, 'desc', 'cx'
1272
+ * );
1273
+ *
1274
+ * // Get edges where interaction equals 'pp'
1275
+ * const ppEdges = await client.networks.getFilteredEdges(
1276
+ * 'network-uuid', 'interaction', 'pp', '=', undefined, undefined, 'cx2'
1277
+ * );
1278
+ * ```
1279
+ */
1280
+ getFilteredEdges(networkUUID: string, columnName: string, valueString: string, operator: '>' | '<' | '=' | '!=', limit?: number, order?: 'asc' | 'desc', format?: 'cx' | 'cx2', accessKey?: string): Promise<CX2Edge[] | CX1Edge[]>;
1281
+ /**
1282
+ * Get CX2 metadata (migrated from original NDEx.js)
1283
+ *
1284
+ * Retrieves metadata information for all aspects in a CX2 network format.
1285
+ * This function provides aspect metadata including element counts for each
1286
+ * aspect in the network using the V3 API.
1287
+ *
1288
+ * @param networkUUID - The UUID of the network to get CX2 metadata for
1289
+ * @param accessKey - Optional access key for private networks
1290
+ * @returns Promise resolving to array of CX2MetaData objects
1291
+ *
1292
+ * @example
1293
+ * ```typescript
1294
+ * // Get CX2 metadata for a network
1295
+ * const metaData = await client.networks.getCX2MetaData('network-uuid');
1296
+ * console.log(metaData); // [{ name: 'nodes', elementCount: 100 }, { name: 'edges', elementCount: 150 }]
1297
+ *
1298
+ * // Get CX2 metadata for a private network
1299
+ * const privateMetaData = await client.networks.getCX2MetaData('private-network-uuid', 'access-key');
1300
+ * ```
1301
+ */
1302
+ getCX2MetaData(networkUUID: string, accessKey?: string): Promise<CX2MetaData[]>;
1303
+ /**
1304
+ * Create network from raw CX2 data (migrated from original NDEx.js)
1305
+ *
1306
+ * Creates a new network in NDEx from raw CX2 network data. This is an unstable function
1307
+ * for uploading CX2 format networks directly to NDEx using the V3 API. The function
1308
+ * extracts the network UUID from the response location header.
1309
+ *
1310
+ * @param rawCX2 - Raw CX2 network data as an object or CX2Network instance
1311
+ * @param makePublic - Whether to make the network public (default: false = private)
1312
+ * @returns Promise resolving to an object containing the UUID of the created network
1313
+ *
1314
+ * @example
1315
+ * ```typescript
1316
+ * // Create private network from raw CX2 data
1317
+ * const result = await client.networks.createNetworkFromRawCX2(cx2Data);
1318
+ * console.log(result.uuid); // "12345678-1234-1234-1234-123456789abc"
1319
+ *
1320
+ * // Create public network from raw CX2 data
1321
+ * const publicResult = await client.networks.createNetworkFromRawCX2(cx2Data, true);
1322
+ * console.log(publicResult.uuid);
1323
+ * ```
1324
+ */
1325
+ createNetworkFromRawCX2(rawCX2: CX2Network$1 | any, makePublic?: boolean): Promise<{
1326
+ uuid: string;
1327
+ }>;
1328
+ /**
1329
+ * Update network from raw CX2 data (migrated from original NDEx.js)
1330
+ *
1331
+ * Updates an existing network with new raw CX2 data using the V3 API.
1332
+ * This function replaces the entire network content with the provided CX2 data.
1333
+ *
1334
+ * @param networkUUID - The UUID of the network to update
1335
+ * @param rawCX2 - Raw CX2 network data as an object or CX2Network instance
1336
+ * @returns Promise resolving when the network update is complete
1337
+ *
1338
+ * @example
1339
+ * ```typescript
1340
+ * // Update existing network with new CX2 data
1341
+ * await client.networks.updateNetworkFromRawCX2('network-uuid', updatedCx2Data);
1342
+ * ```
1343
+ */
1344
+ updateNetworkFromRawCX2(networkUUID: string, rawCX2: CX2Network$1 | any): Promise<void>;
1345
+ /**
1346
+ * Access to underlying service instances for advanced usage
1347
+ */
1348
+ get v2(): NetworkServiceV2;
1349
+ get v3(): NetworkServiceV3;
1350
+ }
1351
+
1352
+ interface ShareData {
1353
+ files: Record<string, 'NETWORK' | 'FOLDER' | 'SHORTCUT'>;
1354
+ }
1355
+ interface MemberData {
1356
+ members: Record<string, 'READ' | 'WRITE'>;
1357
+ }
1358
+ /**
1359
+ * FilesService - NDEx file operations and task management
1360
+ * Handles file uploads, downloads, exports, and asynchronous task tracking
1361
+ */
1362
+ declare class FilesService {
1363
+ private http;
1364
+ constructor(http: HTTPService);
1365
+ /**
1366
+ * Copy a file to a different location
1367
+ * @param fromUuid - Source file UUID
1368
+ * @param toPath - Target path
1369
+ * @param type - File type (NETWORK, FOLDER, SHORTCUT)
1370
+ * @param accessKey - Optional access key for protected files
1371
+ */
1372
+ copyFile(fromUuid: string, toPath: string, type: string, accessKey?: string): Promise<any>;
1373
+ /** Get file count statistics for the current user */
1374
+ getCount(): Promise<any>;
1375
+ /** Get files in the trash for the current user */
1376
+ getTrash(): Promise<any>;
1377
+ /** Permanently delete all files in trash */
1378
+ emptyTrash(): Promise<any>;
1379
+ /**
1380
+ * Permanently delete a file from trash
1381
+ * @param fileId - File UUID to permanently delete
1382
+ */
1383
+ permanentlyDeleteFile(fileId: string): Promise<any>;
1384
+ /**
1385
+ * Restore files from trash
1386
+ * @param networkIds - Array of network UUIDs to restore
1387
+ * @param folderIds - Array of folder UUIDs to restore
1388
+ * @param shortcutIds - Array of shortcut UUIDs to restore
1389
+ */
1390
+ restoreFile(networkIds: string[], folderIds: string[], shortcutIds: string[]): Promise<any>;
1391
+ private _validateShareData;
1392
+ private _validateMemberData;
1393
+ updateMember(files: ShareData['files'], members: MemberData['members']): Promise<any>;
1394
+ listMembers(files: any): Promise<any>;
1395
+ transferOwnership(files: ShareData['files'], newOwner: string): Promise<any>;
1396
+ listShares(limit?: number): Promise<any>;
1397
+ share(files: ShareData['files']): Promise<any>;
1398
+ unshare(files: ShareData['files']): Promise<any>;
1399
+ getFolders(limit?: number): Promise<any>;
1400
+ createFolder(name: string, parentFolderId?: string): Promise<any>;
1401
+ getFolder(folderId: string, accessKey?: string): Promise<any>;
1402
+ updateFolder(folderId: string, name: string, parentFolderId?: string): Promise<any>;
1403
+ deleteFolder(folderId: string): Promise<any>;
1404
+ getFolderCount(folderId: string, accessKey?: string): Promise<any>;
1405
+ getFolderList(folderId: string, accessKey?: string, format?: string, type?: string): Promise<any>;
1406
+ getShortcuts(limit?: number): Promise<any>;
1407
+ createShortcut(name: string, parentFolderId?: string, targetId?: string, targetType?: string): Promise<any>;
1408
+ getShortcut(shortcutId: string, accessKey?: string): Promise<any>;
1409
+ updateShortcut(shortcutId: string, name: string, parentFolderId?: string, targetId?: string, targetType?: string): Promise<any>;
1410
+ deleteShortcut(shortcutId: string): Promise<any>;
1411
+ }
1412
+
1413
+ /**
1414
+ * WorkspaceService - NDEx CyWeb workspace operations
1415
+ *
1416
+ * Provides methods for managing CyWeb workspaces including creation, retrieval,
1417
+ * updates, and deletion of workspaces and their associated networks.
1418
+ * All workspace operations use the V3 API.
1419
+ */
1420
+ declare class WorkspaceService {
1421
+ private http;
1422
+ constructor(http: HTTPService);
1423
+ /**
1424
+ * Create a new CyWeb workspace (migrated from original NDEx.js)
1425
+ *
1426
+ * Creates a new workspace with the specified workspace data.
1427
+ *
1428
+ * @param workspace - The workspace object to create
1429
+ * @returns Promise resolving to the response from the server (typically contains workspace location)
1430
+ *
1431
+ * @example
1432
+ * ```typescript
1433
+ * const workspaceData = {
1434
+ * name: "My Workspace",
1435
+ * description: "A sample workspace",
1436
+ * networkIds: []
1437
+ * };
1438
+ * const response = await client.workspace.createCyWebWorkspace(workspaceData);
1439
+ * ```
1440
+ */
1441
+ createCyWebWorkspace(workspace: CyWebWorkspace): Promise<string>;
1442
+ /**
1443
+ * Get a CyWeb workspace by ID (migrated from original NDEx.js)
1444
+ *
1445
+ * Retrieves a workspace and its details by workspace ID.
1446
+ *
1447
+ * @param workspaceId - The UUID of the workspace to retrieve
1448
+ * @returns Promise resolving to the workspace object
1449
+ *
1450
+ * @example
1451
+ * ```typescript
1452
+ * const workspace = await client.workspace.getCyWebWorkspace('workspace-uuid');
1453
+ * console.log(workspace.name);
1454
+ * ```
1455
+ */
1456
+ getCyWebWorkspace(workspaceId: string): Promise<CyWebWorkspace>;
1457
+ /**
1458
+ * Delete a CyWeb workspace (migrated from original NDEx.js)
1459
+ *
1460
+ * Deletes the specified workspace permanently.
1461
+ *
1462
+ * @param workspaceId - The UUID of the workspace to delete
1463
+ * @returns Promise resolving when the workspace is deleted
1464
+ *
1465
+ * @example
1466
+ * ```typescript
1467
+ * await client.workspace.deleteCyWebWorkspace('workspace-uuid');
1468
+ * ```
1469
+ */
1470
+ deleteCyWebWorkspace(workspaceId: string): Promise<void>;
1471
+ /**
1472
+ * Update a CyWeb workspace (migrated from original NDEx.js)
1473
+ *
1474
+ * Updates a workspace with new data, replacing the entire workspace object.
1475
+ *
1476
+ * @param workspaceId - The UUID of the workspace to update
1477
+ * @param workspaceObj - The updated workspace object
1478
+ * @returns Promise resolving when the workspace is updated
1479
+ *
1480
+ * @example
1481
+ * ```typescript
1482
+ * const updatedWorkspace = {
1483
+ * name: "Updated Workspace Name",
1484
+ * description: "Updated description",
1485
+ * networkIds: ["network-uuid-1", "network-uuid-2"]
1486
+ * };
1487
+ * await client.workspace.updateCyWebWorkspace('workspace-uuid', updatedWorkspace);
1488
+ * ```
1489
+ */
1490
+ updateCyWebWorkspace(workspaceId: string, workspaceObj: CyWebWorkspace): Promise<void>;
1491
+ /**
1492
+ * Update CyWeb workspace name (migrated from original NDEx.js)
1493
+ *
1494
+ * Updates only the name of a workspace.
1495
+ *
1496
+ * @param workspaceId - The UUID of the workspace to update
1497
+ * @param newName - The new name for the workspace
1498
+ * @returns Promise resolving when the workspace name is updated
1499
+ *
1500
+ * @example
1501
+ * ```typescript
1502
+ * await client.workspace.updateCyWebWorkspaceName('workspace-uuid', 'New Workspace Name');
1503
+ * ```
1504
+ */
1505
+ updateCyWebWorkspaceName(workspaceId: string, newName: string): Promise<void>;
1506
+ /**
1507
+ * Update CyWeb workspace networks (migrated from original NDEx.js)
1508
+ *
1509
+ * Updates the list of network IDs associated with a workspace.
1510
+ *
1511
+ * @param workspaceId - The UUID of the workspace to update
1512
+ * @param networkIds - Array of network UUIDs to associate with the workspace
1513
+ * @returns Promise resolving when the workspace networks are updated
1514
+ *
1515
+ * @example
1516
+ * ```typescript
1517
+ * const networkIds = ['network-uuid-1', 'network-uuid-2', 'network-uuid-3'];
1518
+ * await client.workspace.updateCyWebWorkspaceNetworks('workspace-uuid', networkIds);
1519
+ * ```
1520
+ */
1521
+ updateCyWebWorkspaceNetworks(workspaceId: string, networkIds: string[]): Promise<void>;
1522
+ /**
1523
+ * Get user's CyWeb workspaces (migrated from original NDEx.js)
1524
+ *
1525
+ * Retrieves all workspaces belonging to the currently authenticated user.
1526
+ * Requires authentication.
1527
+ *
1528
+ * @returns Promise resolving to array of workspace objects
1529
+ *
1530
+ * @example
1531
+ * ```typescript
1532
+ * const workspaces = await client.workspace.getUserCyWebWorkspaces();
1533
+ * workspaces.forEach(workspace => {
1534
+ * console.log(`Workspace: ${workspace.name}`);
1535
+ * });
1536
+ * ```
1537
+ */
1538
+ getUserCyWebWorkspaces(): Promise<CyWebWorkspace[]>;
1539
+ }
1540
+
1541
+ /**
1542
+ * UserService - NDEx user-related operations
1543
+ * Handles authentication, user management, and user workspace operations
1544
+ */
1545
+ declare class UserService {
1546
+ private http;
1547
+ constructor(http: HTTPService);
1548
+ /**
1549
+ * Get authenticated user (equivalent to getSignedInUser from legacy client)
1550
+ * Returns the current signed-in user object from NDEx server
1551
+ *
1552
+ * For basic authentication: Gets the current user using the /user endpoint
1553
+ * For OAuth authentication: Uses the /users/signin endpoint with ID token
1554
+ *
1555
+ * @returns The authenticated user object
1556
+ * @note When authenticating with OAuth ID token, if a user with matching email
1557
+ * doesn't exist on the server, this function will automatically create
1558
+ * that user and return the newly created user object.
1559
+ */
1560
+ authenticate(): Promise<NDExUser>;
1561
+ /**
1562
+ * Get current user profile (equivalent to getSignedInUser from legacy client)
1563
+ * Returns the current signed-in user object from NDEx server
1564
+ *
1565
+ * Uses the /user endpoint with {valid: true} parameter for both basic and OAuth authentication.
1566
+ * Unlike authenticate(), this function will NOT automatically create a user account for OAuth.
1567
+ * If the OAuth ID token doesn't match an existing user, it will return an unauthorized error.
1568
+ *
1569
+ * @returns The current user object
1570
+ * @note This function requires existing authentication and will not create new users
1571
+ */
1572
+ getCurrentUser(): Promise<NDExUser>;
1573
+ /**
1574
+ * Update current user profile
1575
+ * Uses the UUID from the userUpdate object and server validates against authenticated user
1576
+ */
1577
+ updateCurrentUser(userUpdate: Partial<NDExUser>): Promise<void>;
1578
+ /**
1579
+ * Request password reset
1580
+ */
1581
+ requestPasswordReset(email: string): Promise<void>;
1582
+ /**
1583
+ * Reset password with user UUID (server validates UUID matches authenticated user)
1584
+ * @param userUUID - User UUID (must match authenticated user)
1585
+ * @param newPassword - New password as plain text
1586
+ */
1587
+ resetPassword(userUUID: string, newPassword: string): Promise<void>;
1588
+ /**
1589
+ * Get user by UUID
1590
+ */
1591
+ getUser(userUUID: string): Promise<NDExUser>;
1592
+ /**
1593
+ * Get user by account name or email (matches server getUserByAccountNameOrAuthenticatUser)
1594
+ * @param searchBy - Search criteria - either by username OR by email, but not both
1595
+ * @returns User object matching the search criteria
1596
+ * @note If both username and email are provided, only username will be used
1597
+ */
1598
+ getUserByNameOrEmail(searchBy: {
1599
+ username: string;
1600
+ } | {
1601
+ email: string;
1602
+ }): Promise<NDExUser>;
1603
+ /**
1604
+ * Get multiple users by their UUIDs (batch operation)
1605
+ * @param uuidList - Array of user UUIDs to fetch
1606
+ * @returns Array of user objects corresponding to the provided UUIDs
1607
+ */
1608
+ getUsersByUUIDs(uuidList: string[]): Promise<NDExUser[]>;
1609
+ /**
1610
+ * Search users (equivalent to searchUsers from legacy client)
1611
+ * @param searchTerms - Search string to find users
1612
+ * @param start - Starting offset for pagination (optional)
1613
+ * @param size - Maximum number of results to return (optional)
1614
+ * @returns Array of users matching the search criteria
1615
+ */
1616
+ searchUsers(searchTerms: string, start?: number, size?: number): Promise<NDExUser[]>;
1617
+ /**
1618
+ * Get networks for a user's account page (equivalent to getAccountPageNetworks from legacy client)
1619
+ *
1620
+ * @param userUUID - User UUID to get networks for
1621
+ * @param offset - Starting offset for pagination (optional)
1622
+ * @param limit - Maximum number of networks to return (optional)
1623
+ * @returns Array of V2 network summaries for the specified user
1624
+ * @note This function requires authentication. The auth attribute must be set in the client configuration.
1625
+ */
1626
+ getAccountPageNetworks(userUUID: string, offset?: number, limit?: number): Promise<NetworkSummaryV2[]>;
1627
+ /**
1628
+ * Delete user account (server validates userid matches authenticated user)
1629
+ * @param userUUID - User UUID to delete (must match authenticated user)
1630
+ * @note This function requires authentication. The auth attribute must be set in the client configuration.
1631
+ * @note The userUUID parameter must be the UUID of the currently authenticated user. The server will validate this.
1632
+ */
1633
+ deleteUserAccount(userUUID: string): Promise<void>;
1634
+ }
1635
+
1636
+ /**
1637
+ * AdminService - NDEx admin operations
1638
+ * Handles system administration and user management for admin users
1639
+ */
1640
+ declare class AdminService {
1641
+ private http;
1642
+ constructor(http: HTTPService);
1643
+ }
1644
+
1645
+ /**
1646
+ * CyNDEx Service - Cytoscape-NDEx Bridge
1647
+ *
1648
+ * Provides seamless integration between Cytoscape desktop application and NDEx,
1649
+ * enabling import/export of networks with support for CX and CX2 formats.
1650
+ *
1651
+ * This service communicates with Cytoscape via its REST API and handles NDEx
1652
+ * authentication parameters that are passed to Cytoscape for NDEx operations.
1653
+ *
1654
+ * @example
1655
+ * ```typescript
1656
+ * // Basic usage
1657
+ * const cyNDEx = new CyNDExService();
1658
+ *
1659
+ * // Configure NDEx server
1660
+ * cyNDEx.setNDExBaseURL('https://www.ndexbio.org');
1661
+ *
1662
+ * // Set authentication
1663
+ * cyNDEx.setBasicAuth('username', 'password');
1664
+ * // or
1665
+ * cyNDEx.setAuthToken('oauth-id-token');
1666
+ *
1667
+ * // Import network from NDEx to Cytoscape
1668
+ * await cyNDEx.postNDExNetworkToCytoscape('network-uuid', 'access-key');
1669
+ *
1670
+ * // Export network from Cytoscape to NDEx
1671
+ * await cyNDEx.postCytoscapeNetworkToNDEx('current');
1672
+ *
1673
+ * // Import CX2 data to Cytoscape
1674
+ * await cyNDEx.postCX2NetworkToCytoscape(cx2String, 'My Network', 'My Collection');
1675
+ * ```
1676
+ */
1677
+ declare class CyNDExService {
1678
+ private _port;
1679
+ private cyRestBaseURL;
1680
+ private ndexBaseURL;
1681
+ private authConfig?;
1682
+ private axiosInstance;
1683
+ /**
1684
+ * Create a new CyNDEx service instance
1685
+ *
1686
+ * @param port - Port number for Cytoscape REST API (default: 1234)
1687
+ * @param config - Optional configuration object
1688
+ */
1689
+ constructor(port?: number, config?: CyNDExConfig);
1690
+ /**
1691
+ * Get the port number for Cytoscape REST API
1692
+ */
1693
+ get port(): number;
1694
+ /**
1695
+ * Get the base URL for Cytoscape REST API
1696
+ */
1697
+ static get cyRestBaseURL(): string;
1698
+ /**
1699
+ * Set NDEx server base URL
1700
+ *
1701
+ * @param ndexBaseURL - Complete base URL for NDEx server (e.g., 'https://www.ndexbio.org')
1702
+ * Must include protocol (https:// or http://)
1703
+ *
1704
+ * @example
1705
+ * ```typescript
1706
+ * cyNDEx.setNDExBaseURL('https://www.ndexbio.org');
1707
+ * cyNDEx.setNDExBaseURL('https://test.ndexbio.org');
1708
+ * ```
1709
+ */
1710
+ setNDExBaseURL(ndexBaseURL: string): void;
1711
+ /**
1712
+ * Get the current NDEx server base URL
1713
+ *
1714
+ * @returns Complete NDEx server base URL
1715
+ */
1716
+ getNDExBaseURL(): string;
1717
+ /**
1718
+ * Set basic authentication credentials for NDEx operations
1719
+ *
1720
+ * @param username - NDEx username
1721
+ * @param password - NDEx password
1722
+ */
1723
+ setBasicAuth(username: string, password: string): void;
1724
+ /**
1725
+ * Set OAuth ID token for NDEx operations
1726
+ *
1727
+ * @param idToken - OAuth ID token from authentication provider
1728
+ */
1729
+ setAuthToken(idToken: string): void;
1730
+ /**
1731
+ * Clear authentication credentials
1732
+ */
1733
+ clearAuth(): void;
1734
+ /**
1735
+ * Get the complete Cytoscape REST API URL
1736
+ *
1737
+ * @returns Complete URL for Cytoscape REST API
1738
+ */
1739
+ cyRestURL(): string;
1740
+ /**
1741
+ * Get authorization fields for NDEx operations
1742
+ * These are passed as parameters to Cytoscape for NDEx authentication
1743
+ *
1744
+ * @private
1745
+ * @returns Authorization parameters object
1746
+ */
1747
+ private getAuthFields;
1748
+ /**
1749
+ * Perform HTTP GET request to Cytoscape REST API
1750
+ *
1751
+ * @private
1752
+ * @param url - Endpoint URL (relative to base URL)
1753
+ * @returns Promise resolving to response data
1754
+ */
1755
+ private _httpGet;
1756
+ /**
1757
+ * Perform HTTP POST request to Cytoscape REST API
1758
+ *
1759
+ * @private
1760
+ * @param url - Endpoint URL (relative to base URL)
1761
+ * @param params - Optional query parameters
1762
+ * @param data - Optional request body data
1763
+ * @returns Promise resolving to response data
1764
+ */
1765
+ private _httpPost;
1766
+ /**
1767
+ * Perform HTTP PUT request to Cytoscape REST API
1768
+ *
1769
+ * @private
1770
+ * @param url - Endpoint URL (relative to base URL)
1771
+ * @param params - Optional query parameters
1772
+ * @param data - Optional request body data
1773
+ * @returns Promise resolving to response data
1774
+ */
1775
+ private _httpPut;
1776
+ /**
1777
+ * Get CyNDEx plugin status from Cytoscape
1778
+ *
1779
+ * @returns Promise resolving to CyNDEx status information
1780
+ */
1781
+ getCyNDExStatus(): Promise<CyNDExStatusResponse>;
1782
+ /**
1783
+ * Get network summary information from Cytoscape
1784
+ *
1785
+ * @param suid - Network SUID or 'current' for current network (default: 'current')
1786
+ * @returns Promise resolving to network summary
1787
+ */
1788
+ getCytoscapeNetworkSummary(suid?: string): Promise<CytoscapeNetworkSummary>;
1789
+ /**
1790
+ * Import network from NDEx to Cytoscape
1791
+ *
1792
+ * @param uuid - NDEx network UUID
1793
+ * @param accessKey - Optional access key for private networks
1794
+ * @param createView - Whether to create a network view (default: undefined)
1795
+ * @returns Promise resolving to import result
1796
+ */
1797
+ postNDExNetworkToCytoscape(uuid: string, accessKey?: string, createView?: boolean): Promise<any>;
1798
+ /**
1799
+ * Import CX network data to Cytoscape
1800
+ *
1801
+ * @param cx - CX format network data
1802
+ * @returns Promise resolving to import result
1803
+ */
1804
+ postCXNetworkToCytoscape(cx: any): Promise<any>;
1805
+ /**
1806
+ * Import CX2 network data to Cytoscape
1807
+ *
1808
+ * @param cx2_string - CX2 format network data as string
1809
+ * @param title - Network title
1810
+ * @param collection_name - Collection name
1811
+ * @returns Promise resolving to import result
1812
+ */
1813
+ postCX2NetworkToCytoscape(cx2_string: string, title: string, collection_name: string): Promise<any>;
1814
+ /**
1815
+ * Export network from Cytoscape to NDEx (create new network)
1816
+ *
1817
+ * @param suid - Network SUID or 'current' for current network (default: 'current')
1818
+ * @returns Promise resolving to export result
1819
+ */
1820
+ postCytoscapeNetworkToNDEx(suid?: string): Promise<any>;
1821
+ /**
1822
+ * Update existing network in NDEx with data from Cytoscape
1823
+ *
1824
+ * @param suid - Network SUID or 'current' for current network (default: 'current')
1825
+ * @param uuid - Target NDEx network UUID to update
1826
+ * @returns Promise resolving to update result
1827
+ */
1828
+ putCytoscapeNetworkInNDEx(suid: string, uuid: string): Promise<any>;
1829
+ }
1830
+
1831
+ /**
1832
+ * NDExClient - Main client class for NDEx API operations
1833
+ *
1834
+ * Provides a unified interface for all NDEx operations with intelligent
1835
+ * version routing between v2 and v3 APIs.
1836
+ *
1837
+ * @example
1838
+ * ```typescript
1839
+ * // Basic usage
1840
+ * const client = new NDExClient({
1841
+ * baseURL: 'https://www.ndexbio.org',
1842
+ * debug: true
1843
+ * });
1844
+ *
1845
+ * // Authenticate
1846
+ * await client.user.authenticate({ username: 'user', password: 'pass' });
1847
+ *
1848
+ * // Search networks
1849
+ * const results = await client.networks.searchNetworks({ searchString: 'pathway' });
1850
+ *
1851
+ * // Get network as CX2
1852
+ * const network = await client.networks.getNetworkAsCX2Object('network-uuid');
1853
+ *
1854
+ * // User operations
1855
+ * const profile = await client.user.getCurrentUser();
1856
+ *
1857
+ * // Admin operations (requires admin privileges)
1858
+ * const stats = await client.admin.getSystemStats();
1859
+ * ```
1860
+ */
1861
+ declare class NDExClient {
1862
+ private httpService;
1863
+ /** Network operations with intelligent v2/v3 routing */
1864
+ readonly networks: UnifiedNetworkService;
1865
+ /** File upload/download and task management */
1866
+ readonly files: FilesService;
1867
+ /** Workspace operations (deprecated - most functionality moved to other services) */
1868
+ readonly workspace: WorkspaceService;
1869
+ /** User authentication and management */
1870
+ readonly user: UserService;
1871
+ /** System administration operations */
1872
+ readonly admin: AdminService;
1873
+ constructor(config?: NDExClientConfig);
1874
+ /**
1875
+ * Clear authentication
1876
+ */
1877
+ logout(): void;
1878
+ /**
1879
+ * Get server status information
1880
+ * Can be called by authenticated or anonymous users.
1881
+ * @param format - Optional format parameter. Use 'full' for detailed information including properties and importers/exporters
1882
+ * @returns Server status including network/user counts and optional server details
1883
+ */
1884
+ getServerStatus(format?: 'full'): Promise<{
1885
+ message: string;
1886
+ properties?: {
1887
+ ServerVersion: string;
1888
+ Build: string;
1889
+ ServerResultLimit: string;
1890
+ ImporterExporters: Array<{
1891
+ importer: boolean;
1892
+ exporter: boolean;
1893
+ fileExtension: string;
1894
+ name: string;
1895
+ description: string;
1896
+ }>;
1897
+ };
1898
+ networkCount: number;
1899
+ userCount: number;
1900
+ groupCount?: number;
1901
+ }>;
1902
+ /**
1903
+ * Check if client has valid authentication information configured
1904
+ * @returns true if auth is a valid BasicAuth or OAuthAuth object, false otherwise
1905
+ */
1906
+ hasAuthInfo(): boolean;
1907
+ /**
1908
+ * Update client configuration
1909
+ */
1910
+ updateConfig(config: Partial<NDExClientConfig>): void;
1911
+ /**
1912
+ * Get current client configuration
1913
+ */
1914
+ getConfig(): NDExClientConfig;
1915
+ /**
1916
+ * Access to low-level HTTP service for advanced usage
1917
+ */
1918
+ get http(): HTTPService;
1919
+ /**
1920
+ * Access to version-specific network services for advanced usage
1921
+ */
1922
+ get v2(): {
1923
+ networks: NetworkServiceV2;
1924
+ };
1925
+ get v3(): {
1926
+ networks: NetworkServiceV3;
1927
+ };
1928
+ }
1929
+ declare const version: string;
1930
+
1931
+ 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, HTTPService, type MappingDefinition, type NDExAny, NDExAuthError, type NDExAuthResponse, NDExClient, type NDExClientConfig, NDExError, type NDExExportParams, type NDExImportParams, NDExNetworkError, NDExNotFoundError, 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, type VPMappingType, type VisualPropertyMapping, type VisualPropertyTable, WorkspaceService, version };