node-opcua-address-space 2.56.2 → 2.60.0

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 (237) hide show
  1. package/LICENSE +20 -20
  2. package/dist/source/address_space_ts.d.ts +0 -2
  3. package/dist/source/helpers/argument_list.js +12 -1
  4. package/dist/source/helpers/argument_list.js.map +1 -1
  5. package/dist/source/loader/load_nodeset2.js +76 -67
  6. package/dist/source/loader/load_nodeset2.js.map +1 -1
  7. package/dist/source/session_context.js +2 -2
  8. package/dist/source/session_context.js.map +1 -1
  9. package/dist/source/set_namespace_meta_data.js +1 -1
  10. package/dist/src/address_space.d.ts +2 -3
  11. package/dist/src/address_space.js +9 -6
  12. package/dist/src/address_space.js.map +1 -1
  13. package/dist/src/address_space_private.d.ts +2 -3
  14. package/dist/src/alarms_and_conditions/condition_snapshot.js +3 -3
  15. package/dist/src/alarms_and_conditions/condition_snapshot.js.map +1 -1
  16. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js +2 -1
  17. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.js.map +1 -1
  18. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js +1 -1
  19. package/dist/src/alarms_and_conditions/ua_alarm_condition_impl.js.map +1 -1
  20. package/dist/src/alarms_and_conditions/ua_condition_impl.js +8 -6
  21. package/dist/src/alarms_and_conditions/ua_condition_impl.js.map +1 -1
  22. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js +1 -1
  23. package/dist/src/alarms_and_conditions/ua_off_normal_alarm_impl.js.map +1 -1
  24. package/dist/src/base_node_private.js +2 -2
  25. package/dist/src/base_node_private.js.map +1 -1
  26. package/dist/src/event_data.js +1 -1
  27. package/dist/src/event_data.js.map +1 -1
  28. package/dist/src/namespace_impl.d.ts +2 -2
  29. package/dist/src/namespace_impl.js +9 -9
  30. package/dist/src/namespace_impl.js.map +1 -1
  31. package/dist/src/nodeset_tools/nodeset_to_xml.js +16 -10
  32. package/dist/src/nodeset_tools/nodeset_to_xml.js.map +1 -1
  33. package/dist/src/nodeset_tools/typedictionary_to_xml.js +17 -10
  34. package/dist/src/nodeset_tools/typedictionary_to_xml.js.map +1 -1
  35. package/dist/src/reference_impl.js +1 -1
  36. package/dist/src/reference_impl.js.map +1 -1
  37. package/dist/src/state_machine/ua_shelving_state_machine_ex.js +20 -13
  38. package/dist/src/state_machine/ua_shelving_state_machine_ex.js.map +1 -1
  39. package/dist/src/ua_data_type_impl.d.ts +15 -5
  40. package/dist/src/ua_data_type_impl.js +129 -51
  41. package/dist/src/ua_data_type_impl.js.map +1 -1
  42. package/dist/src/ua_method_impl.d.ts +3 -2
  43. package/dist/src/ua_method_impl.js +5 -0
  44. package/dist/src/ua_method_impl.js.map +1 -1
  45. package/dist/src/ua_variable_impl.d.ts +6 -6
  46. package/dist/src/ua_variable_impl.js +236 -188
  47. package/dist/src/ua_variable_impl.js.map +1 -1
  48. package/dist/src/ua_variable_type_impl.d.ts +3 -4
  49. package/dist/src/ua_variable_type_impl.js +13 -18
  50. package/dist/src/ua_variable_type_impl.js.map +1 -1
  51. package/distHelpers/add_event_generator_object.js.map +1 -1
  52. package/distHelpers/mock_session.js +1 -1
  53. package/distHelpers/mock_session.js.map +1 -1
  54. package/generate.js +1 -1
  55. package/nodeJS.d.ts +1 -1
  56. package/package.json +36 -36
  57. package/source/address_space_ts.ts +0 -1
  58. package/source/helpers/argument_list.ts +13 -3
  59. package/source/loader/load_nodeset2.ts +99 -79
  60. package/source/session_context.ts +1 -1
  61. package/source/set_namespace_meta_data.ts +1 -1
  62. package/source_nodejs/index.ts +1 -1
  63. package/src/address_space.ts +21 -14
  64. package/src/address_space_private.ts +3 -3
  65. package/src/alarms_and_conditions/condition_snapshot.ts +4 -4
  66. package/src/alarms_and_conditions/ua_acknowledgeable_condition_impl.ts +7 -6
  67. package/src/alarms_and_conditions/ua_alarm_condition_impl.ts +2 -2
  68. package/src/alarms_and_conditions/ua_condition_impl.ts +29 -15
  69. package/src/alarms_and_conditions/ua_off_normal_alarm_impl.ts +1 -1
  70. package/src/base_node_private.ts +6 -2
  71. package/src/event_data.ts +1 -1
  72. package/src/namespace_impl.ts +9 -9
  73. package/src/nodeset_tools/nodeset_to_xml.ts +22 -12
  74. package/src/nodeset_tools/typedictionary_to_xml.ts +17 -7
  75. package/src/reference_impl.ts +3 -3
  76. package/src/state_machine/ua_shelving_state_machine_ex.ts +32 -19
  77. package/src/ua_data_type_impl.ts +168 -61
  78. package/src/ua_method_impl.ts +11 -5
  79. package/src/ua_variable_impl.ts +290 -218
  80. package/src/ua_variable_type_impl.ts +9 -15
  81. package/testHelpers.d.ts +1 -1
  82. package/test_helpers/add_event_generator_object.ts +4 -3
  83. package/test_helpers/mock_session.ts +1 -1
  84. package/test_helpers/test_fixtures/dataType_in_separateNamespace.xml +150 -150
  85. package/test_helpers/test_fixtures/dataType_in_separateNamespace_basic.xml +57 -57
  86. package/test_helpers/test_fixtures/dataType_in_separateNamespace_mix.xml +135 -135
  87. package/test_helpers/test_fixtures/dataType_withEnumeration.xml +82 -82
  88. package/test_helpers/test_fixtures/dataType_with_isOptionSet.xml +194 -194
  89. package/test_helpers/test_fixtures/dataType_with_union.xml +1 -1
  90. package/test_helpers/test_fixtures/fixture_empty_nodeset2.xml +106 -106
  91. package/test_helpers/test_fixtures/fixture_simple_statemachine_nodeset2.xml +1312 -1303
  92. package/test_helpers/test_fixtures/fixuture_nodeset_objects_with_some_methods.xml +362 -362
  93. package/test_helpers/test_fixtures/issue_846.xml +3172 -3172
  94. package/test_helpers/test_fixtures/issue_899_variable_with_nodeid_value.xml +32 -32
  95. package/test_helpers/test_fixtures/mini.Node.Set2.xml +14 -0
  96. package/test_helpers/test_fixtures/mini.nodeset.withVariousVariables.xml +194 -194
  97. package/test_helpers/test_fixtures/minimalist_nodeset_with_models.xml +8 -8
  98. package/test_helpers/test_fixtures/minimalist_nodeset_with_models_more_complex.xml +16 -16
  99. package/test_helpers/test_fixtures/nodeset_with_analog_items.xml +45 -45
  100. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.d.ts +0 -23
  101. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js +0 -3
  102. package/dist/source/interfaces/alarms_and_conditions/ua_condition_base_i.js.map +0 -1
  103. package/dist/source/interfaces/data_access/ua_discrete_item.d.ts +0 -6
  104. package/dist/source/interfaces/data_access/ua_discrete_item.js +0 -3
  105. package/dist/source/interfaces/data_access/ua_discrete_item.js.map +0 -1
  106. package/dist/source/interfaces/data_access/ua_multistate_discrete.d.ts +0 -25
  107. package/dist/source/interfaces/data_access/ua_multistate_discrete.js +0 -3
  108. package/dist/source/interfaces/data_access/ua_multistate_discrete.js.map +0 -1
  109. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.d.ts +0 -27
  110. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js +0 -3
  111. package/dist/source/interfaces/data_access/ua_multistate_value_discrete.js.map +0 -1
  112. package/dist/source/interfaces/data_access/ua_two_state_discrete.d.ts +0 -17
  113. package/dist/source/interfaces/data_access/ua_two_state_discrete.js +0 -3
  114. package/dist/source/interfaces/data_access/ua_two_state_discrete.js.map +0 -1
  115. package/dist/source/interfaces/data_access/ua_y_array_item.d.ts +0 -19
  116. package/dist/source/interfaces/data_access/ua_y_array_item.js +0 -3
  117. package/dist/source/interfaces/data_access/ua_y_array_item.js.map +0 -1
  118. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.d.ts +0 -11
  119. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js +0 -3
  120. package/dist/source/interfaces/state_machine/exclusive_limit_state_machine.js.map +0 -1
  121. package/dist/source/interfaces/state_machine/finite_state_machine.d.ts +0 -70
  122. package/dist/source/interfaces/state_machine/finite_state_machine.js +0 -3
  123. package/dist/source/interfaces/state_machine/finite_state_machine.js.map +0 -1
  124. package/dist/source/interfaces/state_machine/program_finite_state_machine.d.ts +0 -74
  125. package/dist/source/interfaces/state_machine/program_finite_state_machine.js +0 -3
  126. package/dist/source/interfaces/state_machine/program_finite_state_machine.js.map +0 -1
  127. package/dist/source/interfaces/state_machine/state_machine.d.ts +0 -342
  128. package/dist/source/interfaces/state_machine/state_machine.js +0 -3
  129. package/dist/source/interfaces/state_machine/state_machine.js.map +0 -1
  130. package/dist/source/interfaces/state_machine/ua_finite_state_variable.d.ts +0 -18
  131. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js +0 -3
  132. package/dist/source/interfaces/state_machine/ua_finite_state_variable.js.map +0 -1
  133. package/dist/source/interfaces/state_machine/ua_state_variable.d.ts +0 -29
  134. package/dist/source/interfaces/state_machine/ua_state_variable.js +0 -3
  135. package/dist/source/interfaces/state_machine/ua_state_variable.js.map +0 -1
  136. package/dist/source/interfaces/state_machine/ua_two_state_variable.d.ts +0 -26
  137. package/dist/source/interfaces/state_machine/ua_two_state_variable.js +0 -3
  138. package/dist/source/interfaces/state_machine/ua_two_state_variable.js.map +0 -1
  139. package/dist/source/interfaces/subscription_diagnostics_variable.d.ts +0 -41
  140. package/dist/source/interfaces/subscription_diagnostics_variable.js +0 -3
  141. package/dist/source/interfaces/subscription_diagnostics_variable.js.map +0 -1
  142. package/dist/src/alarms_and_conditions/base_event_type.d.ts +0 -26
  143. package/dist/src/alarms_and_conditions/base_event_type.js +0 -41
  144. package/dist/src/alarms_and_conditions/base_event_type.js.map +0 -1
  145. package/dist/src/alarms_and_conditions/shelving_state_machine.d.ts +0 -22
  146. package/dist/src/alarms_and_conditions/shelving_state_machine.js +0 -241
  147. package/dist/src/alarms_and_conditions/shelving_state_machine.js.map +0 -1
  148. package/dist/src/alarms_and_conditions/trip_alarm.d.ts +0 -16
  149. package/dist/src/alarms_and_conditions/trip_alarm.js +0 -21
  150. package/dist/src/alarms_and_conditions/trip_alarm.js.map +0 -1
  151. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.d.ts +0 -54
  152. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js +0 -255
  153. package/dist/src/alarms_and_conditions/ua_acknowledgeable_condition_base.js.map +0 -1
  154. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.d.ts +0 -138
  155. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js +0 -460
  156. package/dist/src/alarms_and_conditions/ua_alarm_condition_base.js.map +0 -1
  157. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.d.ts +0 -35
  158. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js +0 -32
  159. package/dist/src/alarms_and_conditions/ua_certificate_expiration_alarm.js.map +0 -1
  160. package/dist/src/alarms_and_conditions/ua_condition_base.d.ts +0 -191
  161. package/dist/src/alarms_and_conditions/ua_condition_base.js +0 -1029
  162. package/dist/src/alarms_and_conditions/ua_condition_base.js.map +0 -1
  163. package/dist/src/alarms_and_conditions/ua_discrete_alarm.d.ts +0 -11
  164. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js +0 -58
  165. package/dist/src/alarms_and_conditions/ua_discrete_alarm.js.map +0 -1
  166. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.d.ts +0 -24
  167. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js +0 -59
  168. package/dist/src/alarms_and_conditions/ua_exclusive_deviation_alarm.js.map +0 -1
  169. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.d.ts +0 -14
  170. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js +0 -17
  171. package/dist/src/alarms_and_conditions/ua_exclusive_level_alarm.js.map +0 -1
  172. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.d.ts +0 -22
  173. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js +0 -87
  174. package/dist/src/alarms_and_conditions/ua_exclusive_limit_alarm.js.map +0 -1
  175. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.d.ts +0 -6
  176. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js +0 -11
  177. package/dist/src/alarms_and_conditions/ua_exclusive_rate_of_change_alarm.js.map +0 -1
  178. package/dist/src/alarms_and_conditions/ua_limit_alarm.d.ts +0 -76
  179. package/dist/src/alarms_and_conditions/ua_limit_alarm.js +0 -237
  180. package/dist/src/alarms_and_conditions/ua_limit_alarm.js.map +0 -1
  181. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.d.ts +0 -27
  182. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js +0 -62
  183. package/dist/src/alarms_and_conditions/ua_non_exclusive_deviation_alarm.js.map +0 -1
  184. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.d.ts +0 -49
  185. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js +0 -176
  186. package/dist/src/alarms_and_conditions/ua_non_exclusive_limit_alarm.js.map +0 -1
  187. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.d.ts +0 -47
  188. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js +0 -151
  189. package/dist/src/alarms_and_conditions/ua_off_normal_alarm.js.map +0 -1
  190. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.d.ts +0 -16
  191. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js +0 -18
  192. package/dist/src/alarms_and_conditions/ua_system_off_normal_alarm.js.map +0 -1
  193. package/dist/src/base_node.d.ts +0 -289
  194. package/dist/src/base_node.js +0 -1345
  195. package/dist/src/base_node.js.map +0 -1
  196. package/dist/src/data_access/ua_analog_item.d.ts +0 -13
  197. package/dist/src/data_access/ua_analog_item.js +0 -37
  198. package/dist/src/data_access/ua_analog_item.js.map +0 -1
  199. package/dist/src/data_access/ua_data_item.d.ts +0 -16
  200. package/dist/src/data_access/ua_data_item.js +0 -66
  201. package/dist/src/data_access/ua_data_item.js.map +0 -1
  202. package/dist/src/data_access/ua_multistate_discrete.d.ts +0 -24
  203. package/dist/src/data_access/ua_multistate_discrete.js +0 -132
  204. package/dist/src/data_access/ua_multistate_discrete.js.map +0 -1
  205. package/dist/src/namespace.d.ts +0 -472
  206. package/dist/src/namespace.js +0 -1751
  207. package/dist/src/namespace.js.map +0 -1
  208. package/dist/src/reference.d.ts +0 -43
  209. package/dist/src/reference.js +0 -138
  210. package/dist/src/reference.js.map +0 -1
  211. package/dist/src/session_context.d.ts +0 -4
  212. package/dist/src/session_context.js +0 -9
  213. package/dist/src/session_context.js.map +0 -1
  214. package/dist/src/ua_data_type.d.ts +0 -83
  215. package/dist/src/ua_data_type.js +0 -289
  216. package/dist/src/ua_data_type.js.map +0 -1
  217. package/dist/src/ua_method.d.ts +0 -41
  218. package/dist/src/ua_method.js +0 -202
  219. package/dist/src/ua_method.js.map +0 -1
  220. package/dist/src/ua_object.d.ts +0 -28
  221. package/dist/src/ua_object.js +0 -153
  222. package/dist/src/ua_object.js.map +0 -1
  223. package/dist/src/ua_object_type.d.ts +0 -49
  224. package/dist/src/ua_object_type.js +0 -123
  225. package/dist/src/ua_object_type.js.map +0 -1
  226. package/dist/src/ua_reference_type.d.ts +0 -42
  227. package/dist/src/ua_reference_type.js +0 -138
  228. package/dist/src/ua_reference_type.js.map +0 -1
  229. package/dist/src/ua_variable.d.ts +0 -339
  230. package/dist/src/ua_variable.js +0 -1706
  231. package/dist/src/ua_variable.js.map +0 -1
  232. package/dist/src/ua_variable_type.d.ts +0 -57
  233. package/dist/src/ua_variable_type.js +0 -530
  234. package/dist/src/ua_variable_type.js.map +0 -1
  235. package/dist/src/ua_view.d.ts +0 -16
  236. package/dist/src/ua_view.js +0 -42
  237. package/dist/src/ua_view.js.map +0 -1
@@ -1,153 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UAObject = void 0;
4
- /**
5
- * @module node-opcua-address-space
6
- */
7
- const chalk = require("chalk");
8
- const node_opcua_assert_1 = require("node-opcua-assert");
9
- const node_opcua_basic_types_1 = require("node-opcua-basic-types");
10
- const node_opcua_data_model_1 = require("node-opcua-data-model");
11
- const node_opcua_data_model_2 = require("node-opcua-data-model");
12
- const node_opcua_data_value_1 = require("node-opcua-data-value");
13
- const node_opcua_date_time_1 = require("node-opcua-date-time");
14
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
15
- const node_opcua_status_code_1 = require("node-opcua-status-code");
16
- const node_opcua_variant_1 = require("node-opcua-variant");
17
- const base_node_1 = require("./base_node");
18
- const base_node_private_1 = require("./base_node_private");
19
- class UAObject extends base_node_1.BaseNode {
20
- constructor(options) {
21
- super(options);
22
- this.nodeClass = node_opcua_data_model_1.NodeClass.Object;
23
- this.eventNotifier = options.eventNotifier || 0;
24
- node_opcua_assert_1.assert(typeof this.eventNotifier === "number" && node_opcua_basic_types_1.isValidByte(this.eventNotifier));
25
- this.symbolicName = options.symbolicName || null;
26
- }
27
- get typeDefinitionObj() {
28
- return super.typeDefinitionObj;
29
- }
30
- readAttribute(context, attributeId) {
31
- const now = node_opcua_date_time_1.getCurrentClock();
32
- const options = {};
33
- switch (attributeId) {
34
- case node_opcua_data_model_2.AttributeIds.EventNotifier:
35
- node_opcua_assert_1.assert(node_opcua_basic_types_1.isValidByte(this.eventNotifier));
36
- options.value = { dataType: node_opcua_variant_1.DataType.Byte, value: this.eventNotifier };
37
- options.serverTimestamp = now.timestamp;
38
- options.serverPicoseconds = now.picoseconds;
39
- options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
40
- break;
41
- default:
42
- return base_node_1.BaseNode.prototype.readAttribute.call(this, context, attributeId);
43
- }
44
- return new node_opcua_data_value_1.DataValue(options);
45
- }
46
- clone(options, optionalFilter, extraInfo) {
47
- options = options || {};
48
- options = Object.assign(Object.assign({}, options), { eventNotifier: this.eventNotifier, symbolicName: this.symbolicName });
49
- const cloneObject = base_node_private_1._clone.call(this, UAObject, options, optionalFilter, extraInfo);
50
- // xx newObject.propagate_back_references();
51
- // xx newObject.install_extra_properties();
52
- return cloneObject;
53
- }
54
- /**
55
- * returns true if the object has some opcua methods
56
- */
57
- get hasMethods() {
58
- return this.getMethods().length > 0;
59
- }
60
- getMethodByName(methodName, namespaceIndex) {
61
- return super.getMethodByName(methodName, namespaceIndex);
62
- }
63
- getMethods() {
64
- return super.getMethods();
65
- }
66
- /**
67
- * Raise a transient Event
68
- */
69
- raiseEvent(eventType, data) {
70
- const addressSpace = this.addressSpace;
71
- if (typeof eventType === "string") {
72
- const eventTypeFound = addressSpace.findEventType(eventType);
73
- if (!eventTypeFound) {
74
- throw new Error("raiseEvent: eventType cannot find event Type " + eventType.toString());
75
- }
76
- eventType = eventTypeFound;
77
- if (!eventType || eventType.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
78
- throw new Error("eventType must exist and be an UAObjectType");
79
- }
80
- }
81
- else if (eventType instanceof node_opcua_nodeid_1.NodeId) {
82
- const eventTypeFound = addressSpace.findNode(eventType);
83
- if (!eventTypeFound) {
84
- throw new Error("raiseEvent: eventType cannot find event Type " + eventType.toString());
85
- }
86
- eventType = eventTypeFound;
87
- if (!eventType || eventType.nodeClass !== node_opcua_data_model_1.NodeClass.ObjectType) {
88
- throw new Error("eventType must exist and be an UAObjectType" + eventType.toString());
89
- }
90
- }
91
- eventType = eventType;
92
- let eventTypeNode = eventType;
93
- // istanbul ignore next
94
- if (!eventTypeNode) {
95
- throw new Error("UAObject#raiseEventType : Cannot find event type :" + eventType.toString());
96
- }
97
- // coerce EventType
98
- eventTypeNode = addressSpace.findEventType(eventType);
99
- const baseEventType = addressSpace.findEventType("BaseEventType");
100
- node_opcua_assert_1.assert(eventTypeNode.isSupertypeOf(baseEventType));
101
- data.$eventDataSource = eventTypeNode;
102
- data.sourceNode = data.sourceNode || { dataType: node_opcua_variant_1.DataType.NodeId, value: this.nodeId };
103
- const eventData1 = addressSpace.constructEventData(eventTypeNode, data);
104
- this._bubble_up_event(eventData1);
105
- }
106
- _bubble_up_event(eventData) {
107
- const addressSpace = this.addressSpace;
108
- const queue = [];
109
- // walk up the hasNotify / hasEventSource chain
110
- const m = {};
111
- // all events are notified to the server object
112
- // emit on server object
113
- const server = addressSpace.findNode("Server");
114
- if (server) {
115
- node_opcua_assert_1.assert(server.eventNotifier > 0x00, "Server must be an event notifier");
116
- server.emit("event", eventData);
117
- m[server.nodeId.toString()] = server;
118
- }
119
- else {
120
- // tslint:disable:no-console
121
- console.warn(chalk.yellow("Warning. ") +
122
- chalk.cyan("UAObject#raiseEvent") +
123
- chalk.red(" cannot find Server object on addressSpace"));
124
- }
125
- addInQueue(this);
126
- function addInQueue(obj) {
127
- const key = obj.nodeId.toString();
128
- if (!m[key]) {
129
- m[key] = obj;
130
- queue.push(obj);
131
- }
132
- }
133
- while (queue.length) {
134
- const obj = queue.pop();
135
- // emit on object
136
- obj.emit("event", eventData);
137
- const elements1 = obj.findReferencesAsObject("HasNotifier", false);
138
- elements1.forEach(addInQueue);
139
- const elements2 = obj.findReferencesAsObject("HasEventSource", false);
140
- elements2.forEach(addInQueue);
141
- }
142
- }
143
- _conditionRefresh(_cache) {
144
- base_node_private_1.apply_condition_refresh.call(this, _cache);
145
- }
146
- toString() {
147
- const options = new base_node_private_1.ToStringBuilder();
148
- base_node_private_1.UAObject_toString.call(this, options);
149
- return options.toString();
150
- }
151
- }
152
- exports.UAObject = UAObject;
153
- //# sourceMappingURL=ua_object.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_object.js","sourceRoot":"","sources":["../../src/ua_object.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,+BAA+B;AAE/B,yDAA2C;AAC3C,mEAAqD;AACrD,iEAA2F;AAC3F,iEAAqD;AACrD,iEAAiE;AACjE,+DAAuD;AACvD,yDAA2C;AAC3C,mEAAqD;AACrD,2DAA8C;AAU9C,2CAAuC;AACvC,2DAA0G;AAE1G,MAAa,QAAS,SAAQ,oBAAQ;IASlC,YAAY,OAAY;QACpB,KAAK,CAAC,OAAO,CAAC,CAAC;QATH,cAAS,GAAG,iCAAS,CAAC,MAAM,CAAC;QAUzC,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,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AO,GAAG,IAAI,mCAAe,EAAE,CAAC;QACtC,qCAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACtC,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACJ;AAtKD,4BAsKC"}
@@ -1,49 +0,0 @@
1
- import { NodeClass } from "node-opcua-data-model";
2
- import { AttributeIds } from "node-opcua-data-model";
3
- import { DataValue } from "node-opcua-data-value";
4
- import { NodeId } from "node-opcua-nodeid";
5
- import { InstantiateObjectOptions, UAObject as UAObjectPublic, UAObjectType as UAObjectTypePublic } from "../source";
6
- import { BaseNode } from "./base_node";
7
- import { SessionContext } from "./session_context";
8
- import * as tools from "./tool_isSupertypeOf";
9
- export declare class UAObjectType extends BaseNode implements UAObjectTypePublic {
10
- readonly nodeClass = NodeClass.ObjectType;
11
- readonly isAbstract: boolean;
12
- /**
13
- * returns true if the object has some opcua methods
14
- */
15
- get hasMethods(): boolean;
16
- get subtypeOf(): NodeId | null;
17
- get subtypeOfObj(): UAObjectTypePublic | null;
18
- isSupertypeOf: tools.IsSupertypeOfFunc<UAObjectTypePublic>;
19
- constructor(options: any);
20
- readAttribute(context: SessionContext, attributeId: AttributeIds): DataValue;
21
- /**
22
- * instantiate an object of this UAObjectType
23
- * The instantiation takes care of object type inheritance when constructing inner properties and components.
24
- * @method instantiate
25
- * @param options
26
- * @param options.browseName
27
- * @param [options.description]
28
- * @param [options.organizedBy] the parent Folder holding this object
29
- * @param [options.componentOf] the parent Object holding this object
30
- * @param [options.notifierOf]
31
- * @param [options.eventSourceOf]
32
- * @param [options.optionals = [] name of the optional child to create
33
- * @param [options.modellingRule]
34
- * @param [options.encodingOf]
35
- *
36
- *
37
- * Note : HasComponent usage scope
38
- *
39
- * Source | Destination
40
- * -------------------+---------------------------
41
- * Object | Object, Variable,Method
42
- * ObjectType |
43
- * -------------------+---------------------------
44
- * DataVariable | Variable
45
- * DataVariableType |
46
- */
47
- instantiate(options: InstantiateObjectOptions): UAObjectPublic;
48
- toString(): string;
49
- }
@@ -1,123 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.UAObjectType = void 0;
4
- /**
5
- * @module node-opcua-address-space
6
- */
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_data_model_1 = require("node-opcua-data-model");
9
- const node_opcua_data_model_2 = require("node-opcua-data-model");
10
- const node_opcua_data_value_1 = require("node-opcua-data-value");
11
- const node_opcua_status_code_1 = require("node-opcua-status-code");
12
- const utils = require("node-opcua-utils");
13
- const node_opcua_variant_1 = require("node-opcua-variant");
14
- const base_node_1 = require("./base_node");
15
- const base_node_private_1 = require("./base_node_private");
16
- const session_context_1 = require("./session_context");
17
- const tool_isSupertypeOf_1 = require("./tool_isSupertypeOf");
18
- const tools = require("./tool_isSupertypeOf");
19
- const ua_variable_type_1 = require("./ua_variable_type");
20
- class UAObjectType extends base_node_1.BaseNode {
21
- constructor(options) {
22
- super(options);
23
- this.nodeClass = node_opcua_data_model_1.NodeClass.ObjectType;
24
- this.isSupertypeOf = tools.construct_isSupertypeOf(UAObjectType);
25
- this.isAbstract = utils.isNullOrUndefined(options.isAbstract) ? false : options.isAbstract;
26
- }
27
- /**
28
- * returns true if the object has some opcua methods
29
- */
30
- get hasMethods() {
31
- return this.getMethods().length > 0;
32
- }
33
- get subtypeOf() {
34
- return tool_isSupertypeOf_1.get_subtypeOf.call(this);
35
- }
36
- get subtypeOfObj() {
37
- return tool_isSupertypeOf_1.get_subtypeOfObj.call(this);
38
- }
39
- readAttribute(context, attributeId) {
40
- node_opcua_assert_1.assert(context instanceof session_context_1.SessionContext);
41
- const options = {};
42
- switch (attributeId) {
43
- case node_opcua_data_model_2.AttributeIds.IsAbstract:
44
- options.value = {
45
- dataType: node_opcua_variant_1.DataType.Boolean,
46
- value: !!this.isAbstract
47
- };
48
- options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
49
- break;
50
- default:
51
- return base_node_1.BaseNode.prototype.readAttribute.call(this, context, attributeId);
52
- }
53
- return new node_opcua_data_value_1.DataValue(options);
54
- }
55
- /**
56
- * instantiate an object of this UAObjectType
57
- * The instantiation takes care of object type inheritance when constructing inner properties and components.
58
- * @method instantiate
59
- * @param options
60
- * @param options.browseName
61
- * @param [options.description]
62
- * @param [options.organizedBy] the parent Folder holding this object
63
- * @param [options.componentOf] the parent Object holding this object
64
- * @param [options.notifierOf]
65
- * @param [options.eventSourceOf]
66
- * @param [options.optionals = [] name of the optional child to create
67
- * @param [options.modellingRule]
68
- * @param [options.encodingOf]
69
- *
70
- *
71
- * Note : HasComponent usage scope
72
- *
73
- * Source | Destination
74
- * -------------------+---------------------------
75
- * Object | Object, Variable,Method
76
- * ObjectType |
77
- * -------------------+---------------------------
78
- * DataVariable | Variable
79
- * DataVariableType |
80
- */
81
- instantiate(options) {
82
- const addressSpace = this.addressSpace;
83
- node_opcua_assert_1.assert(!this.isAbstract, "cannot instantiate abstract UAObjectType");
84
- node_opcua_assert_1.assert(options, "missing option object");
85
- node_opcua_assert_1.assert(typeof options.browseName === "string" || (options.browseName !== null && typeof options.browseName === "object"), "expecting a browse name");
86
- node_opcua_assert_1.assert(!options.hasOwnProperty("propertyOf"), "an Object shall not be a PropertyOf an other object");
87
- node_opcua_assert_1.assert(!options.hasOwnProperty("optional"), "do you mean optionals ?");
88
- ua_variable_type_1.assertUnusedChildBrowseName(addressSpace, options);
89
- const baseObjectType = addressSpace.findObjectType("BaseObjectType");
90
- node_opcua_assert_1.assert(baseObjectType, "BaseObjectType must be defined in the address space");
91
- const references = [];
92
- const opts = {
93
- browseName: options.browseName,
94
- componentOf: options.componentOf,
95
- description: options.description || this.description,
96
- encodingOf: options.encodingOf,
97
- eventSourceOf: options.eventSourceOf,
98
- notifierOf: options.notifierOf,
99
- organizedBy: options.organizedBy,
100
- references,
101
- typeDefinition: this.nodeId,
102
- nodeId: options.nodeId,
103
- eventNotifier: options.eventNotifier === undefined ? 0 : options.eventNotifier,
104
- modellingRule: options.modellingRule
105
- };
106
- const namespace = this.addressSpace.getOwnNamespace();
107
- const instance = namespace.addObject(opts);
108
- ua_variable_type_1.initialize_properties_and_components(instance, baseObjectType, this, options.optionals);
109
- node_opcua_assert_1.assert(instance.typeDefinition.toString() === this.nodeId.toString());
110
- instance.install_extra_properties();
111
- if (this._postInstantiateFunc) {
112
- this._postInstantiateFunc(instance, this, options);
113
- }
114
- return instance;
115
- }
116
- toString() {
117
- const options = new base_node_private_1.ToStringBuilder();
118
- base_node_private_1.UAObjectType_toString.call(this, options);
119
- return options.toString();
120
- }
121
- }
122
- exports.UAObjectType = UAObjectType;
123
- //# sourceMappingURL=ua_object_type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_object_type.js","sourceRoot":"","sources":["../../src/ua_object_type.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,iEAAkD;AAClD,iEAAqD;AACrD,iEAAiE;AAEjE,mEAAqD;AACrD,0CAA0C;AAC1C,2DAA8C;AAO9C,2CAAuC;AACvC,2DAA6E;AAE7E,uDAAmD;AACnD,6DAAuE;AACvE,8CAA8C;AAC9C,yDAAuG;AAGvG,MAAa,YAAa,SAAQ,oBAAQ;IAiBtC,YAAY,OAAY;QACpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAjBH,cAAS,GAAG,iCAAS,CAAC,UAAU,CAAC;QAc1C,kBAAa,GAAG,KAAK,CAAC,uBAAuB,CAAqB,YAAY,CAAC,CAAC;QAInF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC/F,CAAC;IAjBD;;OAEG;IACH,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,IAAW,SAAS;QAChB,OAAO,kCAAa,CAA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YAC3B,IAAI,CAAC,oBAAoB,CAAC,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;SACtD;QAED,OAAO,QAAQ,CAAC;IACpB,CAAC;IAEM,QAAQ;QACX,MAAM,OAAO,GAAG,IAAI,mCAAe,EAAE,CAAC;QACtC,yCAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO,OAAO,CAAC,QAAQ,EAAE,CAAC;IAC9B,CAAC;CACJ;AA9HD,oCA8HC"}
@@ -1,42 +0,0 @@
1
- /**
2
- * @module node-opcua-address-space
3
- */
4
- import { LocalizedTextOptions } from "node-opcua-data-model";
5
- import { LocalizedText, NodeClass } from "node-opcua-data-model";
6
- import { AttributeIds } from "node-opcua-data-model";
7
- import { DataValue } from "node-opcua-data-value";
8
- import { NodeId } from "node-opcua-nodeid";
9
- import { SessionContext, UAReferenceType as UAReferenceTypePublic } from "../source";
10
- import { BaseNode, InternalBaseNodeOptions } from "./base_node";
11
- import { Reference } from "./reference";
12
- export interface UAReferenceTypeOptions extends InternalBaseNodeOptions {
13
- isAbstract?: boolean;
14
- symmetric?: boolean;
15
- inverseName: null | string | LocalizedTextOptions;
16
- }
17
- export declare class UAReferenceType extends BaseNode implements UAReferenceTypePublic {
18
- readonly nodeClass = NodeClass.ReferenceType;
19
- readonly isAbstract: boolean;
20
- readonly symmetric: boolean;
21
- readonly inverseName: LocalizedText;
22
- get subtypeOfObj(): UAReferenceTypePublic | null;
23
- get subtypeOf(): NodeId | null;
24
- /**
25
- * returns true if self is a super type of baseType
26
- */
27
- isSupertypeOf: (baseType: UAReferenceType) => boolean;
28
- /**
29
- * @private
30
- */
31
- _slow_isSupertypeOf: (baseType: UAReferenceType) => boolean;
32
- constructor(options: UAReferenceTypeOptions);
33
- readAttribute(context: SessionContext | null, attributeId: AttributeIds): DataValue;
34
- toString(): string;
35
- install_extra_properties(): void;
36
- /**
37
- * returns a array of all ReferenceTypes in the addressSpace that are self or a subType of self
38
- * recursively
39
- */
40
- getAllSubtypes(): UAReferenceType[];
41
- checkHasSubtype(ref: Reference | NodeId): boolean;
42
- }
@@ -1,138 +0,0 @@
1
- "use strict";
2
- /**
3
- * @module node-opcua-address-space
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.UAReferenceType = void 0;
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_data_model_1 = require("node-opcua-data-model");
9
- const node_opcua_data_model_2 = require("node-opcua-data-model");
10
- const node_opcua_data_model_3 = require("node-opcua-data-model");
11
- const node_opcua_data_value_1 = require("node-opcua-data-value");
12
- const node_opcua_status_code_1 = require("node-opcua-status-code");
13
- const node_opcua_variant_1 = require("node-opcua-variant");
14
- const source_1 = require("../source");
15
- const base_node_1 = require("./base_node");
16
- const tools = require("./tool_isSupertypeOf");
17
- const tool_isSupertypeOf_1 = require("./tool_isSupertypeOf");
18
- const reference_1 = require("./reference");
19
- const base_node_private_1 = require("./base_node_private");
20
- const ReferenceTypeCounter = { count: 0 };
21
- function _internal_getAllSubtypes(referenceType) {
22
- const addressSpace = referenceType.addressSpace;
23
- const possibleReferenceTypes = [];
24
- const hasSubtypeReferenceType = addressSpace.findReferenceType("HasSubtype");
25
- function _findAllSubType(referenceTypeInner) {
26
- possibleReferenceTypes.push(referenceTypeInner);
27
- node_opcua_assert_1.assert(referenceTypeInner.nodeClass === node_opcua_data_model_2.NodeClass.ReferenceType);
28
- const references = referenceTypeInner.findReferences(hasSubtypeReferenceType, true);
29
- for (const _r of references) {
30
- const subType = addressSpace.findReferenceType(_r.nodeId);
31
- _findAllSubType(subType);
32
- }
33
- }
34
- _findAllSubType(referenceType);
35
- return possibleReferenceTypes;
36
- }
37
- function _getAllSubtypes(ref) {
38
- const _cache = base_node_private_1.BaseNode_getCache(ref);
39
- if (!_cache._allSubTypesVersion || _cache._allSubTypesVersion < ReferenceTypeCounter.count) {
40
- _cache._allSubTypes = null;
41
- }
42
- if (!_cache._allSubTypes) {
43
- _cache._allSubTypes = _internal_getAllSubtypes(ref);
44
- _cache._allSubTypesVersion = ReferenceTypeCounter.count;
45
- }
46
- return _cache._allSubTypes;
47
- }
48
- function _internal_getSubtypeIndex(referenceType) {
49
- const possibleReferenceTypes = _getAllSubtypes(referenceType);
50
- // create a index of reference type with browseName as key for faster search
51
- const keys = {};
52
- for (const refType of possibleReferenceTypes) {
53
- keys[refType.nodeId.toString()] = refType;
54
- }
55
- return keys;
56
- }
57
- function _getSubtypeIndex(referenceType) {
58
- const _cache = base_node_private_1.BaseNode_getCache(referenceType);
59
- if (!_cache._subtype_idx || _cache._subtype_idxVersion < ReferenceTypeCounter.count) {
60
- // the cache need to be invalidated
61
- _cache._subtype_idx = null;
62
- }
63
- if (!_cache._subtype_idx) {
64
- _cache._subtype_idx = _internal_getSubtypeIndex(referenceType);
65
- _cache._subtype_idxVersion = ReferenceTypeCounter.count;
66
- }
67
- return _cache._subtype_idx;
68
- }
69
- class UAReferenceType extends base_node_1.BaseNode {
70
- constructor(options) {
71
- super(options);
72
- this.nodeClass = node_opcua_data_model_2.NodeClass.ReferenceType;
73
- /**
74
- * returns true if self is a super type of baseType
75
- */
76
- this.isSupertypeOf = tools.construct_isSupertypeOf(UAReferenceType);
77
- /**
78
- * @private
79
- */
80
- this._slow_isSupertypeOf = tools.construct_slow_isSupertypeOf(UAReferenceType);
81
- this.isAbstract = options.isAbstract === undefined ? false : !!options.isAbstract;
82
- this.symmetric = options.symmetric === undefined ? false : !!options.symmetric;
83
- // Note: Inverse name is not required anymore in 1.0.4
84
- this.inverseName = node_opcua_data_model_1.coerceLocalizedText(options.inverseName || this.browseName.name);
85
- ReferenceTypeCounter.count += 1;
86
- }
87
- get subtypeOfObj() {
88
- return tool_isSupertypeOf_1.get_subtypeOfObj.call(this);
89
- }
90
- get subtypeOf() {
91
- return tool_isSupertypeOf_1.get_subtypeOf.call(this);
92
- }
93
- readAttribute(context, attributeId) {
94
- node_opcua_assert_1.assert(!context || context instanceof source_1.SessionContext);
95
- const options = {};
96
- switch (attributeId) {
97
- case node_opcua_data_model_3.AttributeIds.IsAbstract:
98
- options.value = { dataType: node_opcua_variant_1.DataType.Boolean, value: !!this.isAbstract };
99
- options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
100
- break;
101
- case node_opcua_data_model_3.AttributeIds.Symmetric:
102
- options.value = { dataType: node_opcua_variant_1.DataType.Boolean, value: !!this.symmetric };
103
- options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
104
- break;
105
- case node_opcua_data_model_3.AttributeIds.InverseName: // LocalizedText
106
- options.value = { dataType: node_opcua_variant_1.DataType.LocalizedText, value: this.inverseName };
107
- options.statusCode = node_opcua_status_code_1.StatusCodes.Good;
108
- break;
109
- default:
110
- return super.readAttribute(context, attributeId);
111
- }
112
- return new node_opcua_data_value_1.DataValue(options);
113
- }
114
- toString() {
115
- let str = "";
116
- str += this.isAbstract ? "A" : " ";
117
- str += this.symmetric ? "S" : " ";
118
- str += " " + this.browseName.toString() + "/" + this.inverseName.text + " ";
119
- str += this.nodeId.toString();
120
- return str;
121
- }
122
- install_extra_properties() { }
123
- /**
124
- * returns a array of all ReferenceTypes in the addressSpace that are self or a subType of self
125
- * recursively
126
- */
127
- getAllSubtypes() {
128
- return _getAllSubtypes(this);
129
- }
130
- checkHasSubtype(ref) {
131
- const _index = _getSubtypeIndex(this);
132
- const referenceTypeNodeId = ref instanceof reference_1.Reference ? ref.nodeId : ref;
133
- const _key = referenceTypeNodeId.toString();
134
- return !!_index[_key];
135
- }
136
- }
137
- exports.UAReferenceType = UAReferenceType;
138
- //# sourceMappingURL=ua_reference_type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ua_reference_type.js","sourceRoot":"","sources":["../../src/ua_reference_type.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAIH,yDAA2C;AAC3C,iEAAkF;AAClF,iEAAiE;AACjE,iEAAqD;AACrD,iEAAiE;AAEjE,mEAAqD;AACrD,2DAA8C;AAC9C,sCAAqF;AAC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