node-opcua-client-dynamic-extension-object
Advanced tools
Comparing version 2.5.0-alpha.4 to 2.5.0-alpha.5
@@ -0,0 +0,0 @@ import { StructuredTypeSchema } from "node-opcua-factory"; |
@@ -461,5 +461,5 @@ "use strict"; | ||
// tslint:disable:no-console | ||
console.log("node-id :", dataTypeNodeId.toString()); | ||
console.log("node-id :", dataTypeNodeId ? dataTypeNodeId.toString() : null); | ||
console.log("nodeClass :", node_opcua_data_model_1.NodeClass[nodeClass.value.value]); | ||
console.log("browseName :", browseName.value.value.toString()); | ||
console.log("browseName :", browseName.toString()); | ||
console.log(result1.toString()); | ||
@@ -466,0 +466,0 @@ throw new Error("getDataTypeDefinition invalid HasEncoding reference"); |
@@ -0,0 +0,0 @@ import { ConstructorFunc, DataTypeFactory } from "node-opcua-factory"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { DataValue } from "node-opcua-data-value"; |
@@ -32,4 +32,9 @@ "use strict"; | ||
// count number of Opaque Structures | ||
const dataValuesToFix = dataValues.filter((dataValue) => dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject && | ||
dataValue.value.value instanceof node_opcua_extension_object_1.OpaqueStructure); | ||
const dataValuesToFix = dataValues.filter((dataValue) => dataValue.value && dataValue.value.dataType === node_opcua_variant_1.DataType.ExtensionObject && | ||
((dataValue.value.arrayType === node_opcua_variant_1.VariantArrayType.Scalar | ||
&& dataValue.value.value instanceof node_opcua_extension_object_1.OpaqueStructure) | ||
|| | ||
(dataValue.value.arrayType !== node_opcua_variant_1.VariantArrayType.Scalar | ||
&& dataValue.value.value && dataValue.value.value.length >= 0 | ||
&& dataValue.value.value[0] instanceof node_opcua_extension_object_1.OpaqueStructure))); | ||
if (dataValuesToFix.length === 0) { | ||
@@ -41,3 +46,3 @@ return; | ||
const promises = dataValuesToFix.map((dataValue) => __awaiter(this, void 0, void 0, function* () { | ||
resolve_dynamic_extension_object_1.resolveDynamicExtensionObject(dataValue.value, extraDataTypeManager); | ||
return yield resolve_dynamic_extension_object_1.resolveDynamicExtensionObject(dataValue.value, extraDataTypeManager); | ||
})); | ||
@@ -44,0 +49,0 @@ yield Promise.all(promises); |
import { Variant } from "node-opcua-variant"; | ||
import { ExtraDataTypeManager } from "./extra_data_type_manager"; | ||
export declare function resolveDynamicExtensionObject(variant: Variant, dataTypeManager: ExtraDataTypeManager): Promise<void>; |
@@ -37,5 +37,2 @@ "use strict"; | ||
variant.value = variant.value.map((v) => { | ||
if (!(v instanceof node_opcua_extension_object_1.OpaqueStructure)) { | ||
return v; | ||
} | ||
const obj = resolveDynamicExtensionObjectV(v, dataTypeManager); | ||
@@ -42,0 +39,0 @@ return obj; |
{ | ||
"name": "node-opcua-client-dynamic-extension-object", | ||
"version": "2.5.0-alpha.4", | ||
"version": "2.5.0-alpha.5", | ||
"description": "pure nodejs OPCUA SDK - module client-dynamic-extension-object", | ||
@@ -15,15 +15,15 @@ "main": "./dist/index.js", | ||
"node-opcua-binary-stream": "^2.5.0-alpha.4", | ||
"node-opcua-data-model": "^2.5.0-alpha.4", | ||
"node-opcua-data-value": "^2.5.0-alpha.4", | ||
"node-opcua-data-model": "^2.5.0-alpha.5", | ||
"node-opcua-data-value": "^2.5.0-alpha.5", | ||
"node-opcua-debug": "^2.5.0-alpha.4", | ||
"node-opcua-extension-object": "^2.5.0-alpha.4", | ||
"node-opcua-factory": "^2.5.0-alpha.4", | ||
"node-opcua-extension-object": "^2.5.0-alpha.5", | ||
"node-opcua-factory": "^2.5.0-alpha.5", | ||
"node-opcua-nodeid": "^2.5.0-alpha.4", | ||
"node-opcua-pseudo-session": "^2.5.0-alpha.4", | ||
"node-opcua-schemas": "^2.5.0-alpha.4", | ||
"node-opcua-service-browse": "^2.5.0-alpha.4", | ||
"node-opcua-service-translate-browse-path": "^2.5.0-alpha.4", | ||
"node-opcua-pseudo-session": "^2.5.0-alpha.5", | ||
"node-opcua-schemas": "^2.5.0-alpha.5", | ||
"node-opcua-service-browse": "^2.5.0-alpha.5", | ||
"node-opcua-service-translate-browse-path": "^2.5.0-alpha.5", | ||
"node-opcua-status-code": "^2.5.0-alpha.4", | ||
"node-opcua-types": "^2.5.0-alpha.4", | ||
"node-opcua-variant": "^2.5.0-alpha.4" | ||
"node-opcua-types": "^2.5.0-alpha.5", | ||
"node-opcua-variant": "^2.5.0-alpha.5" | ||
}, | ||
@@ -45,3 +45,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "67068530aea80ae818cd8ee05be517194e706523" | ||
"gitHead": "07dcdd8e8c7f2b55544c6e23023093e35674829c" | ||
} |
@@ -601,5 +601,5 @@ // tslint:disable: no-console | ||
// tslint:disable:no-console | ||
console.log("node-id :", dataTypeNodeId.toString()); | ||
console.log("node-id :", dataTypeNodeId ? dataTypeNodeId.toString() : null); | ||
console.log("nodeClass :", NodeClass[nodeClass.value.value]); | ||
console.log("browseName :", browseName.value.value.toString()); | ||
console.log("browseName :", browseName.toString()); | ||
console.log(result1.toString()); | ||
@@ -606,0 +606,0 @@ throw new Error("getDataTypeDefinition invalid HasEncoding reference"); |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
import { DataValue } from "node-opcua-data-value"; | ||
import { OpaqueStructure } from "node-opcua-extension-object"; | ||
import { IBasicSession } from "node-opcua-pseudo-session"; | ||
import { DataType } from "node-opcua-variant"; | ||
import { DataType, VariantArrayType } from "node-opcua-variant"; | ||
@@ -29,4 +29,13 @@ import { populateDataTypeManager } from "./client_dynamic_extension_object"; | ||
const dataValuesToFix = dataValues.filter((dataValue: DataValue) => | ||
dataValue.value.dataType === DataType.ExtensionObject && | ||
dataValue.value.value instanceof OpaqueStructure); | ||
dataValue.value && dataValue.value.dataType === DataType.ExtensionObject && | ||
( | ||
(dataValue.value.arrayType === VariantArrayType.Scalar | ||
&& dataValue.value.value instanceof OpaqueStructure) | ||
|| | ||
(dataValue.value.arrayType !== VariantArrayType.Scalar | ||
&& dataValue.value.value && dataValue.value.value.length >= 0 | ||
&& dataValue.value.value[0] instanceof OpaqueStructure) | ||
) | ||
); | ||
if (dataValuesToFix.length === 0) { | ||
@@ -39,6 +48,7 @@ return; | ||
const promises = dataValuesToFix.map(async (dataValue: DataValue) => { | ||
resolveDynamicExtensionObject(dataValue.value, extraDataTypeManager); | ||
}); | ||
const promises = dataValuesToFix.map( | ||
async (dataValue: DataValue) => { | ||
return await resolveDynamicExtensionObject(dataValue.value, extraDataTypeManager) | ||
}); | ||
await Promise.all(promises); | ||
} |
@@ -36,8 +36,4 @@ import { BinaryStream } from "node-opcua-binary-stream"; | ||
if (variant.value instanceof Array) { | ||
variant.value = (variant.value as any[]).map((v: any) => { | ||
if (!(v instanceof OpaqueStructure)) { | ||
return v; | ||
} | ||
const obj = resolveDynamicExtensionObjectV(v as OpaqueStructure, dataTypeManager); | ||
variant.value = (variant.value as OpaqueStructure[]).map((v: OpaqueStructure) => { | ||
const obj = resolveDynamicExtensionObjectV(v, dataTypeManager); | ||
return obj; | ||
@@ -44,0 +40,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
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
127730
1988
21
+ Added@peculiar/asn1-cms@2.3.15(transitive)
+ Added@peculiar/asn1-csr@2.3.15(transitive)
+ Added@peculiar/asn1-ecc@2.3.15(transitive)
+ Added@peculiar/asn1-pfx@2.3.15(transitive)
+ Added@peculiar/asn1-pkcs8@2.3.15(transitive)
+ Added@peculiar/asn1-pkcs9@2.3.15(transitive)
+ Added@peculiar/asn1-rsa@2.3.15(transitive)
+ Added@peculiar/asn1-schema@2.3.15(transitive)
+ Added@peculiar/asn1-x509@2.3.15(transitive)
+ Added@peculiar/asn1-x509-attr@2.3.15(transitive)
- Removed@peculiar/asn1-cms@2.3.13(transitive)
- Removed@peculiar/asn1-csr@2.3.13(transitive)
- Removed@peculiar/asn1-ecc@2.3.14(transitive)
- Removed@peculiar/asn1-pfx@2.3.13(transitive)
- Removed@peculiar/asn1-pkcs8@2.3.13(transitive)
- Removed@peculiar/asn1-pkcs9@2.3.13(transitive)
- Removed@peculiar/asn1-rsa@2.3.13(transitive)
- Removed@peculiar/asn1-schema@2.3.13(transitive)
- Removed@peculiar/asn1-x509@2.3.13(transitive)
- Removed@peculiar/asn1-x509-attr@2.3.13(transitive)
- Removedipaddr.js@2.2.0(transitive)
Updatednode-opcua-service-translate-browse-path@^2.5.0-alpha.5