node-opcua-client 2.180.0 → 2.181.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 (87) hide show
  1. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +1 -1
  2. package/dist/alarms_and_conditions/client_tools.js +7 -7
  3. package/dist/alarms_and_conditions/client_tools.js.map +1 -1
  4. package/dist/client_base.d.ts +2 -2
  5. package/dist/client_monitored_item.d.ts +2 -2
  6. package/dist/client_monitored_item_base.d.ts +1 -1
  7. package/dist/client_monitored_item_group.d.ts +2 -2
  8. package/dist/client_monitored_item_toolbox.d.ts +2 -2
  9. package/dist/client_monitored_item_toolbox.js +2 -2
  10. package/dist/client_monitored_item_toolbox.js.map +1 -1
  11. package/dist/client_session.d.ts +1 -1
  12. package/dist/client_session_keepalive_manager.d.ts +1 -1
  13. package/dist/client_session_keepalive_manager.js +3 -3
  14. package/dist/client_session_keepalive_manager.js.map +1 -1
  15. package/dist/client_subscription.d.ts +17 -4
  16. package/dist/client_subscription.js.map +1 -1
  17. package/dist/index.d.ts +17 -17
  18. package/dist/index.js +18 -18
  19. package/dist/index.js.map +1 -1
  20. package/dist/opcua_client.d.ts +4 -4
  21. package/dist/opcua_client.js +5 -5
  22. package/dist/opcua_client.js.map +1 -1
  23. package/dist/private/client_base_impl.d.ts +6 -6
  24. package/dist/private/client_base_impl.js +19 -16
  25. package/dist/private/client_base_impl.js.map +1 -1
  26. package/dist/private/client_monitored_item_group_impl.d.ts +3 -3
  27. package/dist/private/client_monitored_item_group_impl.js +9 -9
  28. package/dist/private/client_monitored_item_group_impl.js.map +1 -1
  29. package/dist/private/client_monitored_item_impl.d.ts +4 -4
  30. package/dist/private/client_monitored_item_impl.js +10 -10
  31. package/dist/private/client_monitored_item_impl.js.map +1 -1
  32. package/dist/private/client_publish_engine.d.ts +3 -3
  33. package/dist/private/client_publish_engine.js +3 -3
  34. package/dist/private/client_publish_engine.js.map +1 -1
  35. package/dist/private/client_session_impl.d.ts +6 -6
  36. package/dist/private/client_session_impl.js +12 -12
  37. package/dist/private/client_session_impl.js.map +1 -1
  38. package/dist/private/client_subscription_impl.d.ts +8 -8
  39. package/dist/private/client_subscription_impl.js +13 -13
  40. package/dist/private/client_subscription_impl.js.map +1 -1
  41. package/dist/private/i_private_client.d.ts +4 -4
  42. package/dist/private/opcua_client_impl.d.ts +7 -7
  43. package/dist/private/opcua_client_impl.js +58 -25
  44. package/dist/private/opcua_client_impl.js.map +1 -1
  45. package/dist/private/reconnection/client_publish_engine_reconnection.d.ts +1 -1
  46. package/dist/private/reconnection/client_publish_engine_reconnection.js +5 -5
  47. package/dist/private/reconnection/client_publish_engine_reconnection.js.map +1 -1
  48. package/dist/private/reconnection/client_reconnection.d.ts +1 -1
  49. package/dist/private/reconnection/client_subscription_reconnection.d.ts +1 -1
  50. package/dist/private/reconnection/client_subscription_reconnection.js +8 -5
  51. package/dist/private/reconnection/client_subscription_reconnection.js.map +1 -1
  52. package/dist/private/reconnection/reconnection.d.ts +3 -3
  53. package/dist/private/reconnection/reconnection.js +4 -4
  54. package/dist/private/reconnection/reconnection.js.map +1 -1
  55. package/dist/tools/findservers.js +3 -3
  56. package/dist/tools/findservers.js.map +1 -1
  57. package/dist/tools/read_history_server_capabilities.d.ts +1 -1
  58. package/dist/verify.js +60 -20
  59. package/dist/verify.js.map +1 -1
  60. package/package.json +48 -47
  61. package/source/alarms_and_conditions/client_alarm_tools.ts +3 -3
  62. package/source/alarms_and_conditions/client_tools.ts +1 -1
  63. package/source/client_base.ts +2 -2
  64. package/source/client_monitored_item.ts +2 -2
  65. package/source/client_monitored_item_base.ts +1 -1
  66. package/source/client_monitored_item_group.ts +2 -2
  67. package/source/client_monitored_item_toolbox.ts +8 -8
  68. package/source/client_session.ts +1 -1
  69. package/source/client_session_keepalive_manager.ts +5 -5
  70. package/source/client_subscription.ts +21 -4
  71. package/source/index.ts +17 -17
  72. package/source/opcua_client.ts +5 -5
  73. package/source/private/client_base_impl.ts +21 -13
  74. package/source/private/client_monitored_item_group_impl.ts +8 -8
  75. package/source/private/client_monitored_item_impl.ts +8 -8
  76. package/source/private/client_publish_engine.ts +8 -8
  77. package/source/private/client_session_impl.ts +13 -13
  78. package/source/private/client_subscription_impl.ts +11 -11
  79. package/source/private/i_private_client.ts +4 -4
  80. package/source/private/opcua_client_impl.ts +85 -30
  81. package/source/private/reconnection/client_publish_engine_reconnection.ts +5 -5
  82. package/source/private/reconnection/client_reconnection.ts +1 -1
  83. package/source/private/reconnection/client_subscription_reconnection.ts +8 -4
  84. package/source/private/reconnection/reconnection.ts +5 -5
  85. package/source/tools/findservers.ts +1 -1
  86. package/source/tools/read_history_server_capabilities.ts +1 -1
  87. package/source/verify.ts +75 -24
@@ -1,5 +1,5 @@
1
1
  import type { Variant } from "node-opcua-variant";
2
- import type { ClientSession } from "../client_session";
2
+ import type { ClientSession } from "../client_session.js";
3
3
  export interface HistoryServerCapabilities {
4
4
  [key: string]: Variant;
5
5
  }
package/dist/verify.js CHANGED
@@ -2,12 +2,38 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.verifyIsOPCUAValidCertificate = verifyIsOPCUAValidCertificate;
4
4
  exports.performCertificateSanityCheck = performCertificateSanityCheck;
5
+ const node_crypto_1 = require("node:crypto");
6
+ const node_opcua_crypto_1 = require("node-opcua-crypto");
5
7
  const web_1 = require("node-opcua-crypto/web");
6
8
  const node_opcua_debug_1 = require("node-opcua-debug");
7
- const _doDebug = (0, node_opcua_debug_1.checkDebugFlag)(__filename);
8
- const _debugLog = (0, node_opcua_debug_1.make_debugLog)(__filename);
9
- const errorLog = (0, node_opcua_debug_1.make_errorLog)(__filename);
10
- const warningLog = (0, node_opcua_debug_1.make_warningLog)(__filename);
9
+ const _doDebug = (0, node_opcua_debug_1.checkDebugFlag)("verify");
10
+ const _debugLog = (0, node_opcua_debug_1.make_debugLog)("verify");
11
+ const errorLog = (0, node_opcua_debug_1.make_errorLog)("verify");
12
+ const warningLog = (0, node_opcua_debug_1.make_warningLog)("verify");
13
+ /**
14
+ * The opaque-key variant of the certificate/key match check: compares the
15
+ * certificate's SPKI against the one the key-operations provider reports.
16
+ * A provider without `getPublicKey` cannot be checked — that is worth a
17
+ * warning, not a refusal to start (the first real handshake will tell).
18
+ */
19
+ async function verifyOpaqueKeyMatchesCertificate(secureObject, certificate) {
20
+ const keyOperations = secureObject.getKeyOperations();
21
+ if (!keyOperations.getPublicKey) {
22
+ warningLog("[NODE-OPCUA-W36] the key-operations provider does not implement getPublicKey():" +
23
+ " cannot verify that the certificate matches the (opaque) private key");
24
+ return;
25
+ }
26
+ const providerSpki = Buffer.from(await keyOperations.getPublicKey());
27
+ const certificateSpki = (0, node_crypto_1.createPublicKey)((0, web_1.extractPublicKeyFromCertificateSync)(certificate)).export({
28
+ type: "spki",
29
+ format: "der"
30
+ });
31
+ if (!providerSpki.equals(certificateSpki)) {
32
+ errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the (opaque) private key do not match !");
33
+ errorLog(" certificateFile= ", secureObject.certificateFile);
34
+ throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate does not carry the key-operations provider's public key ! please fix your configuration");
35
+ }
36
+ }
11
37
  function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, applicationUri) {
12
38
  const certificateInfo = (0, web_1.exploreCertificate)(certificate);
13
39
  const now = new Date();
@@ -94,22 +120,36 @@ function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, appli
94
120
  async function performCertificateSanityCheck(secureObject, serverOrClient, certificateStore, applicationUri) {
95
121
  // verify that certificate is matching private key, and inform the developer if not
96
122
  const certificate = secureObject.getCertificate();
97
- const privateKey = secureObject.getPrivateKey();
98
- //
99
- if (!(0, web_1.publicKeyAndPrivateKeyMatches)(certificate, privateKey)) {
100
- errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
101
- errorLog(" please check the configuration of the OPCUA Server");
102
- errorLog(" privateKey= ", secureObject.privateKeyFile);
103
- errorLog(" certificateFile= ", secureObject.certificateFile);
104
- throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration");
105
- }
106
- // verify that the certificate provided has the right key length ( at least 2048)
107
- const privateKeyInfo = (0, web_1.explorePrivateKey)(privateKey);
108
- const keyLengthInBits = privateKeyInfo.modulus.length * 8;
109
- if (keyLengthInBits <= 1024) {
110
- 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` +
111
- `OPCUA version 1.04 requires that security key length are greater or equal to 2048 bits.\n` +
112
- `The ${serverOrClient} is operating at risk. `);
123
+ let privateKey;
124
+ try {
125
+ privateKey = secureObject.getPrivateKey();
126
+ }
127
+ catch (err) {
128
+ if (!(err instanceof node_opcua_crypto_1.PrivateKeyUnavailableError)) {
129
+ throw err;
130
+ }
131
+ // The key is opaque (HSM/KMS-held): no material to compare or
132
+ // measure. Check what can be checked without it that the
133
+ // certificate carries the provider's public key — and warn (not
134
+ // fail) when the provider cannot even produce that.
135
+ await verifyOpaqueKeyMatchesCertificate(secureObject, certificate);
136
+ }
137
+ if (privateKey) {
138
+ if (!(0, web_1.publicKeyAndPrivateKeyMatches)(certificate, privateKey)) {
139
+ errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
140
+ errorLog(" please check the configuration of the OPCUA Server");
141
+ errorLog(" privateKey= ", secureObject.privateKeyFile);
142
+ errorLog(" certificateFile= ", secureObject.certificateFile);
143
+ throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration");
144
+ }
145
+ // verify that the certificate provided has the right key length ( at least 2048)
146
+ const privateKeyInfo = (0, web_1.explorePrivateKey)(privateKey);
147
+ const keyLengthInBits = privateKeyInfo.modulus.length * 8;
148
+ if (keyLengthInBits <= 1024) {
149
+ 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` +
150
+ `OPCUA version 1.04 requires that security key length are greater or equal to 2048 bits.\n` +
151
+ `The ${serverOrClient} is operating at risk. `);
152
+ }
113
153
  }
114
154
  const options = {
115
155
  acceptOutdatedCertificate: false
@@ -1 +1 @@
1
- {"version":3,"file":"verify.js","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":";;AAUA,sEAsGC;AAED,sEA6CC;AA7JD,+CAA+H;AAC/H,uDAAiG;AAEjG,MAAM,QAAQ,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC5C,MAAM,SAAS,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC5C,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,UAAU,CAAC,CAAC;AAE/C,SAAgB,6BAA6B,CACzC,WAAwB,EACxB,eAAuB,EACvB,IAAyB,EACzB,cAAsB;IAEtB,MAAM,eAAe,GAAG,IAAA,wBAAkB,EAAC,WAAW,CAAC,CAAC;IACxD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IAEvB,IAAI,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9E,mCAAmC;QACnC,gCAAgC;QAChC,UAAU,CACN,sDAAsD;YAClD,mBAAmB,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI;YACtF,mBAAmB,eAAe,EAAE,CAC3C,CAAC;IACN,CAAC;IACD,0CAA0C;IAC1C,IAAI,eAAe,CAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,CAAC,OAAO,EAAE,IAAI,GAAG,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9E,0BAA0B;QAC1B,UAAU,CACN,gDAAgD;YAC5C,yCAAyC;YACzC,oBAAoB,eAAe,CAAC,cA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version": "2.181.1",
4
4
  "description": "pure nodejs OPCUA SDK - module client",
5
5
  "scripts": {
6
6
  "clean": "npx rimraf -g node_modules dist *.tsbuildinfo certificates",
@@ -16,56 +16,57 @@
16
16
  "dependencies": {
17
17
  "@ster5/global-mutex": "^3.3.0",
18
18
  "chalk": "4.1.2",
19
- "node-opcua-alarm-condition": "2.180.0",
19
+ "node-opcua-alarm-condition": "2.181.1",
20
20
  "node-opcua-assert": "2.179.0",
21
- "node-opcua-basic-types": "2.180.0",
22
- "node-opcua-buffer-utils": "2.179.0",
23
- "node-opcua-certificate-manager": "2.180.0",
24
- "node-opcua-client-dynamic-extension-object": "2.180.0",
25
- "node-opcua-common": "2.180.0",
26
- "node-opcua-constants": "2.179.0",
27
- "node-opcua-crypto": "5.9.0",
28
- "node-opcua-data-model": "2.180.0",
29
- "node-opcua-data-value": "2.180.0",
30
- "node-opcua-date-time": "2.180.0",
31
- "node-opcua-debug": "2.179.0",
32
- "node-opcua-extension-object": "2.180.0",
33
- "node-opcua-hostname": "2.179.0",
34
- "node-opcua-nodeid": "2.179.0",
35
- "node-opcua-numeric-range": "2.180.0",
36
- "node-opcua-object-registry": "2.179.0",
37
- "node-opcua-pki": "6.21.0",
38
- "node-opcua-pseudo-session": "2.180.0",
39
- "node-opcua-schemas": "2.180.0",
40
- "node-opcua-secure-channel": "2.180.0",
41
- "node-opcua-service-browse": "2.180.0",
42
- "node-opcua-service-call": "2.180.0",
43
- "node-opcua-service-discovery": "2.180.0",
44
- "node-opcua-service-endpoints": "2.180.0",
45
- "node-opcua-service-filter": "2.180.0",
46
- "node-opcua-service-history": "2.180.0",
47
- "node-opcua-service-query": "2.180.0",
48
- "node-opcua-service-read": "2.180.0",
49
- "node-opcua-service-register-node": "2.180.0",
50
- "node-opcua-service-secure-channel": "2.180.0",
51
- "node-opcua-service-session": "2.180.0",
52
- "node-opcua-service-subscription": "2.180.0",
53
- "node-opcua-service-translate-browse-path": "2.180.0",
54
- "node-opcua-service-write": "2.180.0",
55
- "node-opcua-status-code": "2.180.0",
56
- "node-opcua-transport": "2.180.0",
57
- "node-opcua-types": "2.180.0",
58
- "node-opcua-utils": "2.179.0",
59
- "node-opcua-variant": "2.180.0",
21
+ "node-opcua-basic-types": "2.181.0",
22
+ "node-opcua-buffer-utils": "2.181.0",
23
+ "node-opcua-certificate-manager": "2.181.0",
24
+ "node-opcua-client-dynamic-extension-object": "2.181.1",
25
+ "node-opcua-common": "2.181.0",
26
+ "node-opcua-constants": "2.181.0",
27
+ "node-opcua-crypto": "5.10.1",
28
+ "node-opcua-data-model": "2.181.0",
29
+ "node-opcua-data-value": "2.181.0",
30
+ "node-opcua-date-time": "2.181.0",
31
+ "node-opcua-debug": "2.181.0",
32
+ "node-opcua-extension-object": "2.181.0",
33
+ "node-opcua-hostname": "2.181.0",
34
+ "node-opcua-nodeid": "2.181.0",
35
+ "node-opcua-numeric-range": "2.181.0",
36
+ "node-opcua-object-registry": "2.181.0",
37
+ "node-opcua-pki": "6.22.0",
38
+ "node-opcua-pseudo-session": "2.181.1",
39
+ "node-opcua-schemas": "2.181.0",
40
+ "node-opcua-secure-channel": "2.181.1",
41
+ "node-opcua-service-browse": "2.181.0",
42
+ "node-opcua-service-call": "2.181.0",
43
+ "node-opcua-service-discovery": "2.181.0",
44
+ "node-opcua-service-endpoints": "2.181.0",
45
+ "node-opcua-service-filter": "2.181.0",
46
+ "node-opcua-service-history": "2.181.0",
47
+ "node-opcua-service-query": "2.181.0",
48
+ "node-opcua-service-read": "2.181.0",
49
+ "node-opcua-service-register-node": "2.181.0",
50
+ "node-opcua-service-secure-channel": "2.181.0",
51
+ "node-opcua-service-session": "2.181.0",
52
+ "node-opcua-service-subscription": "2.181.1",
53
+ "node-opcua-service-translate-browse-path": "2.181.0",
54
+ "node-opcua-service-write": "2.181.0",
55
+ "node-opcua-status-code": "2.181.0",
56
+ "node-opcua-transport": "2.181.1",
57
+ "node-opcua-types": "2.181.0",
58
+ "node-opcua-utils": "2.181.0",
59
+ "node-opcua-variant": "2.181.0",
60
60
  "thenify-ex": "4.4.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "dequeue": "^1.0.5",
64
- "node-opcua-address-space": "2.180.0",
65
- "node-opcua-binary-stream": "2.180.0",
66
- "node-opcua-factory": "2.180.0",
67
- "node-opcua-leak-detector": "2.179.0",
68
- "node-opcua-nodesets": "2.179.0"
64
+ "node-opcua-address-space": "2.181.1",
65
+ "node-opcua-binary-stream": "2.181.0",
66
+ "node-opcua-factory": "2.181.0",
67
+ "node-opcua-leak-detector": "2.181.0",
68
+ "node-opcua-nodesets": "2.181.0",
69
+ "node-opcua-test-helpers": "2.181.0"
69
70
  },
70
71
  "eslintConfig": {
71
72
  "env": {
@@ -87,7 +88,7 @@
87
88
  "internet of things"
88
89
  ],
89
90
  "homepage": "http://node-opcua.github.io/",
90
- "gitHead": "11ad1e0894355cd279e19443c6c9a4fc090e7d7a",
91
+ "gitHead": "b3b762ed8259fb8eaec07b8f1e19f920a78e85ca",
91
92
  "files": [
92
93
  "dist",
93
94
  "source"
@@ -13,9 +13,9 @@ import { type ReadValueIdOptions, TimestampsToReturn } from "node-opcua-service-
13
13
  import type { CreateSubscriptionRequestOptions, MonitoringParametersOptions } from "node-opcua-service-subscription";
14
14
  import { DataType, type Variant } from "node-opcua-variant";
15
15
 
16
- import type { ClientMonitoredItem } from "../client_monitored_item";
17
- import type { ClientSession } from "../client_session";
18
- import type { ClientSubscription } from "../client_subscription";
16
+ import type { ClientMonitoredItem } from "../client_monitored_item.js";
17
+ import type { ClientSession } from "../client_session.js";
18
+ import type { ClientSubscription } from "../client_subscription.js";
19
19
 
20
20
  const doDebug = checkDebugFlag("A&E");
21
21
  const debugLog = make_debugLog("A&E");
@@ -9,7 +9,7 @@ import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
9
9
  import { findMethodId, type ResponseCallback } from "node-opcua-pseudo-session";
10
10
  import type { Callback, StatusCode } from "node-opcua-status-code";
11
11
 
12
- import { ClientSessionImpl } from "../private/client_session_impl";
12
+ import { ClientSessionImpl } from "../private/client_session_impl.js";
13
13
 
14
14
  ClientSessionImpl.prototype.disableCondition = () => {
15
15
  /** */
@@ -18,8 +18,8 @@ import type { ApplicationDescription, EndpointDescription } from "node-opcua-ser
18
18
  import type { ChannelSecurityToken, MessageSecurityMode } from "node-opcua-service-secure-channel";
19
19
  import type { ErrorCallback } from "node-opcua-status-code";
20
20
  import type { IClientTransportFactory } from "node-opcua-transport";
21
- import type { Request, Response } from "./common";
22
- import type { ClientReverseConnect, ReverseConnectExpectation } from "./reverse/client_reverse_connect";
21
+ import type { Request, Response } from "./common.js";
22
+ import type { ClientReverseConnect, ReverseConnectExpectation } from "./reverse/client_reverse_connect.js";
23
23
 
24
24
  export type FindServersRequestLike = FindServersRequestOptions;
25
25
  export type FindServersOnNetworkRequestLike = FindServersOnNetworkRequestOptions;
@@ -7,8 +7,8 @@ import { type DataValue, TimestampsToReturn } from "node-opcua-data-value";
7
7
  import type { ReadValueIdOptions } from "node-opcua-service-read";
8
8
  import type { MonitoringParametersOptions } from "node-opcua-types";
9
9
  import type { Variant } from "node-opcua-variant";
10
- import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
11
- import type { ClientSubscription } from "./client_subscription";
10
+ import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base.js";
11
+ import type { ClientSubscription } from "./client_subscription.js";
12
12
 
13
13
  export interface ClientMonitoredItem extends ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction, EventEmitter {
14
14
  on(event: "changed", eventHandler: (dataValue: DataValue) => void): this;
@@ -19,7 +19,7 @@ import type {
19
19
  import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
20
20
  import type { Variant } from "node-opcua-variant";
21
21
 
22
- import type { ClientSubscription } from "./client_subscription";
22
+ import type { ClientSubscription } from "./client_subscription.js";
23
23
 
24
24
  export interface ClientMonitoredItemOrGroupAction {
25
25
  modify(parameters: MonitoringParametersOptions, timestampsToReturn?: TimestampsToReturn): Promise<MonitoredItemModifyResult>;
@@ -7,8 +7,8 @@ import type { DataValue, TimestampsToReturn } from "node-opcua-data-value";
7
7
  import type { ReadValueIdOptions } from "node-opcua-service-read";
8
8
  import type { MonitoringParametersOptions } from "node-opcua-types";
9
9
 
10
- import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
11
- import type { ClientSubscription } from "./client_subscription";
10
+ import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base.js";
11
+ import type { ClientSubscription } from "./client_subscription.js";
12
12
 
13
13
  export interface ClientMonitoredItemGroup extends EventEmitter, ClientMonitoredItemOrGroupAction {
14
14
  on(event: "changed", eventHandler: (monitoredItem: ClientMonitoredItemBase, dataValue: DataValue, index: number) => void): this;
@@ -19,14 +19,14 @@ import {
19
19
  } from "node-opcua-service-subscription";
20
20
  import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
21
21
  import type { MonitoredItemCreateRequestOptions, MonitoringParametersOptions } from "node-opcua-types";
22
- import type { ClientMonitoredItemBase } from "./client_monitored_item_base";
23
- import type { SetMonitoringModeRequestLike } from "./client_session";
24
- import type { ClientSubscription } from "./client_subscription";
25
- import type { ClientMonitoredItemImpl } from "./private/client_monitored_item_impl";
26
- import type { ClientSessionImpl } from "./private/client_session_impl";
27
-
28
- const debugLog = make_debugLog(__filename);
29
- const doDebug = checkDebugFlag(__filename);
22
+ import type { ClientMonitoredItemBase } from "./client_monitored_item_base.js";
23
+ import type { SetMonitoringModeRequestLike } from "./client_session.js";
24
+ import type { ClientSubscription } from "./client_subscription.js";
25
+ import type { ClientMonitoredItemImpl } from "./private/client_monitored_item_impl.js";
26
+ import type { ClientSessionImpl } from "./private/client_session_impl.js";
27
+
28
+ const debugLog = make_debugLog("client_monitored_item_toolbox");
29
+ const doDebug = checkDebugFlag("client_monitored_item_toolbox");
30
30
 
31
31
  export interface ClientMonitoredItemBaseEx extends ClientMonitoredItemBase {
32
32
  internalSetMonitoringMode(monitoringMode: MonitoringMode): void;
@@ -68,7 +68,7 @@ export { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object
68
68
  export { ExtensionObject } from "node-opcua-extension-object";
69
69
  export { ArgumentDefinition, CallMethodRequestLike, MethodId } from "node-opcua-pseudo-session";
70
70
 
71
- import type { ClientSubscription } from "./client_subscription";
71
+ import type { ClientSubscription } from "./client_subscription.js";
72
72
 
73
73
  export interface MonitoredItemData {
74
74
  clientHandles: Uint32Array;
@@ -13,14 +13,14 @@ import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug
13
13
  import { coerceNodeId } from "node-opcua-nodeid";
14
14
  import { ClientSecureChannelLayer, type ServiceFaultAnnotatedError } from "node-opcua-secure-channel";
15
15
  import { StatusCodes } from "node-opcua-status-code";
16
- import type { ClientSessionImpl } from "./private/client_session_impl";
17
- import type { IClientBase } from "./private/i_private_client";
16
+ import type { ClientSessionImpl } from "./private/client_session_impl.js";
17
+ import type { IClientBase } from "./private/i_private_client.js";
18
18
 
19
19
  const serverStatusStateNodeId = coerceNodeId(VariableIds.Server_ServerStatus_State);
20
20
 
21
- const debugLog = make_debugLog(__filename);
22
- const doDebug = checkDebugFlag(__filename);
23
- const warningLog = make_warningLog(__filename);
21
+ const debugLog = make_debugLog("client_session_keepalive_manager");
22
+ const doDebug = checkDebugFlag("client_session_keepalive_manager");
23
+ const warningLog = make_warningLog("client_session_keepalive_manager");
24
24
 
25
25
  export interface ClientSessionKeepAliveManagerEvents {
26
26
  on(event: "keepalive", eventHandler: (lastKnownServerState: ServerState, count: number) => void): this;
@@ -16,10 +16,10 @@ import type {
16
16
  } from "node-opcua-service-subscription";
17
17
  import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
18
18
 
19
- import type { ClientMonitoredItem } from "./client_monitored_item";
20
- import type { ClientMonitoredItemBase } from "./client_monitored_item_base";
21
- import type { ClientMonitoredItemGroup } from "./client_monitored_item_group";
22
- import type { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session";
19
+ import type { ClientMonitoredItem } from "./client_monitored_item.js";
20
+ import type { ClientMonitoredItemBase } from "./client_monitored_item_base.js";
21
+ import type { ClientMonitoredItemGroup } from "./client_monitored_item_group.js";
22
+ import type { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session.js";
23
23
 
24
24
  export interface ClientSubscriptionOptions {
25
25
  requestedPublishingInterval?: number;
@@ -254,6 +254,23 @@ export declare interface ClientSubscription {
254
254
  */
255
255
  on(event: "terminated", eventHandler: () => void): this;
256
256
 
257
+ /**
258
+ * notify the observers that the subscription has been recreated with a new subscriptionId.
259
+ *
260
+ * This happens when the client repairs a broken connection and the server could not
261
+ * transfer the original subscription (TransferSubscriptions not supported or refused,
262
+ * or the subscription had already timed out and been deleted on the server). In that
263
+ * case the client silently creates a new subscription on the server, and `subscriptionId`
264
+ * is updated to reflect it. Since `started` is only emitted once, applications that need
265
+ * to track the current subscriptionId (for logging, diagnostics, or correlating it with
266
+ * server-side state) should listen to this event as well.
267
+ * @event subscriptionId_changed
268
+ */
269
+ on(
270
+ event: "subscriptionId_changed",
271
+ eventHandler: (subscriptionId: SubscriptionId, previousSubscriptionId: SubscriptionId) => void
272
+ ): this;
273
+
257
274
  /**
258
275
  * notify the observers that a new monitored item has been added to the subscription.
259
276
  * @event item_added
package/source/index.ts CHANGED
@@ -26,23 +26,23 @@ export { assert } from "node-opcua-assert";
26
26
  export { ServerState, ServiceCounterDataType } from "node-opcua-common";
27
27
  export { ClientSecureChannelLayer, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
28
28
  export * from "node-opcua-utils";
29
- export * from "./alarms_and_conditions/client_alarm_tools";
30
- export * from "./alarms_and_conditions/client_tools";
31
- export * from "./alarms_and_conditions/client_tools";
32
- export * from "./client_base";
33
- export * from "./client_monitored_item";
34
- export * from "./client_monitored_item_base";
35
- export * from "./client_monitored_item_group";
36
- export * from "./client_session";
37
- export * from "./client_subscription";
38
- export * from "./client_utils";
39
- export * from "./opcua_client";
40
- export { ClientSidePublishEngine } from "./private/client_publish_engine";
41
- export * from "./reverse/client_reverse_connect";
42
- export * from "./tools/findservers";
43
- export * from "./tools/read_history_server_capabilities";
44
- export * from "./user_identity_info";
45
- export * from "./verify";
29
+ export * from "./alarms_and_conditions/client_alarm_tools.js";
30
+ export * from "./alarms_and_conditions/client_tools.js";
31
+ export * from "./alarms_and_conditions/client_tools.js";
32
+ export * from "./client_base.js";
33
+ export * from "./client_monitored_item.js";
34
+ export * from "./client_monitored_item_base.js";
35
+ export * from "./client_monitored_item_group.js";
36
+ export * from "./client_session.js";
37
+ export * from "./client_subscription.js";
38
+ export * from "./client_utils.js";
39
+ export * from "./opcua_client.js";
40
+ export { ClientSidePublishEngine } from "./private/client_publish_engine.js";
41
+ export * from "./reverse/client_reverse_connect.js";
42
+ export * from "./tools/findservers.js";
43
+ export * from "./tools/read_history_server_capabilities.js";
44
+ export * from "./user_identity_info.js";
45
+ export * from "./verify.js";
46
46
 
47
47
  import * as utils1 from "node-opcua-utils";
48
48
  export const utils = utils1;
@@ -12,11 +12,11 @@ import type {
12
12
  OPCUAClientBase,
13
13
  OPCUAClientBaseEvents,
14
14
  OPCUAClientBaseOptions
15
- } from "./client_base";
16
- import type { ClientSession } from "./client_session";
17
- import type { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription";
18
- import { OPCUAClientImpl } from "./private/opcua_client_impl";
19
- import type { UserIdentityInfo } from "./user_identity_info";
15
+ } from "./client_base.js";
16
+ import type { ClientSession } from "./client_session.js";
17
+ import type { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription.js";
18
+ import { OPCUAClientImpl } from "./private/opcua_client_impl.js";
19
+ import type { UserIdentityInfo } from "./user_identity_info.js";
20
20
 
21
21
  export interface OPCUAClientOptions extends OPCUAClientBaseOptions {
22
22
  /**
@@ -70,18 +70,22 @@ import {
70
70
  type OPCUAClientBaseEvents,
71
71
  type OPCUAClientBaseOptions,
72
72
  type TransportSettings
73
- } from "../client_base";
74
- import type { Request, Response } from "../common";
75
- import type { ClientReverseConnect, ICancelableRegistration, ReverseConnectExpectation } from "../reverse/client_reverse_connect";
76
- import type { UserIdentityInfo } from "../user_identity_info";
77
- import { performCertificateSanityCheck } from "../verify";
78
- import type { ClientSessionImpl } from "./client_session_impl";
79
- import type { IClientBase } from "./i_private_client";
80
-
81
- const debugLog = make_debugLog(__filename);
82
- const doDebug = checkDebugFlag(__filename);
83
- const errorLog = make_errorLog(__filename);
84
- const warningLog = make_warningLog(__filename);
73
+ } from "../client_base.js";
74
+ import type { Request, Response } from "../common.js";
75
+ import type {
76
+ ClientReverseConnect,
77
+ ICancelableRegistration,
78
+ ReverseConnectExpectation
79
+ } from "../reverse/client_reverse_connect.js";
80
+ import type { UserIdentityInfo } from "../user_identity_info.js";
81
+ import { performCertificateSanityCheck } from "../verify.js";
82
+ import type { ClientSessionImpl } from "./client_session_impl.js";
83
+ import type { IClientBase } from "./i_private_client.js";
84
+
85
+ const debugLog = make_debugLog("client_base_impl");
86
+ const doDebug = checkDebugFlag("client_base_impl");
87
+ const errorLog = make_errorLog("client_base_impl");
88
+ const warningLog = make_warningLog("client_base_impl");
85
89
 
86
90
  function makeCertificateThumbPrint(certificate: Certificate | Certificate[] | null | undefined): Buffer | null {
87
91
  if (!certificate) return null;
@@ -948,8 +952,12 @@ export class ClientBaseImpl<Events extends OPCUAClientBaseEvents = OPCUAClientBa
948
952
  } else {
949
953
  // Disk path — create default cert if missing
950
954
  await this.createDefaultCertificate();
955
+ const hasOpaqueKey =
956
+ typeof (this.clientCertificateManager as { isPrivateKeyOpaque?: () => boolean }).isPrivateKeyOpaque ===
957
+ "function" &&
958
+ (this.clientCertificateManager as unknown as { isPrivateKeyOpaque: () => boolean }).isPrivateKeyOpaque();
951
959
  // c8 ignore next
952
- if (!fs.existsSync(this.privateKeyFile)) {
960
+ if (!hasOpaqueKey && !fs.existsSync(this.privateKeyFile)) {
953
961
  throw new Error(` cannot locate private key file ${this.privateKeyFile}`);
954
962
  }
955
963
 
@@ -9,14 +9,14 @@ import { NodeId, resolveNodeId } from "node-opcua-nodeid";
9
9
  import { MonitoringMode, type MonitoringParametersOptions } from "node-opcua-service-subscription";
10
10
  import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
11
11
  import type { MonitoredItemModifyResult, ReadValueIdOptions } from "node-opcua-types";
12
- import type { ClientMonitoredItemBase } from "../client_monitored_item_base";
13
- import { ClientMonitoredItemGroup } from "../client_monitored_item_group";
14
- import { type ClientMonitoredItemBaseEx, ClientMonitoredItemToolbox } from "../client_monitored_item_toolbox";
15
- import type { ClientSubscription } from "../client_subscription";
16
- import { ClientMonitoredItemImpl } from "./client_monitored_item_impl";
17
- import type { ClientSubscriptionImpl } from "./client_subscription_impl";
18
-
19
- const warningLog = make_warningLog(__filename);
12
+ import type { ClientMonitoredItemBase } from "../client_monitored_item_base.js";
13
+ import { ClientMonitoredItemGroup } from "../client_monitored_item_group.js";
14
+ import { type ClientMonitoredItemBaseEx, ClientMonitoredItemToolbox } from "../client_monitored_item_toolbox.js";
15
+ import type { ClientSubscription } from "../client_subscription.js";
16
+ import { ClientMonitoredItemImpl } from "./client_monitored_item_impl.js";
17
+ import type { ClientSubscriptionImpl } from "./client_subscription_impl.js";
18
+
19
+ const warningLog = make_warningLog("client_monitored_item_group_impl");
20
20
 
21
21
  /**
22
22
  * ClientMonitoredItemGroup
@@ -20,14 +20,14 @@ import {
20
20
  import { type Callback, type ErrorCallback, type StatusCode, StatusCodes } from "node-opcua-status-code";
21
21
  import type { Variant } from "node-opcua-variant";
22
22
 
23
- import { ClientMonitoredItem } from "../client_monitored_item";
24
- import { type ClientMonitoredItemBaseEx, ClientMonitoredItemToolbox } from "../client_monitored_item_toolbox";
25
- import type { ClientSubscription } from "../client_subscription";
26
- import { ClientMonitoredItem_create, type ClientSubscriptionImpl } from "./client_subscription_impl";
27
-
28
- const _debugLog = make_debugLog(__filename);
29
- const warningLog = make_warningLog(__filename);
30
- const _doDebug = checkDebugFlag(__filename);
23
+ import { ClientMonitoredItem } from "../client_monitored_item.js";
24
+ import { type ClientMonitoredItemBaseEx, ClientMonitoredItemToolbox } from "../client_monitored_item_toolbox.js";
25
+ import type { ClientSubscription } from "../client_subscription.js";
26
+ import { ClientMonitoredItem_create, type ClientSubscriptionImpl } from "./client_subscription_impl.js";
27
+
28
+ const _debugLog = make_debugLog("client_monitored_item_impl");
29
+ const warningLog = make_warningLog("client_monitored_item_impl");
30
+ const _doDebug = checkDebugFlag("client_monitored_item_impl");
31
31
 
32
32
  export type PrepareForMonitoringResult =
33
33
  | { error: string }
@@ -9,14 +9,14 @@ import type { ServiceFaultAnnotatedError } from "node-opcua-secure-channel";
9
9
  import { PublishRequest, type PublishResponse } from "node-opcua-service-subscription";
10
10
  import type { SubscriptionAcknowledgementOptions } from "node-opcua-types";
11
11
 
12
- import type { ClientSession, SubscriptionId } from "../client_session";
13
- import type { ClientSubscription } from "../client_subscription";
14
- import type { ClientSessionImpl } from "../private/client_session_impl";
15
- import type { ClientSubscriptionImpl } from "./client_subscription_impl";
16
-
17
- const debugLog = make_debugLog(__filename);
18
- const doDebug = checkDebugFlag(__filename);
19
- const warningLog = make_warningLog(__filename);
12
+ import type { ClientSession, SubscriptionId } from "../client_session.js";
13
+ import type { ClientSubscription } from "../client_subscription.js";
14
+ import type { ClientSessionImpl } from "../private/client_session_impl.js";
15
+ import type { ClientSubscriptionImpl } from "./client_subscription_impl.js";
16
+
17
+ const debugLog = make_debugLog("client_publish_engine");
18
+ const doDebug = checkDebugFlag("client_publish_engine");
19
+ const warningLog = make_warningLog("client_publish_engine");
20
20
  /**
21
21
  * A client side implementation to deal with publish service.
22
22
  *