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.
Files changed (107) hide show
  1. package/dist/addressSpace_accessor.d.ts +6 -6
  2. package/dist/addressSpace_accessor.js +2 -2
  3. package/dist/addressSpace_accessor.js.map +1 -1
  4. package/dist/base_server.d.ts +14 -3
  5. package/dist/base_server.js +63 -41
  6. package/dist/base_server.js.map +1 -1
  7. package/dist/extract_password_from_blob.js +1 -3
  8. package/dist/extract_password_from_blob.js.map +1 -1
  9. package/dist/factory.d.ts +2 -3
  10. package/dist/factory.js.map +1 -1
  11. package/dist/filter/check_where_clause_on_address_space.d.ts +2 -2
  12. package/dist/filter/check_where_clause_on_address_space.js +1 -2
  13. package/dist/filter/check_where_clause_on_address_space.js.map +1 -1
  14. package/dist/filter/extract_event_fields.d.ts +3 -3
  15. package/dist/filter/extract_event_fields.js +1 -2
  16. package/dist/filter/extract_event_fields.js.map +1 -1
  17. package/dist/helper.d.ts +3 -3
  18. package/dist/helper.js +4 -8
  19. package/dist/helper.js.map +1 -1
  20. package/dist/i_address_space_accessor.d.ts +4 -4
  21. package/dist/i_channel_data.d.ts +1 -1
  22. package/dist/i_register_server_manager.d.ts +1 -1
  23. package/dist/i_server_side_publish_engine.d.ts +8 -6
  24. package/dist/i_server_side_publish_engine.js +7 -2
  25. package/dist/i_server_side_publish_engine.js.map +1 -1
  26. package/dist/index.d.ts +8 -7
  27. package/dist/index.js +8 -7
  28. package/dist/index.js.map +1 -1
  29. package/dist/invalidate_server_certificate_cache.d.ts +16 -0
  30. package/dist/invalidate_server_certificate_cache.js +28 -0
  31. package/dist/invalidate_server_certificate_cache.js.map +1 -0
  32. package/dist/monitored_item.d.ts +10 -11
  33. package/dist/monitored_item.js +38 -39
  34. package/dist/monitored_item.js.map +1 -1
  35. package/dist/node_sampler.d.ts +1 -1
  36. package/dist/node_sampler.js +2 -4
  37. package/dist/node_sampler.js.map +1 -1
  38. package/dist/opcua_server.d.ts +57 -62
  39. package/dist/opcua_server.js +7 -7
  40. package/dist/opcua_server.js.map +1 -1
  41. package/dist/register_server_manager_hidden.d.ts +1 -1
  42. package/dist/register_server_manager_hidden.js +2 -4
  43. package/dist/register_server_manager_hidden.js.map +1 -1
  44. package/dist/register_server_manager_mdns_only.d.ts +1 -1
  45. package/dist/register_server_manager_mdns_only.js.map +1 -1
  46. package/dist/sampling_func.d.ts +2 -2
  47. package/dist/server_capabilities.d.ts +3 -3
  48. package/dist/server_capabilities.js.map +1 -1
  49. package/dist/server_end_point.d.ts +45 -2
  50. package/dist/server_end_point.js +130 -32
  51. package/dist/server_end_point.js.map +1 -1
  52. package/dist/server_engine.js +29 -25
  53. package/dist/server_engine.js.map +1 -1
  54. package/dist/server_publish_engine.d.ts +5 -5
  55. package/dist/server_publish_engine.js +29 -23
  56. package/dist/server_publish_engine.js.map +1 -1
  57. package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +2 -2
  58. package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -1
  59. package/dist/server_session.d.ts +9 -10
  60. package/dist/server_session.js +11 -12
  61. package/dist/server_session.js.map +1 -1
  62. package/dist/server_subscription.d.ts +13 -13
  63. package/dist/server_subscription.js +100 -79
  64. package/dist/server_subscription.js.map +1 -1
  65. package/dist/sessions_compatible_for_transfer.d.ts +1 -1
  66. package/dist/sessions_compatible_for_transfer.js +1 -1
  67. package/dist/sessions_compatible_for_transfer.js.map +1 -1
  68. package/dist/user_manager.d.ts +4 -4
  69. package/dist/user_manager.js +1 -1
  70. package/dist/user_manager.js.map +1 -1
  71. package/dist/user_manager_ua.d.ts +2 -2
  72. package/dist/user_manager_ua.js +2 -2
  73. package/dist/user_manager_ua.js.map +1 -1
  74. package/dist/validate_filter.d.ts +7 -4
  75. package/dist/validate_filter.js +5 -6
  76. package/dist/validate_filter.js.map +1 -1
  77. package/package.json +46 -46
  78. package/source/addressSpace_accessor.ts +24 -24
  79. package/source/base_server.ts +73 -59
  80. package/source/extract_password_from_blob.ts +3 -11
  81. package/source/factory.ts +2 -4
  82. package/source/filter/check_where_clause_on_address_space.ts +4 -7
  83. package/source/filter/extract_event_fields.ts +4 -5
  84. package/source/helper.ts +9 -13
  85. package/source/i_address_space_accessor.ts +13 -4
  86. package/source/i_channel_data.ts +1 -1
  87. package/source/i_register_server_manager.ts +2 -4
  88. package/source/i_server_side_publish_engine.ts +16 -9
  89. package/source/index.ts +10 -9
  90. package/source/invalidate_server_certificate_cache.ts +26 -0
  91. package/source/monitored_item.ts +44 -42
  92. package/source/node_sampler.ts +9 -11
  93. package/source/opcua_server.ts +68 -88
  94. package/source/register_server_manager_hidden.ts +3 -5
  95. package/source/register_server_manager_mdns_only.ts +1 -3
  96. package/source/sampling_func.ts +2 -2
  97. package/source/server_capabilities.ts +9 -6
  98. package/source/server_end_point.ts +142 -42
  99. package/source/server_engine.ts +22 -22
  100. package/source/server_publish_engine.ts +35 -30
  101. package/source/server_publish_engine_for_orphan_subscriptions.ts +3 -3
  102. package/source/server_session.ts +36 -33
  103. package/source/server_subscription.ts +182 -184
  104. package/source/sessions_compatible_for_transfer.ts +9 -9
  105. package/source/user_manager.ts +7 -7
  106. package/source/user_manager_ua.ts +3 -5
  107. package/source/validate_filter.ts +9 -11
@@ -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
- IUserManager
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 { SessionDiagnosticsDataType, SessionSecurityDiagnosticsDataType, SubscriptionDiagnosticsDataType } from "node-opcua-common";
30
- import { QualifiedName, NodeClass } from "node-opcua-data-model";
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 { StatusCode, StatusCodes } from "node-opcua-status-code";
35
- import { WatchDog } from "node-opcua-utils";
36
- import { lowerFirstLetter } from "node-opcua-utils";
37
- import { ISubscriber, IWatchdogData2 } from "node-opcua-utils";
38
-
39
- import { IServerSession, IServerSessionBase, ServerSecureChannelLayer } from "node-opcua-secure-channel";
40
- import { ApplicationDescription, UserIdentityToken, CreateSubscriptionRequestOptions, EndpointDescription } from "node-opcua-types";
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.prototype.hasOwnProperty.call(this._sessionDiagnostics, "currentMonitoredItemsCount"));
281
- assert(Object.prototype.hasOwnProperty.call(this._sessionDiagnostics, "currentSubscriptionsCount"));
282
- assert(Object.prototype.hasOwnProperty.call(this._sessionDiagnostics, "currentPublishRequestsInQueue"));
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.prototype.hasOwnProperty.call(this._sessionDiagnostics, propName)) {
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.prototype.hasOwnProperty.call(this._sessionDiagnostics, propName)) {
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.prototype.hasOwnProperty.call(parameters, "id"));
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.prototype.hasOwnProperty.call(channel.sessionTokens, key), "channel has already a session");
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.prototype.hasOwnProperty.call(channel.sessionTokens, key));
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);