opcua-webapi-ts 1.1.22 → 1.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/dist/cjs/client/utils/UaDataTypeDictionary.js +1 -1
  2. package/dist/cjs/client/utils/UaModelling.js +2 -2
  3. package/dist/cjs/client/utils/UaNodeBrowser.js +7 -36
  4. package/dist/cjs/client/utils/UaNodeReader.js +120 -76
  5. package/dist/cjs/client/utils/UaNodeSerializer.js +166 -0
  6. package/dist/cjs/client/utils/UaObjectTypeDictionary.js +1 -1
  7. package/dist/cjs/client/utils/UaReferenceTypeDictionary.js +1 -1
  8. package/dist/cjs/client/utils/index.js +1 -0
  9. package/dist/cjs/common/nodes/UaMethod.js +22 -0
  10. package/dist/cjs/common/nodes/UaNode.js +0 -13
  11. package/dist/cjs/common/nodes/UaObject.js +4 -4
  12. package/dist/cjs/common/nodes/UaObjectType.js +3 -5
  13. package/dist/cjs/common/nodes/UaVariable.js +14 -7
  14. package/dist/client/utils/UaDataTypeDictionary.js +1 -1
  15. package/dist/client/utils/UaModelling.js +2 -2
  16. package/dist/client/utils/UaNodeBrowser.d.ts +3 -8
  17. package/dist/client/utils/UaNodeBrowser.js +7 -36
  18. package/dist/client/utils/UaNodeReader.d.ts +15 -8
  19. package/dist/client/utils/UaNodeReader.js +120 -76
  20. package/dist/client/utils/UaNodeSerializer.d.ts +14 -0
  21. package/dist/client/utils/UaNodeSerializer.js +166 -0
  22. package/dist/client/utils/UaObjectTypeDictionary.js +1 -1
  23. package/dist/client/utils/UaReferenceTypeDictionary.js +1 -1
  24. package/dist/client/utils/index.d.ts +1 -0
  25. package/dist/client/utils/index.js +1 -0
  26. package/dist/common/nodes/UaMethod.d.ts +1 -0
  27. package/dist/common/nodes/UaMethod.js +22 -0
  28. package/dist/common/nodes/UaNode.d.ts +0 -5
  29. package/dist/common/nodes/UaNode.js +0 -13
  30. package/dist/common/nodes/UaObject.js +4 -4
  31. package/dist/common/nodes/UaObjectType.js +3 -5
  32. package/dist/common/nodes/UaVariable.d.ts +4 -1
  33. package/dist/common/nodes/UaVariable.js +14 -7
  34. package/package.json +1 -1
@@ -49,9 +49,9 @@ class UaObject extends _1.UaInstanceNode {
49
49
  return ret;
50
50
  }
51
51
  toJson() {
52
- let children = [];
52
+ let members = [];
53
53
  for (let item of this._children) {
54
- children.push(item.toJson());
54
+ members.push(item.toJson());
55
55
  }
56
56
  let ret = {
57
57
  nodeId: this._nodeId.toString(),
@@ -60,8 +60,8 @@ class UaObject extends _1.UaInstanceNode {
60
60
  displayName: this._displayName.text,
61
61
  description: (this._description) ? this._description.text : undefined,
62
62
  typeDefinitionId: this._typeDefinitionId.toString(),
63
- eventNotifier: this._eventNotifier,
64
- children: (children.length != 0) ? children : undefined
63
+ eventNotifier: (this._eventNotifier != 0) ? this._eventNotifier : undefined,
64
+ members: (members.length != 0) ? members : undefined
65
65
  };
66
66
  return ret;
67
67
  }
@@ -48,11 +48,9 @@ class UaObjectType extends _1.UaDefintionNode {
48
48
  this._isObjectMemberRead = value;
49
49
  }
50
50
  toJson() {
51
- let children = [];
51
+ let members = [];
52
52
  for (let item of this._children) {
53
- if (item.nodeClass == opcua_webapi_1.NodeClass.ObjectType)
54
- continue;
55
- children.push(item.toJson());
53
+ members.push(item.toJson());
56
54
  }
57
55
  let ret = {
58
56
  nodeId: this._nodeId.toString(),
@@ -61,7 +59,7 @@ class UaObjectType extends _1.UaDefintionNode {
61
59
  displayName: this._displayName.text,
62
60
  description: (this._description) ? this._description.text : undefined,
63
61
  isAbstract: this._isAbstract,
64
- children: (children.length != 0) ? children : undefined
62
+ members: (members.length != 0) ? members : undefined
65
63
  };
66
64
  return ret;
67
65
  }
@@ -9,6 +9,7 @@ export declare class UaVariable extends UaInstanceNode {
9
9
  private _userAccessLevel;
10
10
  private _historizing;
11
11
  private _dataValue;
12
+ private _isProperty;
12
13
  constructor(nodeId: UaNodeId, browseName: string, displayName: UaLocalizedText, dataType: UaNodeId, valueRank: number, accessLevel: number, userAccessLevel: number, historizing: boolean, typeDefinitionId: UaNodeId);
13
14
  get nodeClass(): NodeClass;
14
15
  get dataType(): UaNodeId;
@@ -16,10 +17,12 @@ export declare class UaVariable extends UaInstanceNode {
16
17
  get accessLevel(): number;
17
18
  get userAccessLevel(): number;
18
19
  get historizing(): boolean;
20
+ get typeDefinitionId(): UaNodeId;
19
21
  get value(): UaVariant | null;
20
22
  get dataValue(): UaDataValue | null;
21
23
  set dataValue(value: UaDataValue);
22
- get typeDefinitionId(): UaNodeId;
24
+ get isProperty(): boolean;
25
+ set isProperty(value: boolean);
23
26
  addMember(node: UaVariable): void;
24
27
  get variableMembers(): Array<UaVariable>;
25
28
  toJson(): any;
@@ -13,6 +13,7 @@ class UaVariable extends _1.UaInstanceNode {
13
13
  this._historizing = historizing;
14
14
  this._typeDefinitionId = typeDefinitionId;
15
15
  this._dataValue = null;
16
+ this._isProperty = false;
16
17
  }
17
18
  get nodeClass() {
18
19
  return opcua_webapi_1.NodeClass.Variable;
@@ -32,6 +33,9 @@ class UaVariable extends _1.UaInstanceNode {
32
33
  get historizing() {
33
34
  return this._historizing;
34
35
  }
36
+ get typeDefinitionId() {
37
+ return this._typeDefinitionId;
38
+ }
35
39
  get value() {
36
40
  return (this._dataValue && this._dataValue.statusCode.isGood()) ? this._dataValue.value : null;
37
41
  }
@@ -41,8 +45,11 @@ class UaVariable extends _1.UaInstanceNode {
41
45
  set dataValue(value) {
42
46
  this._dataValue = value;
43
47
  }
44
- get typeDefinitionId() {
45
- return this._typeDefinitionId;
48
+ get isProperty() {
49
+ return this._isProperty;
50
+ }
51
+ set isProperty(value) {
52
+ this._isProperty = value;
46
53
  }
47
54
  addMember(node) {
48
55
  this._children.push(node);
@@ -55,11 +62,11 @@ class UaVariable extends _1.UaInstanceNode {
55
62
  return ret;
56
63
  }
57
64
  toJson() {
58
- let children = [];
65
+ let members = [];
59
66
  for (let item of this._children) {
60
67
  if (item.nodeClass != opcua_webapi_1.NodeClass.Variable)
61
68
  continue;
62
- children.push(item.toJson());
69
+ members.push(item.toJson());
63
70
  }
64
71
  let ret = {
65
72
  nodeId: this._nodeId.toString(),
@@ -68,11 +75,11 @@ class UaVariable extends _1.UaInstanceNode {
68
75
  displayName: this._displayName.text,
69
76
  typeDefinitionId: this._typeDefinitionId.toString(),
70
77
  dataType: this._dataType.toString(),
71
- valueRank: this._valueRank,
78
+ valueRank: (this._valueRank != 0) ? this._valueRank : undefined,
72
79
  accessLevel: this._accessLevel,
73
- historizing: this._historizing,
80
+ historizing: (this._historizing) ? true : undefined,
74
81
  value: this._dataValue ? this._dataValue.value.value : undefined,
75
- children: (children.length != 0) ? children : undefined
82
+ members: (members.length != 0) ? members : undefined
76
83
  };
77
84
  return ret;
78
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opcua-webapi-ts",
3
- "version": "1.1.22",
3
+ "version": "1.1.24",
4
4
  "description": "Provides OPC UA WebAPI wrapper and client based on opcua-webapi-typescript",
5
5
  "author": "DingYan",
6
6
  "license": "MIT",