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

datahub-nodejs-sdk

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datahub-nodejs-sdk - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

docs/datahub-nodejs-sdk.js.html

22

lib/datahub-nodejs-sdk.js
'use strict';
const assert = require('assert');
const fetch = require('node-fetch');
const assert = require('assert');

@@ -54,2 +54,9 @@ const _ = require('./helper');

/**
* update scene by projectId and dataId.
* @async
* @param {string} projectId
* @param {string} dataId
* @returns {Promise}
*/
async updateSceneByProjectIdAndDataId (projectId, dataId, {

@@ -80,2 +87,9 @@ currentScene,

/**
* get data list by projectId and dataId.
* @async
* @param {string} projectId
* @param {string} dataId
* @returns {Promise}
*/
async getDataByProjectIdAndDataId (projectId, dataId) {

@@ -87,2 +101,8 @@ assert(projectId, 'projectId is required');

/**
* get data list by projectId.
* @async
* @param {string} projectId
* @returns {Promise}
*/
async getDataListByProjectId (projectId) {

@@ -89,0 +109,0 @@ assert(projectId, 'projectId is required');

11

package.json
{
"name": "datahub-nodejs-sdk",
"version": "1.0.4",
"version": "1.0.5",
"description": "DataHub Node.js SDK",

@@ -25,2 +25,4 @@ "keywords": [

"eslint-plugin-mocha": "4",
"jsdoc": "^3.5.5",
"minami": "^1.1.1",
"mocha": "4",

@@ -33,4 +35,7 @@ "nyc": "^11.4.1",

"ci": "npm run lint && npm run test",
"test": "nyc --reporter=text-summary --reporter=html `npm bin`/_mocha",
"lint": "eslint index.js lib bin test --fix"
"test": "npm run clean:test && nyc --reporter=text-summary --reporter=html `npm bin`/_mocha",
"lint": "eslint index.js lib bin test --fix",
"clean:test": "rm -rf ./coverage",
"clean:doc": "rm -rf ./docs",
"doc": "npm run clean:doc && jsdoc -c ./jsdoc.json"
},

@@ -37,0 +42,0 @@ "pre-commit": [

@@ -28,4 +28,8 @@ # datahub-nodejs-sdk

## API Documents
[link](//macacajs.github.io/datahub-nodejs-sdk/)
## License
The MIT License (MIT)

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

const config = require('./config');
const localhost = config.localhost;
describe('sdk test', function () {

@@ -43,3 +47,3 @@ it('default options', function () {

}).then(data => {
assert(data[0] === 'http://127.0.0.1:5678/api/data/projectId/dataId');
assert(data[0] === `${localhost}/api/data/projectId/dataId`);
assert.deepStrictEqual(data[1], {

@@ -77,3 +81,3 @@ method: 'POST',

}).then(data => {
assert(data[0] === 'http://127.0.0.1:5678/api/data/projectId/dataId');
assert(data[0] === `${localhost}/api/data/projectId/dataId`);
assert.deepStrictEqual(data[1], {

@@ -124,3 +128,5 @@ method: 'POST',

return Promise.resolve({
json: () => Promise.resolve(args),
json: () => {
return Promise.resolve(args);
},
});

@@ -132,3 +138,3 @@ });

}).then(data => {
assert.equal(data[0], 'http://127.0.0.1:5678/api/data/projectId/dataId');
assert(data[0] === `${localhost}/api/data/projectId/dataId`);
assert.deepStrictEqual(data[1], {

@@ -176,3 +182,5 @@ method: 'POST',

return Promise.resolve({
json: () => { return Promise.resolve(args); },
json: () => {
return Promise.resolve(args);
},
});

@@ -182,3 +190,3 @@ });

.then(data => {
assert.equal(data[0], 'http://127.0.0.1:5678/api/data/projectId');
assert.equal(data[0], `${localhost}/api/data/projectId`);
assert.deepStrictEqual(data[1], {

@@ -210,3 +218,5 @@ credentials: 'same-origin',

return Promise.resolve({
json: () => { return Promise.resolve(args); },
json: () => {
return Promise.resolve(args);
},
});

@@ -216,3 +226,3 @@ });

.then(data => {
assert.equal(data[0], 'http://127.0.0.1:5678/api/data/projectId/dataId');
assert.equal(data[0], `${localhost}/api/data/projectId/dataId`);
assert.deepStrictEqual(data[1], {

@@ -239,2 +249,1 @@ credentials: 'same-origin',

});

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

const config = require('./config');
const localhost = config.localhost;
describe('fetch test', function () {

@@ -18,3 +22,5 @@ it('get with params', function () {

});
return client.get('data/baz/fred', { key: 'value' }, {
return client.get('data/baz/fred', {
key: 'value',
}, {
headers: {

@@ -24,3 +30,3 @@ 'proxy-key': 'proxy-value',

}).then(data => {
assert(data[0] === 'http://127.0.0.1:5678/api/data/baz/fred?key=value');
assert(data[0] === `${localhost}/api/data/baz/fred?key=value`);
assert.deepStrictEqual(data[1], {

@@ -27,0 +33,0 @@ credentials: 'same-origin',

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