node-opcua-server 2.167.0 → 2.168.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.
- package/dist/addressSpace_accessor.d.ts +6 -6
- package/dist/addressSpace_accessor.js +2 -2
- package/dist/addressSpace_accessor.js.map +1 -1
- package/dist/base_server.d.ts +14 -3
- package/dist/base_server.js +63 -41
- package/dist/base_server.js.map +1 -1
- package/dist/extract_password_from_blob.js +1 -3
- package/dist/extract_password_from_blob.js.map +1 -1
- package/dist/factory.d.ts +2 -3
- package/dist/factory.js.map +1 -1
- package/dist/filter/check_where_clause_on_address_space.d.ts +2 -2
- package/dist/filter/check_where_clause_on_address_space.js +1 -2
- package/dist/filter/check_where_clause_on_address_space.js.map +1 -1
- package/dist/filter/extract_event_fields.d.ts +3 -3
- package/dist/filter/extract_event_fields.js +1 -2
- package/dist/filter/extract_event_fields.js.map +1 -1
- package/dist/helper.d.ts +3 -3
- package/dist/helper.js +4 -8
- package/dist/helper.js.map +1 -1
- package/dist/i_address_space_accessor.d.ts +4 -4
- package/dist/i_channel_data.d.ts +1 -1
- package/dist/i_register_server_manager.d.ts +1 -1
- package/dist/i_server_side_publish_engine.d.ts +8 -6
- package/dist/i_server_side_publish_engine.js +7 -2
- package/dist/i_server_side_publish_engine.js.map +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/invalidate_server_certificate_cache.d.ts +16 -0
- package/dist/invalidate_server_certificate_cache.js +28 -0
- package/dist/invalidate_server_certificate_cache.js.map +1 -0
- package/dist/monitored_item.d.ts +10 -11
- package/dist/monitored_item.js +38 -39
- package/dist/monitored_item.js.map +1 -1
- package/dist/node_sampler.d.ts +1 -1
- package/dist/node_sampler.js +2 -4
- package/dist/node_sampler.js.map +1 -1
- package/dist/opcua_server.d.ts +57 -62
- package/dist/opcua_server.js +7 -7
- package/dist/opcua_server.js.map +1 -1
- package/dist/register_server_manager_hidden.d.ts +1 -1
- package/dist/register_server_manager_hidden.js +2 -4
- package/dist/register_server_manager_hidden.js.map +1 -1
- package/dist/register_server_manager_mdns_only.d.ts +1 -1
- package/dist/register_server_manager_mdns_only.js.map +1 -1
- package/dist/sampling_func.d.ts +2 -2
- package/dist/server_capabilities.d.ts +3 -3
- package/dist/server_capabilities.js.map +1 -1
- package/dist/server_end_point.d.ts +45 -2
- package/dist/server_end_point.js +130 -32
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.js +29 -25
- package/dist/server_engine.js.map +1 -1
- package/dist/server_publish_engine.d.ts +5 -5
- package/dist/server_publish_engine.js +29 -23
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +2 -2
- package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -1
- package/dist/server_session.d.ts +9 -10
- package/dist/server_session.js +11 -12
- package/dist/server_session.js.map +1 -1
- package/dist/server_subscription.d.ts +13 -13
- package/dist/server_subscription.js +100 -79
- package/dist/server_subscription.js.map +1 -1
- package/dist/sessions_compatible_for_transfer.d.ts +1 -1
- package/dist/sessions_compatible_for_transfer.js +1 -1
- package/dist/sessions_compatible_for_transfer.js.map +1 -1
- package/dist/user_manager.d.ts +4 -4
- package/dist/user_manager.js +1 -1
- package/dist/user_manager.js.map +1 -1
- package/dist/user_manager_ua.d.ts +2 -2
- package/dist/user_manager_ua.js +2 -2
- package/dist/user_manager_ua.js.map +1 -1
- package/dist/validate_filter.d.ts +7 -4
- package/dist/validate_filter.js +5 -6
- package/dist/validate_filter.js.map +1 -1
- package/package.json +46 -46
- package/source/addressSpace_accessor.ts +24 -24
- package/source/base_server.ts +73 -59
- package/source/extract_password_from_blob.ts +3 -11
- package/source/factory.ts +2 -4
- package/source/filter/check_where_clause_on_address_space.ts +4 -7
- package/source/filter/extract_event_fields.ts +4 -5
- package/source/helper.ts +9 -13
- package/source/i_address_space_accessor.ts +13 -4
- package/source/i_channel_data.ts +1 -1
- package/source/i_register_server_manager.ts +2 -4
- package/source/i_server_side_publish_engine.ts +16 -9
- package/source/index.ts +10 -9
- package/source/invalidate_server_certificate_cache.ts +26 -0
- package/source/monitored_item.ts +44 -42
- package/source/node_sampler.ts +9 -11
- package/source/opcua_server.ts +68 -88
- package/source/register_server_manager_hidden.ts +3 -5
- package/source/register_server_manager_mdns_only.ts +1 -3
- package/source/sampling_func.ts +2 -2
- package/source/server_capabilities.ts +9 -6
- package/source/server_end_point.ts +142 -42
- package/source/server_engine.ts +22 -22
- package/source/server_publish_engine.ts +35 -30
- package/source/server_publish_engine_for_orphan_subscriptions.ts +3 -3
- package/source/server_session.ts +36 -33
- package/source/server_subscription.ts +182 -184
- package/source/sessions_compatible_for_transfer.ts +9 -9
- package/source/user_manager.ts +7 -7
- package/source/user_manager_ua.ts +3 -5
- package/source/validate_filter.ts +9 -11
package/source/server_session.ts
CHANGED
|
@@ -5,44 +5,47 @@
|
|
|
5
5
|
|
|
6
6
|
import { randomBytes } from "crypto";
|
|
7
7
|
import { EventEmitter } from "events";
|
|
8
|
-
|
|
9
|
-
import { assert } from "node-opcua-assert";
|
|
10
8
|
import {
|
|
9
|
+
type AddressSpace,
|
|
11
10
|
addElement,
|
|
12
|
-
AddressSpace,
|
|
13
11
|
ContinuationPointManager,
|
|
14
12
|
createExtObjArrayNode,
|
|
13
|
+
type DTSessionDiagnostics,
|
|
14
|
+
type DTSessionSecurityDiagnostics,
|
|
15
15
|
ensureObjectIsSecure,
|
|
16
|
-
ISessionBase,
|
|
16
|
+
type ISessionBase,
|
|
17
|
+
type IUserManager,
|
|
17
18
|
removeElement,
|
|
18
|
-
UADynamicVariableArray,
|
|
19
|
-
UAObject,
|
|
20
|
-
UASessionDiagnosticsVariable,
|
|
21
|
-
UASessionSecurityDiagnostics,
|
|
22
|
-
DTSessionDiagnostics,
|
|
23
|
-
DTSessionSecurityDiagnostics,
|
|
24
19
|
SessionContext,
|
|
25
|
-
|
|
20
|
+
type UADynamicVariableArray,
|
|
21
|
+
type UAObject,
|
|
22
|
+
type UASessionDiagnosticsVariable,
|
|
23
|
+
type UASessionSecurityDiagnostics
|
|
26
24
|
} from "node-opcua-address-space";
|
|
27
|
-
import { ISessionContext } from "node-opcua-address-space-base";
|
|
25
|
+
import type { ISessionContext } from "node-opcua-address-space-base";
|
|
26
|
+
import { assert } from "node-opcua-assert";
|
|
28
27
|
import { getMinOPCUADate, randomGuid } from "node-opcua-basic-types";
|
|
29
|
-
import {
|
|
30
|
-
|
|
28
|
+
import {
|
|
29
|
+
type SessionDiagnosticsDataType,
|
|
30
|
+
type SessionSecurityDiagnosticsDataType,
|
|
31
|
+
SubscriptionDiagnosticsDataType
|
|
32
|
+
} from "node-opcua-common";
|
|
33
|
+
import { NodeClass, QualifiedName } from "node-opcua-data-model";
|
|
31
34
|
import { checkDebugFlag, make_debugLog, make_errorLog } from "node-opcua-debug";
|
|
32
35
|
import { makeNodeId, NodeId, NodeIdType, sameNodeId } from "node-opcua-nodeid";
|
|
33
36
|
import { ObjectRegistry } from "node-opcua-object-registry";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
import type { IServerSession, IServerSessionBase, ServerSecureChannelLayer } from "node-opcua-secure-channel";
|
|
38
|
+
import { type StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
39
|
+
import type {
|
|
40
|
+
ApplicationDescription,
|
|
41
|
+
CreateSubscriptionRequestOptions,
|
|
42
|
+
EndpointDescription,
|
|
43
|
+
UserIdentityToken
|
|
44
|
+
} from "node-opcua-types";
|
|
45
|
+
import { type ISubscriber, type IWatchdogData2, lowerFirstLetter, WatchDog } from "node-opcua-utils";
|
|
46
|
+
import type { ServerEngine } from "./server_engine";
|
|
42
47
|
import { ServerSidePublishEngine } from "./server_publish_engine";
|
|
43
|
-
import { Subscription } from "./server_subscription";
|
|
44
|
-
import { SubscriptionState } from "./server_subscription";
|
|
45
|
-
import { ServerEngine } from "./server_engine";
|
|
48
|
+
import { type Subscription, SubscriptionState } from "./server_subscription";
|
|
46
49
|
|
|
47
50
|
const debugLog = make_debugLog(__filename);
|
|
48
51
|
const errorLog = make_errorLog(__filename);
|
|
@@ -277,9 +280,9 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
277
280
|
|
|
278
281
|
if (this._sessionDiagnostics) {
|
|
279
282
|
// see https://opcfoundation-onlineapplications.org/mantis/view.php?id=4111
|
|
280
|
-
assert(Object.
|
|
281
|
-
assert(Object.
|
|
282
|
-
assert(Object.
|
|
283
|
+
assert(Object.hasOwn(this._sessionDiagnostics, "currentMonitoredItemsCount"));
|
|
284
|
+
assert(Object.hasOwn(this._sessionDiagnostics, "currentSubscriptionsCount"));
|
|
285
|
+
assert(Object.hasOwn(this._sessionDiagnostics, "currentPublishRequestsInQueue"));
|
|
283
286
|
|
|
284
287
|
// note : https://opcfoundation-onlineapplications.org/mantis/view.php?id=4111
|
|
285
288
|
// sessionDiagnostics extension object uses a different spelling
|
|
@@ -306,7 +309,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
306
309
|
if (this._sessionDiagnostics) {
|
|
307
310
|
const propName = lowerFirstLetter(counterName + "Count");
|
|
308
311
|
// c8 ignore next
|
|
309
|
-
if (!Object.
|
|
312
|
+
if (!Object.hasOwn(this._sessionDiagnostics, propName)) {
|
|
310
313
|
errorLog("incrementRequestTotalCounter: cannot find", propName);
|
|
311
314
|
// xx return;
|
|
312
315
|
} else {
|
|
@@ -320,7 +323,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
320
323
|
if (this._sessionDiagnostics) {
|
|
321
324
|
const propName = lowerFirstLetter(counterName + "Count");
|
|
322
325
|
// c8 ignore next
|
|
323
|
-
if (!Object.
|
|
326
|
+
if (!Object.hasOwn(this._sessionDiagnostics, propName)) {
|
|
324
327
|
errorLog("incrementRequestErrorCounter: cannot find", propName);
|
|
325
328
|
// xx return;
|
|
326
329
|
} else {
|
|
@@ -535,7 +538,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
535
538
|
|
|
536
539
|
public createSubscription(parameters: CreateSubscriptionRequestOptions): Subscription {
|
|
537
540
|
const subscription = this.parent._createSubscriptionOnSession(this, parameters);
|
|
538
|
-
assert(!Object.
|
|
541
|
+
assert(!Object.hasOwn(parameters, "id"));
|
|
539
542
|
this.assignSubscription(subscription);
|
|
540
543
|
assert(subscription.$session === this);
|
|
541
544
|
assert(subscription.sessionId instanceof NodeId);
|
|
@@ -548,7 +551,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
548
551
|
this.channel = channel;
|
|
549
552
|
this.channelId = channel.channelId;
|
|
550
553
|
const key = this.authenticationToken.toString();
|
|
551
|
-
assert(!Object.
|
|
554
|
+
assert(!Object.hasOwn(channel.sessionTokens, key), "channel has already a session");
|
|
552
555
|
|
|
553
556
|
channel.sessionTokens[key] = this;
|
|
554
557
|
|
|
@@ -569,7 +572,7 @@ export class ServerSession extends EventEmitter implements ISubscriber, ISession
|
|
|
569
572
|
assert(this.nonce && this.nonce instanceof Buffer);
|
|
570
573
|
assert(this.authenticationToken);
|
|
571
574
|
const key = this.authenticationToken.toString();
|
|
572
|
-
assert(Object.
|
|
575
|
+
assert(Object.hasOwn(channel.sessionTokens, key));
|
|
573
576
|
assert(this.channel);
|
|
574
577
|
assert(typeof this.channel_abort_event_handler === "function");
|
|
575
578
|
channel.removeListener("abort", this.channel_abort_event_handler);
|