Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ClientSession.prototype.call = function (methodsToCall, callback) {
const self = this;
const isArray = _.isArray(methodsToCall);
if (!isArray) { methodsToCall = [methodsToCall]; }
assert(_.isArray(methodsToCall));
// Note : The client has no explicit address space and therefore will struggle to
// access the method arguments signature.
// There are two methods that can be considered:
// - get the object definition by querying the server
// - load a fake address space to have some thing to query on our end
// const request = self._client.factory.constructObjectId("CallRequest",{ methodsToCall: methodsToCall});
const request = new call_service.CallRequest({methodsToCall: methodsToCall});
self.performMessageTransaction(request, function (err, response) {
/* istanbul ignore next */
if (err) {
return callback(err);
}
assert(response instanceof call_service.CallResponse);
callback(null, isArray ? response.results : response.results[0]);
});
};