node-opcua-server 2.163.1 → 2.164.2
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.
- package/dist/addressSpace_accessor.js +7 -5
- package/dist/addressSpace_accessor.js.map +1 -1
- package/dist/base_server.js +6 -6
- package/dist/base_server.js.map +1 -1
- package/dist/monitored_item.js +32 -32
- package/dist/monitored_item.js.map +1 -1
- package/dist/node_sampler.js +1 -1
- package/dist/node_sampler.js.map +1 -1
- package/dist/opcua_server.js +48 -43
- package/dist/opcua_server.js.map +1 -1
- package/dist/register_server_manager.d.ts +2 -2
- package/dist/register_server_manager.js +12 -6
- package/dist/register_server_manager.js.map +1 -1
- package/dist/register_server_manager_mdns_only.js +1 -1
- package/dist/register_server_manager_mdns_only.js.map +1 -1
- package/dist/server_end_point.js +11 -11
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.js +6 -6
- package/dist/server_engine.js.map +1 -1
- package/dist/server_publish_engine.js +5 -5
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_session.js +4 -4
- package/dist/server_session.js.map +1 -1
- package/dist/server_subscription.js +18 -18
- package/dist/server_subscription.js.map +1 -1
- package/dist/sessions_compatible_for_transfer.js +1 -1
- package/dist/sessions_compatible_for_transfer.js.map +1 -1
- package/package.json +47 -47
- package/source/addressSpace_accessor.ts +6 -3
- package/source/base_server.ts +7 -7
- package/source/monitored_item.ts +32 -32
- package/source/node_sampler.ts +1 -1
- package/source/opcua_server.ts +54 -49
- package/source/register_server_manager.ts +11 -5
- package/source/register_server_manager_mdns_only.ts +1 -1
- package/source/server_end_point.ts +11 -11
- package/source/server_engine.ts +15 -14
- package/source/server_publish_engine.ts +5 -5
- package/source/server_session.ts +4 -4
- package/source/server_subscription.ts +18 -18
- package/source/sessions_compatible_for_transfer.ts +4 -2
package/source/server_session.ts
CHANGED
|
@@ -305,7 +305,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
305
305
|
public incrementRequestTotalCounter(counterName: string): void {
|
|
306
306
|
if (this._sessionDiagnostics) {
|
|
307
307
|
const propName = lowerFirstLetter(counterName + "Count");
|
|
308
|
-
//
|
|
308
|
+
// c8 ignore next
|
|
309
309
|
if (!Object.prototype.hasOwnProperty.call(this._sessionDiagnostics, propName)) {
|
|
310
310
|
errorLog("incrementRequestTotalCounter: cannot find", propName);
|
|
311
311
|
// xx return;
|
|
@@ -319,7 +319,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
319
319
|
this.parent?.incrementRejectedRequestsCount();
|
|
320
320
|
if (this._sessionDiagnostics) {
|
|
321
321
|
const propName = lowerFirstLetter(counterName + "Count");
|
|
322
|
-
//
|
|
322
|
+
// c8 ignore next
|
|
323
323
|
if (!Object.prototype.hasOwnProperty.call(this._sessionDiagnostics, propName)) {
|
|
324
324
|
errorLog("incrementRequestErrorCounter: cannot find", propName);
|
|
325
325
|
// xx return;
|
|
@@ -560,7 +560,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
560
560
|
public _detach_channel(): void {
|
|
561
561
|
const channel = this.channel;
|
|
562
562
|
|
|
563
|
-
//
|
|
563
|
+
// c8 ignore next
|
|
564
564
|
if (!channel) {
|
|
565
565
|
return;
|
|
566
566
|
// already detached !
|
|
@@ -895,7 +895,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
895
895
|
*/
|
|
896
896
|
private _getSubscriptionDiagnosticsArray() {
|
|
897
897
|
if (!this.addressSpace) {
|
|
898
|
-
//
|
|
898
|
+
// c8 ignore next
|
|
899
899
|
if (doDebug) {
|
|
900
900
|
console.warn("ServerSession#_getSubscriptionDiagnosticsArray : no addressSpace");
|
|
901
901
|
}
|
|
@@ -150,7 +150,7 @@ function _getSequenceNumbers(arr: NotificationMessage[]): number[] {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
function analyzeEventFilterResult(node: BaseNode, eventFilter: EventFilter): EventFilterResult {
|
|
153
|
-
/*
|
|
153
|
+
/* c8 ignore next */
|
|
154
154
|
if (!(eventFilter instanceof EventFilter)) {
|
|
155
155
|
throw new Error("Internal Error");
|
|
156
156
|
}
|
|
@@ -189,7 +189,7 @@ function _process_filter(node: BaseNode, filter: any): EventFilterResult | Aggre
|
|
|
189
189
|
} else if (filter instanceof AggregateFilter) {
|
|
190
190
|
return analyzeAggregateFilterResult(node, filter);
|
|
191
191
|
}
|
|
192
|
-
//
|
|
192
|
+
// c8 ignore next
|
|
193
193
|
throw new Error("invalid filter");
|
|
194
194
|
}
|
|
195
195
|
|
|
@@ -882,7 +882,7 @@ export class Subscription extends EventEmitter {
|
|
|
882
882
|
};
|
|
883
883
|
}
|
|
884
884
|
public dispose(): void {
|
|
885
|
-
//
|
|
885
|
+
// c8 ignore next
|
|
886
886
|
if (doDebug) {
|
|
887
887
|
debugLog("Subscription#dispose", this.id, this.monitoredItemCount);
|
|
888
888
|
}
|
|
@@ -977,7 +977,7 @@ export class Subscription extends EventEmitter {
|
|
|
977
977
|
// - Any negative number is interpreted as -1.
|
|
978
978
|
samplingInterval = this.publishingInterval;
|
|
979
979
|
} else if (samplingInterval === 0) {
|
|
980
|
-
//
|
|
980
|
+
// c8 ignore next
|
|
981
981
|
if (!node) throw new Error("Internal Error");
|
|
982
982
|
|
|
983
983
|
// OPCUA 1.0.3 Part 4 - 5.12.1.2
|
|
@@ -1092,7 +1092,7 @@ export class Subscription extends EventEmitter {
|
|
|
1092
1092
|
assert(createResult.statusCode.isGood());
|
|
1093
1093
|
|
|
1094
1094
|
const monitoredItem = this.getMonitoredItem(createResult.monitoredItemId);
|
|
1095
|
-
//
|
|
1095
|
+
// c8 ignore next
|
|
1096
1096
|
if (!monitoredItem) {
|
|
1097
1097
|
throw new Error("internal error");
|
|
1098
1098
|
}
|
|
@@ -1234,13 +1234,13 @@ export class Subscription extends EventEmitter {
|
|
|
1234
1234
|
});
|
|
1235
1235
|
|
|
1236
1236
|
if (foundIndex === -1) {
|
|
1237
|
-
//
|
|
1237
|
+
// c8 ignore next
|
|
1238
1238
|
if (doDebug) {
|
|
1239
1239
|
debugLog(chalk.red("acknowledging sequence FAILED !!! "), chalk.cyan(sequenceNumber.toString()));
|
|
1240
1240
|
}
|
|
1241
1241
|
return StatusCodes.BadSequenceNumberUnknown;
|
|
1242
1242
|
} else {
|
|
1243
|
-
//
|
|
1243
|
+
// c8 ignore next
|
|
1244
1244
|
if (doDebug) {
|
|
1245
1245
|
debugLog(chalk.yellow("acknowledging sequence "), chalk.cyan(sequenceNumber.toString()));
|
|
1246
1246
|
}
|
|
@@ -1434,7 +1434,7 @@ export class Subscription extends EventEmitter {
|
|
|
1434
1434
|
|
|
1435
1435
|
this.resetLifeTimeAndKeepAliveCounters();
|
|
1436
1436
|
|
|
1437
|
-
//
|
|
1437
|
+
// c8 ignore next
|
|
1438
1438
|
if (doDebug) {
|
|
1439
1439
|
debugLog(
|
|
1440
1440
|
"Subscription sending a notificationMessage subscriptionId=",
|
|
@@ -1476,7 +1476,7 @@ export class Subscription extends EventEmitter {
|
|
|
1476
1476
|
this.state === SubscriptionState.NORMAL ||
|
|
1477
1477
|
(this.state === SubscriptionState.LATE && this.hasPendingNotifications)
|
|
1478
1478
|
) {
|
|
1479
|
-
//
|
|
1479
|
+
// c8 ignore next
|
|
1480
1480
|
if (doDebug) {
|
|
1481
1481
|
debugLog(" -> pendingPublishRequestCount > 0 " + "&& normal state => re-trigger tick event immediately ");
|
|
1482
1482
|
}
|
|
@@ -1564,7 +1564,7 @@ export class Subscription extends EventEmitter {
|
|
|
1564
1564
|
* @private
|
|
1565
1565
|
*/
|
|
1566
1566
|
private _tick() {
|
|
1567
|
-
//
|
|
1567
|
+
// c8 ignore next
|
|
1568
1568
|
if (doDebug) {
|
|
1569
1569
|
debugLog(`Subscription#_tick id ${this.id} aborted=${this.aborted} state=${SubscriptionState[this.state]}`);
|
|
1570
1570
|
}
|
|
@@ -1575,7 +1575,7 @@ export class Subscription extends EventEmitter {
|
|
|
1575
1575
|
|
|
1576
1576
|
this.discardOldSentNotifications();
|
|
1577
1577
|
|
|
1578
|
-
//
|
|
1578
|
+
// c8 ignore next
|
|
1579
1579
|
if (doDebug) {
|
|
1580
1580
|
debugLog(
|
|
1581
1581
|
t(new Date()) + " " + this._life_time_counter + "/" + this.lifeTimeCount + chalk.cyan(" Subscription#_tick"),
|
|
@@ -1598,7 +1598,7 @@ export class Subscription extends EventEmitter {
|
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
1600
|
if (this.lifeTimeHasExpired) {
|
|
1601
|
-
/*
|
|
1601
|
+
/* c8 ignore next */
|
|
1602
1602
|
doDebug && debugLog(chalk.red.bold(`Subscription ${this.id} has expired !!!!! => Terminating`));
|
|
1603
1603
|
|
|
1604
1604
|
/**
|
|
@@ -1620,14 +1620,14 @@ export class Subscription extends EventEmitter {
|
|
|
1620
1620
|
|
|
1621
1621
|
const publishEngine = this.publishEngine!;
|
|
1622
1622
|
|
|
1623
|
-
//
|
|
1623
|
+
// c8 ignore next
|
|
1624
1624
|
doDebug && debugLog("Subscription#_tick self._pending_notifications= ", this._pending_notifications.size);
|
|
1625
1625
|
|
|
1626
1626
|
if (
|
|
1627
1627
|
publishEngine.pendingPublishRequestCount === 0 &&
|
|
1628
1628
|
(this.hasPendingNotifications || this.hasUncollectedMonitoredItemNotifications)
|
|
1629
1629
|
) {
|
|
1630
|
-
//
|
|
1630
|
+
// c8 ignore next
|
|
1631
1631
|
doDebug &&
|
|
1632
1632
|
debugLog(
|
|
1633
1633
|
"subscription set to LATE hasPendingNotifications = ",
|
|
@@ -1666,7 +1666,7 @@ export class Subscription extends EventEmitter {
|
|
|
1666
1666
|
|
|
1667
1667
|
if (this.publishEngine!.send_keep_alive_response(this.id, future_sequence_number)) {
|
|
1668
1668
|
this.messageSent = true;
|
|
1669
|
-
//
|
|
1669
|
+
// c8 ignore next
|
|
1670
1670
|
doDebug &&
|
|
1671
1671
|
debugLog(
|
|
1672
1672
|
` -> Subscription#_sendKeepAliveResponse subscriptionId ${this.id} future_sequence_number ${future_sequence_number}`
|
|
@@ -1692,7 +1692,7 @@ export class Subscription extends EventEmitter {
|
|
|
1692
1692
|
private resetKeepAliveCounter(): void {
|
|
1693
1693
|
this._keep_alive_counter = 0;
|
|
1694
1694
|
|
|
1695
|
-
//
|
|
1695
|
+
// c8 ignore next
|
|
1696
1696
|
doDebug &&
|
|
1697
1697
|
debugLog(
|
|
1698
1698
|
" -> subscriptionId",
|
|
@@ -1709,7 +1709,7 @@ export class Subscription extends EventEmitter {
|
|
|
1709
1709
|
private increaseKeepAliveCounter() {
|
|
1710
1710
|
this._keep_alive_counter += 1;
|
|
1711
1711
|
|
|
1712
|
-
//
|
|
1712
|
+
// c8 ignore next
|
|
1713
1713
|
doDebug &&
|
|
1714
1714
|
debugLog(
|
|
1715
1715
|
" -> subscriptionId",
|
|
@@ -1724,7 +1724,7 @@ export class Subscription extends EventEmitter {
|
|
|
1724
1724
|
* @private
|
|
1725
1725
|
*/
|
|
1726
1726
|
private _addNotificationMessage(notificationData: QueueItem | StatusChangeNotification, monitoredItemId?: number) {
|
|
1727
|
-
//
|
|
1727
|
+
// c8 ignore next
|
|
1728
1728
|
doDebug && debugLog(chalk.yellow("Subscription#_addNotificationMessage"), notificationData.toString());
|
|
1729
1729
|
|
|
1730
1730
|
this._pending_notifications.push({
|
|
@@ -23,7 +23,7 @@ export function sessionsCompatibleForTransfer(sessionSrc: ServerSession | undefi
|
|
|
23
23
|
}
|
|
24
24
|
return sessionSrc.userIdentityToken.userName === sessionDest.userIdentityToken.userName;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
else if (sessionSrc.userIdentityToken instanceof X509IdentityToken) {
|
|
28
28
|
if (!(sessionDest.userIdentityToken instanceof X509IdentityToken)) {
|
|
29
29
|
return false;
|
|
@@ -32,7 +32,9 @@ export function sessionsCompatibleForTransfer(sessionSrc: ServerSession | undefi
|
|
|
32
32
|
sessionSrc.userIdentityToken.certificateData.toString("hex") ===
|
|
33
33
|
sessionDest.userIdentityToken.certificateData.toString("hex")
|
|
34
34
|
);
|
|
35
|
-
}
|
|
35
|
+
}
|
|
36
|
+
/* c8 ignore next */
|
|
37
|
+
else {
|
|
36
38
|
throw new Error("Unsupported Identity token");
|
|
37
39
|
}
|
|
38
40
|
}
|