@js4cytoscape/ndex-client 0.4.3-alpha.3 → 0.4.3-alpha.5

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.3",
3
+ "version": "0.4.3-alpha.5",
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,32 @@ 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
+
396
+ getAttributesOfSelectedNodes(uuid, {ids: nodeIds, attributeNames: names},accessKey) {
397
+ let parameters = {
398
+ };
399
+
400
+ if (accessKey != null) {
401
+ parameters ['accesskey'] = accessKey;
402
+ }
403
+
404
+ let data = {
405
+ "ids": nodeIds,
406
+ "attributeNames": names,
407
+ };
408
+
409
+ return this._httpPostV3ProtectedObj('/search/networks/' + uuid + '/nodes', parameters, data);
410
+ }
411
+
383
412
  createNetworkFromRawCX(rawCX, parameters) {
384
413
  return new Promise((resolve, reject) =>{
385
414
  this._httpPostProtectedObj('network', parameters, rawCX).then(
@@ -463,7 +492,7 @@ class NDEx {
463
492
  return this._httpPostProtectedObj('search/network', params, data);
464
493
  }
465
494
 
466
- neighborhoodQuery(uuid, searchTerms, saveResult, parameters) {
495
+ neighborhoodQuery(uuid, searchTerms, saveResult, parameters, outputCX2 = false) {
467
496
  let params = {};
468
497
 
469
498
  if (saveResult !== undefined && saveResult === true) {params.save = true;}
@@ -484,7 +513,13 @@ class NDEx {
484
513
  if (parameters.directOnly !== undefined) {
485
514
  data.directOnly = parameters.directOnly;
486
515
  }
516
+ if ( parameters.nodeIds !=null) {
517
+ data.nodeIds = parameters.nodeIds;
518
+ }
487
519
  }
520
+ if( outputCX2)
521
+ return this._httpPostV3ProtectedObj('search/network/' + uuid + '/query', params, data);
522
+
488
523
  return this._httpPostProtectedObj('search/network/' + uuid + '/query', params, data);
489
524
 
490
525
  }
@@ -533,10 +568,10 @@ class NDEx {
533
568
  getNetworkSummariesV3ByUUIDs(uuidList, accessKey,fmt) {
534
569
  let parameter = {format: fmt == undefined ? "FULL" : fmt}
535
570
 
536
- if(accessKey === undefined)
571
+ if(accessKey != null)
537
572
  parameter['accesskey']= accessKey;
538
573
 
539
- return this._httpPostV3ProtectedObj('/networks/summary', parameter, uuidList);
574
+ return this._httpPostV3ProtectedObj('batch/networks/summary', parameter, uuidList);
540
575
  }
541
576
 
542
577