node-opcua-client 2.102.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 (52) hide show
  1. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +6 -3
  2. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
  3. package/dist/alarms_and_conditions/client_tools.js +24 -1
  4. package/dist/alarms_and_conditions/client_tools.js.map +1 -1
  5. package/dist/client_base.d.ts +5 -1
  6. package/dist/client_base.js +1 -1
  7. package/dist/client_base.js.map +1 -1
  8. package/dist/client_monitored_item_toolbox.js +5 -2
  9. package/dist/client_monitored_item_toolbox.js.map +1 -1
  10. package/dist/client_session_keepalive_manager.d.ts +1 -1
  11. package/dist/client_session_keepalive_manager.js +10 -6
  12. package/dist/client_session_keepalive_manager.js.map +1 -1
  13. package/dist/client_subscription.js +1 -1
  14. package/dist/client_subscription.js.map +1 -1
  15. package/dist/index.js +14 -2
  16. package/dist/index.js.map +1 -1
  17. package/dist/opcua_client.d.ts +0 -38
  18. package/dist/opcua_client.js.map +1 -1
  19. package/dist/private/client_base_impl.d.ts +2 -0
  20. package/dist/private/client_base_impl.js +78 -34
  21. package/dist/private/client_base_impl.js.map +1 -1
  22. package/dist/private/client_publish_engine.js +39 -13
  23. package/dist/private/client_publish_engine.js.map +1 -1
  24. package/dist/private/client_session_impl.d.ts +1 -1
  25. package/dist/private/client_session_impl.js +26 -23
  26. package/dist/private/client_session_impl.js.map +1 -1
  27. package/dist/private/client_subscription_impl.js +45 -19
  28. package/dist/private/client_subscription_impl.js.map +1 -1
  29. package/dist/private/opcua_client_impl.js +32 -6
  30. package/dist/private/opcua_client_impl.js.map +1 -1
  31. package/dist/reconnection.js +52 -26
  32. package/dist/reconnection.js.map +1 -1
  33. package/dist/tools/findservers.js +24 -1
  34. package/dist/tools/findservers.js.map +1 -1
  35. package/dist/tools/read_history_server_capabilities.js.map +1 -1
  36. package/dist/verify.d.ts +1 -1
  37. package/dist/verify.js +9 -8
  38. package/dist/verify.js.map +1 -1
  39. package/package.json +48 -48
  40. package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -1
  41. package/source/client_base.ts +5 -1
  42. package/source/client_monitored_item_toolbox.ts +1 -1
  43. package/source/client_session_keepalive_manager.ts +7 -5
  44. package/source/opcua_client.ts +0 -46
  45. package/source/private/client_base_impl.ts +46 -26
  46. package/source/private/client_publish_engine.ts +1 -1
  47. package/source/private/client_session_impl.ts +4 -4
  48. package/source/private/client_subscription_impl.ts +1 -1
  49. package/source/private/opcua_client_impl.ts +2 -3
  50. package/source/reconnection.ts +1 -1
  51. package/source/tools/read_history_server_capabilities.ts +6 -0
  52. package/source/verify.ts +9 -8
@@ -9,7 +9,7 @@ import * as crypto from "crypto";
9
9
  import { createPublicKey } from "crypto";
10
10
  import { callbackify } from "util";
11
11
  import * as async from "async";
12
- import * as chalk from "chalk";
12
+ import chalk from "chalk";
13
13
 
14
14
  import { assert } from "node-opcua-assert";
15
15
  import { createFastUninitializedBuffer } from "node-opcua-buffer-utils";
@@ -19,7 +19,6 @@ import {
19
19
  extractPublicKeyFromCertificateSync,
20
20
  Nonce,
21
21
  PrivateKey,
22
- PrivateKeyPEM,
23
22
  toPem
24
23
  } from "node-opcua-crypto";
25
24
 
@@ -1049,7 +1048,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
1049
1048
  session.serverNonce = response.serverNonce;
1050
1049
  session.lastResponseReceivedTime = new Date();
1051
1050
  if (this.keepSessionAlive) {
1052
- session.startKeepAliveManager();
1051
+ session.startKeepAliveManager(this.keepAliveInterval);
1053
1052
  }
1054
1053
  session.userIdentityInfo = userIdentityInfo;
1055
1054
  return callback(null, session);
@@ -4,7 +4,7 @@
4
4
 
5
5
  // tslint:disable:only-arrow-functions
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 { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
10
10
  import { TransferSubscriptionsRequest, TransferSubscriptionsResponse } from "node-opcua-service-subscription";
@@ -55,18 +55,24 @@ export function readHistoryServerCapabilities(
55
55
  const properties = [
56
56
  "AccessHistoryDataCapability",
57
57
  "AccessHistoryEventsCapability",
58
+
58
59
  "DeleteAtTimeCapability",
59
60
  "DeleteRawCapability",
60
61
  "DeleteEventCapability",
62
+
61
63
  "InsertAnnotationCapability",
62
64
  "InsertDataCapability",
63
65
  "InsertEventCapability",
66
+
64
67
  "ReplaceDataCapability",
65
68
  "ReplaceEventCapability",
69
+
66
70
  "UpdateDataCapability",
67
71
  "UpdateEventCapability",
72
+
68
73
  "MaxReturnDataValues",
69
74
  "MaxReturnEventValues",
75
+
70
76
  "AggregateFunctions/AnnotationCount",
71
77
  "AggregateFunctions/Average",
72
78
  "AggregateFunctions/Count",
package/source/verify.ts CHANGED
@@ -86,6 +86,7 @@ export function verifyIsOPCUAValidCertificate(
86
86
  `see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
87
87
  `certificateFile = ${certificateFile}`
88
88
  );
89
+ warningLog(`keyUsage = ${JSON.stringify(keyUsage, null, " ")}`);
89
90
  }
90
91
  }
91
92
  const extKeyUsage = certificateInfo.tbsCertificate.extensions?.extKeyUsage;
@@ -120,21 +121,21 @@ export function verifyIsOPCUAValidCertificate(
120
121
  }
121
122
 
122
123
  export async function performCertificateSanityCheck(
123
- this: OPCUASecureObject,
124
+ secureObject: OPCUASecureObject,
124
125
  serverOrClient: "server" | "client",
125
126
  certificateManager: OPCUACertificateManager,
126
127
  applicationUri: string
127
128
  ): Promise<void> {
128
- // verify that certificate is matching private key, and inform the developper if not
129
- const certificate = this.getCertificate();
130
- const privateKey = this.getPrivateKey();
129
+ // verify that certificate is matching private key, and inform the developer if not
130
+ const certificate = secureObject.getCertificate();
131
+ const privateKey = secureObject.getPrivateKey();
131
132
  //
132
133
  if (!publicKeyAndPrivateKeyMatches(certificate, privateKey)) {
133
134
  errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
134
135
  errorLog(" please check the configuration of the OPCUA Server");
135
- errorLog(" privateKey= ", this.privateKeyFile);
136
+ errorLog(" privateKey= ", secureObject.privateKeyFile);
136
137
  errorLog(" certificateManager.privateKey= ", certificateManager.privateKey);
137
- errorLog(" certificateFile= ", this.certificateFile);
138
+ errorLog(" certificateFile= ", secureObject.certificateFile);
138
139
  throw new Error(
139
140
  "[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration"
140
141
  );
@@ -154,8 +155,8 @@ export async function performCertificateSanityCheck(
154
155
  const status = await certificateManager.verifyCertificateAsync(certificate);
155
156
 
156
157
  if (status !== "Good") {
157
- warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ", this.certificateFile);
158
+ warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ", secureObject.certificateFile);
158
159
  }
159
160
 
160
- verifyIsOPCUAValidCertificate(certificate, this.certificateFile, serverOrClient, applicationUri);
161
+ verifyIsOPCUAValidCertificate(certificate, secureObject.certificateFile, serverOrClient, applicationUri);
161
162
  }