opcua-webapi-ts 1.1.23 → 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 +102 -144
  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 +3 -10
  12. package/dist/cjs/common/nodes/UaObjectType.js +3 -12
  13. package/dist/cjs/common/nodes/UaVariable.js +12 -5
  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 -18
  19. package/dist/client/utils/UaNodeReader.js +102 -144
  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 +3 -10
  31. package/dist/common/nodes/UaObjectType.js +3 -12
  32. package/dist/common/nodes/UaVariable.d.ts +4 -1
  33. package/dist/common/nodes/UaVariable.js +12 -5
  34. package/package.json +1 -1
@@ -8,7 +8,6 @@ export declare abstract class UaNode {
8
8
  protected _writeMask: number | null;
9
9
  protected _parent: UaNode | null;
10
10
  protected _children: Array<UaNode>;
11
- protected _refToParent: UaNodeId | null;
12
11
  constructor(nodeId: UaNodeId, browseName: string, displayName: UaLocalizedText);
13
12
  abstract get nodeClass(): NodeClass;
14
13
  get nodeId(): UaNodeId;
@@ -18,16 +17,12 @@ export declare abstract class UaNode {
18
17
  set writeMask(writeMask: number);
19
18
  get description(): UaLocalizedText | null;
20
19
  set description(description: UaLocalizedText | null);
21
- get refToParent(): UaNodeId | null;
22
- set refToParent(referenceTypeId: UaNodeId | null);
23
20
  abstract toJson(): any;
24
21
  }
25
22
  export declare abstract class UaDefintionNode extends UaNode {
26
23
  protected _isAbstract: boolean;
27
24
  constructor(nodeId: UaNodeId, browseName: string, displayName: UaLocalizedText, isAbstract: boolean);
28
25
  get isAbstract(): boolean;
29
- get refToParent(): UaNodeId | null;
30
- set refToParent(referenceTypeId: UaNodeId);
31
26
  setParentType(parentType: UaDefintionNode): void;
32
27
  isSubtypeOf(typeId: UaNodeId): boolean;
33
28
  parentType(): UaDefintionNode | null;
@@ -12,7 +12,6 @@ class UaNode {
12
12
  this._writeMask = null;
13
13
  this._parent = null;
14
14
  this._children = [];
15
- this._refToParent = null;
16
15
  }
17
16
  get nodeId() {
18
17
  return this._nodeId;
@@ -35,12 +34,6 @@ class UaNode {
35
34
  set description(description) {
36
35
  this._description = description;
37
36
  }
38
- get refToParent() {
39
- return this._refToParent;
40
- }
41
- set refToParent(referenceTypeId) {
42
- this._refToParent = referenceTypeId;
43
- }
44
37
  }
45
38
  exports.UaNode = UaNode;
46
39
  class UaDefintionNode extends UaNode {
@@ -51,12 +44,6 @@ class UaDefintionNode extends UaNode {
51
44
  get isAbstract() {
52
45
  return this._isAbstract;
53
46
  }
54
- get refToParent() {
55
- return (this._refToParent) ? this._refToParent : null;
56
- }
57
- set refToParent(referenceTypeId) {
58
- this._refToParent = referenceTypeId;
59
- }
60
47
  setParentType(parentType) {
61
48
  if (parentType.nodeClass != this.nodeClass ||
62
49
  null != this._parent)
@@ -49,15 +49,9 @@ class UaObject extends _1.UaInstanceNode {
49
49
  return ret;
50
50
  }
51
51
  toJson() {
52
- let variables = [];
53
- let methods = [];
52
+ let members = [];
54
53
  for (let item of this._children) {
55
- if (opcua_webapi_1.NodeClass.Variable == item.nodeClass) {
56
- variables.push(item.toJson());
57
- }
58
- else if (opcua_webapi_1.NodeClass.Method == item.nodeClass) {
59
- methods.push(item.toJson());
60
- }
54
+ members.push(item.toJson());
61
55
  }
62
56
  let ret = {
63
57
  nodeId: this._nodeId.toString(),
@@ -67,8 +61,7 @@ class UaObject extends _1.UaInstanceNode {
67
61
  description: (this._description) ? this._description.text : undefined,
68
62
  typeDefinitionId: this._typeDefinitionId.toString(),
69
63
  eventNotifier: (this._eventNotifier != 0) ? this._eventNotifier : undefined,
70
- variables: (variables.length != 0) ? variables : undefined,
71
- methods: (methods.length != 0) ? methods : undefined
64
+ members: (members.length != 0) ? members : undefined
72
65
  };
73
66
  return ret;
74
67
  }
@@ -48,17 +48,9 @@ class UaObjectType extends _1.UaDefintionNode {
48
48
  this._isObjectMemberRead = value;
49
49
  }
50
50
  toJson() {
51
- let variables = [];
52
- let methods = [];
51
+ let members = [];
53
52
  for (let item of this._children) {
54
- if (item.nodeClass == opcua_webapi_1.NodeClass.ObjectType)
55
- continue;
56
- if (opcua_webapi_1.NodeClass.Variable == item.nodeClass) {
57
- variables.push(item.toJson());
58
- }
59
- else if (opcua_webapi_1.NodeClass.Method == item.nodeClass) {
60
- methods.push(item.toJson());
61
- }
53
+ members.push(item.toJson());
62
54
  }
63
55
  let ret = {
64
56
  nodeId: this._nodeId.toString(),
@@ -67,8 +59,7 @@ class UaObjectType extends _1.UaDefintionNode {
67
59
  displayName: this._displayName.text,
68
60
  description: (this._description) ? this._description.text : undefined,
69
61
  isAbstract: this._isAbstract,
70
- variables: (variables.length != 0) ? variables : undefined,
71
- methods: (methods.length != 0) ? methods : undefined
62
+ members: (members.length != 0) ? members : undefined
72
63
  };
73
64
  return ret;
74
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(),
@@ -72,7 +79,7 @@ class UaVariable extends _1.UaInstanceNode {
72
79
  accessLevel: this._accessLevel,
73
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.23",
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",