Comparing version 2.11.0 to 3.0.0
@@ -505,4 +505,3 @@ /* | ||
} | ||
/** | ||
/** | ||
* Fetch entities from a context | ||
@@ -515,8 +514,8 @@ * | ||
HKDatasource.prototype.getContextChildrenLazy = function(context, payload, callback = () => {}) | ||
{ | ||
let url = `${this.url}repository/${this.graphName}/context/${context}/lazy`; | ||
Object.assign(payload, this.options); | ||
const options = { | ||
HKDatasource.prototype.getContextChildren = function(context, payload, callback = () => {}) | ||
{ | ||
let url = `${this.url}repository/${this.graphName}/context/${context}`; | ||
Object.assign(payload, this.options); | ||
const options = { | ||
method: 'POST', | ||
@@ -530,29 +529,29 @@ url: url, | ||
}; | ||
request(options, (err, res) => | ||
{ | ||
if(!err) | ||
{ | ||
if(requestCompletedWithSuccess (res.statusCode)) | ||
{ | ||
try | ||
{ | ||
callback(null, res.body); | ||
} | ||
catch(exp) | ||
{ | ||
callback(exp); | ||
} | ||
} | ||
else | ||
{ | ||
callback(stringifyResponseLog(res)); | ||
} | ||
} | ||
else | ||
{ | ||
callback(err); | ||
} | ||
}); | ||
} | ||
request(options, (err, res) => | ||
{ | ||
if(!err) | ||
{ | ||
if(requestCompletedWithSuccess (res.statusCode)) | ||
{ | ||
try | ||
{ | ||
callback(null, res.body); | ||
} | ||
catch(exp) | ||
{ | ||
callback(exp); | ||
} | ||
} | ||
else | ||
{ | ||
callback(`Server responded with ${res.statusCode}. ${res.body}`); | ||
} | ||
} | ||
else | ||
{ | ||
callback(err); | ||
} | ||
}); | ||
} | ||
@@ -559,0 +558,0 @@ /** |
@@ -31,2 +31,4 @@ /* | ||
exports.VIRTUAL_SOURCE_PROPERTY = "virtualsrc"; | ||
const RolesTypes = require("./roletypes"); | ||
@@ -33,0 +35,0 @@ |
{ | ||
"name": "hklib", | ||
"version": "2.11.0", | ||
"version": "3.0.0", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "author": "IBM Research", |
114388
4279