node-opcua-client-dynamic-extension-object
Advanced tools
Comparing version 2.85.0 to 2.86.0
@@ -20,3 +20,2 @@ "use strict"; | ||
const node_opcua_pseudo_session_1 = require("node-opcua-pseudo-session"); | ||
const node_opcua_status_code_1 = require("node-opcua-status-code"); | ||
const node_opcua_types_1 = require("node-opcua-types"); | ||
@@ -46,3 +45,3 @@ const node_opcua_extension_object_1 = require("node-opcua-extension-object"); | ||
/* istanbul ignore next */ | ||
if (result3.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
if (result3.statusCode.isNotGood()) { | ||
throw new Error("Cannot find superType for " + dataTypeNodeId.toString()); | ||
@@ -117,3 +116,3 @@ } | ||
const dataValue = yield session.read({ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
if (dataValue.statusCode.isNotGood()) { | ||
const message = "cannot extract BrowseName of nodeId = " + nodeId.toString() + " statusCode = " + dataValue.statusCode.toString(); | ||
@@ -147,3 +146,3 @@ debugLog(message); | ||
/* istanbul ignore next */ | ||
if (dataTypeDefinitionDataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
if (dataTypeDefinitionDataValue.statusCode.isNotGood()) { | ||
throw new Error(" Cannot find dataType Definition ! with nodeId =" + dataTypeNodeId.toString()); | ||
@@ -290,3 +289,3 @@ } | ||
schema.dataTypeNodeId = dataTypeNodeId; | ||
if (isAbstractDV.statusCode === node_opcua_status_code_1.StatusCodes.Good && isAbstractDV.value.value === false) { | ||
if (isAbstractDV.statusCode.isGood() && isAbstractDV.value.value === false) { | ||
const encodings = yield (0, find_encodings_1._findEncodings)(session, dataTypeNodeId); | ||
@@ -293,0 +292,0 @@ schema.encodingDefaultBinary = (0, node_opcua_nodeid_2.makeExpandedNodeId)(encodings.binaryEncodingNodeId); |
@@ -17,3 +17,2 @@ "use strict"; | ||
const node_opcua_constants_1 = require("node-opcua-constants"); | ||
const node_opcua_status_code_1 = require("node-opcua-status-code"); | ||
const node_opcua_variant_1 = require("node-opcua-variant"); | ||
@@ -68,3 +67,3 @@ const populate_data_type_manager_103_1 = require("./private/populate_data_type_manager_103"); | ||
// } | ||
const countOK = dataValues.reduce((prev, a) => prev + (a.statusCode === node_opcua_status_code_1.StatusCodes.Good ? 1 : 0), 0); | ||
const countOK = dataValues.reduce((prev, a) => prev + (a.statusCode.isGood() ? 1 : 0), 0); | ||
if (countOK === dataValues.length) { | ||
@@ -71,0 +70,0 @@ return true; |
@@ -28,3 +28,2 @@ "use strict"; | ||
const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path"); | ||
const node_opcua_status_code_1 = require("node-opcua-status-code"); | ||
const node_opcua_types_1 = require("node-opcua-types"); | ||
@@ -253,3 +252,3 @@ const convert_data_type_definition_to_structuretype_schema_1 = require("../convert_data_type_definition_to_structuretype_schema"); | ||
/* istanbul ignore else */ | ||
if (dataValue.statusCode === node_opcua_status_code_1.StatusCodes.Good) { | ||
if (dataValue.statusCode.isGood()) { | ||
const dataTypeDefinition = dataValue.value.value; | ||
@@ -460,3 +459,3 @@ if (dataTypeDefinition && dataTypeDefinition instanceof node_opcua_types_1.StructureDefinition) { | ||
} | ||
if (dataValueNamespaceArray.statusCode === node_opcua_status_code_1.StatusCodes.Good && namespaceArray && namespaceArray.length > 0) { | ||
if (dataValueNamespaceArray.statusCode.isGood() && namespaceArray && namespaceArray.length > 0) { | ||
dataTypeManager.setNamespaceArray(namespaceArray); | ||
@@ -463,0 +462,0 @@ for (let namespaceIndex = 1; namespaceIndex < namespaceArray.length; namespaceIndex++) { |
@@ -42,3 +42,3 @@ "use strict"; | ||
/* istanbul ignore next */ | ||
if (isAbstractDataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
if (isAbstractDataValue.statusCode.isNotGood()) { | ||
throw new Error(" Cannot find dataType isAbstract ! with nodeId =" + dataTypeNodeId.toString()); | ||
@@ -49,3 +49,3 @@ } | ||
/* istanbul ignore next */ | ||
if (dataTypeDefinitionDataValue.statusCode !== node_opcua_status_code_1.StatusCodes.Good) { | ||
if (dataTypeDefinitionDataValue.statusCode.isNotGood()) { | ||
// may be we are reading a 1.03 server | ||
@@ -131,4 +131,4 @@ if (!isAbstract) { | ||
const nodeToBrowse = nodesToBrowse[i]; | ||
if (result.statusCode === node_opcua_status_code_1.StatusCodes.BadNoContinuationPoints || | ||
result.statusCode === node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid) { | ||
if (result.statusCode.equals(node_opcua_status_code_1.StatusCodes.BadNoContinuationPoints) || | ||
result.statusCode.equals(node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid)) { | ||
// not enough continuation points .. we need to rebrowse | ||
@@ -138,3 +138,3 @@ pendingNodesToBrowse.push(nodeToBrowse); | ||
} | ||
else if (result.statusCode === node_opcua_status_code_1.StatusCodes.Good) { | ||
else if (result.statusCode.isGood()) { | ||
for (const r of result.references || []) { | ||
@@ -141,0 +141,0 @@ // also explore sub types |
@@ -18,3 +18,2 @@ "use strict"; | ||
const node_opcua_data_model_1 = require("node-opcua-data-model"); | ||
const node_opcua_status_code_1 = require("node-opcua-status-code"); | ||
const populate_data_type_manager_104_1 = require("./private/populate_data_type_manager_104"); | ||
@@ -41,3 +40,3 @@ const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename); | ||
}); | ||
if (browseResult.statusCode !== node_opcua_status_code_1.StatusCodes.Good || browseResult.references.length !== 1) { | ||
if (browseResult.statusCode.isNotGood() || browseResult.references.length !== 1) { | ||
throw new Error("browse failed"); | ||
@@ -44,0 +43,0 @@ } |
{ | ||
"name": "node-opcua-client-dynamic-extension-object", | ||
"version": "2.85.0", | ||
"version": "2.86.0", | ||
"description": "pure nodejs OPCUA SDK - module client-dynamic-extension-object", | ||
@@ -15,17 +15,17 @@ "main": "./dist/index.js", | ||
"node-opcua-assert": "2.77.0", | ||
"node-opcua-binary-stream": "2.85.0", | ||
"node-opcua-binary-stream": "2.86.0", | ||
"node-opcua-constants": "2.77.0", | ||
"node-opcua-data-model": "2.85.0", | ||
"node-opcua-data-value": "2.85.0", | ||
"node-opcua-debug": "2.85.0", | ||
"node-opcua-extension-object": "2.85.0", | ||
"node-opcua-factory": "2.85.0", | ||
"node-opcua-nodeid": "2.85.0", | ||
"node-opcua-pseudo-session": "2.85.0", | ||
"node-opcua-schemas": "2.85.0", | ||
"node-opcua-service-browse": "2.85.0", | ||
"node-opcua-service-translate-browse-path": "2.85.0", | ||
"node-opcua-status-code": "2.85.0", | ||
"node-opcua-types": "2.85.0", | ||
"node-opcua-variant": "2.85.0" | ||
"node-opcua-data-model": "2.86.0", | ||
"node-opcua-data-value": "2.86.0", | ||
"node-opcua-debug": "2.86.0", | ||
"node-opcua-extension-object": "2.86.0", | ||
"node-opcua-factory": "2.86.0", | ||
"node-opcua-nodeid": "2.86.0", | ||
"node-opcua-pseudo-session": "2.86.0", | ||
"node-opcua-schemas": "2.86.0", | ||
"node-opcua-service-browse": "2.86.0", | ||
"node-opcua-service-translate-browse-path": "2.86.0", | ||
"node-opcua-status-code": "2.86.0", | ||
"node-opcua-types": "2.86.0", | ||
"node-opcua-variant": "2.86.0" | ||
}, | ||
@@ -47,3 +47,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "68498fcf7b20ea9f7bd66e8529c546221daf5d52" | ||
"gitHead": "36afc46fe2c91aa5664a8c5418f4db5a354670c3" | ||
} |
@@ -57,3 +57,3 @@ import { assert } from "node-opcua-assert"; | ||
/* istanbul ignore next */ | ||
if (result3.statusCode !== StatusCodes.Good) { | ||
if (result3.statusCode.isNotGood()) { | ||
throw new Error("Cannot find superType for " + dataTypeNodeId.toString()); | ||
@@ -145,3 +145,3 @@ } | ||
const dataValue = await session.read({ nodeId, attributeId: AttributeIds.BrowseName }); | ||
if (dataValue.statusCode !== StatusCodes.Good) { | ||
if (dataValue.statusCode.isNotGood()) { | ||
const message = | ||
@@ -183,3 +183,3 @@ "cannot extract BrowseName of nodeId = " + nodeId.toString() + " statusCode = " + dataValue.statusCode.toString(); | ||
/* istanbul ignore next */ | ||
if (dataTypeDefinitionDataValue.statusCode !== StatusCodes.Good) { | ||
if (dataTypeDefinitionDataValue.statusCode.isNotGood()) { | ||
throw new Error(" Cannot find dataType Definition ! with nodeId =" + dataTypeNodeId.toString()); | ||
@@ -352,3 +352,3 @@ } | ||
if (isAbstractDV.statusCode === StatusCodes.Good && isAbstractDV.value.value === false) { | ||
if (isAbstractDV.statusCode.isGood() && isAbstractDV.value.value === false) { | ||
const encodings = await _findEncodings(session, dataTypeNodeId); | ||
@@ -355,0 +355,0 @@ schema.encodingDefaultBinary = makeExpandedNodeId(encodings.binaryEncodingNodeId); |
@@ -64,3 +64,3 @@ import { findLastKey } from "lodash"; | ||
const countOK = dataValues.reduce((prev, a) => prev + (a.statusCode === StatusCodes.Good ? 1 : 0), 0); | ||
const countOK = dataValues.reduce((prev, a) => prev + (a.statusCode.isGood() ? 1 : 0), 0); | ||
if (countOK === dataValues.length) { | ||
@@ -67,0 +67,0 @@ return true; |
@@ -292,3 +292,3 @@ /* eslint-disable max-statements */ | ||
/* istanbul ignore else */ | ||
if (dataValue.statusCode === StatusCodes.Good) { | ||
if (dataValue.statusCode.isGood()) { | ||
const dataTypeDefinition = dataValue.value.value; | ||
@@ -550,3 +550,3 @@ | ||
if (dataValueNamespaceArray.statusCode === StatusCodes.Good && namespaceArray && namespaceArray.length > 0) { | ||
if (dataValueNamespaceArray.statusCode.isGood() && namespaceArray && namespaceArray.length > 0) { | ||
dataTypeManager.setNamespaceArray(namespaceArray); | ||
@@ -553,0 +553,0 @@ |
@@ -6,3 +6,3 @@ import { assert } from "node-opcua-assert"; | ||
import { NodeId, resolveNodeId } from "node-opcua-nodeid"; | ||
import { IBasicSession, BrowseDescriptionLike, browseAll } from "node-opcua-pseudo-session"; | ||
import { IBasicSession, browseAll } from "node-opcua-pseudo-session"; | ||
import { createDynamicObjectConstructor as createDynamicObjectConstructorAndRegister } from "node-opcua-schemas"; | ||
@@ -51,3 +51,3 @@ import { StatusCodes } from "node-opcua-status-code"; | ||
/* istanbul ignore next */ | ||
if (isAbstractDataValue.statusCode !== StatusCodes.Good) { | ||
if (isAbstractDataValue.statusCode.isNotGood()) { | ||
throw new Error(" Cannot find dataType isAbstract ! with nodeId =" + dataTypeNodeId.toString()); | ||
@@ -59,3 +59,3 @@ } | ||
/* istanbul ignore next */ | ||
if (dataTypeDefinitionDataValue.statusCode !== StatusCodes.Good) { | ||
if (dataTypeDefinitionDataValue.statusCode.isNotGood()) { | ||
// may be we are reading a 1.03 server | ||
@@ -148,4 +148,4 @@ if (!isAbstract) { | ||
if ( | ||
result.statusCode === StatusCodes.BadNoContinuationPoints || | ||
result.statusCode === StatusCodes.BadContinuationPointInvalid | ||
result.statusCode.equals(StatusCodes.BadNoContinuationPoints) || | ||
result.statusCode.equals(StatusCodes.BadContinuationPointInvalid) | ||
) { | ||
@@ -155,3 +155,3 @@ // not enough continuation points .. we need to rebrowse | ||
// taskMananager.registerTask(flushBrowse); | ||
} else if (result.statusCode === StatusCodes.Good) { | ||
} else if (result.statusCode.isGood()) { | ||
for (const r of result.references || []) { | ||
@@ -163,3 +163,8 @@ // also explore sub types | ||
} else { | ||
errorLog("Unexpected status code", i, new BrowseDescription(nodesToBrowse[i]||{})?.toString(), result.statusCode.toString()); | ||
errorLog( | ||
"Unexpected status code", | ||
i, | ||
new BrowseDescription(nodesToBrowse[i] || {})?.toString(), | ||
result.statusCode.toString() | ||
); | ||
} | ||
@@ -166,0 +171,0 @@ } |
@@ -40,3 +40,3 @@ import { BinaryStream } from "node-opcua-binary-stream"; | ||
}); | ||
if (browseResult.statusCode !== StatusCodes.Good || browseResult.references!.length !== 1) { | ||
if (browseResult.statusCode.isNotGood() || browseResult.references!.length !== 1) { | ||
throw new Error("browse failed"); | ||
@@ -43,0 +43,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
4059
265330
+ Addednode-opcua-basic-types@2.86.0(transitive)
+ Addednode-opcua-binary-stream@2.86.0(transitive)
+ Addednode-opcua-buffer-utils@2.86.0(transitive)
+ Addednode-opcua-data-model@2.86.0(transitive)
+ Addednode-opcua-data-value@2.86.0(transitive)
+ Addednode-opcua-date-time@2.86.0(transitive)
+ Addednode-opcua-debug@2.86.0(transitive)
+ Addednode-opcua-enum@2.86.0(transitive)
+ Addednode-opcua-extension-object@2.86.0(transitive)
+ Addednode-opcua-factory@2.86.0(transitive)
+ Addednode-opcua-generator@2.86.0(transitive)
+ Addednode-opcua-nodeid@2.86.0(transitive)
+ Addednode-opcua-numeric-range@2.86.0(transitive)
+ Addednode-opcua-pseudo-session@2.86.0(transitive)
+ Addednode-opcua-schemas@2.86.0(transitive)
+ Addednode-opcua-service-browse@2.86.0(transitive)
+ Addednode-opcua-service-call@2.86.0(transitive)
+ Addednode-opcua-service-read@2.86.0(transitive)
+ Addednode-opcua-service-secure-channel@2.86.0(transitive)
+ Addednode-opcua-service-subscription@2.86.0(transitive)
+ Addednode-opcua-service-translate-browse-path@2.86.0(transitive)
+ Addednode-opcua-service-write@2.86.0(transitive)
+ Addednode-opcua-status-code@2.86.0(transitive)
+ Addednode-opcua-types@2.86.0(transitive)
+ Addednode-opcua-utils@2.86.0(transitive)
+ Addednode-opcua-variant@2.86.0(transitive)
+ Addednode-opcua-xml2json@2.86.0(transitive)
- Removednode-opcua-basic-types@2.85.0(transitive)
- Removednode-opcua-binary-stream@2.85.0(transitive)
- Removednode-opcua-buffer-utils@2.85.0(transitive)
- Removednode-opcua-data-model@2.85.0(transitive)
- Removednode-opcua-data-value@2.85.0(transitive)
- Removednode-opcua-date-time@2.85.0(transitive)
- Removednode-opcua-debug@2.85.0(transitive)
- Removednode-opcua-enum@2.85.0(transitive)
- Removednode-opcua-extension-object@2.85.0(transitive)
- Removednode-opcua-factory@2.85.0(transitive)
- Removednode-opcua-generator@2.85.0(transitive)
- Removednode-opcua-nodeid@2.85.0(transitive)
- Removednode-opcua-numeric-range@2.85.0(transitive)
- Removednode-opcua-pseudo-session@2.85.0(transitive)
- Removednode-opcua-schemas@2.85.0(transitive)
- Removednode-opcua-service-browse@2.85.0(transitive)
- Removednode-opcua-service-call@2.85.0(transitive)
- Removednode-opcua-service-read@2.85.0(transitive)
- Removednode-opcua-service-secure-channel@2.85.0(transitive)
- Removednode-opcua-service-subscription@2.85.0(transitive)
- Removednode-opcua-service-translate-browse-path@2.85.0(transitive)
- Removednode-opcua-service-write@2.85.0(transitive)
- Removednode-opcua-status-code@2.85.0(transitive)
- Removednode-opcua-types@2.85.0(transitive)
- Removednode-opcua-utils@2.85.0(transitive)
- Removednode-opcua-variant@2.85.0(transitive)
- Removednode-opcua-xml2json@2.85.0(transitive)
Updatednode-opcua-data-model@2.86.0
Updatednode-opcua-data-value@2.86.0
Updatednode-opcua-debug@2.86.0
Updatednode-opcua-factory@2.86.0
Updatednode-opcua-nodeid@2.86.0
Updatednode-opcua-schemas@2.86.0
Updatednode-opcua-types@2.86.0
Updatednode-opcua-variant@2.86.0