node-opcua-server 2.64.1 → 2.66.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/dist/base_server.d.ts +110 -110
- package/dist/base_server.js +473 -473
- 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 +30 -26
- package/dist/index.js.map +1 -1
- 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 -654
- package/dist/opcua_server.js +2389 -2389
- 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 +49 -49
- package/source/opcua_server.ts +1 -1
- package/dist/I_register_server_manager.d.ts +0 -15
- package/dist/I_register_server_manager.js +0 -3
- package/dist/I_register_server_manager.js.map +0 -1
- package/dist/continuation_point_manager.d.ts +0 -18
- package/dist/continuation_point_manager.js +0 -84
- package/dist/continuation_point_manager.js.map +0 -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,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.66.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -server",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc -b",
|
|
7
7
|
"lint": "eslint source test",
|
|
8
8
|
"format": "prettier --write source test",
|
|
9
|
-
"clean": "
|
|
9
|
+
"clean": "npx rimraf dist *.tsbuildinfo certificates",
|
|
10
10
|
"test": "mocha"
|
|
11
11
|
},
|
|
12
12
|
"main": "./dist/index.js",
|
|
@@ -18,54 +18,54 @@
|
|
|
18
18
|
"bonjour": "^3.5.0",
|
|
19
19
|
"dequeue": "^1.0.5",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
|
-
"node-opcua-address-space": "2.
|
|
22
|
-
"node-opcua-assert": "2.
|
|
23
|
-
"node-opcua-basic-types": "2.
|
|
24
|
-
"node-opcua-certificate-manager": "2.
|
|
25
|
-
"node-opcua-client": "2.
|
|
26
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
27
|
-
"node-opcua-common": "2.
|
|
28
|
-
"node-opcua-constants": "2.
|
|
29
|
-
"node-opcua-crypto": "^1.
|
|
30
|
-
"node-opcua-data-
|
|
31
|
-
"node-opcua-data-
|
|
32
|
-
"node-opcua-
|
|
33
|
-
"node-opcua-
|
|
34
|
-
"node-opcua-
|
|
35
|
-
"node-opcua-
|
|
36
|
-
"node-opcua-
|
|
37
|
-
"node-opcua-
|
|
38
|
-
"node-opcua-
|
|
39
|
-
"node-opcua-
|
|
40
|
-
"node-opcua-
|
|
41
|
-
"node-opcua-
|
|
42
|
-
"node-opcua-
|
|
43
|
-
"node-opcua-
|
|
44
|
-
"node-opcua-
|
|
45
|
-
"node-opcua-service-
|
|
46
|
-
"node-opcua-service-
|
|
47
|
-
"node-opcua-service-
|
|
48
|
-
"node-opcua-service-
|
|
49
|
-
"node-opcua-service-
|
|
50
|
-
"node-opcua-service-
|
|
51
|
-
"node-opcua-service-
|
|
52
|
-
"node-opcua-service-
|
|
53
|
-
"node-opcua-service-
|
|
54
|
-
"node-opcua-service-
|
|
55
|
-
"node-opcua-service-
|
|
56
|
-
"node-opcua-service-
|
|
57
|
-
"node-opcua-service-
|
|
58
|
-
"node-opcua-service-
|
|
59
|
-
"node-opcua-
|
|
60
|
-
"node-opcua-
|
|
61
|
-
"node-opcua-
|
|
62
|
-
"node-opcua-
|
|
21
|
+
"node-opcua-address-space": "2.66.0",
|
|
22
|
+
"node-opcua-assert": "2.66.0",
|
|
23
|
+
"node-opcua-basic-types": "2.66.0",
|
|
24
|
+
"node-opcua-certificate-manager": "2.66.0",
|
|
25
|
+
"node-opcua-client": "2.66.0",
|
|
26
|
+
"node-opcua-client-dynamic-extension-object": "2.66.0",
|
|
27
|
+
"node-opcua-common": "2.66.0",
|
|
28
|
+
"node-opcua-constants": "2.66.0",
|
|
29
|
+
"node-opcua-crypto": "^1.10.0",
|
|
30
|
+
"node-opcua-data-access": "2.66.0",
|
|
31
|
+
"node-opcua-data-model": "2.66.0",
|
|
32
|
+
"node-opcua-data-value": "2.66.0",
|
|
33
|
+
"node-opcua-date-time": "2.66.0",
|
|
34
|
+
"node-opcua-debug": "2.66.0",
|
|
35
|
+
"node-opcua-enum": "2.66.0",
|
|
36
|
+
"node-opcua-extension-object": "2.66.0",
|
|
37
|
+
"node-opcua-factory": "2.66.0",
|
|
38
|
+
"node-opcua-hostname": "2.66.0",
|
|
39
|
+
"node-opcua-nodeid": "2.66.0",
|
|
40
|
+
"node-opcua-nodesets": "2.66.0",
|
|
41
|
+
"node-opcua-numeric-range": "2.66.0",
|
|
42
|
+
"node-opcua-object-registry": "2.66.0",
|
|
43
|
+
"node-opcua-pki": "^2.15.0",
|
|
44
|
+
"node-opcua-secure-channel": "2.66.0",
|
|
45
|
+
"node-opcua-service-browse": "2.66.0",
|
|
46
|
+
"node-opcua-service-call": "2.66.0",
|
|
47
|
+
"node-opcua-service-discovery": "2.66.0",
|
|
48
|
+
"node-opcua-service-endpoints": "2.66.0",
|
|
49
|
+
"node-opcua-service-filter": "2.66.0",
|
|
50
|
+
"node-opcua-service-history": "2.66.0",
|
|
51
|
+
"node-opcua-service-node-management": "2.66.0",
|
|
52
|
+
"node-opcua-service-query": "2.66.0",
|
|
53
|
+
"node-opcua-service-read": "2.66.0",
|
|
54
|
+
"node-opcua-service-register-node": "2.66.0",
|
|
55
|
+
"node-opcua-service-secure-channel": "2.66.0",
|
|
56
|
+
"node-opcua-service-session": "2.66.0",
|
|
57
|
+
"node-opcua-service-subscription": "2.66.0",
|
|
58
|
+
"node-opcua-service-translate-browse-path": "2.66.0",
|
|
59
|
+
"node-opcua-service-write": "2.66.0",
|
|
60
|
+
"node-opcua-status-code": "2.66.0",
|
|
61
|
+
"node-opcua-transport": "2.66.0",
|
|
62
|
+
"node-opcua-types": "2.66.0",
|
|
63
|
+
"node-opcua-utils": "2.66.0",
|
|
64
|
+
"node-opcua-variant": "2.66.0"
|
|
63
65
|
},
|
|
64
66
|
"devDependencies": {
|
|
65
|
-
"node-opcua-
|
|
66
|
-
"node-opcua-
|
|
67
|
-
"node-opcua-test-helpers": "2.64.1",
|
|
68
|
-
"node-opcua-transport": "2.64.1",
|
|
67
|
+
"node-opcua-leak-detector": "2.66.0",
|
|
68
|
+
"node-opcua-test-helpers": "2.66.0",
|
|
69
69
|
"should": "^13.2.3",
|
|
70
70
|
"sinon": "^13.0.1"
|
|
71
71
|
},
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"internet of things"
|
|
85
85
|
],
|
|
86
86
|
"homepage": "http://node-opcua.github.io/",
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "97f47e2e242a1fd737495fd64cb65e8fb7a9964b"
|
|
88
88
|
}
|
package/source/opcua_server.ts
CHANGED
|
@@ -2185,7 +2185,7 @@ export class OPCUAServer extends OPCUABaseServer {
|
|
|
2185
2185
|
// --- check that provided session matches session attached to channel
|
|
2186
2186
|
if (channel.channelId !== session.channelId) {
|
|
2187
2187
|
if (!(request instanceof ActivateSessionRequest)) {
|
|
2188
|
-
errorLog(chalk.red.bgWhite("ERROR: channel.channelId !== session.channelId"), channel.channelId, session.channelId);
|
|
2188
|
+
errorLog(chalk.red.bgWhite("ERROR: channel.channelId !== session.channelId on processing request " + request.constructor.name), channel.channelId, session.channelId);
|
|
2189
2189
|
}
|
|
2190
2190
|
message.session_statusCode = StatusCodes.BadSecureChannelIdInvalid;
|
|
2191
2191
|
} else if (channel_has_session(channel, session)) {
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-server
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
export interface IRegisterServerManager extends EventEmitter {
|
|
7
|
-
discoveryServerEndpointUrl: string;
|
|
8
|
-
start(callback: (err?: Error) => void): void;
|
|
9
|
-
stop(callback: (err?: Error) => void): void;
|
|
10
|
-
dispose(): void;
|
|
11
|
-
on(eventName: "serverRegistrationPending", eventHandler: () => void): this;
|
|
12
|
-
on(eventName: "serverRegistered", eventHandler: () => void): this;
|
|
13
|
-
on(eventName: "serverRegistrationRenewed", eventHandler: () => void): this;
|
|
14
|
-
on(eventName: "serverUnregistered", eventHandler: () => void): this;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"I_register_server_manager.js","sourceRoot":"","sources":["../source/I_register_server_manager.ts"],"names":[],"mappings":""}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-server
|
|
3
|
-
*/
|
|
4
|
-
import { ContinuationPoint } from "node-opcua-address-space";
|
|
5
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
6
|
-
import { BrowseResultOptions, ReferenceDescription } from "node-opcua-types";
|
|
7
|
-
export interface ContinuationPointInfo extends BrowseResultOptions {
|
|
8
|
-
continuationPoint?: ContinuationPoint;
|
|
9
|
-
references?: ReferenceDescription[];
|
|
10
|
-
statusCode: StatusCode;
|
|
11
|
-
}
|
|
12
|
-
export declare class ContinuationPointManager {
|
|
13
|
-
private readonly _map;
|
|
14
|
-
constructor();
|
|
15
|
-
register(maxElements: number, values: ReferenceDescription[]): ContinuationPointInfo;
|
|
16
|
-
getNext(continuationPoint: ContinuationPoint): ContinuationPointInfo;
|
|
17
|
-
cancel(continuationPoint: ContinuationPoint): ContinuationPointInfo;
|
|
18
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
4
|
-
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
5
|
-
let counter = 0;
|
|
6
|
-
function make_key() {
|
|
7
|
-
// return crypto.randomBytes(32);
|
|
8
|
-
counter += 1;
|
|
9
|
-
return Buffer.from(counter.toString(), "ascii");
|
|
10
|
-
}
|
|
11
|
-
class ContinuationPointManager {
|
|
12
|
-
constructor() {
|
|
13
|
-
this._map = {};
|
|
14
|
-
}
|
|
15
|
-
register(maxElements, values) {
|
|
16
|
-
maxElements = maxElements || values.length;
|
|
17
|
-
if (maxElements >= values.length) {
|
|
18
|
-
return {
|
|
19
|
-
continuationPoint: undefined,
|
|
20
|
-
references: values,
|
|
21
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
const key = make_key();
|
|
25
|
-
const keyHash = key.toString("ascii");
|
|
26
|
-
// split the array in two ( values)
|
|
27
|
-
const current_block = values.splice(0, maxElements);
|
|
28
|
-
const result = {
|
|
29
|
-
continuationPoint: key,
|
|
30
|
-
references: current_block,
|
|
31
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good
|
|
32
|
-
};
|
|
33
|
-
// create
|
|
34
|
-
const data = {
|
|
35
|
-
maxElements,
|
|
36
|
-
remainingElements: values
|
|
37
|
-
};
|
|
38
|
-
this._map[keyHash] = data;
|
|
39
|
-
return result;
|
|
40
|
-
}
|
|
41
|
-
getNext(continuationPoint) {
|
|
42
|
-
if (!continuationPoint) {
|
|
43
|
-
return { statusCode: node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid };
|
|
44
|
-
}
|
|
45
|
-
const keyHash = continuationPoint.toString("ascii");
|
|
46
|
-
const data = this._map[keyHash];
|
|
47
|
-
if (!data) {
|
|
48
|
-
return { statusCode: node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid };
|
|
49
|
-
}
|
|
50
|
-
node_opcua_assert_1.assert(data.maxElements > 0);
|
|
51
|
-
// split the array in two ( values)
|
|
52
|
-
const current_block = data.remainingElements.splice(0, data.maxElements);
|
|
53
|
-
const result = {
|
|
54
|
-
continuationPoint: data.remainingElements.length ? continuationPoint : undefined,
|
|
55
|
-
references: current_block,
|
|
56
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good
|
|
57
|
-
};
|
|
58
|
-
if (data.remainingElements.length === 0) {
|
|
59
|
-
// we are done
|
|
60
|
-
delete this._map[keyHash];
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
cancel(continuationPoint) {
|
|
65
|
-
if (!continuationPoint) {
|
|
66
|
-
return { statusCode: node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid };
|
|
67
|
-
}
|
|
68
|
-
const keyHash = continuationPoint.toString("ascii");
|
|
69
|
-
const data = this._map[keyHash];
|
|
70
|
-
if (!data) {
|
|
71
|
-
return {
|
|
72
|
-
continuationPoint: undefined,
|
|
73
|
-
references: [],
|
|
74
|
-
statusCode: node_opcua_status_code_1.StatusCodes.BadContinuationPointInvalid
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
delete this._map[keyHash];
|
|
78
|
-
return {
|
|
79
|
-
statusCode: node_opcua_status_code_1.StatusCodes.Good
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
exports.ContinuationPointManager = ContinuationPointManager;
|
|
84
|
-
//# sourceMappingURL=continuation_point_manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuation_point_manager.js","sourceRoot":"","sources":["../source/continuation_point_manager.ts"],"names":[],"mappings":"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"}
|