node-opcua-service-call 2.55.0 → 2.59.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/LICENSE +20 -20
- package/deprecated_generate.js +13 -13
- package/dist/imports.js +1 -1
- package/dist/imports.js.map +1 -1
- package/package.json +11 -9
- package/source/imports.ts +50 -54
- package/source/index.ts +36 -36
package/LICENSE
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
The MIT License (MIT)
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
-
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
-
the Software without restriction, including without limitation the rights to
|
|
8
|
-
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
-
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
-
subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
-
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
-
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
-
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2014-2021 Etienne Rossignon
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/deprecated_generate.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
const generator = require("node-opcua-generator");
|
|
2
|
-
require("node-opcua-basic-types");
|
|
3
|
-
require("node-opcua-variant");
|
|
4
|
-
|
|
5
|
-
generator.registerObject("Argument");
|
|
6
|
-
// Call service
|
|
7
|
-
generator.registerObject("CallMethodRequest");
|
|
8
|
-
generator.registerObject("CallMethodResult");
|
|
9
|
-
generator.registerObject("CallRequest");
|
|
10
|
-
generator.registerObject("CallResponse");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
const generator = require("node-opcua-generator");
|
|
2
|
+
require("node-opcua-basic-types");
|
|
3
|
+
require("node-opcua-variant");
|
|
4
|
+
|
|
5
|
+
generator.registerObject("Argument");
|
|
6
|
+
// Call service
|
|
7
|
+
generator.registerObject("CallMethodRequest");
|
|
8
|
+
generator.registerObject("CallMethodResult");
|
|
9
|
+
generator.registerObject("CallRequest");
|
|
10
|
+
generator.registerObject("CallResponse");
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
package/dist/imports.js
CHANGED
|
@@ -26,7 +26,7 @@ function constructHookArgument(options) {
|
|
|
26
26
|
// nothing
|
|
27
27
|
}
|
|
28
28
|
else if (dataType.value) {
|
|
29
|
-
(0, node_opcua_assert_1.assert)(
|
|
29
|
+
(0, node_opcua_assert_1.assert)(Object.prototype.hasOwnProperty.call(dataType, "namespace"));
|
|
30
30
|
dataType = (0, node_opcua_nodeid_1.coerceNodeId)(dataType.value, dataType.namespace);
|
|
31
31
|
}
|
|
32
32
|
else {
|
package/dist/imports.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../source/imports.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,yDAAwE;AACxE,
|
|
1
|
+
{"version":3,"file":"imports.js","sourceRoot":"","sources":["../source/imports.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAC3C,yDAAwE;AACxE,uDAA4C;AAC5C,2DAA8C;AAE9C,qDAU0B;AATtB,4GAAA,QAAQ,OAAA;AAER,qHAAA,iBAAiB,OAAA;AAEjB,+GAAA,WAAW,OAAA;AAEX,oHAAA,gBAAgB,OAAA;AAEhB,gHAAA,YAAY,OAAA;AAGhB,GAAG;AACH,SAAS,qBAAqB,CAAC,OAAsE;IACjG,OAAO,GAAG,OAAO,IAAI,EAAE,QAAQ,EAAE,6BAAQ,CAAC,IAAI,EAAE,CAAC;IAEjD,IAAI,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAChC,IAAI,QAAQ,EAAE;QACV,IAAI,OAAO,QAAQ,KAAK,QAAQ,EAAE;YAC9B,QAAQ,GAAG,IAAA,iCAAa,EAAC,QAAQ,CAAC,CAAC;SACtC;aAAM,IAAI,QAAQ,YAAY,0BAAM,EAAE;YACnC,UAAU;SACb;aAAM,IAAI,QAAQ,CAAC,KAAK,EAAE;YACvB,IAAA,0BAAM,EAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;YACpE,QAAQ,GAAG,IAAA,gCAAY,EAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,SAAS,CAAC,CAAC;SAC/D;aAAM;YACH,IAAA,0BAAM,EAAC,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC;SACxC;QACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;KAC/B;IACD,IAAI,OAAO,CAAC,SAAS,KAAK,SAAS,EAAE;QACjC,OAAO,CAAC,SAAS,GAAG,CAAC,CAAC,CAAC;KAC1B;IACD,yEAAyE;IACzE,IAAI,OAAO,CAAC,SAAS,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;QACrD,OAAO,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC;KACjC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,2BAAQ,CAAC,MAAM,CAAC,aAAa,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-service-call",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.59.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -service-call",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "mocha",
|
|
7
|
+
"lint": "eslint source test",
|
|
8
|
+
"format": "prettier --write source test",
|
|
7
9
|
"clean": "node -e \"require('rimraf').sync('dist');\"",
|
|
8
10
|
"build": "tsc -b"
|
|
9
11
|
},
|
|
@@ -11,17 +13,17 @@
|
|
|
11
13
|
"types": "./dist/index.d.ts",
|
|
12
14
|
"dependencies": {
|
|
13
15
|
"node-opcua-assert": "2.55.0",
|
|
14
|
-
"node-opcua-basic-types": "2.
|
|
16
|
+
"node-opcua-basic-types": "2.57.0",
|
|
15
17
|
"node-opcua-binary-stream": "2.55.0",
|
|
16
|
-
"node-opcua-factory": "2.
|
|
18
|
+
"node-opcua-factory": "2.57.0",
|
|
17
19
|
"node-opcua-nodeid": "2.55.0",
|
|
18
|
-
"node-opcua-service-secure-channel": "2.
|
|
19
|
-
"node-opcua-types": "2.
|
|
20
|
-
"node-opcua-variant": "2.
|
|
20
|
+
"node-opcua-service-secure-channel": "2.59.0",
|
|
21
|
+
"node-opcua-types": "2.59.0",
|
|
22
|
+
"node-opcua-variant": "2.59.0"
|
|
21
23
|
},
|
|
22
24
|
"devDependencies": {
|
|
23
|
-
"node-opcua-packet-analyzer": "2.
|
|
24
|
-
"node-opcua-status-code": "2.
|
|
25
|
+
"node-opcua-packet-analyzer": "2.57.0",
|
|
26
|
+
"node-opcua-status-code": "2.56.0",
|
|
25
27
|
"should": "^13.2.3"
|
|
26
28
|
},
|
|
27
29
|
"author": "Etienne Rossignon",
|
|
@@ -39,5 +41,5 @@
|
|
|
39
41
|
"internet of things"
|
|
40
42
|
],
|
|
41
43
|
"homepage": "http://node-opcua.github.io/",
|
|
42
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "ea10265745d3d4b8af249a4e13288ad71232706f"
|
|
43
45
|
}
|
package/source/imports.ts
CHANGED
|
@@ -1,54 +1,50 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-service-browse
|
|
3
|
-
*/
|
|
4
|
-
import { assert } from "node-opcua-assert";
|
|
5
|
-
import { coerceNodeId, NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} else
|
|
35
|
-
assert(dataType
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
options.
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
Argument.schema.constructHook = constructHookArgument;
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-service-browse
|
|
3
|
+
*/
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { coerceNodeId, NodeId, resolveNodeId } from "node-opcua-nodeid";
|
|
6
|
+
import { Argument } from "node-opcua-types";
|
|
7
|
+
import { DataType } from "node-opcua-variant";
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
Argument,
|
|
11
|
+
ArgumentOptions,
|
|
12
|
+
CallMethodRequest,
|
|
13
|
+
CallMethodRequestOptions,
|
|
14
|
+
CallRequest,
|
|
15
|
+
CallRequestOptions,
|
|
16
|
+
CallMethodResult,
|
|
17
|
+
CallMethodResultOptions,
|
|
18
|
+
CallResponse
|
|
19
|
+
} from "node-opcua-types";
|
|
20
|
+
|
|
21
|
+
///
|
|
22
|
+
function constructHookArgument(options?: { dataType: any; valueRank?: number; arrayDimensions?: any }): any {
|
|
23
|
+
options = options || { dataType: DataType.Null };
|
|
24
|
+
|
|
25
|
+
let dataType = options.dataType;
|
|
26
|
+
if (dataType) {
|
|
27
|
+
if (typeof dataType === "string") {
|
|
28
|
+
dataType = resolveNodeId(dataType);
|
|
29
|
+
} else if (dataType instanceof NodeId) {
|
|
30
|
+
// nothing
|
|
31
|
+
} else if (dataType.value) {
|
|
32
|
+
assert(Object.prototype.hasOwnProperty.call(dataType, "namespace"));
|
|
33
|
+
dataType = coerceNodeId(dataType.value, dataType.namespace);
|
|
34
|
+
} else {
|
|
35
|
+
assert(typeof dataType === "number");
|
|
36
|
+
}
|
|
37
|
+
options.dataType = dataType;
|
|
38
|
+
}
|
|
39
|
+
if (options.valueRank === undefined) {
|
|
40
|
+
options.valueRank = -1;
|
|
41
|
+
}
|
|
42
|
+
// fix missing ArrayDimension (The value is an array with one dimension.)
|
|
43
|
+
if (options.valueRank !== 1 || !options.arrayDimensions) {
|
|
44
|
+
options.arrayDimensions = [0];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return options;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
Argument.schema.constructHook = constructHookArgument;
|
package/source/index.ts
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-service-browse
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* This Service is used to call (invoke) a list of Methods. Each method call is invoked within the context
|
|
7
|
-
* of an existing Session. If the Session is terminated, the results of the method’s execution cannot be
|
|
8
|
-
* returned to the Client and are discarded. This is independent of the task actually performed at the
|
|
9
|
-
* Server.
|
|
10
|
-
* This Service provides for passing input and output arguments to/from a method. These arguments
|
|
11
|
-
* are defined by Properties of the method.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
/*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* extract from OPCUA Specification Part 4 Release 1.02 page 61:
|
|
18
|
-
*
|
|
19
|
-
* 5.11 **Method Service Set**
|
|
20
|
-
*
|
|
21
|
-
* 5.11.1 Overview
|
|
22
|
-
* Methods represent the function calls of Objects. They are defined in Part 3. Methods are invoked
|
|
23
|
-
* and return only after completion (successful or unsuccessful). Execution times for methods may
|
|
24
|
-
* vary, depending on the function that they perform.
|
|
25
|
-
* The Method Service Set defines the means to invoke methods. A method shall be a component of an
|
|
26
|
-
* Object. Discovery is provided through the Browse and Query Services. Clients discover the methods
|
|
27
|
-
* supported by a Server by browsing for the owning Objects References that identify their supported
|
|
28
|
-
* methods.
|
|
29
|
-
* Because Methods may control some aspect of plant operations, method invocation may depend on
|
|
30
|
-
* environmental or other conditions. This may be especially true when attempting to re -invoke a
|
|
31
|
-
* method immediately after it has completed execution. Conditions that are required to invoke the
|
|
32
|
-
* method might not yet have returned to the state that permits the method to start again.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*/
|
|
36
|
-
export * from "./imports";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-service-browse
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* This Service is used to call (invoke) a list of Methods. Each method call is invoked within the context
|
|
7
|
+
* of an existing Session. If the Session is terminated, the results of the method’s execution cannot be
|
|
8
|
+
* returned to the Client and are discarded. This is independent of the task actually performed at the
|
|
9
|
+
* Server.
|
|
10
|
+
* This Service provides for passing input and output arguments to/from a method. These arguments
|
|
11
|
+
* are defined by Properties of the method.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
/*
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
* extract from OPCUA Specification Part 4 Release 1.02 page 61:
|
|
18
|
+
*
|
|
19
|
+
* 5.11 **Method Service Set**
|
|
20
|
+
*
|
|
21
|
+
* 5.11.1 Overview
|
|
22
|
+
* Methods represent the function calls of Objects. They are defined in Part 3. Methods are invoked
|
|
23
|
+
* and return only after completion (successful or unsuccessful). Execution times for methods may
|
|
24
|
+
* vary, depending on the function that they perform.
|
|
25
|
+
* The Method Service Set defines the means to invoke methods. A method shall be a component of an
|
|
26
|
+
* Object. Discovery is provided through the Browse and Query Services. Clients discover the methods
|
|
27
|
+
* supported by a Server by browsing for the owning Objects References that identify their supported
|
|
28
|
+
* methods.
|
|
29
|
+
* Because Methods may control some aspect of plant operations, method invocation may depend on
|
|
30
|
+
* environmental or other conditions. This may be especially true when attempting to re -invoke a
|
|
31
|
+
* method immediately after it has completed execution. Conditions that are required to invoke the
|
|
32
|
+
* method might not yet have returned to the state that permits the method to start again.
|
|
33
|
+
*
|
|
34
|
+
*
|
|
35
|
+
*/
|
|
36
|
+
export * from "./imports";
|