Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
nodeClass: NodeClass.Object,
nodeId: resolveNodeId(ObjectIds.ModellingRule_Mandatory),
}) as any as UAObject;
// add the root folder
{
const rootFolder = namespace0._createNode({
browseName: "RootFolder",
nodeClass: NodeClass.Object,
nodeId: resolveNodeId(ObjectIds.RootFolder)
}) as any as UAObject;
{
const objectsFolder = namespace0.addObject({
browseName: "Objects",
nodeId: resolveNodeId(ObjectIds.ObjectsFolder),
organizedBy: rootFolder
});
assert(rootFolder.getFolderElementByName("Objects")!
.browseName.toString() === "Objects");
}
{
const dataTypeFolder = namespace0.addObject({
browseName: "DataType",
nodeId: resolveNodeId(ObjectIds.DataTypesFolder),
organizedBy: rootFolder
});
{
const doubleDataType = namespace0._createNode({
browseName: "Double",
isAbstract: true
});
// add the root folder
{
const rootFolder = namespace0._createNode({
browseName: "RootFolder",
nodeId: resolveNodeId(ObjectIds.RootFolder),
nodeClass: NodeClass.Object
});
{
const objectsFolder = namespace0.addObject({
browseName: "Objects",
nodeId: resolveNodeId(ObjectIds.ObjectsFolder),
organizedBy: rootFolder
});
rootFolder.getFolderElementByName("Objects").browseName.toString().should.eql("Objects");
}
{
const dataTypeFolder = namespace0.addObject({
browseName: "DataType",
nodeId: resolveNodeId(ObjectIds.DataTypesFolder),
organizedBy: rootFolder
});
{
const doubleDataType = namespace0._createNode({
browseName: "Double",
nodeId: resolveNodeId(DataTypeIds.Double),
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",
export function readHistoryServerCapabilities(
session: ClientSession,
callback?: (err: Error | null, capabilities?: HistoryServerCapabilities) => void
): any {
if (!callback) { throw new Error("Internal error"); }
// display HistoryCapabilities of server
const browsePath: BrowsePath = makeBrowsePath(
ObjectIds.ObjectsFolder,
"/Server/ServerCapabilities.HistoryServerCapabilities");
session.translateBrowsePath(browsePath, (err: Error | null, result?: BrowsePathResult) => {
if (err) {
return callback(err);
}
if (!result) {
return callback(new Error("Internal Error"));
}
if (result.statusCode !== StatusCodes.Good) {
return callback(new Error("StatusCode = " + result.statusCode.toString()));
}
result.targets = result.targets || [];
const historyServerCapabilitiesNodeId = result.targets[0].targetId;