node-opcua-samples 2.140.0 → 2.142.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.
- package/bin/interactive_client.js +10 -19
- package/package.json +10 -11
|
@@ -12,8 +12,6 @@ const chalk = require("chalk");
|
|
|
12
12
|
const treeify = require("treeify");
|
|
13
13
|
const { sprintf } = require("sprintf-js");
|
|
14
14
|
|
|
15
|
-
const _ = require("underscore");
|
|
16
|
-
|
|
17
15
|
const { DataType, OPCUAClient, makeNodeId, coerceNodeId, ObjectIds, StatusCodes, parseEndpointUrl } = require("node-opcua");
|
|
18
16
|
const { UAProxyManager } = require("node-opcua-client-proxy");
|
|
19
17
|
const { analyze_object_binary_encoding } = require("node-opcua-packet-analyzer");
|
|
@@ -109,7 +107,7 @@ rl.setPrompt(the_prompt);
|
|
|
109
107
|
rl.prompt();
|
|
110
108
|
|
|
111
109
|
function save_history(callback) {
|
|
112
|
-
const history_uniq =
|
|
110
|
+
const history_uniq = [ ... new Set(rl.history)];
|
|
113
111
|
fs.writeFileSync(history_file, history_uniq.join("\n"), "utf-8");
|
|
114
112
|
callback();
|
|
115
113
|
}
|
|
@@ -224,21 +222,14 @@ function moveToChild(browseName) {
|
|
|
224
222
|
setCurrentNode(child);
|
|
225
223
|
}
|
|
226
224
|
|
|
227
|
-
function
|
|
225
|
+
async function getRootFolder() {
|
|
228
226
|
if (!rootFolder) {
|
|
229
227
|
rl.pause();
|
|
230
|
-
proxyManager.getObject(makeNodeId(ObjectIds.RootFolder)
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
rl.resume();
|
|
236
|
-
}
|
|
237
|
-
callback();
|
|
238
|
-
});
|
|
239
|
-
} else {
|
|
240
|
-
setCurrentNode(rootFolder);
|
|
241
|
-
callback();
|
|
228
|
+
await proxyManager.getObject(makeNodeId(ObjectIds.RootFolder));
|
|
229
|
+
rootFolder = data;
|
|
230
|
+
assert(rootFolder, "expecting rootFolder");
|
|
231
|
+
setRootNode(rootFolder);
|
|
232
|
+
rl.resume();
|
|
242
233
|
}
|
|
243
234
|
}
|
|
244
235
|
|
|
@@ -548,7 +539,7 @@ function process_line(line) {
|
|
|
548
539
|
|
|
549
540
|
case "rootFolder":
|
|
550
541
|
apply_on_valid_session(cmd, function (the_session, callback) {
|
|
551
|
-
|
|
542
|
+
getRootFolder().then(()=>callback()).catch((err)=>callback(err));
|
|
552
543
|
});
|
|
553
544
|
break;
|
|
554
545
|
|
|
@@ -566,7 +557,7 @@ function process_line(line) {
|
|
|
566
557
|
endTime = startTime;
|
|
567
558
|
startTime = tmp;
|
|
568
559
|
}
|
|
569
|
-
nodes = nodes.map((n)=>coerceNodeId(n));
|
|
560
|
+
nodes = nodes.map((n) => coerceNodeId(n));
|
|
570
561
|
|
|
571
562
|
the_session.readHistoryValue(nodes, startTime, endTime, function (err, historyReadResults) {
|
|
572
563
|
if (err) {
|
|
@@ -593,7 +584,7 @@ function process_line(line) {
|
|
|
593
584
|
case "read":
|
|
594
585
|
apply_on_valid_session(cmd, function (the_session, callback) {
|
|
595
586
|
nodes = [args[1]];
|
|
596
|
-
nodes = nodes.map((n)=>coerceNodeId(n));
|
|
587
|
+
nodes = nodes.map((n) => coerceNodeId(n));
|
|
597
588
|
|
|
598
589
|
the_session.readVariableValue(nodes, function (err, dataValues) {
|
|
599
590
|
if (err) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-samples",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.142.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module samples",
|
|
5
5
|
"bin": {
|
|
6
6
|
"simple_client": "./dist/simple_client_ts.js",
|
|
@@ -24,20 +24,19 @@
|
|
|
24
24
|
"easy-table": "^1.2.0",
|
|
25
25
|
"env-paths": "2.2.1",
|
|
26
26
|
"exit": "^0.1.2",
|
|
27
|
-
"node-opcua": "2.
|
|
28
|
-
"node-opcua-address-space": "2.
|
|
29
|
-
"node-opcua-address-space-for-conformance-testing": "2.
|
|
27
|
+
"node-opcua": "2.142.0",
|
|
28
|
+
"node-opcua-address-space": "2.142.0",
|
|
29
|
+
"node-opcua-address-space-for-conformance-testing": "2.142.0",
|
|
30
30
|
"node-opcua-assert": "2.139.0",
|
|
31
|
-
"node-opcua-client-proxy": "2.
|
|
32
|
-
"node-opcua-crypto": "4.
|
|
31
|
+
"node-opcua-client-proxy": "2.142.0",
|
|
32
|
+
"node-opcua-crypto": "4.16.0",
|
|
33
33
|
"node-opcua-packet-analyzer": "2.139.0",
|
|
34
|
-
"node-opcua-pki": "
|
|
35
|
-
"node-opcua-server-configuration": "2.
|
|
34
|
+
"node-opcua-pki": "5.1.0",
|
|
35
|
+
"node-opcua-server-configuration": "2.142.0",
|
|
36
36
|
"node-opcua-utils": "2.139.0",
|
|
37
|
-
"node-opcua-vendor-diagnostic": "2.
|
|
37
|
+
"node-opcua-vendor-diagnostic": "2.142.0",
|
|
38
38
|
"sprintf-js": "^1.1.3",
|
|
39
39
|
"treeify": "^1.1.0",
|
|
40
|
-
"underscore": "^1.13.7",
|
|
41
40
|
"yargs": "15.4.1"
|
|
42
41
|
},
|
|
43
42
|
"author": "Etienne Rossignon",
|
|
@@ -55,7 +54,7 @@
|
|
|
55
54
|
"internet of things"
|
|
56
55
|
],
|
|
57
56
|
"homepage": "http://node-opcua.github.io/",
|
|
58
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "50cfa07779d4c07b299176ac9c27527fcd97d079",
|
|
59
58
|
"files": [
|
|
60
59
|
"dist"
|
|
61
60
|
]
|