datahub-nodejs-sdk
Advanced tools
Comparing version 1.0.4 to 1.0.5
'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'); |
{ | ||
"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', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 2 instances in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1449543
50
1254
35
9
1
4