node-opcua-server 2.64.0 → 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.
- package/dist/I_register_server_manager.d.ts +15 -0
- package/dist/I_register_server_manager.js +3 -0
- package/dist/I_register_server_manager.js.map +1 -0
- package/dist/base_server.d.ts +110 -110
- package/dist/base_server.js +473 -473
- package/dist/continuation_point_manager.d.ts +18 -0
- package/dist/continuation_point_manager.js +84 -0
- package/dist/continuation_point_manager.js.map +1 -0
- package/dist/factory.d.ts +12 -12
- package/dist/factory.js +23 -23
- package/dist/history_server_capabilities.d.ts +35 -35
- package/dist/history_server_capabilities.js +43 -43
- package/dist/i_channel_data.d.ts +13 -13
- package/dist/i_channel_data.js +2 -2
- package/dist/i_register_server_manager.d.ts +16 -16
- package/dist/i_register_server_manager.js +2 -2
- package/dist/i_server_side_publish_engine.d.ts +36 -36
- package/dist/i_server_side_publish_engine.js +49 -49
- package/dist/i_socket_data.d.ts +11 -11
- package/dist/i_socket_data.js +2 -2
- package/dist/index.d.ts +14 -14
- package/dist/index.js +26 -26
- package/dist/monitored_item.d.ts +176 -176
- package/dist/monitored_item.js +998 -998
- package/dist/node_sampler.d.ts +3 -3
- package/dist/node_sampler.js +75 -75
- package/dist/opcua_server.d.ts +654 -653
- package/dist/opcua_server.js +2389 -2366
- package/dist/opcua_server.js.map +1 -1
- package/dist/queue.d.ts +11 -11
- package/dist/queue.js +71 -71
- package/dist/register_server_manager.d.ts +95 -95
- package/dist/register_server_manager.js +584 -584
- package/dist/register_server_manager_hidden.d.ts +17 -17
- package/dist/register_server_manager_hidden.js +27 -27
- package/dist/register_server_manager_mdns_only.d.ts +22 -22
- package/dist/register_server_manager_mdns_only.js +57 -57
- package/dist/server_capabilities.d.ts +61 -61
- package/dist/server_capabilities.js +108 -108
- package/dist/server_end_point.d.ts +183 -183
- package/dist/server_end_point.js +816 -816
- package/dist/server_engine.d.ts +315 -315
- package/dist/server_engine.js +1678 -1678
- package/dist/server_publish_engine.d.ts +112 -112
- package/dist/server_publish_engine.js +530 -530
- package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -16
- package/dist/server_publish_engine_for_orphan_subscriptions.js +49 -49
- package/dist/server_session.d.ts +180 -180
- package/dist/server_session.js +737 -737
- package/dist/server_subscription.d.ts +395 -395
- package/dist/server_subscription.js +1316 -1316
- package/dist/sessions_compatible_for_transfer.d.ts +2 -2
- package/dist/sessions_compatible_for_transfer.js +36 -36
- package/dist/validate_filter.d.ts +5 -5
- package/dist/validate_filter.js +60 -60
- package/package.json +87 -87
- package/source/opcua_server.ts +28 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ServerSession } from "./server_session";
|
|
2
|
-
export declare function sessionsCompatibleForTransfer(sessionSrc: ServerSession, sessionDest: ServerSession): boolean;
|
|
1
|
+
import { ServerSession } from "./server_session";
|
|
2
|
+
export declare function sessionsCompatibleForTransfer(sessionSrc: ServerSession, sessionDest: ServerSession): boolean;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sessionsCompatibleForTransfer = void 0;
|
|
4
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
5
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
6
|
-
function sessionsCompatibleForTransfer(sessionSrc, sessionDest) {
|
|
7
|
-
(0, node_opcua_assert_1.assert)(sessionDest);
|
|
8
|
-
(0, node_opcua_assert_1.assert)(sessionSrc);
|
|
9
|
-
if (!sessionSrc.userIdentityToken && !sessionDest.userIdentityToken) {
|
|
10
|
-
return true;
|
|
11
|
-
}
|
|
12
|
-
if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.AnonymousIdentityToken) {
|
|
13
|
-
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.AnonymousIdentityToken)) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
return true;
|
|
17
|
-
}
|
|
18
|
-
else if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.UserNameIdentityToken) {
|
|
19
|
-
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.UserNameIdentityToken)) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
return sessionSrc.userIdentityToken.userName === sessionDest.userIdentityToken.userName;
|
|
23
|
-
}
|
|
24
|
-
// istanbul ignore else
|
|
25
|
-
else if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.X509IdentityToken) {
|
|
26
|
-
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.X509IdentityToken)) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return (sessionSrc.userIdentityToken.certificateData.toString("hex") ===
|
|
30
|
-
sessionDest.userIdentityToken.certificateData.toString("hex"));
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
throw new Error("Unsupported Identity token");
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
exports.sessionsCompatibleForTransfer = sessionsCompatibleForTransfer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sessionsCompatibleForTransfer = void 0;
|
|
4
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
5
|
+
const node_opcua_types_1 = require("node-opcua-types");
|
|
6
|
+
function sessionsCompatibleForTransfer(sessionSrc, sessionDest) {
|
|
7
|
+
(0, node_opcua_assert_1.assert)(sessionDest);
|
|
8
|
+
(0, node_opcua_assert_1.assert)(sessionSrc);
|
|
9
|
+
if (!sessionSrc.userIdentityToken && !sessionDest.userIdentityToken) {
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.AnonymousIdentityToken) {
|
|
13
|
+
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.AnonymousIdentityToken)) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
else if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.UserNameIdentityToken) {
|
|
19
|
+
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.UserNameIdentityToken)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
return sessionSrc.userIdentityToken.userName === sessionDest.userIdentityToken.userName;
|
|
23
|
+
}
|
|
24
|
+
// istanbul ignore else
|
|
25
|
+
else if (sessionSrc.userIdentityToken instanceof node_opcua_types_1.X509IdentityToken) {
|
|
26
|
+
if (!(sessionDest.userIdentityToken instanceof node_opcua_types_1.X509IdentityToken)) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
return (sessionSrc.userIdentityToken.certificateData.toString("hex") ===
|
|
30
|
+
sessionDest.userIdentityToken.certificateData.toString("hex"));
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
throw new Error("Unsupported Identity token");
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.sessionsCompatibleForTransfer = sessionsCompatibleForTransfer;
|
|
37
37
|
//# sourceMappingURL=sessions_compatible_for_transfer.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseNode } from "node-opcua-address-space";
|
|
2
|
-
import { ExtensionObject } from "node-opcua-extension-object";
|
|
3
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
4
|
-
import { ReadValueIdOptions } from "node-opcua-types";
|
|
5
|
-
export declare function validateFilter(filter: ExtensionObject | null, itemToMonitor: ReadValueIdOptions, node: BaseNode): StatusCode;
|
|
1
|
+
import { BaseNode } from "node-opcua-address-space";
|
|
2
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
3
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
4
|
+
import { ReadValueIdOptions } from "node-opcua-types";
|
|
5
|
+
export declare function validateFilter(filter: ExtensionObject | null, itemToMonitor: ReadValueIdOptions, node: BaseNode): StatusCode;
|
package/dist/validate_filter.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFilter = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-server
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
9
|
-
const node_opcua_data_model_2 = require("node-opcua-data-model");
|
|
10
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
11
|
-
const node_opcua_service_filter_1 = require("node-opcua-service-filter");
|
|
12
|
-
const node_opcua_service_subscription_1 = require("node-opcua-service-subscription");
|
|
13
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
14
|
-
function __validateDataChangeFilter(filter, itemToMonitor, node) {
|
|
15
|
-
(0, node_opcua_assert_1.assert)(itemToMonitor.attributeId === node_opcua_data_model_1.AttributeIds.Value);
|
|
16
|
-
if (node.nodeClass !== node_opcua_data_model_2.NodeClass.Variable) {
|
|
17
|
-
return node_opcua_status_code_1.StatusCodes.BadNodeIdInvalid;
|
|
18
|
-
}
|
|
19
|
-
(0, node_opcua_assert_1.assert)(node.nodeClass === node_opcua_data_model_2.NodeClass.Variable);
|
|
20
|
-
// if node is not Numerical=> DataChangeFilter
|
|
21
|
-
(0, node_opcua_assert_1.assert)(node.dataType instanceof node_opcua_nodeid_1.NodeId);
|
|
22
|
-
const dataType = node.addressSpace.findDataType(node.dataType);
|
|
23
|
-
const dataTypeNumber = node.addressSpace.findDataType("Number");
|
|
24
|
-
if (filter.deadbandType !== node_opcua_service_subscription_1.DeadbandType.None) {
|
|
25
|
-
if (!dataType.isSupertypeOf(dataTypeNumber)) {
|
|
26
|
-
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (filter.deadbandType === node_opcua_service_subscription_1.DeadbandType.Percent) {
|
|
30
|
-
if (filter.deadbandValue < 0 || filter.deadbandValue > 100) {
|
|
31
|
-
return node_opcua_status_code_1.StatusCodes.BadDeadbandFilterInvalid;
|
|
32
|
-
}
|
|
33
|
-
// node must also have a valid euRange
|
|
34
|
-
if (!node.euRange) {
|
|
35
|
-
// tslint:disable:no-console
|
|
36
|
-
console.log(" node has no euRange ! Dead band Percent cannot be used on node " + node.nodeId.toString());
|
|
37
|
-
return node_opcua_status_code_1.StatusCodes.BadMonitoredItemFilterUnsupported;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
return node_opcua_status_code_1.StatusCodes.Good;
|
|
41
|
-
}
|
|
42
|
-
function validateFilter(filter, itemToMonitor, node) {
|
|
43
|
-
// handle filter information
|
|
44
|
-
if (filter && filter instanceof node_opcua_service_filter_1.EventFilter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.EventNotifier) {
|
|
45
|
-
// invalid filter on Event
|
|
46
|
-
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
47
|
-
}
|
|
48
|
-
if (filter && filter instanceof node_opcua_service_filter_1.DataChangeFilter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
49
|
-
// invalid DataChange filter on non Value Attribute
|
|
50
|
-
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
51
|
-
}
|
|
52
|
-
if (filter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.EventNotifier && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
53
|
-
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
54
|
-
}
|
|
55
|
-
if (filter instanceof node_opcua_service_filter_1.DataChangeFilter) {
|
|
56
|
-
return __validateDataChangeFilter(filter, itemToMonitor, node);
|
|
57
|
-
}
|
|
58
|
-
return node_opcua_status_code_1.StatusCodes.Good;
|
|
59
|
-
}
|
|
60
|
-
exports.validateFilter = validateFilter;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateFilter = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-server
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
+
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
9
|
+
const node_opcua_data_model_2 = require("node-opcua-data-model");
|
|
10
|
+
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
11
|
+
const node_opcua_service_filter_1 = require("node-opcua-service-filter");
|
|
12
|
+
const node_opcua_service_subscription_1 = require("node-opcua-service-subscription");
|
|
13
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
14
|
+
function __validateDataChangeFilter(filter, itemToMonitor, node) {
|
|
15
|
+
(0, node_opcua_assert_1.assert)(itemToMonitor.attributeId === node_opcua_data_model_1.AttributeIds.Value);
|
|
16
|
+
if (node.nodeClass !== node_opcua_data_model_2.NodeClass.Variable) {
|
|
17
|
+
return node_opcua_status_code_1.StatusCodes.BadNodeIdInvalid;
|
|
18
|
+
}
|
|
19
|
+
(0, node_opcua_assert_1.assert)(node.nodeClass === node_opcua_data_model_2.NodeClass.Variable);
|
|
20
|
+
// if node is not Numerical=> DataChangeFilter
|
|
21
|
+
(0, node_opcua_assert_1.assert)(node.dataType instanceof node_opcua_nodeid_1.NodeId);
|
|
22
|
+
const dataType = node.addressSpace.findDataType(node.dataType);
|
|
23
|
+
const dataTypeNumber = node.addressSpace.findDataType("Number");
|
|
24
|
+
if (filter.deadbandType !== node_opcua_service_subscription_1.DeadbandType.None) {
|
|
25
|
+
if (!dataType.isSupertypeOf(dataTypeNumber)) {
|
|
26
|
+
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (filter.deadbandType === node_opcua_service_subscription_1.DeadbandType.Percent) {
|
|
30
|
+
if (filter.deadbandValue < 0 || filter.deadbandValue > 100) {
|
|
31
|
+
return node_opcua_status_code_1.StatusCodes.BadDeadbandFilterInvalid;
|
|
32
|
+
}
|
|
33
|
+
// node must also have a valid euRange
|
|
34
|
+
if (!node.euRange) {
|
|
35
|
+
// tslint:disable:no-console
|
|
36
|
+
console.log(" node has no euRange ! Dead band Percent cannot be used on node " + node.nodeId.toString());
|
|
37
|
+
return node_opcua_status_code_1.StatusCodes.BadMonitoredItemFilterUnsupported;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return node_opcua_status_code_1.StatusCodes.Good;
|
|
41
|
+
}
|
|
42
|
+
function validateFilter(filter, itemToMonitor, node) {
|
|
43
|
+
// handle filter information
|
|
44
|
+
if (filter && filter instanceof node_opcua_service_filter_1.EventFilter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.EventNotifier) {
|
|
45
|
+
// invalid filter on Event
|
|
46
|
+
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
47
|
+
}
|
|
48
|
+
if (filter && filter instanceof node_opcua_service_filter_1.DataChangeFilter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
49
|
+
// invalid DataChange filter on non Value Attribute
|
|
50
|
+
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
51
|
+
}
|
|
52
|
+
if (filter && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.EventNotifier && itemToMonitor.attributeId !== node_opcua_data_model_1.AttributeIds.Value) {
|
|
53
|
+
return node_opcua_status_code_1.StatusCodes.BadFilterNotAllowed;
|
|
54
|
+
}
|
|
55
|
+
if (filter instanceof node_opcua_service_filter_1.DataChangeFilter) {
|
|
56
|
+
return __validateDataChangeFilter(filter, itemToMonitor, node);
|
|
57
|
+
}
|
|
58
|
+
return node_opcua_status_code_1.StatusCodes.Good;
|
|
59
|
+
}
|
|
60
|
+
exports.validateFilter = validateFilter;
|
|
61
61
|
//# sourceMappingURL=validate_filter.js.map
|
package/package.json
CHANGED
|
@@ -1,88 +1,88 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
}
|
|
2
|
+
"name": "node-opcua-server",
|
|
3
|
+
"version": "2.64.1",
|
|
4
|
+
"description": "pure nodejs OPCUA SDK - module -server",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc -b",
|
|
7
|
+
"lint": "eslint source test",
|
|
8
|
+
"format": "prettier --write source test",
|
|
9
|
+
"clean": "node -e \"require('rimraf').sync('certificates');\" && node -e \"require('rimraf').sync('dist');\"",
|
|
10
|
+
"test": "mocha"
|
|
11
|
+
},
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@ster5/global-mutex": "^1.2.0",
|
|
16
|
+
"@types/underscore": "^1.11.4",
|
|
17
|
+
"async": "^3.2.3",
|
|
18
|
+
"bonjour": "^3.5.0",
|
|
19
|
+
"dequeue": "^1.0.5",
|
|
20
|
+
"lodash": "4.17.21",
|
|
21
|
+
"node-opcua-address-space": "2.64.1",
|
|
22
|
+
"node-opcua-assert": "2.64.1",
|
|
23
|
+
"node-opcua-basic-types": "2.64.1",
|
|
24
|
+
"node-opcua-certificate-manager": "2.64.1",
|
|
25
|
+
"node-opcua-client": "2.64.1",
|
|
26
|
+
"node-opcua-client-dynamic-extension-object": "2.64.1",
|
|
27
|
+
"node-opcua-common": "2.64.1",
|
|
28
|
+
"node-opcua-constants": "2.64.1",
|
|
29
|
+
"node-opcua-crypto": "^1.9.0",
|
|
30
|
+
"node-opcua-data-model": "2.64.1",
|
|
31
|
+
"node-opcua-data-value": "2.64.1",
|
|
32
|
+
"node-opcua-date-time": "2.64.1",
|
|
33
|
+
"node-opcua-debug": "2.64.1",
|
|
34
|
+
"node-opcua-enum": "2.64.1",
|
|
35
|
+
"node-opcua-extension-object": "2.64.1",
|
|
36
|
+
"node-opcua-factory": "2.64.1",
|
|
37
|
+
"node-opcua-hostname": "2.64.1",
|
|
38
|
+
"node-opcua-nodeid": "2.64.1",
|
|
39
|
+
"node-opcua-nodesets": "2.64.1",
|
|
40
|
+
"node-opcua-numeric-range": "2.64.1",
|
|
41
|
+
"node-opcua-object-registry": "2.64.1",
|
|
42
|
+
"node-opcua-pki": "^2.14.0",
|
|
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-node-management": "2.64.1",
|
|
51
|
+
"node-opcua-service-query": "2.64.1",
|
|
52
|
+
"node-opcua-service-read": "2.64.1",
|
|
53
|
+
"node-opcua-service-register-node": "2.64.1",
|
|
54
|
+
"node-opcua-service-secure-channel": "2.64.1",
|
|
55
|
+
"node-opcua-service-session": "2.64.1",
|
|
56
|
+
"node-opcua-service-subscription": "2.64.1",
|
|
57
|
+
"node-opcua-service-translate-browse-path": "2.64.1",
|
|
58
|
+
"node-opcua-service-write": "2.64.1",
|
|
59
|
+
"node-opcua-status-code": "2.64.1",
|
|
60
|
+
"node-opcua-types": "2.64.1",
|
|
61
|
+
"node-opcua-utils": "2.64.1",
|
|
62
|
+
"node-opcua-variant": "2.64.1"
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"node-opcua-data-access": "2.64.1",
|
|
66
|
+
"node-opcua-leak-detector": "2.64.1",
|
|
67
|
+
"node-opcua-test-helpers": "2.64.1",
|
|
68
|
+
"node-opcua-transport": "2.64.1",
|
|
69
|
+
"should": "^13.2.3",
|
|
70
|
+
"sinon": "^13.0.1"
|
|
71
|
+
},
|
|
72
|
+
"author": "Etienne Rossignon",
|
|
73
|
+
"license": "MIT",
|
|
74
|
+
"repository": {
|
|
75
|
+
"type": "git",
|
|
76
|
+
"url": "git://github.com/node-opcua/node-opcua.git"
|
|
77
|
+
},
|
|
78
|
+
"keywords": [
|
|
79
|
+
"OPCUA",
|
|
80
|
+
"opcua",
|
|
81
|
+
"m2m",
|
|
82
|
+
"iot",
|
|
83
|
+
"opc ua",
|
|
84
|
+
"internet of things"
|
|
85
|
+
],
|
|
86
|
+
"homepage": "http://node-opcua.github.io/",
|
|
87
|
+
"gitHead": "b65b8738603cd475d7d99a2b20b0ae9d32b4110c"
|
|
88
|
+
}
|
package/source/opcua_server.ts
CHANGED
|
@@ -43,7 +43,9 @@ import {
|
|
|
43
43
|
import { getDefaultCertificateManager, OPCUACertificateManager } from "node-opcua-certificate-manager";
|
|
44
44
|
import { ServerState } from "node-opcua-common";
|
|
45
45
|
import { Certificate, exploreCertificate, makeSHA1Thumbprint, Nonce, toPem } from "node-opcua-crypto";
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
AttributeIds, DiagnosticInfo, filterDiagnosticInfoLevel, filterDiagnosticOperationLevel, filterDiagnosticServiceLevel, LocalizedText, NodeClass, RESPONSE_DIAGNOSTICS_MASK_ALL
|
|
48
|
+
} from "node-opcua-data-model";
|
|
47
49
|
import { DataValue } from "node-opcua-data-value";
|
|
48
50
|
import { dump, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
49
51
|
import { NodeId } from "node-opcua-nodeid";
|
|
@@ -677,6 +679,30 @@ function validate_security_endpoint(
|
|
|
677
679
|
return { errCode: StatusCodes.Good, endpoint: endpoints_matching_security_policy[0] };
|
|
678
680
|
}
|
|
679
681
|
|
|
682
|
+
export function filterDiagnosticInfo(returnDiagnostics: number, response: CallResponse): void {
|
|
683
|
+
if (RESPONSE_DIAGNOSTICS_MASK_ALL & returnDiagnostics) {
|
|
684
|
+
response.responseHeader.serviceDiagnostics = filterDiagnosticServiceLevel(returnDiagnostics, response.responseHeader.serviceDiagnostics);
|
|
685
|
+
|
|
686
|
+
if (response.diagnosticInfos && response.diagnosticInfos.length > 0) {
|
|
687
|
+
response.diagnosticInfos = response.diagnosticInfos.map((d) => filterDiagnosticOperationLevel(returnDiagnostics, d));
|
|
688
|
+
} else {
|
|
689
|
+
response.diagnosticInfos = [];
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
if (response.results) {
|
|
693
|
+
for (const entry of response.results) {
|
|
694
|
+
if (entry.inputArgumentDiagnosticInfos && entry.inputArgumentDiagnosticInfos.length > 0) {
|
|
695
|
+
entry.inputArgumentDiagnosticInfos = entry.inputArgumentDiagnosticInfos.map(
|
|
696
|
+
(d) => filterDiagnosticOperationLevel(returnDiagnostics, d)
|
|
697
|
+
);
|
|
698
|
+
} else {
|
|
699
|
+
entry.inputArgumentDiagnosticInfos = [];
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
|
|
680
706
|
export enum RegisterServerMethod {
|
|
681
707
|
HIDDEN = 1, // the server doesn't expose itself to the external world
|
|
682
708
|
MDNS = 2, // the server publish itself to the mDNS Multicast network directly
|
|
@@ -3339,6 +3365,7 @@ export class OPCUAServer extends OPCUABaseServer {
|
|
|
3339
3365
|
response = new CallResponse({
|
|
3340
3366
|
results: results as CallMethodResultOptions[]
|
|
3341
3367
|
});
|
|
3368
|
+
filterDiagnosticInfo(request.requestHeader.returnDiagnostics, response);
|
|
3342
3369
|
sendResponse(response);
|
|
3343
3370
|
}
|
|
3344
3371
|
);
|