Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readHistoryServerCapabilities(the_session,callback) {
// display HistoryCapabilities of server
const browsePath = makeBrowsePath(ObjectIds.ObjectsFolder,"/Server/ServerCapabilities.HistoryServerCapabilities");
the_session.translateBrowsePath(browsePath,function(err,result) {
if (err) { return callback(err); }
if (result.statusCode !== StatusCodes.Good) {
return callback();
}
const historyServerCapabilitiesNodeId = result.targets[0].targetId;
// (should be ns=0;i=11192)
assert(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
// -------------------------
const properties = [
"AccessHistoryDataCapability",
"AccessHistoryEventsCapability",
"DeleteAtTimeCapability",
"DeleteRawCapability",
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
if (results[2].statusCode !== StatusCodes.Good) {
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
if (results[2].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory SetPosition Method");
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
if (results[2].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory SetPosition Method");
}
if (results[3].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory GetPosition Method");
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
if (results[2].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory SetPosition Method");
}
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
private async extractMethodsIds(): Promise {
const browsePaths: BrowsePath[] = [
makeBrowsePath(this.fileNodeId, "/Open"),
makeBrowsePath(this.fileNodeId, "/Close"),
makeBrowsePath(this.fileNodeId, "/SetPosition"),
makeBrowsePath(this.fileNodeId, "/GetPosition"),
makeBrowsePath(this.fileNodeId, "/Write"),
makeBrowsePath(this.fileNodeId, "/Read"),
makeBrowsePath(this.fileNodeId, "/OpenCount"),
makeBrowsePath(this.fileNodeId, "/Size")
];
const results = await this.session.translateBrowsePath(browsePaths);
if (results[0].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Open Method");
}
if (results[1].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory Close Method");
}
if (results[2].statusCode !== StatusCodes.Good) {
throw new Error("fileType object does not expose mandatory SetPosition Method");
}
if (results[3].statusCode !== StatusCodes.Good) {