node-opcua-client 2.63.1 → 2.64.1

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 (71) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +42 -42
  2. package/dist/alarms_and_conditions/client_alarm.js +84 -84
  3. package/dist/alarms_and_conditions/client_alarm_list.d.ts +21 -21
  4. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  5. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  6. package/dist/alarms_and_conditions/client_alarm_tools.js +139 -139
  7. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  8. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +190 -190
  9. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  10. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -73
  11. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +8 -8
  12. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +120 -120
  13. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  14. package/dist/alarms_and_conditions/client_tools.js +179 -179
  15. package/dist/client_base.d.ts +270 -270
  16. package/dist/client_base.js +13 -13
  17. package/dist/client_monitored_item.d.ts +21 -21
  18. package/dist/client_monitored_item.js +11 -11
  19. package/dist/client_monitored_item_base.d.ts +39 -39
  20. package/dist/client_monitored_item_base.js +2 -2
  21. package/dist/client_monitored_item_group.d.ts +18 -18
  22. package/dist/client_monitored_item_group.js +13 -13
  23. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  24. package/dist/client_monitored_item_toolbox.js +117 -117
  25. package/dist/client_session.d.ts +483 -483
  26. package/dist/client_session.js +10 -10
  27. package/dist/client_session_keepalive_manager.d.ts +34 -34
  28. package/dist/client_session_keepalive_manager.js +150 -150
  29. package/dist/client_session_keepalive_manager.js.map +1 -1
  30. package/dist/client_subscription.d.ts +241 -241
  31. package/dist/client_subscription.js +14 -14
  32. package/dist/client_utils.d.ts +22 -22
  33. package/dist/client_utils.js +88 -88
  34. package/dist/common.d.ts +17 -17
  35. package/dist/common.js +5 -5
  36. package/dist/index.d.ts +55 -55
  37. package/dist/index.js +89 -89
  38. package/dist/opcua_client.d.ts +132 -132
  39. package/dist/opcua_client.js +33 -33
  40. package/dist/private/client_base_impl.d.ts +169 -169
  41. package/dist/private/client_base_impl.js +1315 -1318
  42. package/dist/private/client_base_impl.js.map +1 -1
  43. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  44. package/dist/private/client_monitored_item_base_impl.js +4 -4
  45. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  46. package/dist/private/client_monitored_item_group_impl.js +159 -159
  47. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  48. package/dist/private/client_monitored_item_impl.js +304 -304
  49. package/dist/private/client_publish_engine.d.ts +62 -62
  50. package/dist/private/client_publish_engine.js +408 -408
  51. package/dist/private/client_session_impl.d.ts +620 -620
  52. package/dist/private/client_session_impl.js +1298 -1298
  53. package/dist/private/client_subscription_impl.d.ts +93 -93
  54. package/dist/private/client_subscription_impl.js +779 -779
  55. package/dist/private/i_private_client.d.ts +18 -18
  56. package/dist/private/i_private_client.js +2 -2
  57. package/dist/private/opcua_client_impl.d.ts +169 -169
  58. package/dist/private/opcua_client_impl.js +978 -975
  59. package/dist/private/opcua_client_impl.js.map +1 -1
  60. package/dist/reconnection.d.ts +9 -9
  61. package/dist/reconnection.js +362 -362
  62. package/dist/tools/findservers.d.ts +20 -20
  63. package/dist/tools/findservers.js +61 -61
  64. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  65. package/dist/tools/read_history_server_capabilities.js +99 -99
  66. package/dist/verify.d.ts +5 -5
  67. package/dist/verify.js +134 -134
  68. package/package.json +46 -46
  69. package/source/client_session_keepalive_manager.ts +1 -1
  70. package/source/private/client_base_impl.ts +0 -3
  71. package/source/private/opcua_client_impl.ts +4 -1
package/dist/verify.js CHANGED
@@ -1,135 +1,135 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.performCertificateSanityCheck = exports.verifyIsOPCUAValidCertificate = void 0;
13
- const node_opcua_crypto_1 = require("node-opcua-crypto");
14
- const node_opcua_debug_1 = require("node-opcua-debug");
15
- const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
16
- const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
17
- const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
18
- const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
19
- function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, applicationUri) {
20
- var _a, _b, _c, _d, _e;
21
- const certificateInfo = (0, node_opcua_crypto_1.exploreCertificate)(certificate);
22
- const now = new Date();
23
- if (certificateInfo.tbsCertificate.validity.notBefore.getTime() > now.getTime()) {
24
- // check that certificate is active
25
- // certificate is not active yet
26
- warningLog(`[NODE-OPCUA-W02] The certificate is not active yet\n` +
27
- `notBefore ${certificateInfo.tbsCertificate.validity.notBefore.toISOString()}\n` +
28
- `certificateFile ${certificateFile}`);
29
- }
30
- // check that certificate has not expired
31
- if (certificateInfo.tbsCertificate.validity.notAfter.getTime() <= now.getTime()) {
32
- // certificate is obsolete
33
- warningLog(`[NODE-OPCUA-W03] The certificate has expired\n` +
34
- `Please regenerate a valid certificate\n` +
35
- `notAfter = ${certificateInfo.tbsCertificate.validity.notAfter.toISOString()}\n` +
36
- `certificateFile= ${certificateFile}`);
37
- }
38
- else {
39
- const tenDays = 10 * 24 * 60 * 60 * 1000;
40
- if (certificateInfo.tbsCertificate.validity.notAfter.getTime() <= now.getTime() + tenDays) {
41
- // certificate is going to expired very soon
42
- warningLog(`[NODE-OPCUA-W05] The certificate is about to expire in less than 10 days.\n` +
43
- `Please regenerate a valid certificate as soon as possible\n` +
44
- `notAfter = ${certificateInfo.tbsCertificate.validity.notAfter.toISOString()}\n` +
45
- `certificateFile= ${certificateFile}\n`);
46
- }
47
- }
48
- // check that server certificate matches Application URI
49
- const uniformResourceIdentifier = (_c = (_b = (_a = certificateInfo === null || certificateInfo === void 0 ? void 0 : certificateInfo.tbsCertificate) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.subjectAltName) === null || _c === void 0 ? void 0 : _c.uniformResourceIdentifier;
50
- if (!uniformResourceIdentifier) {
51
- warningLog(`[NODE-OPCUA-W14] The certificate subjectAltName uniformResourceIdentifier is missing.\n` +
52
- `Please regenerate a specific certificate with a uniformResourceIdentifier that matches your ${type} applicationUri\n` +
53
- `applicationUri = ${applicationUri}\n` +
54
- `certificateFile = ${certificateFile}\n`);
55
- return;
56
- }
57
- else if (uniformResourceIdentifier[0] !== applicationUri) {
58
- warningLog(`[NODE-OPCUA-W06] The certificate subjectAltName does not match the ${type} applicationUri\n` +
59
- `Please regenerate a specific certificate that matches your ${type} applicationUri\n` +
60
- `certificate subjectAltName = ${uniformResourceIdentifier[0]}\n` +
61
- `${type} applicationUri = ${applicationUri}\n` +
62
- `certificateFile = ${certificateFile}\n`);
63
- }
64
- const keyUsage = (_d = certificateInfo.tbsCertificate.extensions) === null || _d === void 0 ? void 0 : _d.keyUsage;
65
- if (!keyUsage) {
66
- warningLog(`[NODE-OPCUA-W15] The certificate keyUsage is missing\n` + `certificateFile = ${certificateFile}`);
67
- }
68
- else {
69
- // spec says that certificate shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.
70
- // Other key uses are allowed.
71
- if (!keyUsage.digitalSignature || !keyUsage.nonRepudiation || !keyUsage.keyEncipherment || !keyUsage.dataEncipherment) {
72
- warningLog(`[NODE-OPCUA-W16] The certificate keyUsage must include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.\n` +
73
- `see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
74
- `certificateFile = ${certificateFile}`);
75
- }
76
- }
77
- const extKeyUsage = (_e = certificateInfo.tbsCertificate.extensions) === null || _e === void 0 ? void 0 : _e.extKeyUsage;
78
- if (!extKeyUsage) {
79
- warningLog(`[NODE-OPCUA-W17] The certificate extKeyUsage is missing\n` + `certificateFile = ${certificateFile}`);
80
- }
81
- else {
82
- // spec says that certificate shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.
83
- // Other key uses are allowed.
84
- if (!extKeyUsage.clientAuth && !extKeyUsage.serverAuth) {
85
- warningLog(`[NODE-OPCUA-W18] The certificate extKeyUsage must include clientAuth and/or serverAuth.\n` +
86
- `see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
87
- `certificateFile = ${certificateFile}`);
88
- }
89
- }
90
- const keyLengthInBits = certificateInfo.tbsCertificate.subjectPublicKeyInfo.keyLength * 8;
91
- if (keyLengthInBits < 1024) {
92
- errorLog(`[NODE-OPCUA-W19] The public key length shall be greater than or equal to 1024 bits. key length is ${keyLengthInBits}.\n` +
93
- `see https://reference.opcfoundation.org/v104/GDS/docs/7.6.3/\n` +
94
- `certificateFile = ${certificateFile}`);
95
- }
96
- else if (keyLengthInBits < 2048) {
97
- warningLog(`[NODE-OPCUA-W23] key lengths less than 2048 are considered insecure. key length is ${keyLengthInBits}\n` +
98
- `see https://reference.opcfoundation.org/v104/Core/docs/Part2/6.8/\n` +
99
- `certificateFile = ${certificateFile}`);
100
- }
101
- }
102
- exports.verifyIsOPCUAValidCertificate = verifyIsOPCUAValidCertificate;
103
- function performCertificateSanityCheck(serverOrClient, certificateManager, applicationUri) {
104
- return __awaiter(this, void 0, void 0, function* () {
105
- // verify that certificate is matching private key, and inform the developper if not
106
- const certificate = this.getCertificate();
107
- const privateKey = (0, node_opcua_crypto_1.convertPEMtoDER)(this.getPrivateKey());
108
- //
109
- if (!(0, node_opcua_crypto_1.publicKeyAndPrivateKeyMatches)(certificate, privateKey)) {
110
- errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
111
- errorLog(" please check the configuration of the OPCUA Server");
112
- errorLog(" privateKey= ", this.privateKeyFile);
113
- errorLog(" certificateManager.privateKey= ", certificateManager.privateKey);
114
- errorLog(" certificateFile= ", this.certificateFile);
115
- throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration");
116
- }
117
- // verify that the certificate provided has the right key length ( at least 2048)
118
- const privateKeyInfo = (0, node_opcua_crypto_1.explorePrivateKey)(privateKey);
119
- const keyLengthInBits = privateKeyInfo.modulus.length * 8;
120
- if (keyLengthInBits <= 1024) {
121
- warningLog(`[NODE-OPCUA-W04] The public/private key pair uses a key length which is equal or lower than 1024 bits. ( key length was ${keyLengthInBits} )\n` +
122
- `OPCUA version 1.04 requires that security key length are greater or equal to 2048 bits.\n` +
123
- `The ${serverOrClient} is operating at risk. `);
124
- }
125
- // verify that the certificate has a valid date and has expected extensions fields such as DNS and IP.
126
- const status1 = yield certificateManager.trustCertificate(certificate);
127
- const status = yield certificateManager.verifyCertificateAsync(certificate);
128
- if (status !== "Good") {
129
- warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ", this.certificateFile);
130
- }
131
- verifyIsOPCUAValidCertificate(certificate, this.certificateFile, serverOrClient, applicationUri);
132
- });
133
- }
134
- exports.performCertificateSanityCheck = performCertificateSanityCheck;
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.performCertificateSanityCheck = exports.verifyIsOPCUAValidCertificate = void 0;
13
+ const node_opcua_crypto_1 = require("node-opcua-crypto");
14
+ const node_opcua_debug_1 = require("node-opcua-debug");
15
+ const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
16
+ const debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
17
+ const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
18
+ const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
19
+ function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, applicationUri) {
20
+ var _a, _b, _c, _d, _e;
21
+ const certificateInfo = (0, node_opcua_crypto_1.exploreCertificate)(certificate);
22
+ const now = new Date();
23
+ if (certificateInfo.tbsCertificate.validity.notBefore.getTime() > now.getTime()) {
24
+ // check that certificate is active
25
+ // certificate is not active yet
26
+ warningLog(`[NODE-OPCUA-W02] The certificate is not active yet\n` +
27
+ `notBefore ${certificateInfo.tbsCertificate.validity.notBefore.toISOString()}\n` +
28
+ `certificateFile ${certificateFile}`);
29
+ }
30
+ // check that certificate has not expired
31
+ if (certificateInfo.tbsCertificate.validity.notAfter.getTime() <= now.getTime()) {
32
+ // certificate is obsolete
33
+ warningLog(`[NODE-OPCUA-W03] The certificate has expired\n` +
34
+ `Please regenerate a valid certificate\n` +
35
+ `notAfter = ${certificateInfo.tbsCertificate.validity.notAfter.toISOString()}\n` +
36
+ `certificateFile= ${certificateFile}`);
37
+ }
38
+ else {
39
+ const tenDays = 10 * 24 * 60 * 60 * 1000;
40
+ if (certificateInfo.tbsCertificate.validity.notAfter.getTime() <= now.getTime() + tenDays) {
41
+ // certificate is going to expired very soon
42
+ warningLog(`[NODE-OPCUA-W05] The certificate is about to expire in less than 10 days.\n` +
43
+ `Please regenerate a valid certificate as soon as possible\n` +
44
+ `notAfter = ${certificateInfo.tbsCertificate.validity.notAfter.toISOString()}\n` +
45
+ `certificateFile= ${certificateFile}\n`);
46
+ }
47
+ }
48
+ // check that server certificate matches Application URI
49
+ const uniformResourceIdentifier = (_c = (_b = (_a = certificateInfo === null || certificateInfo === void 0 ? void 0 : certificateInfo.tbsCertificate) === null || _a === void 0 ? void 0 : _a.extensions) === null || _b === void 0 ? void 0 : _b.subjectAltName) === null || _c === void 0 ? void 0 : _c.uniformResourceIdentifier;
50
+ if (!uniformResourceIdentifier) {
51
+ warningLog(`[NODE-OPCUA-W14] The certificate subjectAltName uniformResourceIdentifier is missing.\n` +
52
+ `Please regenerate a specific certificate with a uniformResourceIdentifier that matches your ${type} applicationUri\n` +
53
+ `applicationUri = ${applicationUri}\n` +
54
+ `certificateFile = ${certificateFile}\n`);
55
+ return;
56
+ }
57
+ else if (uniformResourceIdentifier[0] !== applicationUri) {
58
+ warningLog(`[NODE-OPCUA-W06] The certificate subjectAltName does not match the ${type} applicationUri\n` +
59
+ `Please regenerate a specific certificate that matches your ${type} applicationUri\n` +
60
+ `certificate subjectAltName = ${uniformResourceIdentifier[0]}\n` +
61
+ `${type} applicationUri = ${applicationUri}\n` +
62
+ `certificateFile = ${certificateFile}\n`);
63
+ }
64
+ const keyUsage = (_d = certificateInfo.tbsCertificate.extensions) === null || _d === void 0 ? void 0 : _d.keyUsage;
65
+ if (!keyUsage) {
66
+ warningLog(`[NODE-OPCUA-W15] The certificate keyUsage is missing\n` + `certificateFile = ${certificateFile}`);
67
+ }
68
+ else {
69
+ // spec says that certificate shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.
70
+ // Other key uses are allowed.
71
+ if (!keyUsage.digitalSignature || !keyUsage.nonRepudiation || !keyUsage.keyEncipherment || !keyUsage.dataEncipherment) {
72
+ warningLog(`[NODE-OPCUA-W16] The certificate keyUsage must include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.\n` +
73
+ `see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
74
+ `certificateFile = ${certificateFile}`);
75
+ }
76
+ }
77
+ const extKeyUsage = (_e = certificateInfo.tbsCertificate.extensions) === null || _e === void 0 ? void 0 : _e.extKeyUsage;
78
+ if (!extKeyUsage) {
79
+ warningLog(`[NODE-OPCUA-W17] The certificate extKeyUsage is missing\n` + `certificateFile = ${certificateFile}`);
80
+ }
81
+ else {
82
+ // spec says that certificate shall include digitalSignature, nonRepudiation, keyEncipherment and dataEncipherment.
83
+ // Other key uses are allowed.
84
+ if (!extKeyUsage.clientAuth && !extKeyUsage.serverAuth) {
85
+ warningLog(`[NODE-OPCUA-W18] The certificate extKeyUsage must include clientAuth and/or serverAuth.\n` +
86
+ `see https://reference.opcfoundation.org/v104/Core/docs/Part6/6.2.2/\n` +
87
+ `certificateFile = ${certificateFile}`);
88
+ }
89
+ }
90
+ const keyLengthInBits = certificateInfo.tbsCertificate.subjectPublicKeyInfo.keyLength * 8;
91
+ if (keyLengthInBits < 1024) {
92
+ errorLog(`[NODE-OPCUA-W19] The public key length shall be greater than or equal to 1024 bits. key length is ${keyLengthInBits}.\n` +
93
+ `see https://reference.opcfoundation.org/v104/GDS/docs/7.6.3/\n` +
94
+ `certificateFile = ${certificateFile}`);
95
+ }
96
+ else if (keyLengthInBits < 2048) {
97
+ warningLog(`[NODE-OPCUA-W23] key lengths less than 2048 are considered insecure. key length is ${keyLengthInBits}\n` +
98
+ `see https://reference.opcfoundation.org/v104/Core/docs/Part2/6.8/\n` +
99
+ `certificateFile = ${certificateFile}`);
100
+ }
101
+ }
102
+ exports.verifyIsOPCUAValidCertificate = verifyIsOPCUAValidCertificate;
103
+ function performCertificateSanityCheck(serverOrClient, certificateManager, applicationUri) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ // verify that certificate is matching private key, and inform the developper if not
106
+ const certificate = this.getCertificate();
107
+ const privateKey = (0, node_opcua_crypto_1.convertPEMtoDER)(this.getPrivateKey());
108
+ //
109
+ if (!(0, node_opcua_crypto_1.publicKeyAndPrivateKeyMatches)(certificate, privateKey)) {
110
+ errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
111
+ errorLog(" please check the configuration of the OPCUA Server");
112
+ errorLog(" privateKey= ", this.privateKeyFile);
113
+ errorLog(" certificateManager.privateKey= ", certificateManager.privateKey);
114
+ errorLog(" certificateFile= ", this.certificateFile);
115
+ throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration");
116
+ }
117
+ // verify that the certificate provided has the right key length ( at least 2048)
118
+ const privateKeyInfo = (0, node_opcua_crypto_1.explorePrivateKey)(privateKey);
119
+ const keyLengthInBits = privateKeyInfo.modulus.length * 8;
120
+ if (keyLengthInBits <= 1024) {
121
+ warningLog(`[NODE-OPCUA-W04] The public/private key pair uses a key length which is equal or lower than 1024 bits. ( key length was ${keyLengthInBits} )\n` +
122
+ `OPCUA version 1.04 requires that security key length are greater or equal to 2048 bits.\n` +
123
+ `The ${serverOrClient} is operating at risk. `);
124
+ }
125
+ // verify that the certificate has a valid date and has expected extensions fields such as DNS and IP.
126
+ const status1 = yield certificateManager.trustCertificate(certificate);
127
+ const status = yield certificateManager.verifyCertificateAsync(certificate);
128
+ if (status !== "Good") {
129
+ warningLog("[NODE-OPCUA-W04] Warning: the certificate status is = ", status, " file = ", this.certificateFile);
130
+ }
131
+ verifyIsOPCUAValidCertificate(certificate, this.certificateFile, serverOrClient, applicationUri);
132
+ });
133
+ }
134
+ exports.performCertificateSanityCheck = performCertificateSanityCheck;
135
135
  //# sourceMappingURL=verify.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-client",
3
- "version": "2.63.1",
3
+ "version": "2.64.1",
4
4
  "description": "pure nodejs OPCUA SDK - module -client",
5
5
  "scripts": {
6
6
  "clean": "node -e \"require('rimraf').sync('certificates');\" && node -e \"require('rimraf').sync('dist');\"",
@@ -21,57 +21,57 @@
21
21
  "callbackify": "^1.1.0",
22
22
  "chalk": "4.1.2",
23
23
  "delayed": "^2.0.0",
24
- "node-opcua-assert": "2.63.0",
25
- "node-opcua-basic-types": "2.63.1",
26
- "node-opcua-buffer-utils": "2.63.1",
27
- "node-opcua-certificate-manager": "2.63.1",
28
- "node-opcua-client-dynamic-extension-object": "2.63.1",
29
- "node-opcua-common": "2.63.1",
30
- "node-opcua-constants": "2.62.7",
31
- "node-opcua-crypto": "^1.7.5",
32
- "node-opcua-data-model": "2.63.1",
33
- "node-opcua-data-value": "2.63.1",
34
- "node-opcua-date-time": "2.63.1",
35
- "node-opcua-debug": "2.63.1",
36
- "node-opcua-extension-object": "2.63.1",
37
- "node-opcua-hostname": "2.63.0",
38
- "node-opcua-nodeid": "2.63.1",
39
- "node-opcua-object-registry": "2.63.1",
40
- "node-opcua-pki": "^2.13.0",
41
- "node-opcua-pseudo-session": "2.63.1",
42
- "node-opcua-schemas": "2.63.1",
43
- "node-opcua-secure-channel": "2.63.1",
44
- "node-opcua-service-browse": "2.63.1",
45
- "node-opcua-service-call": "2.63.1",
46
- "node-opcua-service-discovery": "2.63.1",
47
- "node-opcua-service-endpoints": "2.63.1",
48
- "node-opcua-service-filter": "2.63.1",
49
- "node-opcua-service-history": "2.63.1",
50
- "node-opcua-service-query": "2.63.1",
51
- "node-opcua-service-read": "2.63.1",
52
- "node-opcua-service-register-node": "2.63.1",
53
- "node-opcua-service-secure-channel": "2.63.1",
54
- "node-opcua-service-session": "2.63.1",
55
- "node-opcua-service-subscription": "2.63.1",
56
- "node-opcua-service-translate-browse-path": "2.63.1",
57
- "node-opcua-service-write": "2.63.1",
58
- "node-opcua-status-code": "2.63.1",
59
- "node-opcua-types": "2.63.1",
60
- "node-opcua-utils": "2.63.1",
61
- "node-opcua-variant": "2.63.1",
24
+ "node-opcua-assert": "2.64.1",
25
+ "node-opcua-basic-types": "2.64.1",
26
+ "node-opcua-buffer-utils": "2.64.1",
27
+ "node-opcua-certificate-manager": "2.64.1",
28
+ "node-opcua-client-dynamic-extension-object": "2.64.1",
29
+ "node-opcua-common": "2.64.1",
30
+ "node-opcua-constants": "2.64.1",
31
+ "node-opcua-crypto": "^1.9.0",
32
+ "node-opcua-data-model": "2.64.1",
33
+ "node-opcua-data-value": "2.64.1",
34
+ "node-opcua-date-time": "2.64.1",
35
+ "node-opcua-debug": "2.64.1",
36
+ "node-opcua-extension-object": "2.64.1",
37
+ "node-opcua-hostname": "2.64.1",
38
+ "node-opcua-nodeid": "2.64.1",
39
+ "node-opcua-object-registry": "2.64.1",
40
+ "node-opcua-pki": "^2.14.0",
41
+ "node-opcua-pseudo-session": "2.64.1",
42
+ "node-opcua-schemas": "2.64.1",
43
+ "node-opcua-secure-channel": "2.64.1",
44
+ "node-opcua-service-browse": "2.64.1",
45
+ "node-opcua-service-call": "2.64.1",
46
+ "node-opcua-service-discovery": "2.64.1",
47
+ "node-opcua-service-endpoints": "2.64.1",
48
+ "node-opcua-service-filter": "2.64.1",
49
+ "node-opcua-service-history": "2.64.1",
50
+ "node-opcua-service-query": "2.64.1",
51
+ "node-opcua-service-read": "2.64.1",
52
+ "node-opcua-service-register-node": "2.64.1",
53
+ "node-opcua-service-secure-channel": "2.64.1",
54
+ "node-opcua-service-session": "2.64.1",
55
+ "node-opcua-service-subscription": "2.64.1",
56
+ "node-opcua-service-translate-browse-path": "2.64.1",
57
+ "node-opcua-service-write": "2.64.1",
58
+ "node-opcua-status-code": "2.64.1",
59
+ "node-opcua-types": "2.64.1",
60
+ "node-opcua-utils": "2.64.1",
61
+ "node-opcua-variant": "2.64.1",
62
62
  "once": "^1.4.0",
63
63
  "thenify": "^3.3.1",
64
64
  "underscore": "^1.13.2"
65
65
  },
66
66
  "devDependencies": {
67
67
  "dequeue": "^1.0.5",
68
- "node-opcua-address-space": "2.63.1",
69
- "node-opcua-binary-stream": "2.63.1",
70
- "node-opcua-factory": "2.63.1",
71
- "node-opcua-leak-detector": "2.63.1",
72
- "node-opcua-nodesets": "2.63.0",
68
+ "node-opcua-address-space": "2.64.1",
69
+ "node-opcua-binary-stream": "2.64.1",
70
+ "node-opcua-factory": "2.64.1",
71
+ "node-opcua-leak-detector": "2.64.1",
72
+ "node-opcua-nodesets": "2.64.1",
73
73
  "should": "^13.2.3",
74
- "sinon": "^12.0.1"
74
+ "sinon": "^13.0.1"
75
75
  },
76
76
  "eslintConfig": {
77
77
  "env": {
@@ -93,5 +93,5 @@
93
93
  "internet of things"
94
94
  ],
95
95
  "homepage": "http://node-opcua.github.io/",
96
- "gitHead": "d37385314fce703c1cc197104c592df03b2663fb"
96
+ "gitHead": "b65b8738603cd475d7d99a2b20b0ae9d32b4110c"
97
97
  }
@@ -95,7 +95,7 @@ export class ClientSessionKeepAliveManager extends EventEmitter implements Clien
95
95
  */
96
96
  private async _ping_server(): Promise<number> {
97
97
  const session = this.session;
98
- if (!session) {
98
+ if (!session || session.isReconnecting) {
99
99
  debugLog("ClientSessionKeepAliveManager#ping_server => no session available");
100
100
  return 0;
101
101
  }
@@ -1292,9 +1292,6 @@ export class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase
1292
1292
  session._client = this;
1293
1293
  this._sessions.push(session);
1294
1294
 
1295
- if (this.keepSessionAlive) {
1296
- session.startKeepAliveManager();
1297
- }
1298
1295
  }
1299
1296
 
1300
1297
  private fetchServerCertificate(endpointUrl: string, callback: (err: Error | null, adjustedEndpointUrl?: string) => void): void {
@@ -411,7 +411,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
411
411
 
412
412
  this._addSession(session as ClientSessionImpl);
413
413
 
414
- this._activateSession(session as ClientSessionImpl, (err1: Error | null, session2?: ClientSessionImpl) => {
414
+ this._activateSession(session as ClientSessionImpl, (err1: Error | null, session2?: ClientSessionImpl) => {
415
415
  callback(err1, session2);
416
416
  });
417
417
  }
@@ -1037,6 +1037,9 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
1037
1037
  session._client = this;
1038
1038
  session.serverNonce = response.serverNonce;
1039
1039
  session.lastResponseReceivedTime = new Date();
1040
+ if (this.keepSessionAlive) {
1041
+ session.startKeepAliveManager();
1042
+ }
1040
1043
  return callback(null, session);
1041
1044
  } else {
1042
1045
  // restore client