node-opcua-client-dynamic-extension-object
Advanced tools
Comparing version 2.5.0-alpha.1 to 2.5.0-alpha.2
@@ -589,2 +589,13 @@ "use strict"; | ||
} | ||
function readBrowseName(session, nodeId) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const dataValue = yield session.read({ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
const message = "cannot extract BrowseName of nodeId = " + nodeId.toString(); | ||
debugLog(message); | ||
throw new Error(message); | ||
} | ||
return dataValue.value.value.name; | ||
}); | ||
} | ||
function resolveFieldType(session, dataTypeNodeId, dataTypeFactory, cache) { | ||
@@ -602,13 +613,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
} | ||
function getFieldTypeName() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const dataValue = yield session.read({ nodeId: dataTypeNodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
debugLog("cannot extract node", dataTypeNodeId.toString()); | ||
throw new Error("cannot extract browseName for nodeId " + dataTypeNodeId.toString()); | ||
} | ||
return dataValue.value.value.name; | ||
}); | ||
} | ||
const fieldTypeName = yield getFieldTypeName(); | ||
const fieldTypeName = yield readBrowseName(session, dataTypeNodeId); | ||
let schema; | ||
@@ -615,0 +616,0 @@ let category = node_opcua_factory_1.FieldCategory.enumeration; |
{ | ||
"name": "node-opcua-client-dynamic-extension-object", | ||
"version": "2.5.0-alpha.1", | ||
"version": "2.5.0-alpha.2", | ||
"description": "pure nodejs OPCUA SDK - module client-dynamic-extension-object", | ||
@@ -44,3 +44,3 @@ "main": "./dist/index.js", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "948ef35d410ec9af5dbdafdedefde0aaffd3ebcd" | ||
"gitHead": "b56b01a361c4741405cebd24c199e495eae37cd6" | ||
} |
@@ -743,2 +743,13 @@ // tslint:disable: no-console | ||
} | ||
async function readBrowseName(session: IBasicSession, nodeId: NodeId): Promise<string> { | ||
const dataValue = await session.read({ nodeId, attributeId: AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== StatusCodes.Good) { | ||
const message = "cannot extract BrowseName of nodeId = " + nodeId.toString(); | ||
debugLog(message); | ||
throw new Error(message); | ||
} | ||
return dataValue.value!.value.name; | ||
} | ||
async function resolveFieldType( | ||
@@ -761,11 +772,3 @@ session: IBasicSession, | ||
} | ||
async function getFieldTypeName(): Promise<string> { | ||
const dataValue = await session.read({ nodeId: dataTypeNodeId, attributeId: AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== StatusCodes.Good) { | ||
debugLog("cannot extract node", dataTypeNodeId.toString()); | ||
throw new Error("cannot extract browseName for nodeId " + dataTypeNodeId.toString()); | ||
} | ||
return dataValue.value!.value.name; | ||
} | ||
const fieldTypeName = await getFieldTypeName(); | ||
const fieldTypeName = await readBrowseName(session, dataTypeNodeId); | ||
@@ -772,0 +775,0 @@ let schema: any; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
333500
1876