Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cbioportal-api-client

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cbioportal-api-client - npm Package Compare versions

Comparing version 0.2.13 to 0.3.0

webpack.config.prod.js

27

dist/index.js

@@ -7,2 +7,6 @@ 'use strict';

var _keys = require('babel-runtime/core-js/object/keys');
var _keys2 = _interopRequireDefault(_keys);
var _create = require('babel-runtime/core-js/object/create');

@@ -21,5 +25,5 @@

var _requestPromise = require('request-promise');
var _isomorphicFetch = require('isomorphic-fetch');
var _requestPromise2 = _interopRequireDefault(_requestPromise);
var _isomorphicFetch2 = _interopRequireDefault(_isomorphicFetch);

@@ -80,5 +84,4 @@ var _reduce2 = require('lodash/reduce');

headers: {
'User-Agent': 'cbioportal-api-client.js/0.0.1'
},
uri: 'http://www.cbioportal.org/webservice.do'
'User-Agent': 'cbioportal-api-client.js/1.0.0'
}
})

@@ -122,9 +125,11 @@ });

var cmd = 'get' + endpoint;
var qsObj = (0, _assign2.default)((0, _utils.formatQuery)(query), { cmd: cmd });
var qs = (0, _keys2.default)(qsObj).reverse().map(function (key) {
return key + '=' + encodeURIComponent(qsObj[key]);
}).join('&');
var requestOpts = (0, _assign2.default)({
qs: (0, _assign2.default)((0, _utils.formatQuery)(query), { cmd: cmd })
}, this.requestOpts);
return (0, _requestPromise2.default)(requestOpts).then(function (response) {
return (0, _utils.convertResponse)(response, cmd);
return (0, _isomorphicFetch2.default)('http://www.cbioportal.org/webservice.do?' + qs, this.requestOpts).then(function (response) {
return response.text();
}).then(function (responseText) {
return (0, _utils.convertResponse)(responseText, cmd);
});

@@ -131,0 +136,0 @@ },

@@ -11,2 +11,6 @@ 'use strict';

var _promise = require('babel-runtime/core-js/promise');
var _promise2 = _interopRequireDefault(_promise);
Object.defineProperty(exports, "__esModule", {

@@ -17,6 +21,2 @@ value: true

var _bluebird = require('bluebird');
var _bluebird2 = _interopRequireDefault(_bluebird);
var _csvParser = require('csv-parser');

@@ -34,8 +34,6 @@

var _ExecutionEnvironment = require('fbjs/lib/ExecutionEnvironment');
var _stream = require('stream');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var Readable = _ExecutionEnvironment.canUseDom ? require('stream-browserify').Readable : require('stream').Readable;
var copyNumberRegexp = /^.*#.*(?:COPY_NUMBER_ALTERATION)\n/mg;

@@ -60,4 +58,4 @@ var mutationRegexp = /^.*#.*(?:MUTATION_EXTENDED)\n/mg;

return new _bluebird2.default(function (resolve) {
var stream = new Readable();
return new _promise2.default(function (resolve) {
var stream = new _stream.Readable();
var rows = [];

@@ -64,0 +62,0 @@ stream._read = function () {}; // eslint-disable-line no-underscore-dangle

'use strict';
var _promise = require('babel-runtime/core-js/promise');
var _promise2 = _interopRequireDefault(_promise);
var _typeof2 = require('babel-runtime/helpers/typeof');

@@ -16,6 +20,2 @@

var _bluebird = require('bluebird');
var _bluebird2 = _interopRequireDefault(_bluebird);
var _map2 = require('lodash/map');

@@ -54,2 +54,4 @@

*/
/* eslint-disable no-param-reassign */
function reduceCaseIds(key) {

@@ -71,4 +73,2 @@ return function (cases, n) {

*/
/* eslint-disable no-param-reassign */
function summarizer(cases, alterationFilter) {

@@ -193,3 +193,3 @@ var summary = (0, _transform3.default)(cases, function (result, n, key) {

return new _bluebird2.default(function (resolve) {
return new _promise2.default(function (resolve) {

@@ -196,0 +196,0 @@ var rows = (0, _flatten3.default)((0, _map3.default)((0, _flattenDeep3.default)(dataSets), function (set) {

@@ -8,3 +8,3 @@ /**

import Request from 'request-promise';
import Fetch from 'isomorphic-fetch';
import _reduce from 'lodash/reduce';

@@ -48,5 +48,4 @@ import _defaults from 'lodash/defaults';

headers: {
'User-Agent': 'cbioportal-api-client.js/0.0.1'
},
uri: 'http://www.cbioportal.org/webservice.do'
'User-Agent': 'cbioportal-api-client.js/1.0.0'
}
})

@@ -87,9 +86,10 @@ });

const cmd = `get${endpoint}`;
const qsObj = Object.assign(formatQuery(query), { cmd });
const qs = Object.keys(qsObj).reverse().map(key => {
return key + '=' + encodeURIComponent(qsObj[key]);
}).join('&');
const requestOpts = Object.assign({
qs: Object.assign(formatQuery(query), { cmd })
}, this.requestOpts);
return Request(requestOpts)
.then(response => convertResponse(response, cmd));
return Fetch(`http://www.cbioportal.org/webservice.do?${qs}`, this.requestOpts)
.then(response => response.text())
.then(responseText => convertResponse(responseText, cmd));
},

@@ -96,0 +96,0 @@

@@ -1,9 +0,6 @@

import Promise from 'bluebird';
import CsvParser from 'csv-parser';
import _map from 'lodash/map';
import _transform from 'lodash/transform';
import { canUseDom } from 'fbjs/lib/ExecutionEnvironment';
import { Readable } from 'stream';
const Readable = canUseDom ? require('stream-browserify').Readable : require('stream').Readable;
const copyNumberRegexp = /^.*#.*(?:COPY_NUMBER_ALTERATION)\n/mg;

@@ -10,0 +7,0 @@ const mutationRegexp = /^.*#.*(?:MUTATION_EXTENDED)\n/mg;

/* eslint-disable no-param-reassign */
import Promise from 'bluebird';
import _map from 'lodash/map';

@@ -5,0 +4,0 @@ import _uniq from 'lodash/uniq';

{
"name": "cbioportal-api-client",
"version": "0.2.13",
"version": "0.3.0",
"description": "cBio Portal API client with promises and response parsing",

@@ -10,3 +10,5 @@ "main": "dist/index.js",

"scripts": {
"build": "npm run clean:dist && babel lib -d dist",
"build": "npm run clean:dist && babel lib -d dist && npm run build:webpack",
"build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js",
"build:webpack:stats": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js --profile --json > stats.json",
"build:dev": "nodemon -w lib --exec \"npm run clean:dist && babel lib -d dist\"",

@@ -41,2 +43,3 @@ "clean": "npm run clean:dist && npm run clean:coverage",

"babel-eslint": "^5.0.0-beta6",
"babel-loader": "^6.2.1",
"babel-plugin-transform-es2015-modules-commonjs": "^6.4.5",

@@ -48,3 +51,5 @@ "babel-plugin-transform-runtime": "^6.4.0",

"blue-tape": "^0.1.11",
"bluebird": "^3.1.5",
"coveralls": "^2.11.6",
"cross-env": "^1.0.7",
"ddata": "github:nathanmarks/ddata#personal-modifications",

@@ -56,2 +61,3 @@ "eslint": "^1.10.3",

"jsdoc-to-markdown": "^1.3.3",
"json-loader": "^0.5.4",
"nock": "^5.2.1",

@@ -61,16 +67,13 @@ "rimraf": "^2.5.0",

"tap-xunit": "^1.3.1",
"tape": "^4.4.0"
"tape": "^4.4.0",
"webpack": "^1.12.12"
},
"dependencies": {
"bluebird": "^3.1.1",
"cls-bluebird": "^1.0.1",
"commander": "^2.9.0",
"continuation-local-storage": "^3.1.4",
"csv-parser": "^1.9.2",
"fbjs": "^0.7.0",
"in-publish": "^2.0.0",
"isomorphic-fetch": "^2.2.1",
"lodash": "^4.0.0",
"request-promise": "^2.0.0",
"stream-browserify": "^2.0.1"
"readable-stream": "^2.0.5"
}
}

@@ -6,3 +6,3 @@ # cBio Portal API Client

[cBio Portal API](http://www.cbioportal.org/web_api.jsp) client. Parses tab separated responses into JSON format. Works in node and in the browser via a module loader such as [Webpack](http://webpack.github.io) (**soon:** just finalizing the browser build).
[cBio Portal API](http://www.cbioportal.org/web_api.jsp) client. Parses tab separated responses into JSON format. Works in node and in the browser via a module loader such as [Webpack](http://webpack.github.io).

@@ -9,0 +9,0 @@ This library can be used programatically or via the command line.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc