node-opcua-client 2.139.0 → 2.141.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 (28) hide show
  1. package/dist/alarms_and_conditions/client_tools.js +5 -5
  2. package/dist/alarms_and_conditions/client_tools.js.map +1 -1
  3. package/dist/private/client_base_impl.js +6 -6
  4. package/dist/private/client_base_impl.js.map +1 -1
  5. package/dist/private/client_monitored_item_group_impl.js +4 -4
  6. package/dist/private/client_monitored_item_group_impl.js.map +1 -1
  7. package/dist/private/client_monitored_item_impl.js +4 -4
  8. package/dist/private/client_monitored_item_impl.js.map +1 -1
  9. package/dist/private/client_session_impl.js +46 -46
  10. package/dist/private/client_session_impl.js.map +1 -1
  11. package/dist/private/client_subscription_impl.js +8 -8
  12. package/dist/private/client_subscription_impl.js.map +1 -1
  13. package/dist/private/opcua_client_impl.js +9 -9
  14. package/dist/private/opcua_client_impl.js.map +1 -1
  15. package/dist/tools/findservers.js +3 -3
  16. package/dist/tools/findservers.js.map +1 -1
  17. package/dist/tools/read_history_server_capabilities.js +2 -2
  18. package/dist/tools/read_history_server_capabilities.js.map +1 -1
  19. package/package.json +27 -27
  20. package/source/alarms_and_conditions/client_tools.ts +5 -5
  21. package/source/private/client_base_impl.ts +6 -6
  22. package/source/private/client_monitored_item_group_impl.ts +4 -4
  23. package/source/private/client_monitored_item_impl.ts +4 -4
  24. package/source/private/client_session_impl.ts +47 -52
  25. package/source/private/client_subscription_impl.ts +8 -8
  26. package/source/private/opcua_client_impl.ts +11 -11
  27. package/source/tools/findservers.ts +3 -3
  28. package/source/tools/read_history_server_capabilities.ts +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":";;AAyBA,sEAqGC;AA9HD;;GAEG;AACH,yDAA2C;AAC3C,+DAAiD;AACjD,iEAAqD;AAErD,yDAA2C;AAE3C,uGAAwG;AA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BAC1B,CAAC;gBACD,0BAA0B;gBAC1B,IAAI,CAAC,UAAU,EAAE,CAAC;oBACd,OAAO,QAAQ,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC;gBACjD,CAAC;gBAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACzC,MAAM,QAAQ,GAAG,IAAA,mCAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;oBACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAgB,CAAC;gBACpD,CAAC;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AACD,iCAAiC;AACjC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACjC,MAAc,CAAC,OAAO,CAAC,6BAA6B,GAAG,OAAO,CAAC,YAAY,CACvE,MAAc,CAAC,OAAO,CAAC,6BAA6B,EACrD,IAAI,CACP,CAAC"}
1
+ {"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":";;AAyBA,sEAqGC;AA9HD;;GAEG;AACH,yDAA2C;AAC3C,+DAAiD;AACjD,iEAAqD;AAErD,yDAA2C;AAE3C,uGAAwG;AAExG,uDAAoD;AAcpD,SAAgB,6BAA6B,CACzC,OAAsB,EACtB,QAAgF;IAEhF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACtC,CAAC;IACD,wCAAwC;IACxC,MAAM,UAAU,GAAe,IAAA,yDAAc,EAAC,gCAA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AE,CAAC,EAAE,EAAE,CAAC;oBACzC,MAAM,QAAQ,GAAG,IAAA,mCAAgB,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;oBACjD,IAAI,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAgB,CAAC;gBACpD,CAAC;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AACD,iCAAiC;AACjC,2CAA0C;AAC1C,MAAM,IAAI,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;AACjC,MAAc,CAAC,OAAO,CAAC,6BAA6B,GAAG,IAAA,yBAAY,EAC/D,MAAc,CAAC,OAAO,CAAC,6BAA6B,EACrD,IAAI,CACP,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-client",
3
- "version": "2.139.0",
3
+ "version": "2.141.0",
4
4
  "description": "pure nodejs OPCUA SDK - module client",
5
5
  "scripts": {
6
6
  "clean": "npx rimraf -g node_modules dist *.tsbuildinfo certificates",
@@ -17,13 +17,13 @@
17
17
  "@types/async": "^3.2.24",
18
18
  "async": "^3.2.6",
19
19
  "chalk": "4.1.2",
20
- "node-opcua-alarm-condition": "2.139.0",
20
+ "node-opcua-alarm-condition": "2.141.0",
21
21
  "node-opcua-assert": "2.139.0",
22
22
  "node-opcua-basic-types": "2.139.0",
23
23
  "node-opcua-buffer-utils": "2.139.0",
24
- "node-opcua-certificate-manager": "2.139.0",
25
- "node-opcua-client-dynamic-extension-object": "2.139.0",
26
- "node-opcua-common": "2.139.0",
24
+ "node-opcua-certificate-manager": "2.141.0",
25
+ "node-opcua-client-dynamic-extension-object": "2.141.0",
26
+ "node-opcua-common": "2.141.0",
27
27
  "node-opcua-constants": "2.139.0",
28
28
  "node-opcua-crypto": "4.15.0",
29
29
  "node-opcua-data-model": "2.139.0",
@@ -34,34 +34,34 @@
34
34
  "node-opcua-hostname": "2.139.0",
35
35
  "node-opcua-nodeid": "2.139.0",
36
36
  "node-opcua-object-registry": "2.139.0",
37
- "node-opcua-pki": "4.17.0",
38
- "node-opcua-pseudo-session": "2.139.0",
39
- "node-opcua-schemas": "2.139.0",
40
- "node-opcua-secure-channel": "2.139.0",
41
- "node-opcua-service-browse": "2.139.0",
42
- "node-opcua-service-call": "2.139.0",
43
- "node-opcua-service-discovery": "2.139.0",
44
- "node-opcua-service-endpoints": "2.139.0",
45
- "node-opcua-service-filter": "2.139.0",
46
- "node-opcua-service-history": "2.139.0",
47
- "node-opcua-service-query": "2.139.0",
48
- "node-opcua-service-read": "2.139.0",
49
- "node-opcua-service-register-node": "2.139.0",
50
- "node-opcua-service-secure-channel": "2.139.0",
51
- "node-opcua-service-session": "2.139.0",
52
- "node-opcua-service-subscription": "2.139.0",
53
- "node-opcua-service-translate-browse-path": "2.139.0",
54
- "node-opcua-service-write": "2.139.0",
37
+ "node-opcua-pki": "4.18.0",
38
+ "node-opcua-pseudo-session": "2.141.0",
39
+ "node-opcua-schemas": "2.141.0",
40
+ "node-opcua-secure-channel": "2.141.0",
41
+ "node-opcua-service-browse": "2.141.0",
42
+ "node-opcua-service-call": "2.141.0",
43
+ "node-opcua-service-discovery": "2.141.0",
44
+ "node-opcua-service-endpoints": "2.141.0",
45
+ "node-opcua-service-filter": "2.141.0",
46
+ "node-opcua-service-history": "2.141.0",
47
+ "node-opcua-service-query": "2.141.0",
48
+ "node-opcua-service-read": "2.141.0",
49
+ "node-opcua-service-register-node": "2.141.0",
50
+ "node-opcua-service-secure-channel": "2.141.0",
51
+ "node-opcua-service-session": "2.141.0",
52
+ "node-opcua-service-subscription": "2.141.0",
53
+ "node-opcua-service-translate-browse-path": "2.141.0",
54
+ "node-opcua-service-write": "2.141.0",
55
55
  "node-opcua-status-code": "2.139.0",
56
- "node-opcua-types": "2.139.0",
56
+ "node-opcua-types": "2.141.0",
57
57
  "node-opcua-utils": "2.139.0",
58
58
  "node-opcua-variant": "2.139.0",
59
- "thenify": "^3.3.1"
59
+ "thenify-ex": "4.2.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@types/underscore": "^1.13.0",
63
63
  "dequeue": "^1.0.5",
64
- "node-opcua-address-space": "2.139.0",
64
+ "node-opcua-address-space": "2.141.0",
65
65
  "node-opcua-binary-stream": "2.139.0",
66
66
  "node-opcua-factory": "2.139.0",
67
67
  "node-opcua-leak-detector": "2.139.0",
@@ -88,7 +88,7 @@
88
88
  "internet of things"
89
89
  ],
90
90
  "homepage": "http://node-opcua.github.io/",
91
- "gitHead": "b7a01d31c7602d323e60a5f4a54428199a266f29",
91
+ "gitHead": "7467e145ce9ebad2c80cabb096189bda7714083d",
92
92
  "files": [
93
93
  "dist",
94
94
  "source"
@@ -66,9 +66,9 @@ ClientSessionImpl.prototype.acknowledgeCondition = function (
66
66
 
67
67
  // tslint:disable:no-var-requires
68
68
  // tslint:disable:max-line-length
69
- const thenify = require("thenify");
69
+ import { withCallback } from "thenify-ex";
70
70
  const opts = { multiArgs: false };
71
- ClientSessionImpl.prototype.addCommentCondition = thenify.withCallback(ClientSessionImpl.prototype.addCommentCondition, opts);
72
- ClientSessionImpl.prototype.findMethodId = thenify.withCallback(ClientSessionImpl.prototype.findMethodId, opts);
73
- ClientSessionImpl.prototype.confirmCondition = thenify.withCallback(ClientSessionImpl.prototype.confirmCondition, opts);
74
- ClientSessionImpl.prototype.acknowledgeCondition = thenify.withCallback(ClientSessionImpl.prototype.acknowledgeCondition, opts);
71
+ ClientSessionImpl.prototype.addCommentCondition = withCallback(ClientSessionImpl.prototype.addCommentCondition, opts);
72
+ ClientSessionImpl.prototype.findMethodId = withCallback(ClientSessionImpl.prototype.findMethodId, opts);
73
+ ClientSessionImpl.prototype.confirmCondition = withCallback(ClientSessionImpl.prototype.confirmCondition, opts);
74
+ ClientSessionImpl.prototype.acknowledgeCondition = withCallback(ClientSessionImpl.prototype.acknowledgeCondition, opts);
@@ -1791,12 +1791,12 @@ class TmpClient extends ClientBaseImpl {
1791
1791
 
1792
1792
  // tslint:disable:no-var-requires
1793
1793
  // tslint:disable:max-line-length
1794
- const thenify = require("thenify");
1795
- ClientBaseImpl.prototype.connect = thenify.withCallback(ClientBaseImpl.prototype.connect);
1796
- ClientBaseImpl.prototype.disconnect = thenify.withCallback(ClientBaseImpl.prototype.disconnect);
1797
- ClientBaseImpl.prototype.getEndpoints = thenify.withCallback(ClientBaseImpl.prototype.getEndpoints);
1798
- ClientBaseImpl.prototype.findServers = thenify.withCallback(ClientBaseImpl.prototype.findServers);
1799
- ClientBaseImpl.prototype.findServersOnNetwork = thenify.withCallback(ClientBaseImpl.prototype.findServersOnNetwork);
1794
+ import { withCallback } from "thenify-ex";
1795
+ ClientBaseImpl.prototype.connect = withCallback(ClientBaseImpl.prototype.connect);
1796
+ ClientBaseImpl.prototype.disconnect = withCallback(ClientBaseImpl.prototype.disconnect);
1797
+ ClientBaseImpl.prototype.getEndpoints = withCallback(ClientBaseImpl.prototype.getEndpoints);
1798
+ ClientBaseImpl.prototype.findServers = withCallback(ClientBaseImpl.prototype.findServers);
1799
+ ClientBaseImpl.prototype.findServersOnNetwork = withCallback(ClientBaseImpl.prototype.findServersOnNetwork);
1800
1800
 
1801
1801
  OPCUAClientBase.create = (options: OPCUAClientBaseOptions): OPCUAClientBase => {
1802
1802
  return new ClientBaseImpl(options);
@@ -215,14 +215,14 @@ Please investigate the code of the event handler function to fix the error.`
215
215
 
216
216
  // tslint:disable:no-var-requires
217
217
  // tslint:disable:max-line-length
218
- const thenify = require("thenify");
218
+ import { withCallback } from "thenify-ex";
219
219
  const opts = { multiArgs: false };
220
220
 
221
- ClientMonitoredItemGroupImpl.prototype.terminate = thenify.withCallback(ClientMonitoredItemGroupImpl.prototype.terminate);
222
- ClientMonitoredItemGroupImpl.prototype.setMonitoringMode = thenify.withCallback(
221
+ ClientMonitoredItemGroupImpl.prototype.terminate = withCallback(ClientMonitoredItemGroupImpl.prototype.terminate);
222
+ ClientMonitoredItemGroupImpl.prototype.setMonitoringMode = withCallback(
223
223
  ClientMonitoredItemGroupImpl.prototype.setMonitoringMode
224
224
  );
225
- ClientMonitoredItemGroupImpl.prototype.modify = thenify.withCallback(ClientMonitoredItemGroupImpl.prototype.modify);
225
+ ClientMonitoredItemGroupImpl.prototype.modify = withCallback(ClientMonitoredItemGroupImpl.prototype.modify);
226
226
 
227
227
  ClientMonitoredItemGroup.create = (
228
228
  subscription: ClientSubscription,
@@ -386,12 +386,12 @@ export class ClientMonitoredItemImpl extends EventEmitter implements ClientMonit
386
386
 
387
387
  // tslint:disable:no-var-requires
388
388
  // tslint:disable:max-line-length
389
- const thenify = require("thenify");
389
+ import { withCallback } from "thenify-ex";
390
390
  const opts = { multiArgs: false };
391
391
 
392
- ClientMonitoredItemImpl.prototype.terminate = thenify.withCallback(ClientMonitoredItemImpl.prototype.terminate);
393
- ClientMonitoredItemImpl.prototype.setMonitoringMode = thenify.withCallback(ClientMonitoredItemImpl.prototype.setMonitoringMode);
394
- ClientMonitoredItemImpl.prototype.modify = thenify.withCallback(ClientMonitoredItemImpl.prototype.modify);
392
+ ClientMonitoredItemImpl.prototype.terminate = withCallback(ClientMonitoredItemImpl.prototype.terminate);
393
+ ClientMonitoredItemImpl.prototype.setMonitoringMode = withCallback(ClientMonitoredItemImpl.prototype.setMonitoringMode);
394
+ ClientMonitoredItemImpl.prototype.modify = withCallback(ClientMonitoredItemImpl.prototype.modify);
395
395
 
396
396
  ClientMonitoredItem.create = (
397
397
  subscription: ClientSubscription,
@@ -1208,9 +1208,11 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession, Re
1208
1208
  }
1209
1209
 
1210
1210
  // perform ExtensionObject resolution
1211
- promoteOpaqueStructureWithCallback(this, response.results!, () => {
1211
+ promoteOpaqueStructure(this, response.results!).then(() => {
1212
1212
  response.results = response.results || /* istanbul ignore next */ [];
1213
- return callback(null, isArray ? response.results : response.results[0]);
1213
+ callback(null, isArray ? response.results : response.results[0]);
1214
+ }).catch((err) => {
1215
+ callback(err);
1214
1216
  });
1215
1217
  });
1216
1218
  }
@@ -1708,8 +1710,10 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession, Re
1708
1710
  }
1709
1711
  response.results = response.results || [];
1710
1712
 
1711
- promoteOpaqueStructure3WithCallback(this, response.results, () => {
1713
+ promoteOpaqueStructureForCall(this, response.results).then(() => {
1712
1714
  callback(null, isArray ? response.results : response.results![0]);
1715
+ }).catch((err) => {
1716
+ callback(err);
1713
1717
  });
1714
1718
  });
1715
1719
  }
@@ -2145,13 +2149,7 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession, Re
2145
2149
  }
2146
2150
  }
2147
2151
 
2148
- type promoteOpaqueStructure3WithCallbackFunc = (
2149
- session: IBasicSessionAsync2,
2150
- callMethodResults: CallMethodResult[],
2151
- callback: ErrorCallback
2152
- ) => void;
2153
-
2154
- async function promoteOpaqueStructure2(session: IBasicSessionAsync2, callMethodResult: CallMethodResult): Promise<void> {
2152
+ async function promoteOpaqueStructureForCallMethodResult(session: IBasicSessionAsync2, callMethodResult: CallMethodResult): Promise<void> {
2155
2153
  if (!callMethodResult || !callMethodResult.outputArguments || callMethodResult.outputArguments.length === 0) {
2156
2154
  return;
2157
2155
  }
@@ -2173,61 +2171,58 @@ function countOpaqueStructures(callMethodResults: CallMethodResult[]): number {
2173
2171
  }, 0);
2174
2172
  return opaqueStructureCount;
2175
2173
  }
2176
- async function promoteOpaqueStructure3(session: IBasicSessionAsync2, callMethodResults: CallMethodResult[]): Promise<void> {
2174
+
2175
+ async function promoteOpaqueStructureForCall(session: IBasicSessionAsync2, callMethodResults: CallMethodResult[]): Promise<void> {
2177
2176
  const opaqueStructureCount = countOpaqueStructures(callMethodResults);
2178
2177
  if (0 === opaqueStructureCount) return;
2179
2178
 
2180
2179
  // construct dataTypeManager if not already present
2181
2180
  await getExtraDataTypeManager(session);
2182
2181
 
2183
- const promises: Promise<void>[] = callMethodResults.map(async (x: CallMethodResult) => promoteOpaqueStructure2(session, x));
2182
+ const promises: Promise<void>[] = callMethodResults.map(async (x: CallMethodResult) => promoteOpaqueStructureForCallMethodResult(session, x));
2184
2183
  await Promise.all(promises);
2185
2184
  }
2186
2185
 
2187
2186
  // tslint:disable:no-var-requires
2188
2187
  // tslint:disable:max-line-length
2189
- const thenify = require("thenify");
2188
+ import { withCallback } from "thenify-ex";
2190
2189
  const opts = { multiArgs: false };
2191
2190
 
2192
- const promoteOpaqueStructureWithCallback = callbackify(promoteOpaqueStructure);
2193
- const promoteOpaqueStructure3WithCallback = callbackify(promoteOpaqueStructure3) as promoteOpaqueStructure3WithCallbackFunc;
2194
- // ClientSessionImpl.prototype.constructExtensionObject = callbackify(ClientSessionImpl.prototype.constructExtensionObject) as any;
2195
-
2196
- ClientSessionImpl.prototype.browse = thenify.withCallback(ClientSessionImpl.prototype.browse, opts);
2197
- ClientSessionImpl.prototype.browseNext = thenify.withCallback(ClientSessionImpl.prototype.browseNext, opts);
2198
- ClientSessionImpl.prototype.readVariableValue = thenify.withCallback(ClientSessionImpl.prototype.readVariableValue, opts);
2199
- ClientSessionImpl.prototype.readHistoryValue = thenify.withCallback(ClientSessionImpl.prototype.readHistoryValue, opts);
2200
- ClientSessionImpl.prototype.readAggregateValue = thenify.withCallback(ClientSessionImpl.prototype.readAggregateValue, opts);
2201
- ClientSessionImpl.prototype.historyRead = thenify.withCallback(ClientSessionImpl.prototype.historyRead, opts);
2202
- ClientSessionImpl.prototype.write = thenify.withCallback(ClientSessionImpl.prototype.write, opts);
2203
- ClientSessionImpl.prototype.writeSingleNode = thenify.withCallback(ClientSessionImpl.prototype.writeSingleNode, opts);
2204
- ClientSessionImpl.prototype.readAllAttributes = thenify.withCallback(ClientSessionImpl.prototype.readAllAttributes, opts);
2205
- ClientSessionImpl.prototype.read = thenify.withCallback(ClientSessionImpl.prototype.read, opts);
2206
- ClientSessionImpl.prototype.createSubscription = thenify.withCallback(ClientSessionImpl.prototype.createSubscription, opts);
2207
- ClientSessionImpl.prototype.createSubscription2 = thenify.withCallback(ClientSessionImpl.prototype.createSubscription2, opts);
2208
- ClientSessionImpl.prototype.deleteSubscriptions = thenify.withCallback(ClientSessionImpl.prototype.deleteSubscriptions, opts);
2209
- ClientSessionImpl.prototype.transferSubscriptions = thenify.withCallback(ClientSessionImpl.prototype.transferSubscriptions, opts);
2210
- ClientSessionImpl.prototype.createMonitoredItems = thenify.withCallback(ClientSessionImpl.prototype.createMonitoredItems, opts);
2211
- ClientSessionImpl.prototype.modifyMonitoredItems = thenify.withCallback(ClientSessionImpl.prototype.modifyMonitoredItems, opts);
2212
- ClientSessionImpl.prototype.modifySubscription = thenify.withCallback(ClientSessionImpl.prototype.modifySubscription, opts);
2213
- ClientSessionImpl.prototype.setTriggering = thenify.withCallback(ClientSessionImpl.prototype.setTriggering, opts);
2214
- ClientSessionImpl.prototype.setMonitoringMode = thenify.withCallback(ClientSessionImpl.prototype.setMonitoringMode, opts);
2215
- ClientSessionImpl.prototype.publish = thenify.withCallback(ClientSessionImpl.prototype.publish, opts);
2216
- ClientSessionImpl.prototype.republish = thenify.withCallback(ClientSessionImpl.prototype.republish, opts);
2217
- ClientSessionImpl.prototype.deleteMonitoredItems = thenify.withCallback(ClientSessionImpl.prototype.deleteMonitoredItems, opts);
2218
- ClientSessionImpl.prototype.setPublishingMode = thenify.withCallback(ClientSessionImpl.prototype.setPublishingMode, opts);
2219
- ClientSessionImpl.prototype.translateBrowsePath = thenify.withCallback(ClientSessionImpl.prototype.translateBrowsePath, opts);
2220
- ClientSessionImpl.prototype.performMessageTransaction = thenify.withCallback(
2191
+ ClientSessionImpl.prototype.browse = withCallback(ClientSessionImpl.prototype.browse, opts);
2192
+ ClientSessionImpl.prototype.browseNext = withCallback(ClientSessionImpl.prototype.browseNext, opts);
2193
+ ClientSessionImpl.prototype.readVariableValue = withCallback(ClientSessionImpl.prototype.readVariableValue, opts);
2194
+ ClientSessionImpl.prototype.readHistoryValue = withCallback(ClientSessionImpl.prototype.readHistoryValue, opts);
2195
+ ClientSessionImpl.prototype.readAggregateValue = withCallback(ClientSessionImpl.prototype.readAggregateValue, opts);
2196
+ ClientSessionImpl.prototype.historyRead = withCallback(ClientSessionImpl.prototype.historyRead, opts);
2197
+ ClientSessionImpl.prototype.write = withCallback(ClientSessionImpl.prototype.write, opts);
2198
+ ClientSessionImpl.prototype.writeSingleNode = withCallback(ClientSessionImpl.prototype.writeSingleNode, opts);
2199
+ ClientSessionImpl.prototype.readAllAttributes = withCallback(ClientSessionImpl.prototype.readAllAttributes, opts);
2200
+ ClientSessionImpl.prototype.read = withCallback(ClientSessionImpl.prototype.read, opts);
2201
+ ClientSessionImpl.prototype.createSubscription = withCallback(ClientSessionImpl.prototype.createSubscription, opts);
2202
+ ClientSessionImpl.prototype.createSubscription2 = withCallback(ClientSessionImpl.prototype.createSubscription2, opts);
2203
+ ClientSessionImpl.prototype.deleteSubscriptions = withCallback(ClientSessionImpl.prototype.deleteSubscriptions, opts);
2204
+ ClientSessionImpl.prototype.transferSubscriptions = withCallback(ClientSessionImpl.prototype.transferSubscriptions, opts);
2205
+ ClientSessionImpl.prototype.createMonitoredItems = withCallback(ClientSessionImpl.prototype.createMonitoredItems, opts);
2206
+ ClientSessionImpl.prototype.modifyMonitoredItems = withCallback(ClientSessionImpl.prototype.modifyMonitoredItems, opts);
2207
+ ClientSessionImpl.prototype.modifySubscription = withCallback(ClientSessionImpl.prototype.modifySubscription, opts);
2208
+ ClientSessionImpl.prototype.setTriggering = withCallback(ClientSessionImpl.prototype.setTriggering, opts);
2209
+ ClientSessionImpl.prototype.setMonitoringMode = withCallback(ClientSessionImpl.prototype.setMonitoringMode, opts);
2210
+ ClientSessionImpl.prototype.publish = withCallback(ClientSessionImpl.prototype.publish, opts);
2211
+ ClientSessionImpl.prototype.republish = withCallback(ClientSessionImpl.prototype.republish, opts);
2212
+ ClientSessionImpl.prototype.deleteMonitoredItems = withCallback(ClientSessionImpl.prototype.deleteMonitoredItems, opts);
2213
+ ClientSessionImpl.prototype.setPublishingMode = withCallback(ClientSessionImpl.prototype.setPublishingMode, opts);
2214
+ ClientSessionImpl.prototype.translateBrowsePath = withCallback(ClientSessionImpl.prototype.translateBrowsePath, opts);
2215
+ ClientSessionImpl.prototype.performMessageTransaction = withCallback(
2221
2216
  ClientSessionImpl.prototype.performMessageTransaction,
2222
2217
  opts
2223
2218
  );
2224
- ClientSessionImpl.prototype.close = thenify.withCallback(ClientSessionImpl.prototype.close, opts);
2225
- ClientSessionImpl.prototype.call = thenify.withCallback(ClientSessionImpl.prototype.call, opts);
2226
- ClientSessionImpl.prototype.getMonitoredItems = thenify.withCallback(ClientSessionImpl.prototype.getMonitoredItems, opts);
2227
- ClientSessionImpl.prototype.getArgumentDefinition = thenify.withCallback(ClientSessionImpl.prototype.getArgumentDefinition, opts);
2228
- ClientSessionImpl.prototype.queryFirst = thenify.withCallback(ClientSessionImpl.prototype.queryFirst, opts);
2229
- ClientSessionImpl.prototype.registerNodes = thenify.withCallback(ClientSessionImpl.prototype.registerNodes, opts);
2230
- ClientSessionImpl.prototype.unregisterNodes = thenify.withCallback(ClientSessionImpl.prototype.unregisterNodes, opts);
2231
- ClientSessionImpl.prototype.readNamespaceArray = thenify.withCallback(ClientSessionImpl.prototype.readNamespaceArray, opts);
2232
- ClientSessionImpl.prototype.getBuiltInDataType = thenify.withCallback(ClientSessionImpl.prototype.getBuiltInDataType, opts);
2233
- ClientSessionImpl.prototype.changeUser = thenify.withCallback(ClientSessionImpl.prototype.changeUser, opts);
2219
+ ClientSessionImpl.prototype.close = withCallback(ClientSessionImpl.prototype.close, opts);
2220
+ ClientSessionImpl.prototype.call = withCallback(ClientSessionImpl.prototype.call, opts);
2221
+ ClientSessionImpl.prototype.getMonitoredItems = withCallback(ClientSessionImpl.prototype.getMonitoredItems, opts);
2222
+ ClientSessionImpl.prototype.getArgumentDefinition = withCallback(ClientSessionImpl.prototype.getArgumentDefinition, opts);
2223
+ ClientSessionImpl.prototype.queryFirst = withCallback(ClientSessionImpl.prototype.queryFirst, opts);
2224
+ ClientSessionImpl.prototype.registerNodes = withCallback(ClientSessionImpl.prototype.registerNodes, opts);
2225
+ ClientSessionImpl.prototype.unregisterNodes = withCallback(ClientSessionImpl.prototype.unregisterNodes, opts);
2226
+ ClientSessionImpl.prototype.readNamespaceArray = withCallback(ClientSessionImpl.prototype.readNamespaceArray, opts);
2227
+ ClientSessionImpl.prototype.getBuiltInDataType = withCallback(ClientSessionImpl.prototype.getBuiltInDataType, opts);
2228
+ ClientSessionImpl.prototype.changeUser = withCallback(ClientSessionImpl.prototype.changeUser, opts);
@@ -863,16 +863,16 @@ export function ClientMonitoredItem_create(
863
863
  }
864
864
  // tslint:disable:no-var-requires
865
865
  // tslint:disable:max-line-length
866
- const thenify = require("thenify");
866
+ import { withCallback } from "thenify-ex";
867
867
  const opts = { multiArgs: false };
868
868
 
869
- ClientSubscriptionImpl.prototype.setPublishingMode = thenify.withCallback(ClientSubscriptionImpl.prototype.setPublishingMode);
870
- ClientSubscriptionImpl.prototype.monitor = thenify.withCallback(ClientSubscriptionImpl.prototype.monitor);
871
- ClientSubscriptionImpl.prototype.monitorItems = thenify.withCallback(ClientSubscriptionImpl.prototype.monitorItems);
872
- ClientSubscriptionImpl.prototype.setTriggering = thenify.withCallback(ClientSubscriptionImpl.prototype.setTriggering);
873
- ClientSubscriptionImpl.prototype.modify = thenify.withCallback(ClientSubscriptionImpl.prototype.modify);
874
- ClientSubscriptionImpl.prototype.terminate = thenify.withCallback(ClientSubscriptionImpl.prototype.terminate);
875
- ClientSubscriptionImpl.prototype.getMonitoredItems = thenify.withCallback(ClientSubscriptionImpl.prototype.getMonitoredItems);
869
+ ClientSubscriptionImpl.prototype.setPublishingMode = withCallback(ClientSubscriptionImpl.prototype.setPublishingMode);
870
+ ClientSubscriptionImpl.prototype.monitor = withCallback(ClientSubscriptionImpl.prototype.monitor);
871
+ ClientSubscriptionImpl.prototype.monitorItems = withCallback(ClientSubscriptionImpl.prototype.monitorItems);
872
+ ClientSubscriptionImpl.prototype.setTriggering = withCallback(ClientSubscriptionImpl.prototype.setTriggering);
873
+ ClientSubscriptionImpl.prototype.modify = withCallback(ClientSubscriptionImpl.prototype.modify);
874
+ ClientSubscriptionImpl.prototype.terminate = withCallback(ClientSubscriptionImpl.prototype.terminate);
875
+ ClientSubscriptionImpl.prototype.getMonitoredItems = withCallback(ClientSubscriptionImpl.prototype.getMonitoredItems);
876
876
 
877
877
  ClientSubscription.create = (clientSession: ClientSession, options: ClientSubscriptionOptions) => {
878
878
  return new ClientSubscriptionImpl(clientSession, options);
@@ -518,7 +518,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
518
518
  public changeSessionIdentity(session: ClientSession, userIdentityInfo: UserIdentityInfo, callback: CallbackT<StatusCode>): void;
519
519
  public changeSessionIdentity(...args: any[]): any {
520
520
  warningLog(
521
- "[NODE-OPCUA-W27] OPCUAClient.changeSessionIdentity(session,userIdentity) is deprecated use ClientSession.changeUser(userIdentity) instead"
521
+ "[NODE-OPCUA-W34] OPCUAClient.changeSessionIdentity(session,userIdentity) is deprecated use ClientSession.changeUser(userIdentity) instead"
522
522
  );
523
523
  const session = args[0] as ClientSessionImpl;
524
524
  const userIdentityInfo = args[1] as UserIdentityInfo;
@@ -583,7 +583,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
583
583
  const session = await client.createSession2(userIdentity);
584
584
 
585
585
  const oldClose = session.close as any;
586
- (session as any).close = thenify.withCallback((...args: any[]): any => {
586
+ (session as any).close = withCallback((...args: any[]): any => {
587
587
  if (args.length === 1) {
588
588
  return session.close(true, args[0]);
589
589
  }
@@ -612,12 +612,12 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
612
612
  const endpointUrl: string = typeof connectionPoint === "string" ? connectionPoint : connectionPoint.endpointUrl;
613
613
  const userIdentity: UserIdentityInfo =
614
614
  typeof connectionPoint === "string" ? { type: UserTokenType.Anonymous } : connectionPoint.userIdentity;
615
-
616
- await this.connect(endpointUrl);
617
-
615
+
618
616
  this.on("backoff", (count, delay) => {
619
617
  warningLog("cannot connect to ", endpointUrl, "attempt #" + count, " retrying in ", delay);
620
618
  });
619
+
620
+ await this.connect(endpointUrl);
621
621
 
622
622
  try {
623
623
  const session = await this.createSession2(userIdentity);
@@ -1214,7 +1214,7 @@ export class OPCUAClientImpl extends ClientBaseImpl implements OPCUAClient {
1214
1214
 
1215
1215
  // tslint:disable:no-var-requires
1216
1216
  // tslint:disable:max-line-length
1217
- const thenify = require("thenify");
1217
+ import { withCallback } from "thenify-ex";
1218
1218
  /**
1219
1219
 
1220
1220
  *
@@ -1232,15 +1232,15 @@ const thenify = require("thenify");
1232
1232
  * const session = client.createSession(userIdentityInfo);
1233
1233
  *
1234
1234
  */
1235
- OPCUAClientImpl.prototype.createSession = thenify.withCallback(OPCUAClientImpl.prototype.createSession);
1236
- OPCUAClientImpl.prototype.createSession2 = thenify.withCallback(OPCUAClientImpl.prototype.createSession2);
1235
+ OPCUAClientImpl.prototype.createSession = withCallback(OPCUAClientImpl.prototype.createSession);
1236
+ OPCUAClientImpl.prototype.createSession2 = withCallback(OPCUAClientImpl.prototype.createSession2);
1237
1237
  /**
1238
1238
  */
1239
- OPCUAClientImpl.prototype.changeSessionIdentity = thenify.withCallback(OPCUAClientImpl.prototype.changeSessionIdentity);
1239
+ OPCUAClientImpl.prototype.changeSessionIdentity = withCallback(OPCUAClientImpl.prototype.changeSessionIdentity);
1240
1240
  /**
1241
1241
  * @example
1242
1242
  * const session = await client.createSession();
1243
1243
  * await client.closeSession(session);
1244
1244
  */
1245
- OPCUAClientImpl.prototype.closeSession = thenify.withCallback(OPCUAClientImpl.prototype.closeSession);
1246
- OPCUAClientImpl.prototype.reactivateSession = thenify.withCallback(OPCUAClientImpl.prototype.reactivateSession);
1245
+ OPCUAClientImpl.prototype.closeSession = withCallback(OPCUAClientImpl.prototype.closeSession);
1246
+ OPCUAClientImpl.prototype.reactivateSession = withCallback(OPCUAClientImpl.prototype.reactivateSession);
@@ -91,6 +91,6 @@ export function findServersOnNetwork(
91
91
  }
92
92
 
93
93
  // tslint:disable:no-var-requires
94
- const thenify = require("thenify");
95
- (module.exports as any).findServersOnNetwork = thenify.withCallback((module.exports as any).findServersOnNetwork);
96
- (module.exports as any).findServers = thenify.withCallback((module.exports as any).findServers);
94
+ import { withCallback } from "thenify-ex";
95
+ (module.exports as any).findServersOnNetwork = withCallback((module.exports as any).findServersOnNetwork);
96
+ (module.exports as any).findServers = withCallback((module.exports as any).findServers);
@@ -126,9 +126,9 @@ export function readHistoryServerCapabilities(
126
126
  });
127
127
  }
128
128
  // tslint:disable:no-var-requires
129
- const thenify = require("thenify");
129
+ import { withCallback } from "thenify-ex";
130
130
  const opts = { multiArgs: false };
131
- (module as any).exports.readHistoryServerCapabilities = thenify.withCallback(
131
+ (module as any).exports.readHistoryServerCapabilities = withCallback(
132
132
  (module as any).exports.readHistoryServerCapabilities,
133
133
  opts
134
134
  );