Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// xx console.log("xxx ",arg.toString());
const propName = lowerFirstLetter(arg.name);
const value = inputArgs[propName];
if (value === undefined) {
throw new Error("expecting input argument " + propName);
}
if (arrayType === VariantArrayType.Array) {
if (!_.isArray(value)) {
throw new Error("expecting value to be an Array or a TypedArray");
}
}
return new Variant({arrayType, dataType, value});
});
const methodToCall = new CallMethodRequest({
inputArguments,
methodId: reference.nodeId,
objectId: obj.nodeId,
});
session.call(methodToCall, (err: Error | null, callResult?: CallMethodResult) => {
// istanbul ignore next
if (err) {
return callback(err);
}
callResult = callResult!;
if (callResult.statusCode !== StatusCodes.Good) {
return callback(new Error("Error " + callResult.statusCode.toString()));
const propName = lowerFirstLetter(arg.name);
const value = inputArgs[propName];
if (value === undefined) {
throw new Error("expecting input argument " + propName);
}
if (arrayType === VariantArrayType.Array) {
if (!_.isArray(value)) {
throw new Error("expecting value to be an Array or a TypedArray");
}
}
return new Variant({arrayType: arrayType, dataType: dataType, value: value});
});
const methodToCall = new call_service.CallMethodRequest({
objectId: obj.nodeId,
methodId: reference.nodeId,
inputArguments: inputArguments
});
//xx console.log(" calling ",methodToCall.toString());
session.call(methodToCall, function (err, callResult) {
// istanbul ignore next
if (err) {
return callback(err);
}
if (callResult.statusCode !== StatusCodes.Good) {
return callback(new Error("Error " + callResult.statusCode.toString()));
}
(innerCallback: ErrorCallback) => {
const methodToCalls = [];
methodToCalls.push(new CallMethodRequest({
inputArguments: [
/* eventId */ new Variant({ dataType: "ByteString", value: eventId }),
/* comment */ new Variant({ dataType: "LocalizedText", value: comment })
],
methodId,
objectId: conditionId
}));
this.call(methodToCalls, (err: Error | null, results?: CallMethodResult[]) => {
if (err) {
return innerCallback(err);
}
statusCode = results![0].statusCode;
innerCallback();
});
}
ClientSession.prototype.getMonitoredItems = function (subscriptionId, callback) {
//
//
//
const self = this;
const methodsToCall =
new call_service.CallMethodRequest({
objectId: coerceNodeId("ns=0;i=2253"), // ObjectId.Server
methodId: coerceNodeId("ns=0;i=11492"), // MethodIds.Server_GetMonitoredItems;
inputArguments: [
// BaseDataType
{dataType: DataType.UInt32, value: subscriptionId}
]
});
self.call([methodsToCall], function (err, result) {
/* istanbul ignore next */
if (err) {
return callback(err);
}
result = result[0];