@js4cytoscape/ndex-client 0.4.3-alpha.2 → 0.4.3-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@js4cytoscape/ndex-client",
3
- "version": "0.4.3-alpha.2",
3
+ "version": "0.4.3-alpha.4",
4
4
  "description": "NDEx client library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -28,6 +28,9 @@
28
28
  "node": ">=12.16.1"
29
29
  },
30
30
  "dependencies": {
31
- "axios": "^1.3.4"
31
+ "axios": "^1.4.0"
32
+ },
33
+ "devDependencies": {
34
+ "@microsoft/tsdoc": "^0.14.2"
32
35
  }
33
36
  }
package/src/NDEx.js CHANGED
@@ -6,6 +6,9 @@ const CX1_HEADER = {
6
6
  }]
7
7
  };
8
8
 
9
+ /**
10
+ * NDEx client class.
11
+ */
9
12
  class NDEx {
10
13
  constructor(hostprefix) {
11
14
  if (hostprefix === undefined || hostprefix === null || hostprefix === '') {
@@ -380,6 +383,16 @@ class NDEx {
380
383
  return this._httpGetProtectedObj('network/' + uuid + '/summary', parameters);
381
384
  }
382
385
 
386
+ getNetworkV3Summary(uuid, accessKey,fmt) {
387
+ let parameters = {format: fmt != null? fmt : "FULL"}
388
+
389
+ if (accessKey != null) {
390
+ parameters ['accesskey'] = accessKey;
391
+ }
392
+
393
+ return this._httpGetV3ProtectedObj('networks/' + uuid + '/summary', parameters);
394
+ }
395
+
383
396
  createNetworkFromRawCX(rawCX, parameters) {
384
397
  return new Promise((resolve, reject) =>{
385
398
  this._httpPostProtectedObj('network', parameters, rawCX).then(
@@ -463,7 +476,7 @@ class NDEx {
463
476
  return this._httpPostProtectedObj('search/network', params, data);
464
477
  }
465
478
 
466
- neighborhoodQuery(uuid, searchTerms, saveResult, parameters) {
479
+ neighborhoodQuery(uuid, searchTerms, saveResult, parameters, outputCX2 = false) {
467
480
  let params = {};
468
481
 
469
482
  if (saveResult !== undefined && saveResult === true) {params.save = true;}
@@ -484,12 +497,18 @@ class NDEx {
484
497
  if (parameters.directOnly !== undefined) {
485
498
  data.directOnly = parameters.directOnly;
486
499
  }
500
+ if ( parameters.nodeIds !=null) {
501
+ data.nodeIds = parameters.nodeIds;
502
+ }
487
503
  }
504
+ if( outputCX2)
505
+ return this._httpPostV3ProtectedObj('search/network/' + uuid + '/query', params, data);
506
+
488
507
  return this._httpPostProtectedObj('search/network/' + uuid + '/query', params, data);
489
508
 
490
509
  }
491
510
 
492
- interConnectQuery(uuid, searchTerms, saveResult, parameters) {
511
+ interConnectQuery(uuid, searchTerms, saveResult, parameters, outputCX2 = false) {
493
512
  let params = {};
494
513
 
495
514
  if (saveResult !== undefined && saveResult === true) {params.save = true;}
@@ -503,7 +522,13 @@ class NDEx {
503
522
  if (parameters.errorWhenLimitIsOver !== undefined) {
504
523
  data.errorWhenLimitIsOver = parameters.errorWhenLimitIsOver;
505
524
  }
525
+ if ( parameters.nodeIds !=null) {
526
+ data.nodeIds = parameters.nodeIds;
527
+ }
506
528
  }
529
+ if (outputCX2)
530
+ return this._httpPostV3ProtectedObj('search/networks/' + uuid + '/interconnectquery', params, data);
531
+
507
532
  return this._httpPostProtectedObj('search/network/' + uuid + '/interconnectquery', params, data);
508
533
 
509
534
  }
@@ -524,6 +549,16 @@ class NDEx {
524
549
  return this._httpPostProtectedObj('batch/network/summary', parameter, uuidList);
525
550
  }
526
551
 
552
+ getNetworkSummariesV3ByUUIDs(uuidList, accessKey,fmt) {
553
+ let parameter = {format: fmt == undefined ? "FULL" : fmt}
554
+
555
+ if(accessKey != null)
556
+ parameter['accesskey']= accessKey;
557
+
558
+ return this._httpPostV3ProtectedObj('batch/networks/summary', parameter, uuidList);
559
+ }
560
+
561
+
527
562
  getNetworkPermissionsByUUIDs(uuidList) {
528
563
  return this._httpPostProtectedObj('batch/network/permission', undefined, uuidList);
529
564
  }
@@ -762,11 +797,11 @@ class NDEx {
762
797
  return new Promise((resolve, reject)=> {
763
798
  this._httpPostV3ProtectedObj('workspaces', undefined, workspace).then(
764
799
  (response) => {
765
- let uuidr = response.split('/');
800
+ // let uuidr = response.split('/');
766
801
 
767
- let uuid = uuidr[uuidr.length - 1];
802
+ // let uuid = uuidr[uuidr.length - 1];
768
803
 
769
- return resolve(uuid);
804
+ return resolve(response);
770
805
  },
771
806
  (err) => {reject(err);}
772
807
  );