node-opcua-server 2.103.0 → 2.104.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 (34) hide show
  1. package/dist/base_server.js +45 -17
  2. package/dist/base_server.js.map +1 -1
  3. package/dist/helper.js +24 -1
  4. package/dist/helper.js.map +1 -1
  5. package/dist/i_server_side_publish_engine.js +4 -1
  6. package/dist/i_server_side_publish_engine.js.map +1 -1
  7. package/dist/monitored_item.js +6 -3
  8. package/dist/monitored_item.js.map +1 -1
  9. package/dist/opcua_server.js +39 -13
  10. package/dist/opcua_server.js.map +1 -1
  11. package/dist/register_server_manager.js +31 -5
  12. package/dist/register_server_manager.js.map +1 -1
  13. package/dist/server_end_point.js +40 -14
  14. package/dist/server_end_point.js.map +1 -1
  15. package/dist/server_engine.js +34 -8
  16. package/dist/server_engine.js.map +1 -1
  17. package/dist/server_publish_engine.js +16 -13
  18. package/dist/server_publish_engine.js.map +1 -1
  19. package/dist/server_publish_engine_for_orphan_subscriptions.js +6 -3
  20. package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -1
  21. package/dist/server_session.js +25 -2
  22. package/dist/server_session.js.map +1 -1
  23. package/dist/server_subscription.js +18 -15
  24. package/dist/server_subscription.js.map +1 -1
  25. package/package.json +47 -48
  26. package/source/base_server.ts +11 -9
  27. package/source/monitored_item.ts +1 -1
  28. package/source/opcua_server.ts +1 -1
  29. package/source/register_server_manager.ts +1 -1
  30. package/source/server_end_point.ts +29 -29
  31. package/source/server_engine.ts +1 -1
  32. package/source/server_publish_engine.ts +1 -1
  33. package/source/server_publish_engine_for_orphan_subscriptions.ts +1 -1
  34. package/source/server_subscription.ts +1 -1
@@ -4,7 +4,7 @@
4
4
  // tslint:disable:no-console
5
5
  import { EventEmitter } from "events";
6
6
  import * as async from "async";
7
- import * as chalk from "chalk";
7
+ import chalk from "chalk";
8
8
 
9
9
  import { assert } from "node-opcua-assert";
10
10
  import { ErrorCallback, UAString } from "node-opcua-basic-types";
@@ -5,7 +5,7 @@
5
5
  import { EventEmitter } from "events";
6
6
  import * as net from "net";
7
7
  import { Server, Socket } from "net";
8
- import * as chalk from "chalk";
8
+ import chalk from "chalk";
9
9
  import * as async from "async";
10
10
 
11
11
  import { assert } from "node-opcua-assert";
@@ -82,8 +82,9 @@ function extractChannelData(channel: ServerSecureChannelLayer): IChannelData {
82
82
 
83
83
  function dumpChannelInfo(channels: ServerSecureChannelLayer[]): void {
84
84
  function d(s: IServerSessionBase) {
85
- return `[ status=${s.status} lastSeen=${s.clientLastContactTime.toFixed(0)}ms sessionName=${s.sessionName} timeout=${s.sessionTimeout
86
- } ]`;
85
+ return `[ status=${s.status} lastSeen=${s.clientLastContactTime.toFixed(0)}ms sessionName=${s.sessionName} timeout=${
86
+ s.sessionTimeout
87
+ } ]`;
87
88
  }
88
89
  function dumpChannel(channel: ServerSecureChannelLayer): void {
89
90
  console.log("------------------------------------------------------");
@@ -379,7 +380,6 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
379
380
  }
380
381
  //
381
382
 
382
-
383
383
  // resource Path is a string added at the end of the url such as "/UA/Server"
384
384
  const resourcePath = (options.resourcePath || "").replace(/\\/g, "/");
385
385
 
@@ -399,23 +399,26 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
399
399
 
400
400
  // now build endpointUrl
401
401
  this._endpoints.push(
402
- _makeEndpointDescription({
403
- collection: this._policy_deduplicator,
404
- hostname,
405
- server: this.serverInfo,
406
- serverCertificateChain: this.getCertificateChain(),
407
-
408
- securityMode,
409
- securityPolicy,
410
-
411
- allowUnsecurePassword: options.allowUnsecurePassword,
412
- resourcePath: options.resourcePath,
413
-
414
- restricted: !!options.restricted,
415
- securityPolicies: options.securityPolicies || [],
416
-
417
- userTokenTypes
418
- }, this)
402
+ _makeEndpointDescription(
403
+ {
404
+ collection: this._policy_deduplicator,
405
+ hostname,
406
+ server: this.serverInfo,
407
+ serverCertificateChain: this.getCertificateChain(),
408
+
409
+ securityMode,
410
+ securityPolicy,
411
+
412
+ allowUnsecurePassword: options.allowUnsecurePassword,
413
+ resourcePath: options.resourcePath,
414
+
415
+ restricted: !!options.restricted,
416
+ securityPolicies: options.securityPolicies || [],
417
+
418
+ userTokenTypes
419
+ },
420
+ this
421
+ )
419
422
  );
420
423
  }
421
424
 
@@ -508,7 +511,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
508
511
 
509
512
  this._server!.listen(
510
513
  this.port,
511
- /*"::",*/(err?: Error) => {
514
+ /*"::",*/ (err?: Error) => {
512
515
  // 'listening' listener
513
516
  debugLog(chalk.green.bold("LISTENING TO PORT "), this.port, "err ", err);
514
517
  assert(!err, " cannot listen to port ");
@@ -516,12 +519,10 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
516
519
  if (!this.port) {
517
520
  const add = this._server!.address()!;
518
521
  this.port = typeof add !== "string" ? add.port : this.port;
519
-
520
522
  }
521
523
  this._end_listen();
522
524
  }
523
525
  );
524
-
525
526
  }
526
527
 
527
528
  public killClientSockets(callback: (err?: Error) => void): void {
@@ -692,7 +693,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
692
693
  debugLog(
693
694
  chalk.bgWhite.cyan(
694
695
  "OPCUAServerEndPoint#_on_client_connection " +
695
- "SERVER END POINT IS PROBABLY SHUTTING DOWN !!! - Connection is refused"
696
+ "SERVER END POINT IS PROBABLY SHUTTING DOWN !!! - Connection is refused"
696
697
  )
697
698
  );
698
699
  socket.end();
@@ -702,7 +703,7 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
702
703
  console.log(
703
704
  chalk.bgWhite.cyan(
704
705
  "OPCUAServerEndPoint#_on_client_connection " +
705
- "The maximum number of connection has been reached - Connection is refused"
706
+ "The maximum number of connection has been reached - Connection is refused"
706
707
  )
707
708
  );
708
709
  const reason = "maxConnections reached (" + this.maxConnections + ")";
@@ -938,7 +939,6 @@ export class OPCUAServerEndPoint extends EventEmitter implements ServerSecureCha
938
939
  }
939
940
 
940
941
  interface MakeEndpointDescriptionOptions {
941
-
942
942
  /**
943
943
  * @default default hostname (default value will be full qualified domain name)
944
944
  */
@@ -1139,7 +1139,7 @@ function _makeEndpointDescription(options: MakeEndpointDescriptionOptions, paren
1139
1139
  }
1140
1140
  // return the endpoint object
1141
1141
  const endpoint = new EndpointDescription({
1142
- endpointUrl: '<to be evaluated at run time>',// options.endpointUrl,
1142
+ endpointUrl: "<to be evaluated at run time>", // options.endpointUrl,
1143
1143
 
1144
1144
  server: undefined, // options.server,
1145
1145
  serverCertificate: options.serverCertificateChain,
@@ -1152,7 +1152,7 @@ function _makeEndpointDescription(options: MakeEndpointDescriptionOptions, paren
1152
1152
  transportProfileUri: default_transportProfileUri
1153
1153
  }) as EndpointDescriptionEx;
1154
1154
  endpoint._parent = parent;
1155
-
1155
+
1156
1156
  // endpointUrl is dynamic as port number may be adjusted
1157
1157
  // when the tcp socker start listening
1158
1158
  (endpoint as any).__defineGetter__("endpointUrl", () => {
@@ -4,7 +4,7 @@
4
4
  import { EventEmitter } from "events";
5
5
  import { types } from "util";
6
6
  import * as async from "async";
7
- import * as chalk from "chalk";
7
+ import chalk from "chalk";
8
8
  import { assert } from "node-opcua-assert";
9
9
  import { BinaryStream } from "node-opcua-binary-stream";
10
10
  import {
@@ -3,7 +3,7 @@
3
3
  */
4
4
  // tslint:disable:no-console
5
5
  import { EventEmitter } from "events";
6
- import * as chalk from "chalk";
6
+ import chalk from "chalk";
7
7
  import { partition, sortBy } from "lodash";
8
8
 
9
9
  import { assert } from "node-opcua-assert";
@@ -2,7 +2,7 @@
2
2
  * @module node-opcua-server
3
3
  */
4
4
  // tslint:disable:no-console
5
- import * as chalk from "chalk";
5
+ import chalk from "chalk";
6
6
 
7
7
  import { checkDebugFlag, make_debugLog } from "node-opcua-debug";
8
8
  import { NodeId } from "node-opcua-nodeid";
@@ -4,7 +4,7 @@
4
4
  // tslint:disable:no-console
5
5
 
6
6
  import { EventEmitter } from "events";
7
- import * as chalk from "chalk";
7
+ import chalk from "chalk";
8
8
 
9
9
  import { SessionContext, AddressSpace, BaseNode, Duration, UAObjectType } from "node-opcua-address-space";
10
10
  import { assert } from "node-opcua-assert";