Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-opcua-client-dynamic-extension-object

Package Overview
Dependencies
Maintainers
1
Versions
201
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-opcua-client-dynamic-extension-object - npm Package Compare versions

Comparing version 2.65.1 to 2.66.0

14

dist/convert_data_type_definition_to_structuretype_schema.js

@@ -142,6 +142,12 @@ "use strict";

const definition = dataTypeDefinitionDataValue.value.value;
const convertIn64ToInteger = (a) => a[1];
const convert = (fields) => {
const retVal = {};
fields && fields.forEach((field) => (retVal[field.name || ""] = convertIn64ToInteger(field.value)));
return retVal;
};
if (category === node_opcua_factory_1.FieldCategory.enumeration) {
if (definition instanceof node_opcua_types_1.EnumDefinition) {
const e = new node_opcua_factory_1.EnumerationDefinitionSchema({
enumValues: definition.fields,
enumValues: convert(definition.fields),
name: fieldTypeName

@@ -269,4 +275,3 @@ });

const fieldTypeName = yield readBrowseName(session, dataTypeNodeId);
field.fieldType = fieldTypeName,
field.category = node_opcua_factory_1.FieldCategory.complex;
(field.fieldType = fieldTypeName), (field.category = node_opcua_factory_1.FieldCategory.complex);
fields.push(field);

@@ -285,4 +290,3 @@ const capturedField = field;

const { schema, category, fieldTypeName } = rt;
field.fieldType = fieldTypeName,
field.category = category;
(field.fieldType = fieldTypeName), (field.category = category);
field.schema = schema;

@@ -289,0 +293,0 @@ fields.push(field);

"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {

@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k;

{
"name": "node-opcua-client-dynamic-extension-object",
"version": "2.65.1",
"version": "2.66.0",
"description": "pure nodejs OPCUA SDK - module client-dynamic-extension-object",

@@ -9,3 +9,3 @@ "main": "./dist/index.js",

"build": "tsc -b",
"clean": "node -e \"require('rimraf').sync('dist');\"",
"clean": "npx rimraf dist *.tsbuildinfo",
"test": "echo no test"

@@ -15,18 +15,18 @@ },

"chalk": "4.1.2",
"node-opcua-assert": "2.64.1",
"node-opcua-binary-stream": "2.64.1",
"node-opcua-constants": "2.64.1",
"node-opcua-data-model": "2.64.1",
"node-opcua-data-value": "2.64.1",
"node-opcua-debug": "2.64.1",
"node-opcua-extension-object": "2.64.1",
"node-opcua-factory": "2.64.1",
"node-opcua-nodeid": "2.64.1",
"node-opcua-pseudo-session": "2.65.1",
"node-opcua-schemas": "2.64.1",
"node-opcua-service-browse": "2.65.1",
"node-opcua-service-translate-browse-path": "2.65.1",
"node-opcua-status-code": "2.64.1",
"node-opcua-types": "2.65.1",
"node-opcua-variant": "2.64.1"
"node-opcua-assert": "2.66.0",
"node-opcua-binary-stream": "2.66.0",
"node-opcua-constants": "2.66.0",
"node-opcua-data-model": "2.66.0",
"node-opcua-data-value": "2.66.0",
"node-opcua-debug": "2.66.0",
"node-opcua-extension-object": "2.66.0",
"node-opcua-factory": "2.66.0",
"node-opcua-nodeid": "2.66.0",
"node-opcua-pseudo-session": "2.66.0",
"node-opcua-schemas": "2.66.0",
"node-opcua-service-browse": "2.66.0",
"node-opcua-service-translate-browse-path": "2.66.0",
"node-opcua-status-code": "2.66.0",
"node-opcua-types": "2.66.0",
"node-opcua-variant": "2.66.0"
},

@@ -48,3 +48,3 @@ "author": "Etienne Rossignon",

"homepage": "http://node-opcua.github.io/",
"gitHead": "494c1a72df17756dafa8661648d7ae4d89be89ea"
"gitHead": "97f47e2e242a1fd737495fd64cb65e8fb7a9964b"
}

@@ -17,3 +17,10 @@ import { assert } from "node-opcua-assert";

import { StatusCodes } from "node-opcua-status-code";
import { EnumDefinition, DataTypeDefinition, StructureDefinition, StructureType, StructureField } from "node-opcua-types";
import {
EnumDefinition,
DataTypeDefinition,
StructureDefinition,
StructureType,
StructureField,
EnumField
} from "node-opcua-types";
import { ExtensionObject } from "node-opcua-extension-object";

@@ -136,7 +143,7 @@ //

cache: { [key: string]: CacheForFieldResolution }
): Promise<{ schema: TypeDefinition| undefined, category: FieldCategory}> {
): Promise<{ schema: TypeDefinition | undefined; category: FieldCategory }> {
const category = await findDataTypeCategory(session, cache, dataTypeNodeId);
debugLog(" type " + fieldTypeName + " has not been seen yet, let resolve it => (category = ", category, " )");
let schema: TypeDefinition|undefined = undefined;
let schema: TypeDefinition | undefined = undefined;
switch (category) {

@@ -165,6 +172,13 @@ case FieldCategory.basic:

const convertIn64ToInteger = (a: number[]) => a[1];
const convert = (fields: EnumField[] | null) => {
const retVal: Record<string, number> = {};
fields && fields.forEach((field: EnumField) => (retVal[field.name || ""] = convertIn64ToInteger(field.value)));
return retVal;
};
if (category === FieldCategory.enumeration) {
if (definition instanceof EnumDefinition) {
const e = new EnumerationDefinitionSchema({
enumValues: definition.fields,
enumValues: convert(definition.fields),
name: fieldTypeName

@@ -314,18 +328,16 @@ });

const postActions: ((schema: StructuredTypeSchema ) => void)[] = [];
const postActions: ((schema: StructuredTypeSchema) => void)[] = [];
for (const fieldD of definition.fields!) {
let field: FieldInterfaceOptions | undefined;
({ field, switchBit, switchValue } = createField(fieldD, switchBit, bitFields, isUnion, switchValue));
if (fieldD.dataType.value === dataTypeNodeId.value && fieldD.dataType.namespace === dataTypeNodeId.namespace ) {
if (fieldD.dataType.value === dataTypeNodeId.value && fieldD.dataType.namespace === dataTypeNodeId.namespace) {
// this is a structure with a field of the same type
// push an empty placeholder that we will fill later
const fieldTypeName = await readBrowseName(session, dataTypeNodeId);
field.fieldType= fieldTypeName!,
field.category = FieldCategory.complex;
(field.fieldType = fieldTypeName!), (field.category = FieldCategory.complex);
fields.push(field);
const capturedField = field;
postActions.push( (schema: StructuredTypeSchema )=> {
postActions.push((schema: StructuredTypeSchema) => {
capturedField.schema = schema;

@@ -348,4 +360,3 @@ });

field.fieldType= fieldTypeName!,
field.category = category;
(field.fieldType = fieldTypeName!), (field.category = category);
field.schema = schema;

@@ -367,3 +378,3 @@ fields.push(field);

postActions.forEach((action)=>action(structuredTypeSchema));
postActions.forEach((action) => action(structuredTypeSchema));

@@ -374,3 +385,9 @@ return structuredTypeSchema;

function createField(fieldD: StructureField, switchBit: number, bitFields: { name: string; length?: number | undefined; }[] | undefined, isUnion: boolean, switchValue: number) {
function createField(
fieldD: StructureField,
switchBit: number,
bitFields: { name: string; length?: number | undefined }[] | undefined,
isUnion: boolean,
switchValue: number
) {
const field: FieldInterfaceOptions = {

@@ -377,0 +394,0 @@ fieldType: "",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc