node-opcua-client 2.73.1 → 2.76.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 (83) hide show
  1. package/LICENSE +3 -1
  2. package/README.md +54 -0
  3. package/dist/alarms_and_conditions/client_alarm.d.ts +49 -45
  4. package/dist/alarms_and_conditions/client_alarm.js +109 -101
  5. package/dist/alarms_and_conditions/client_alarm.js.map +1 -1
  6. package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -25
  7. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  8. package/dist/alarms_and_conditions/client_alarm_list.js.map +1 -1
  9. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  10. package/dist/alarms_and_conditions/client_alarm_tools.js +156 -152
  11. package/dist/alarms_and_conditions/client_alarm_tools.js.map +1 -1
  12. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  13. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +192 -190
  14. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js.map +1 -1
  15. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  16. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -73
  17. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -8
  18. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +118 -120
  19. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js.map +1 -1
  20. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  21. package/dist/alarms_and_conditions/client_tools.js +180 -180
  22. package/dist/client_base.d.ts +277 -277
  23. package/dist/client_base.js +14 -14
  24. package/dist/client_monitored_item.d.ts +21 -21
  25. package/dist/client_monitored_item.js +11 -11
  26. package/dist/client_monitored_item_base.d.ts +39 -39
  27. package/dist/client_monitored_item_base.js +2 -2
  28. package/dist/client_monitored_item_group.d.ts +18 -18
  29. package/dist/client_monitored_item_group.js +13 -13
  30. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  31. package/dist/client_monitored_item_toolbox.js +117 -117
  32. package/dist/client_session.d.ts +484 -484
  33. package/dist/client_session.js +10 -10
  34. package/dist/client_session_keepalive_manager.d.ts +34 -34
  35. package/dist/client_session_keepalive_manager.js +150 -150
  36. package/dist/client_subscription.d.ts +241 -241
  37. package/dist/client_subscription.js +14 -14
  38. package/dist/client_utils.d.ts +22 -22
  39. package/dist/client_utils.js +88 -88
  40. package/dist/common.d.ts +17 -17
  41. package/dist/common.js +5 -5
  42. package/dist/index.d.ts +55 -55
  43. package/dist/index.js +93 -93
  44. package/dist/opcua_client.d.ts +132 -132
  45. package/dist/opcua_client.js +33 -33
  46. package/dist/private/client_base_impl.d.ts +157 -157
  47. package/dist/private/client_base_impl.js +1337 -1337
  48. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  49. package/dist/private/client_monitored_item_base_impl.js +4 -4
  50. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  51. package/dist/private/client_monitored_item_group_impl.js +159 -159
  52. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  53. package/dist/private/client_monitored_item_impl.js +305 -304
  54. package/dist/private/client_monitored_item_impl.js.map +1 -1
  55. package/dist/private/client_publish_engine.d.ts +62 -62
  56. package/dist/private/client_publish_engine.js +408 -408
  57. package/dist/private/client_session_impl.d.ts +621 -621
  58. package/dist/private/client_session_impl.js +1302 -1301
  59. package/dist/private/client_session_impl.js.map +1 -1
  60. package/dist/private/client_subscription_impl.d.ts +93 -93
  61. package/dist/private/client_subscription_impl.js +748 -743
  62. package/dist/private/client_subscription_impl.js.map +1 -1
  63. package/dist/private/i_private_client.d.ts +18 -18
  64. package/dist/private/i_private_client.js +2 -2
  65. package/dist/private/opcua_client_impl.d.ts +169 -169
  66. package/dist/private/opcua_client_impl.js +981 -981
  67. package/dist/reconnection.d.ts +9 -9
  68. package/dist/reconnection.js +408 -408
  69. package/dist/tools/findservers.d.ts +20 -20
  70. package/dist/tools/findservers.js +61 -61
  71. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  72. package/dist/tools/read_history_server_capabilities.js +99 -99
  73. package/dist/verify.d.ts +5 -5
  74. package/dist/verify.js +134 -134
  75. package/package.json +48 -48
  76. package/source/alarms_and_conditions/client_alarm.ts +28 -17
  77. package/source/alarms_and_conditions/client_alarm_list.ts +1 -0
  78. package/source/alarms_and_conditions/client_alarm_tools.ts +33 -23
  79. package/source/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.ts +10 -4
  80. package/source/alarms_and_conditions/client_alarm_tools_extractConditionFields.ts +11 -11
  81. package/source/private/client_monitored_item_impl.ts +4 -3
  82. package/source/private/client_session_impl.ts +10 -2
  83. package/source/private/client_subscription_impl.ts +6 -2
@@ -1,191 +1,193 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.confirmAllConditions = exports.acknwoledgeAllConditions = exports.findActiveConditions = exports.confirmCondition = exports.acknowledgeCondition = void 0;
13
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
14
- const node_opcua_service_filter_1 = require("node-opcua-service-filter");
15
- const node_opcua_service_read_1 = require("node-opcua-service-read");
16
- const node_opcua_status_code_1 = require("node-opcua-status-code");
17
- const node_opcua_variant_1 = require("node-opcua-variant");
18
- const node_opcua_debug_1 = require("node-opcua-debug");
19
- const client_alarm_1 = require("./client_alarm");
20
- const client_alarm_tools_extractConditionFields_1 = require("./client_alarm_tools_extractConditionFields");
21
- const client_tools_1 = require("./client_tools");
22
- const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
23
- const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
24
- const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
25
- /**
26
- *
27
- * @param session
28
- * @param eventStuff
29
- * @param comment
30
- */
31
- function acknowledgeCondition(session, eventStuff, comment) {
32
- return __awaiter(this, void 0, void 0, function* () {
33
- try {
34
- const conditionId = eventStuff.conditionId.value;
35
- const eventId = eventStuff.eventId.value;
36
- return yield session.acknowledgeCondition(conditionId, eventId, comment);
37
- }
38
- catch (err) {
39
- errorLog("Acknowledging alarm has failed !", err);
40
- return node_opcua_status_code_1.StatusCodes.BadInternalError;
41
- }
42
- });
43
- }
44
- exports.acknowledgeCondition = acknowledgeCondition;
45
- function confirmCondition(session, eventStuff, comment) {
46
- return __awaiter(this, void 0, void 0, function* () {
47
- try {
48
- const conditionId = eventStuff.conditionId.value;
49
- const eventId = eventStuff.eventId.value;
50
- return yield session.confirmCondition(conditionId, eventId, comment);
51
- }
52
- catch (err) {
53
- errorLog("Acknowledging alarm has failed !", err);
54
- return node_opcua_status_code_1.StatusCodes.BadInternalError;
55
- }
56
- });
57
- }
58
- exports.confirmCondition = confirmCondition;
59
- /**
60
- * Enumerate all events
61
- * @param session
62
- */
63
- function findActiveConditions(session) {
64
- return __awaiter(this, void 0, void 0, function* () {
65
- const request = {
66
- maxNotificationsPerPublish: 10000,
67
- priority: 6,
68
- publishingEnabled: true,
69
- requestedLifetimeCount: 1000,
70
- requestedMaxKeepAliveCount: 100,
71
- requestedPublishingInterval: 100
72
- };
73
- const subscription = yield session.createSubscription2(request);
74
- const itemToMonitor = {
75
- attributeId: node_opcua_service_read_1.AttributeIds.EventNotifier,
76
- nodeId: (0, node_opcua_nodeid_1.resolveNodeId)("Server") // i=2253
77
- };
78
- const fields = yield (0, client_alarm_tools_extractConditionFields_1.extractConditionFields)(session, "AcknowledgeableConditionType");
79
- const eventFilter = (0, node_opcua_service_filter_1.constructEventFilter)(fields, [(0, node_opcua_nodeid_1.resolveNodeId)("AcknowledgeableConditionType")]);
80
- const monitoringParameters = {
81
- discardOldest: false,
82
- filter: eventFilter,
83
- queueSize: 100,
84
- samplingInterval: 0
85
- };
86
- const event_monitoringItem = yield subscription.monitor(itemToMonitor, monitoringParameters, node_opcua_service_read_1.TimestampsToReturn.Both);
87
- const acknowledgeableConditions = [];
88
- let refreshStartEventHasBeenReceived = false;
89
- let RefreshEndEventHasBeenReceived = false;
90
- const RefreshStartEventType = (0, node_opcua_nodeid_1.resolveNodeId)("RefreshStartEventType").toString();
91
- const RefreshEndEventType = (0, node_opcua_nodeid_1.resolveNodeId)("RefreshEndEventType").toString();
92
- const promise = new Promise((resolve, reject) => {
93
- // now create a event monitored Item
94
- event_monitoringItem.on("changed", (_eventFields) => {
95
- const eventFields = _eventFields;
96
- try {
97
- if (RefreshEndEventHasBeenReceived) {
98
- return;
99
- }
100
- // dumpEvent(session, fields, eventFields);
101
- const pojo = (0, client_alarm_1.fieldsToJson)(fields, eventFields);
102
- // console.log(pojo.eventType.value.toString(), RefreshEndEventType, RefreshStartEventType);
103
- // make sure we only start recording event after the RefreshStartEvent has been received
104
- if (!refreshStartEventHasBeenReceived) {
105
- if (pojo.eventType.value.toString() === RefreshStartEventType) {
106
- refreshStartEventHasBeenReceived = true;
107
- }
108
- return;
109
- }
110
- if (pojo.eventType.value.toString() === RefreshEndEventType) {
111
- RefreshEndEventHasBeenReceived = true;
112
- resolve();
113
- return;
114
- }
115
- if (!pojo.conditionId.value) {
116
- // not a Acknowledgeable condition
117
- return;
118
- }
119
- if (pojo.ackedState.id.dataType === node_opcua_variant_1.DataType.Boolean) {
120
- acknowledgeableConditions.push(pojo);
121
- }
122
- }
123
- catch (err) {
124
- errorLog("Error !!", err);
125
- }
126
- });
127
- // async call without waiting !
128
- try {
129
- (0, client_tools_1.callConditionRefresh)(subscription);
130
- }
131
- catch (err) {
132
- // it is possible that server do not implement conditionRefresh ...
133
- debugLog("Server may not implement conditionRefresh", err);
134
- }
135
- });
136
- yield promise;
137
- // now shut down susbscription
138
- yield subscription.terminate();
139
- return acknowledgeableConditions;
140
- });
141
- }
142
- exports.findActiveConditions = findActiveConditions;
143
- function acknwoledgeAllConditions(session, message) {
144
- return __awaiter(this, void 0, void 0, function* () {
145
- try {
146
- let conditions = yield findActiveConditions(session);
147
- if (conditions.length === 0) {
148
- debugLog("Warning: cannot find conditions ");
149
- }
150
- // filter acknowledgable conditions (no acked yet)
151
- conditions = conditions.filter((pojo) => pojo.ackedState.id.value === false);
152
- const promises = [];
153
- for (const eventStuff of conditions) {
154
- promises.push(acknowledgeCondition(session, eventStuff, message));
155
- }
156
- const result = yield Promise.all(promises);
157
- if (doDebug) {
158
- debugLog("Acked all results: ", result.map((e) => e.toString()).join(" "));
159
- }
160
- }
161
- catch (err) {
162
- errorLog("Error", err);
163
- }
164
- });
165
- }
166
- exports.acknwoledgeAllConditions = acknwoledgeAllConditions;
167
- function confirmAllConditions(session, message) {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- try {
170
- let conditions = yield findActiveConditions(session);
171
- if (conditions.length === 0) {
172
- debugLog("Warning: cannot find conditions ");
173
- }
174
- // filter acknowledgable conditions (no acked yet)
175
- conditions = conditions.filter((pojo) => pojo.confirmedState.id.value === false);
176
- const promises = [];
177
- for (const eventStuff of conditions) {
178
- promises.push(confirmCondition(session, eventStuff, message));
179
- }
180
- const result = yield Promise.all(promises);
181
- if (doDebug) {
182
- debugLog("Confirm all results: ", result.map((e) => e.toString()).join(" "));
183
- }
184
- }
185
- catch (err) {
186
- errorLog("Error", err);
187
- }
188
- });
189
- }
190
- exports.confirmAllConditions = confirmAllConditions;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.confirmAllConditions = exports.acknwoledgeAllConditions = exports.findActiveConditions = exports.confirmCondition = exports.acknowledgeCondition = void 0;
13
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
14
+ const node_opcua_service_filter_1 = require("node-opcua-service-filter");
15
+ const node_opcua_service_read_1 = require("node-opcua-service-read");
16
+ const node_opcua_status_code_1 = require("node-opcua-status-code");
17
+ const node_opcua_variant_1 = require("node-opcua-variant");
18
+ const node_opcua_debug_1 = require("node-opcua-debug");
19
+ const client_alarm_1 = require("./client_alarm");
20
+ const client_alarm_tools_extractConditionFields_1 = require("./client_alarm_tools_extractConditionFields");
21
+ const client_tools_1 = require("./client_tools");
22
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
23
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
24
+ const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
25
+ /**
26
+ *
27
+ * @param session
28
+ * @param eventStuff
29
+ * @param comment
30
+ */
31
+ function acknowledgeCondition(session, eventStuff, comment) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ try {
34
+ const conditionId = eventStuff.conditionId.value;
35
+ const eventId = eventStuff.eventId.value;
36
+ return yield session.acknowledgeCondition(conditionId, eventId, comment);
37
+ }
38
+ catch (err) {
39
+ errorLog("Acknowledging alarm has failed !", err);
40
+ return node_opcua_status_code_1.StatusCodes.BadInternalError;
41
+ }
42
+ });
43
+ }
44
+ exports.acknowledgeCondition = acknowledgeCondition;
45
+ function confirmCondition(session, eventStuff, comment) {
46
+ return __awaiter(this, void 0, void 0, function* () {
47
+ try {
48
+ const conditionId = eventStuff.conditionId.value;
49
+ const eventId = eventStuff.eventId.value;
50
+ return yield session.confirmCondition(conditionId, eventId, comment);
51
+ }
52
+ catch (err) {
53
+ errorLog("Acknowledging alarm has failed !", err);
54
+ return node_opcua_status_code_1.StatusCodes.BadInternalError;
55
+ }
56
+ });
57
+ }
58
+ exports.confirmCondition = confirmCondition;
59
+ /**
60
+ * Enumerate all events
61
+ * @param session
62
+ */
63
+ function findActiveConditions(session) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const request = {
66
+ maxNotificationsPerPublish: 10000,
67
+ priority: 6,
68
+ publishingEnabled: true,
69
+ requestedLifetimeCount: 1000,
70
+ requestedMaxKeepAliveCount: 100,
71
+ requestedPublishingInterval: 100
72
+ };
73
+ const subscription = yield session.createSubscription2(request);
74
+ const itemToMonitor = {
75
+ attributeId: node_opcua_service_read_1.AttributeIds.EventNotifier,
76
+ nodeId: (0, node_opcua_nodeid_1.resolveNodeId)("Server") // i=2253
77
+ };
78
+ const fields = yield (0, client_alarm_tools_extractConditionFields_1.extractConditionFields)(session, "AcknowledgeableConditionType");
79
+ // note: we may want to have this select clause
80
+ // Or(OfType("AcknowledgeableConditionType"), OfType("RefreshStartEventType"), OfType("RefreshEndEventType"))
81
+ const eventFilter = (0, node_opcua_service_filter_1.constructEventFilter)(fields);
82
+ const monitoringParameters = {
83
+ discardOldest: false,
84
+ filter: eventFilter,
85
+ queueSize: 100,
86
+ samplingInterval: 0
87
+ };
88
+ const event_monitoringItem = yield subscription.monitor(itemToMonitor, monitoringParameters, node_opcua_service_read_1.TimestampsToReturn.Both);
89
+ const acknowledgeableConditions = [];
90
+ let refreshStartEventHasBeenReceived = false;
91
+ let RefreshEndEventHasBeenReceived = false;
92
+ const RefreshStartEventType = (0, node_opcua_nodeid_1.resolveNodeId)("RefreshStartEventType").toString();
93
+ const RefreshEndEventType = (0, node_opcua_nodeid_1.resolveNodeId)("RefreshEndEventType").toString();
94
+ const promise = new Promise((resolve, reject) => {
95
+ // now create a event monitored Item
96
+ event_monitoringItem.on("changed", (_eventFields) => {
97
+ const eventFields = _eventFields;
98
+ try {
99
+ if (RefreshEndEventHasBeenReceived) {
100
+ return;
101
+ }
102
+ // dumpEvent(session, fields, eventFields);
103
+ const pojo = (0, client_alarm_1.fieldsToJson)(fields, eventFields);
104
+ // console.log(pojo.eventType.value.toString({ addressSpace}), RefreshEndEventType, RefreshStartEventType);
105
+ // make sure we only start recording event after the RefreshStartEvent has been received
106
+ if (!refreshStartEventHasBeenReceived) {
107
+ if (pojo.eventType.value.toString() === RefreshStartEventType) {
108
+ refreshStartEventHasBeenReceived = true;
109
+ }
110
+ return;
111
+ }
112
+ if (pojo.eventType.value.toString() === RefreshEndEventType) {
113
+ RefreshEndEventHasBeenReceived = true;
114
+ resolve();
115
+ return;
116
+ }
117
+ if (!pojo.conditionId.value) {
118
+ // not a Acknowledgeable condition
119
+ return;
120
+ }
121
+ if (pojo.ackedState.id.dataType === node_opcua_variant_1.DataType.Boolean) {
122
+ acknowledgeableConditions.push(pojo);
123
+ }
124
+ }
125
+ catch (err) {
126
+ errorLog("Error !!", err);
127
+ }
128
+ });
129
+ // async call without waiting !
130
+ try {
131
+ (0, client_tools_1.callConditionRefresh)(subscription);
132
+ }
133
+ catch (err) {
134
+ // it is possible that server do not implement conditionRefresh ...
135
+ debugLog("Server may not implement conditionRefresh", err);
136
+ }
137
+ });
138
+ yield promise;
139
+ // now shut down susbscription
140
+ yield subscription.terminate();
141
+ return acknowledgeableConditions;
142
+ });
143
+ }
144
+ exports.findActiveConditions = findActiveConditions;
145
+ function acknwoledgeAllConditions(session, message) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ try {
148
+ let conditions = yield findActiveConditions(session);
149
+ if (conditions.length === 0) {
150
+ debugLog("Warning: cannot find conditions ");
151
+ }
152
+ // filter acknowledgable conditions (no acked yet)
153
+ conditions = conditions.filter((pojo) => pojo.ackedState.id.value === false);
154
+ const promises = [];
155
+ for (const eventStuff of conditions) {
156
+ promises.push(acknowledgeCondition(session, eventStuff, message));
157
+ }
158
+ const result = yield Promise.all(promises);
159
+ if (doDebug) {
160
+ debugLog("Acked all results: ", result.map((e) => e.toString()).join(" "));
161
+ }
162
+ }
163
+ catch (err) {
164
+ errorLog("Error", err);
165
+ }
166
+ });
167
+ }
168
+ exports.acknwoledgeAllConditions = acknwoledgeAllConditions;
169
+ function confirmAllConditions(session, message) {
170
+ return __awaiter(this, void 0, void 0, function* () {
171
+ try {
172
+ let conditions = yield findActiveConditions(session);
173
+ if (conditions.length === 0) {
174
+ debugLog("Warning: cannot find conditions ");
175
+ }
176
+ // filter acknowledgable conditions (no acked yet)
177
+ conditions = conditions.filter((pojo) => pojo.confirmedState.id.value === false);
178
+ const promises = [];
179
+ for (const eventStuff of conditions) {
180
+ promises.push(confirmCondition(session, eventStuff, message));
181
+ }
182
+ const result = yield Promise.all(promises);
183
+ if (doDebug) {
184
+ debugLog("Confirm all results: ", result.map((e) => e.toString()).join(" "));
185
+ }
186
+ }
187
+ catch (err) {
188
+ errorLog("Error", err);
189
+ }
190
+ });
191
+ }
192
+ exports.confirmAllConditions = confirmAllConditions;
191
193
  //# sourceMappingURL=client_alarm_tools_acknowledge_all_conditions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client_alarm_tools_acknowledge_all_conditions.js","sourceRoot":"","sources":["../../source/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAkD;AAClD,yEAAiE;AACjE,qEAA+F;AAE/F,mEAAiE;AACjE,2DAAuD;AACvD,uDAAgF;AAGhF,iDAA0D;AAC1D,2GAAqF;AACrF,iDAAsD;AAEtD,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,M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,UAAU,EAAE;gBACjC,QAAQ,CAAC,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;aACjE;YACD,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC3C,IAAI,OAAO,EAAE;gBACT,QAAQ,CAAC,uBAAuB,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;aAChF;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SAC1B;IACL,CAAC;CAAA;AArBD,oDAqBC"}
1
+ {"version":3,"file":"client_alarm_tools_acknowledge_all_conditions.js","sourceRoot":"","sources":["../../source/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAAkD;AAClD,yEAAiE;AACjE,qEAA+F;AAE/F,mEAAiE;AACjE,2DAAuD;AACvD,uDAAgF;AAEhF,iDAA0D;AAC1D,2GAAqF;AACrF,iDAAsD;AAEtD,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAE3C;;;;;GAKG;AACH,SAAsB,oBAAoB,CAAC,OAAsB,EAAE,UAAsB,EAAE,OAAe;;QAEtG,IAAI;YACA,MAAM,WAAW,GAAG,UAAU,CAAC,WAAW,CAAC,KAAK,CAAC;YACjD,MAAM,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC;YACzC,OAAO,MAAM,OAAO,CAAC,oBAAoB,CAAC,WAAW,EAAE,OAAO,EAA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AC,GAAG,CAAC,CAAC,CAAC;aAChF;SACJ;QAAC,OAAO,GAAG,EAAE;YACV,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;SAC1B;IACL,CAAC;CAAA;AArBD,oDAqBC"}
@@ -1,9 +1,9 @@
1
- import { IBasicSession } from "node-opcua-pseudo-session";
2
- import { Variant } from "node-opcua-variant";
3
- /**
4
- *
5
- * @param session
6
- * @param fields
7
- * @param eventFields
8
- */
9
- export declare function dumpEvent(session: IBasicSession, fields: string[], eventFields: Variant[]): Promise<void>;
1
+ import { IBasicSession } from "node-opcua-pseudo-session";
2
+ import { Variant } from "node-opcua-variant";
3
+ /**
4
+ *
5
+ * @param session
6
+ * @param fields
7
+ * @param eventFields
8
+ */
9
+ export declare function dumpEvent(session: IBasicSession, fields: string[], eventFields: Variant[]): Promise<void>;
@@ -1,74 +1,74 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.dumpEvent = void 0;
13
- const chalk = require("chalk");
14
- const node_opcua_data_model_1 = require("node-opcua-data-model");
15
- const node_opcua_status_code_1 = require("node-opcua-status-code");
16
- const node_opcua_variant_1 = require("node-opcua-variant");
17
- /**
18
- *
19
- * @param session
20
- * @param fields
21
- * @param eventFields
22
- */
23
- function dumpEvent(session, fields, eventFields) {
24
- return __awaiter(this, void 0, void 0, function* () {
25
- function getBrowseName(_session, nodeId) {
26
- return __awaiter(this, void 0, void 0, function* () {
27
- const dataValue = yield _session.read({
28
- attributeId: node_opcua_data_model_1.AttributeIds.BrowseName,
29
- nodeId
30
- });
31
- if (dataValue.statusCode === node_opcua_status_code_1.StatusCodes.Good) {
32
- const browseName = dataValue.value.value.name;
33
- return browseName;
34
- }
35
- else {
36
- return "???";
37
- }
38
- });
39
- }
40
- function w(str, l) {
41
- return str.padEnd(l, " ").substring(0, l);
42
- }
43
- function __dumpEvent1(_session, _fields, variant, index) {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (variant.dataType === node_opcua_variant_1.DataType.Null) {
46
- return;
47
- }
48
- if (variant.dataType === node_opcua_variant_1.DataType.NodeId) {
49
- const name = yield getBrowseName(_session, variant.value);
50
- // tslint:disable-next-line: no-console
51
- console.log(chalk.yellow(w(name, 30), w(_fields[index], 25)), chalk.cyan(w(node_opcua_variant_1.DataType[variant.dataType], 10).toString()), chalk.cyan.bold(name), "(", w(variant.value, 20), ")");
52
- }
53
- else {
54
- // tslint:disable-next-line: no-console
55
- console.log(chalk.yellow(w("", 30), w(_fields[index], 25)), chalk.cyan(w(node_opcua_variant_1.DataType[variant.dataType], 10).toString()), variant.value);
56
- }
57
- });
58
- }
59
- function __dumpEvent(_session, _fields, _eventFields) {
60
- return __awaiter(this, void 0, void 0, function* () {
61
- let index = 0;
62
- const promises = [];
63
- for (const variant of _eventFields) {
64
- promises.push(__dumpEvent1(_session, _fields, variant, index));
65
- index++;
66
- }
67
- yield Promise.all(promises);
68
- });
69
- }
70
- yield __dumpEvent(session, fields, eventFields);
71
- });
72
- }
73
- exports.dumpEvent = dumpEvent;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.dumpEvent = void 0;
13
+ const chalk = require("chalk");
14
+ const node_opcua_data_model_1 = require("node-opcua-data-model");
15
+ const node_opcua_status_code_1 = require("node-opcua-status-code");
16
+ const node_opcua_variant_1 = require("node-opcua-variant");
17
+ /**
18
+ *
19
+ * @param session
20
+ * @param fields
21
+ * @param eventFields
22
+ */
23
+ function dumpEvent(session, fields, eventFields) {
24
+ return __awaiter(this, void 0, void 0, function* () {
25
+ function getBrowseName(_session, nodeId) {
26
+ return __awaiter(this, void 0, void 0, function* () {
27
+ const dataValue = yield _session.read({
28
+ attributeId: node_opcua_data_model_1.AttributeIds.BrowseName,
29
+ nodeId
30
+ });
31
+ if (dataValue.statusCode === node_opcua_status_code_1.StatusCodes.Good) {
32
+ const browseName = dataValue.value.value.name;
33
+ return browseName;
34
+ }
35
+ else {
36
+ return "???";
37
+ }
38
+ });
39
+ }
40
+ function w(str, l) {
41
+ return str.padEnd(l, " ").substring(0, l);
42
+ }
43
+ function __dumpEvent1(_session, _fields, variant, index) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ if (variant.dataType === node_opcua_variant_1.DataType.Null) {
46
+ return;
47
+ }
48
+ if (variant.dataType === node_opcua_variant_1.DataType.NodeId) {
49
+ const name = yield getBrowseName(_session, variant.value);
50
+ // tslint:disable-next-line: no-console
51
+ console.log(chalk.yellow(w(name, 30), w(_fields[index], 25)), chalk.cyan(w(node_opcua_variant_1.DataType[variant.dataType], 10).toString()), chalk.cyan.bold(name), "(", w(variant.value, 20), ")");
52
+ }
53
+ else {
54
+ // tslint:disable-next-line: no-console
55
+ console.log(chalk.yellow(w("", 30), w(_fields[index], 25)), chalk.cyan(w(node_opcua_variant_1.DataType[variant.dataType], 10).toString()), variant.value);
56
+ }
57
+ });
58
+ }
59
+ function __dumpEvent(_session, _fields, _eventFields) {
60
+ return __awaiter(this, void 0, void 0, function* () {
61
+ let index = 0;
62
+ const promises = [];
63
+ for (const variant of _eventFields) {
64
+ promises.push(__dumpEvent1(_session, _fields, variant, index));
65
+ index++;
66
+ }
67
+ yield Promise.all(promises);
68
+ });
69
+ }
70
+ yield __dumpEvent(session, fields, eventFields);
71
+ });
72
+ }
73
+ exports.dumpEvent = dumpEvent;
74
74
  //# sourceMappingURL=client_alarm_tools_dump_event.js.map
@@ -1,8 +1,3 @@
1
- import { NodeIdLike } from "node-opcua-nodeid";
2
- import { IBasicSession } from "node-opcua-pseudo-session";
3
- /**
4
- *
5
- * @param session
6
- * @param conditionNodeId
7
- */
8
- export declare function extractConditionFields(session: IBasicSession, conditionNodeId: NodeIdLike): Promise<string[]>;
1
+ import { NodeIdLike } from "node-opcua-nodeid";
2
+ import { IBasicSession } from "node-opcua-pseudo-session";
3
+ export declare function extractConditionFields(session: IBasicSession, conditionNodeId: NodeIdLike): Promise<string[]>;