Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async expand_opcua_node(node: any): Promise {
if (!this.session) {
throw new Error("No Session yet");
}
if (this.session.isReconnecting) {
throw new Error("Session is not available (reconnecting)");
}
const children: NodeChild[] = [];
const nodesToBrowse = [{
nodeId: node.nodeId,
referenceTypeId: "Organizes",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
},
{
nodeId: node.nodeId,
referenceTypeId: "Aggregates",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
},
{
nodeId: node.nodeId,
referenceTypeId: "HasSubtype",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
}
const children: NodeChild[] = [];
const nodesToBrowse = [{
nodeId: node.nodeId,
referenceTypeId: "Organizes",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
},
{
nodeId: node.nodeId,
referenceTypeId: "Aggregates",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
},
{
nodeId: node.nodeId,
referenceTypeId: "HasSubtype",
includeSubtypes: true,
browseDirection: BrowseDirection.Forward,
resultMask: 0x3f
},
];
try {
const results = await this.session.browse(nodesToBrowse);
let result = results[0];