node-opcua-server 2.51.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/.mocharc.yml +10 -0
- package/LICENSE +20 -0
- package/dist/base_server.d.ts +110 -0
- package/dist/base_server.js +476 -0
- package/dist/base_server.js.map +1 -0
- package/dist/factory.d.ts +10 -0
- package/dist/factory.js +24 -0
- package/dist/factory.js.map +1 -0
- package/dist/history_server_capabilities.d.ts +35 -0
- package/dist/history_server_capabilities.js +44 -0
- package/dist/history_server_capabilities.js.map +1 -0
- package/dist/i_channel_data.d.ts +13 -0
- package/dist/i_channel_data.js +3 -0
- package/dist/i_channel_data.js.map +1 -0
- package/dist/i_register_server_manager.d.ts +16 -0
- package/dist/i_register_server_manager.js +3 -0
- package/dist/i_register_server_manager.js.map +1 -0
- package/dist/i_server_side_publish_engine.d.ts +36 -0
- package/dist/i_server_side_publish_engine.js +50 -0
- package/dist/i_server_side_publish_engine.js.map +1 -0
- package/dist/i_socket_data.d.ts +11 -0
- package/dist/i_socket_data.js +3 -0
- package/dist/i_socket_data.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/monitored_item.d.ts +173 -0
- package/dist/monitored_item.js +1006 -0
- package/dist/monitored_item.js.map +1 -0
- package/dist/node_sampler.d.ts +3 -0
- package/dist/node_sampler.js +76 -0
- package/dist/node_sampler.js.map +1 -0
- package/dist/opcua_server.d.ts +668 -0
- package/dist/opcua_server.js +2407 -0
- package/dist/opcua_server.js.map +1 -0
- package/dist/queue.d.ts +11 -0
- package/dist/queue.js +71 -0
- package/dist/queue.js.map +1 -0
- package/dist/register_server_manager.d.ts +92 -0
- package/dist/register_server_manager.js +574 -0
- package/dist/register_server_manager.js.map +1 -0
- package/dist/register_server_manager_hidden.d.ts +17 -0
- package/dist/register_server_manager_hidden.js +28 -0
- package/dist/register_server_manager_hidden.js.map +1 -0
- package/dist/register_server_manager_mdns_only.d.ts +19 -0
- package/dist/register_server_manager_mdns_only.js +58 -0
- package/dist/register_server_manager_mdns_only.js.map +1 -0
- package/dist/server_capabilities.d.ts +61 -0
- package/dist/server_capabilities.js +109 -0
- package/dist/server_capabilities.js.map +1 -0
- package/dist/server_end_point.d.ts +180 -0
- package/dist/server_end_point.js +825 -0
- package/dist/server_end_point.js.map +1 -0
- package/dist/server_engine.d.ts +311 -0
- package/dist/server_engine.js +1659 -0
- package/dist/server_engine.js.map +1 -0
- package/dist/server_publish_engine.d.ts +109 -0
- package/dist/server_publish_engine.js +531 -0
- package/dist/server_publish_engine.js.map +1 -0
- package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -0
- package/dist/server_publish_engine_for_orphan_subscriptions.js +50 -0
- package/dist/server_publish_engine_for_orphan_subscriptions.js.map +1 -0
- package/dist/server_session.d.ts +176 -0
- package/dist/server_session.js +734 -0
- package/dist/server_session.js.map +1 -0
- package/dist/server_subscription.d.ts +393 -0
- package/dist/server_subscription.js +1313 -0
- package/dist/server_subscription.js.map +1 -0
- package/dist/sessions_compatible_for_transfer.d.ts +2 -0
- package/dist/sessions_compatible_for_transfer.js +36 -0
- package/dist/sessions_compatible_for_transfer.js.map +1 -0
- package/dist/validate_filter.d.ts +5 -0
- package/dist/validate_filter.js +64 -0
- package/dist/validate_filter.js.map +1 -0
- package/package.json +88 -0
- package/source/base_server.ts +617 -0
- package/source/factory.ts +25 -0
- package/source/history_server_capabilities.ts +75 -0
- package/source/i_channel_data.ts +17 -0
- package/source/i_register_server_manager.ts +24 -0
- package/source/i_server_side_publish_engine.ts +77 -0
- package/source/i_socket_data.ts +11 -0
- package/source/index.ts +14 -0
- package/source/monitored_item.ts +1303 -0
- package/source/node_sampler.ts +82 -0
- package/source/opcua_server.ts +3742 -0
- package/source/queue.ts +73 -0
- package/source/register_server_manager.ts +744 -0
- package/source/register_server_manager_hidden.ts +33 -0
- package/source/register_server_manager_mdns_only.ts +69 -0
- package/source/server_capabilities.ts +177 -0
- package/source/server_end_point.ts +1182 -0
- package/source/server_engine.ts +2167 -0
- package/source/server_publish_engine.ts +657 -0
- package/source/server_publish_engine_for_orphan_subscriptions.ts +52 -0
- package/source/server_session.ts +931 -0
- package/source/server_subscription.ts +1792 -0
- package/source/sessions_compatible_for_transfer.ts +33 -0
- package/source/validate_filter.ts +86 -0
- package/test_helpers/create_certificates.js +1 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-server
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
import { IRegisterServerManager } from "./i_register_server_manager";
|
|
7
|
+
/**
|
|
8
|
+
* a RegisterServerManager that declare the server the OPCUA Bonjour service
|
|
9
|
+
* available on the current computer
|
|
10
|
+
*/
|
|
11
|
+
export declare class RegisterServerManagerMDNSONLY extends EventEmitter implements IRegisterServerManager {
|
|
12
|
+
discoveryServerEndpointUrl: string;
|
|
13
|
+
private server?;
|
|
14
|
+
private bonjour;
|
|
15
|
+
constructor(options: any);
|
|
16
|
+
stop(callback: () => void): void;
|
|
17
|
+
start(callback: () => void): void;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-server
|
|
4
|
+
*/
|
|
5
|
+
// RegisterServerManagerMDNSONLY
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.RegisterServerManagerMDNSONLY = void 0;
|
|
8
|
+
const events_1 = require("events");
|
|
9
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
10
|
+
const node_opcua_service_discovery_1 = require("node-opcua-service-discovery");
|
|
11
|
+
const base_server_1 = require("./base_server");
|
|
12
|
+
/**
|
|
13
|
+
* a RegisterServerManager that declare the server the OPCUA Bonjour service
|
|
14
|
+
* available on the current computer
|
|
15
|
+
*/
|
|
16
|
+
class RegisterServerManagerMDNSONLY extends events_1.EventEmitter {
|
|
17
|
+
constructor(options) {
|
|
18
|
+
super();
|
|
19
|
+
this.discoveryServerEndpointUrl = "";
|
|
20
|
+
this.server = options.server;
|
|
21
|
+
(0, node_opcua_assert_1.assert)(this.server);
|
|
22
|
+
(0, node_opcua_assert_1.assert)(this.server instanceof base_server_1.OPCUABaseServer);
|
|
23
|
+
this.bonjour = new node_opcua_service_discovery_1.BonjourHolder();
|
|
24
|
+
}
|
|
25
|
+
stop(callback) {
|
|
26
|
+
if (this.bonjour) {
|
|
27
|
+
this.bonjour._stop_announcedOnMulticastSubnet();
|
|
28
|
+
}
|
|
29
|
+
setImmediate(() => {
|
|
30
|
+
this.emit("serverUnregistered");
|
|
31
|
+
setImmediate(callback);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
start(callback) {
|
|
35
|
+
// istanbul ignore next
|
|
36
|
+
if (!this.server) {
|
|
37
|
+
throw new Error("internal error");
|
|
38
|
+
}
|
|
39
|
+
(0, node_opcua_assert_1.assert)(this.server instanceof base_server_1.OPCUABaseServer);
|
|
40
|
+
this.bonjour._announcedOnMulticastSubnet({
|
|
41
|
+
capabilities: this.server.capabilitiesForMDNS,
|
|
42
|
+
name: this.server.serverInfo.applicationUri,
|
|
43
|
+
path: "/",
|
|
44
|
+
port: this.server.endpoints[0].port,
|
|
45
|
+
});
|
|
46
|
+
setImmediate(() => {
|
|
47
|
+
this.emit("serverRegistered");
|
|
48
|
+
setImmediate(callback);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
dispose() {
|
|
52
|
+
(0, node_opcua_assert_1.assert)(!this.bonjour.isStarted());
|
|
53
|
+
(0, node_opcua_assert_1.assert)(this.server);
|
|
54
|
+
this.server = undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.RegisterServerManagerMDNSONLY = RegisterServerManagerMDNSONLY;
|
|
58
|
+
//# sourceMappingURL=register_server_manager_mdns_only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register_server_manager_mdns_only.js","sourceRoot":"","sources":["../source/register_server_manager_mdns_only.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,gCAAgC;;;AAEhC,mCAAsC;AACtC,yDAA2C;AAC3C,+EAEsC;AACtC,+CAAgD;AAGhD;;;GAGG;AACH,MAAa,6BACX,SAAQ,qBAAY;IAQlB,YAAY,OAAY;QACpB,KAAK,EAAE,CAAC;QANL,+BAA0B,GAAW,EAAE,CAAC;QAO3C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAA,0BAAM,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,IAAA,0BAAM,EAAC,IAAI,CAAC,MAAM,YAAY,6BAAe,CAAC,CAAC;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,4CAAa,EAAE,CAAC;IACvC,CAAC;IAEM,IAAI,CAAC,QAAoB;QAC5B,IAAI,IAAI,CAAC,OAAO,EAAE;YACd,IAAI,CAAC,OAAO,CAAC,gCAAgC,EAAE,CAAC;SACnD;QACD,YAAY,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YAChC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,KAAK,CAAC,QAAoB;QAC7B,uBAAuB;QACvB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;SACrC;QACD,IAAA,0BAAM,EAAC,IAAI,CAAC,MAAM,YAAY,6BAAe,CAAC,CAAC;QAE/C,IAAI,CAAC,OAAO,CAAC,2BAA2B,CAAC;YACrC,YAAY,EAAE,IAAI,CAAC,MAAM,CAAC,mBAAmB;YAC7C,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAe;YAC5C,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI;SACtC,CAAC,CAAC;QACH,YAAY,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YAC9B,YAAY,CAAC,QAAQ,CAAC,CAAC;QAC3B,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,OAAO;QACV,IAAA,0BAAM,EAAC,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QAClC,IAAA,0BAAM,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC5B,CAAC;CACJ;AAnDD,sEAmDC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SignedSoftwareCertificate } from "node-opcua-types";
|
|
2
|
+
/**
|
|
3
|
+
*/
|
|
4
|
+
export interface OperationLimitsOptions {
|
|
5
|
+
maxNodesPerRead?: number;
|
|
6
|
+
maxNodesPerBrowse?: number;
|
|
7
|
+
maxNodesPerWrite?: number;
|
|
8
|
+
maxNodesPerMethodCall?: number;
|
|
9
|
+
maxNodesPerRegisterNodes?: number;
|
|
10
|
+
maxNodesPerNodeManagement?: number;
|
|
11
|
+
maxMonitoredItemsPerCall?: number;
|
|
12
|
+
maxNodesPerHistoryReadData?: number;
|
|
13
|
+
maxNodesPerHistoryReadEvents?: number;
|
|
14
|
+
maxNodesPerHistoryUpdateData?: number;
|
|
15
|
+
maxNodesPerHistoryUpdateEvents?: number;
|
|
16
|
+
maxNodesPerTranslateBrowsePathsToNodeIds?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class OperationLimits {
|
|
19
|
+
maxNodesPerRead: number;
|
|
20
|
+
maxNodesPerBrowse: number;
|
|
21
|
+
maxNodesPerWrite: number;
|
|
22
|
+
maxNodesPerMethodCall: number;
|
|
23
|
+
maxNodesPerRegisterNodes: number;
|
|
24
|
+
maxNodesPerNodeManagement: number;
|
|
25
|
+
maxMonitoredItemsPerCall: number;
|
|
26
|
+
maxNodesPerHistoryReadData: number;
|
|
27
|
+
maxNodesPerHistoryReadEvents: number;
|
|
28
|
+
maxNodesPerHistoryUpdateData: number;
|
|
29
|
+
maxNodesPerHistoryUpdateEvents: number;
|
|
30
|
+
maxNodesPerTranslateBrowsePathsToNodeIds: number;
|
|
31
|
+
constructor(options: OperationLimitsOptions);
|
|
32
|
+
}
|
|
33
|
+
export interface ServerCapabilitiesOptions {
|
|
34
|
+
maxBrowseContinuationPoints?: number;
|
|
35
|
+
maxHistoryContinuationPoints?: number;
|
|
36
|
+
maxStringLength?: number;
|
|
37
|
+
maxArrayLength?: number;
|
|
38
|
+
maxByteStringLength?: number;
|
|
39
|
+
maxQueryContinuationPoints?: number;
|
|
40
|
+
minSupportedSampleRate?: number;
|
|
41
|
+
operationLimits?: OperationLimitsOptions;
|
|
42
|
+
serverProfileArray?: string[];
|
|
43
|
+
localeIdArray?: string[];
|
|
44
|
+
softwareCertificates?: SignedSoftwareCertificate[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
*/
|
|
48
|
+
export declare class ServerCapabilities {
|
|
49
|
+
maxBrowseContinuationPoints: number;
|
|
50
|
+
maxHistoryContinuationPoints: number;
|
|
51
|
+
maxStringLength: number;
|
|
52
|
+
maxArrayLength: number;
|
|
53
|
+
maxByteStringLength: number;
|
|
54
|
+
maxQueryContinuationPoints: number;
|
|
55
|
+
minSupportedSampleRate: number;
|
|
56
|
+
operationLimits: OperationLimits;
|
|
57
|
+
serverProfileArray: string[];
|
|
58
|
+
localeIdArray: string[];
|
|
59
|
+
softwareCertificates: SignedSoftwareCertificate[];
|
|
60
|
+
constructor(options: ServerCapabilitiesOptions);
|
|
61
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ServerCapabilities = exports.OperationLimits = void 0;
|
|
4
|
+
class OperationLimits {
|
|
5
|
+
constructor(options) {
|
|
6
|
+
/**
|
|
7
|
+
* @property maxNodesPerRead
|
|
8
|
+
* @default 0
|
|
9
|
+
*/
|
|
10
|
+
this.maxNodesPerRead = options.maxNodesPerRead || 0;
|
|
11
|
+
/**
|
|
12
|
+
* @property maxNodesPerWrite
|
|
13
|
+
* @default 0
|
|
14
|
+
*/
|
|
15
|
+
this.maxNodesPerWrite = options.maxNodesPerWrite || 0;
|
|
16
|
+
/**
|
|
17
|
+
* @property maxNodesPerMethodCall
|
|
18
|
+
* @default 0
|
|
19
|
+
*/
|
|
20
|
+
this.maxNodesPerMethodCall = options.maxNodesPerMethodCall || 0;
|
|
21
|
+
/**
|
|
22
|
+
* @property maxNodesPerBrowse
|
|
23
|
+
* @default 0
|
|
24
|
+
*/
|
|
25
|
+
this.maxNodesPerBrowse = options.maxNodesPerBrowse || 0;
|
|
26
|
+
/**
|
|
27
|
+
* @property maxNodesPerRegisterNodes
|
|
28
|
+
* @default 0
|
|
29
|
+
*/
|
|
30
|
+
this.maxNodesPerRegisterNodes = options.maxNodesPerRegisterNodes || 0;
|
|
31
|
+
/**
|
|
32
|
+
* @property maxNodesPerNodeManagement
|
|
33
|
+
* @default 0
|
|
34
|
+
*/
|
|
35
|
+
this.maxNodesPerNodeManagement = options.maxNodesPerNodeManagement || 0;
|
|
36
|
+
/**
|
|
37
|
+
* @property maxMonitoredItemsPerCall
|
|
38
|
+
* @default 0
|
|
39
|
+
*/
|
|
40
|
+
this.maxMonitoredItemsPerCall = options.maxMonitoredItemsPerCall || 0;
|
|
41
|
+
/**
|
|
42
|
+
* @property maxNodesPerHistoryReadData
|
|
43
|
+
*/
|
|
44
|
+
this.maxNodesPerHistoryReadData = options.maxNodesPerHistoryReadData || 0;
|
|
45
|
+
/**
|
|
46
|
+
* @property maxNodesPerHistoryReadEvents
|
|
47
|
+
* @default 0
|
|
48
|
+
*/
|
|
49
|
+
this.maxNodesPerHistoryReadEvents = options.maxNodesPerHistoryReadEvents || 0;
|
|
50
|
+
/**
|
|
51
|
+
* @property maxNodesPerHistoryUpdateData
|
|
52
|
+
* @default 0
|
|
53
|
+
*/
|
|
54
|
+
this.maxNodesPerHistoryUpdateData = options.maxNodesPerHistoryUpdateData || 0;
|
|
55
|
+
/**
|
|
56
|
+
* @property maxNodesPerHistoryUpdateEvents
|
|
57
|
+
* @default 0
|
|
58
|
+
*/
|
|
59
|
+
this.maxNodesPerHistoryUpdateEvents = options.maxNodesPerHistoryUpdateEvents || 0;
|
|
60
|
+
/**
|
|
61
|
+
* @property maxNodesPerTranslateBrowsePathsToNodeIds
|
|
62
|
+
* @default 0
|
|
63
|
+
*/
|
|
64
|
+
this.maxNodesPerTranslateBrowsePathsToNodeIds = options.maxNodesPerTranslateBrowsePathsToNodeIds || 0;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.OperationLimits = OperationLimits;
|
|
68
|
+
/**
|
|
69
|
+
*/
|
|
70
|
+
class ServerCapabilities {
|
|
71
|
+
constructor(options) {
|
|
72
|
+
options = options || {};
|
|
73
|
+
options.operationLimits = options.operationLimits || {};
|
|
74
|
+
this.serverProfileArray = options.serverProfileArray || [];
|
|
75
|
+
this.localeIdArray = options.localeIdArray || [];
|
|
76
|
+
this.softwareCertificates = options.softwareCertificates || [];
|
|
77
|
+
/**
|
|
78
|
+
* @property maxArrayLength
|
|
79
|
+
*/
|
|
80
|
+
this.maxArrayLength = options.maxArrayLength || 0;
|
|
81
|
+
/**
|
|
82
|
+
* @property maxStringLength
|
|
83
|
+
*/
|
|
84
|
+
this.maxStringLength = options.maxStringLength || 0;
|
|
85
|
+
/**
|
|
86
|
+
* @property maxByteStringLength
|
|
87
|
+
*/
|
|
88
|
+
this.maxByteStringLength = options.maxByteStringLength || 0;
|
|
89
|
+
/**
|
|
90
|
+
* @property maxBrowseContinuationPoints
|
|
91
|
+
*/
|
|
92
|
+
this.maxBrowseContinuationPoints = options.maxBrowseContinuationPoints || 0;
|
|
93
|
+
/**
|
|
94
|
+
* @property maxQueryContinuationPoints
|
|
95
|
+
*/
|
|
96
|
+
this.maxQueryContinuationPoints = options.maxQueryContinuationPoints || 0;
|
|
97
|
+
/**
|
|
98
|
+
* @property maxHistoryContinuationPoints
|
|
99
|
+
*/
|
|
100
|
+
this.maxHistoryContinuationPoints = options.maxHistoryContinuationPoints || 0;
|
|
101
|
+
/**
|
|
102
|
+
* @property operationLimits
|
|
103
|
+
*/
|
|
104
|
+
this.operationLimits = new OperationLimits(options.operationLimits);
|
|
105
|
+
this.minSupportedSampleRate = 100; // to do adjust me
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
exports.ServerCapabilities = ServerCapabilities;
|
|
109
|
+
//# sourceMappingURL=server_capabilities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server_capabilities.js","sourceRoot":"","sources":["../source/server_capabilities.ts"],"names":[],"mappings":";;;AAwBA,MAAa,eAAe;IAexB,YAAY,OAA+B;QAEvC;;;WAGG;QACH,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC;QACpD;;;WAGG;QACH,IAAI,CAAC,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,IAAI,CAAC,CAAC;QACtD;;;WAGG;QACH,IAAI,CAAC,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,IAAI,CAAC,CAAC;QAChE;;;WAGG;QACH,IAAI,CAAC,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,IAAI,CAAC,CAAC;QACxD;;;WAGG;QACH,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,IAAI,CAAC,CAAC;QACtE;;;WAGG;QACH,IAAI,CAAC,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,IAAI,CAAC,CAAC;QACxE;;;WAGG;QACH,IAAI,CAAC,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,IAAI,CAAC,CAAC;QACtE;;WAEG;QACH,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,IAAI,CAAC,CAAC;QAC1E;;;WAGG;QACH,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,IAAI,CAAC,CAAC;QAC9E;;;WAGG;QACH,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,IAAI,CAAC,CAAC;QAC9E;;;WAGG;QACH,IAAI,CAAC,8BAA8B,GAAG,OAAO,CAAC,8BAA8B,IAAI,CAAC,CAAC;QAClF;;;WAGG;QACH,IAAI,CAAC,wCAAwC,GAAG,OAAO,CAAC,wCAAwC,IAAI,CAAC,CAAC;IAE1G,CAAC;CACJ;AA9ED,0CA8EC;AAiBD;GACG;AACH,MAAa,kBAAkB;IAe3B,YAAY,OAAkC;QAE1C,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;QACxB,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,EAAE,CAAC;QAExD,IAAI,CAAC,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,IAAI,EAAE,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,EAAE,CAAC;QACjD,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,oBAAoB,IAAI,EAAE,CAAC;QAC/D;;WAEG;QACH,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC;QAClD;;WAEG;QACH,IAAI,CAAC,eAAe,GAAG,OAAO,CAAC,eAAe,IAAI,CAAC,CAAC;QACpD;;WAEG;QACH,IAAI,CAAC,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,IAAI,CAAC,CAAC;QAC5D;;WAEG;QACH,IAAI,CAAC,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,IAAI,CAAC,CAAC;QAC5E;;WAEG;QACH,IAAI,CAAC,0BAA0B,GAAG,OAAO,CAAC,0BAA0B,IAAI,CAAC,CAAC;QAC1E;;WAEG;QACH,IAAI,CAAC,4BAA4B,GAAG,OAAO,CAAC,4BAA4B,IAAI,CAAC,CAAC;QAE9E;;WAEG;QACH,IAAI,CAAC,eAAe,GAAG,IAAI,eAAe,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;QAEpE,IAAI,CAAC,sBAAsB,GAAG,GAAG,CAAC,CAAC,kBAAkB;IACzD,CAAC;CACJ;AAvDD,gDAuDC"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from "events";
|
|
3
|
+
import { OPCUACertificateManager } from "node-opcua-certificate-manager";
|
|
4
|
+
import { Certificate, PrivateKeyPEM } from "node-opcua-crypto";
|
|
5
|
+
import { MessageSecurityMode, SecurityPolicy, ServerSecureChannelLayer, ServerSecureChannelParent } from "node-opcua-secure-channel";
|
|
6
|
+
import { EndpointDescription } from "node-opcua-service-endpoints";
|
|
7
|
+
import { ApplicationDescription } from "node-opcua-service-endpoints";
|
|
8
|
+
export interface OPCUAServerEndPointOptions {
|
|
9
|
+
/**
|
|
10
|
+
* the tcp port
|
|
11
|
+
*/
|
|
12
|
+
port: number;
|
|
13
|
+
/**
|
|
14
|
+
* the DER certificate chain
|
|
15
|
+
*/
|
|
16
|
+
certificateChain: Certificate;
|
|
17
|
+
/**
|
|
18
|
+
* privateKey
|
|
19
|
+
*/
|
|
20
|
+
privateKey: PrivateKeyPEM;
|
|
21
|
+
certificateManager: OPCUACertificateManager;
|
|
22
|
+
/**
|
|
23
|
+
* the default secureToken lifetime @default=60000
|
|
24
|
+
*/
|
|
25
|
+
defaultSecureTokenLifetime?: number;
|
|
26
|
+
/**
|
|
27
|
+
* the maximum number of connection allowed on the TCP server socket
|
|
28
|
+
* @default 20
|
|
29
|
+
*/
|
|
30
|
+
maxConnections?: number;
|
|
31
|
+
/**
|
|
32
|
+
* the timeout for the TCP HEL/ACK transaction (in ms)
|
|
33
|
+
* @default 30000
|
|
34
|
+
*/
|
|
35
|
+
timeout?: number;
|
|
36
|
+
serverInfo: ApplicationDescription;
|
|
37
|
+
objectFactory?: any;
|
|
38
|
+
}
|
|
39
|
+
export interface EndpointDescriptionParams {
|
|
40
|
+
allowAnonymous?: boolean;
|
|
41
|
+
restricted?: boolean;
|
|
42
|
+
allowUnsecurePassword?: boolean;
|
|
43
|
+
resourcePath?: string;
|
|
44
|
+
alternateHostname?: string[];
|
|
45
|
+
hostname: string;
|
|
46
|
+
securityPolicies: SecurityPolicy[];
|
|
47
|
+
}
|
|
48
|
+
export interface AddStandardEndpointDescriptionsParam {
|
|
49
|
+
securityModes?: MessageSecurityMode[];
|
|
50
|
+
securityPolicies?: SecurityPolicy[];
|
|
51
|
+
disableDiscovery?: boolean;
|
|
52
|
+
allowAnonymous?: boolean;
|
|
53
|
+
restricted?: boolean;
|
|
54
|
+
hostname?: string;
|
|
55
|
+
alternateHostname?: string[];
|
|
56
|
+
allowUnsecurePassword?: boolean;
|
|
57
|
+
resourcePath?: string;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* OPCUAServerEndPoint a Server EndPoint.
|
|
61
|
+
* A sever end point is listening to one port
|
|
62
|
+
* note:
|
|
63
|
+
* see OPCUA Release 1.03 part 4 page 108 7.1 ApplicationDescription
|
|
64
|
+
*/
|
|
65
|
+
export declare class OPCUAServerEndPoint extends EventEmitter implements ServerSecureChannelParent {
|
|
66
|
+
/**
|
|
67
|
+
* the tcp port
|
|
68
|
+
*/
|
|
69
|
+
port: number;
|
|
70
|
+
certificateManager: OPCUACertificateManager;
|
|
71
|
+
defaultSecureTokenLifetime: number;
|
|
72
|
+
maxConnections: number;
|
|
73
|
+
timeout: number;
|
|
74
|
+
bytesWrittenInOldChannels: number;
|
|
75
|
+
bytesReadInOldChannels: number;
|
|
76
|
+
transactionsCountOldChannels: number;
|
|
77
|
+
securityTokenCountOldChannels: number;
|
|
78
|
+
serverInfo: ApplicationDescription;
|
|
79
|
+
objectFactory: any;
|
|
80
|
+
_on_new_channel?: (channel: ServerSecureChannelLayer) => void;
|
|
81
|
+
_on_close_channel?: (channel: ServerSecureChannelLayer) => void;
|
|
82
|
+
_on_connectionRefused?: (socketData: any) => void;
|
|
83
|
+
_on_openSecureChannelFailure?: (socketData: any, channelData: any) => void;
|
|
84
|
+
private _certificateChain;
|
|
85
|
+
private _privateKey;
|
|
86
|
+
private _channels;
|
|
87
|
+
private _server?;
|
|
88
|
+
private _endpoints;
|
|
89
|
+
private _listen_callback;
|
|
90
|
+
private _started;
|
|
91
|
+
private _counter;
|
|
92
|
+
private _policy_deduplicator;
|
|
93
|
+
constructor(options: OPCUAServerEndPointOptions);
|
|
94
|
+
dispose(): void;
|
|
95
|
+
toString(): string;
|
|
96
|
+
getChannels(): ServerSecureChannelLayer[];
|
|
97
|
+
/**
|
|
98
|
+
* Returns the X509 DER form of the server certificate
|
|
99
|
+
*/
|
|
100
|
+
getCertificate(): Certificate;
|
|
101
|
+
/**
|
|
102
|
+
* Returns the X509 DER form of the server certificate
|
|
103
|
+
*/
|
|
104
|
+
getCertificateChain(): Certificate;
|
|
105
|
+
/**
|
|
106
|
+
* the private key
|
|
107
|
+
*/
|
|
108
|
+
getPrivateKey(): PrivateKeyPEM;
|
|
109
|
+
/**
|
|
110
|
+
* The number of active channel on this end point.
|
|
111
|
+
*/
|
|
112
|
+
get currentChannelCount(): number;
|
|
113
|
+
/**
|
|
114
|
+
* @method getEndpointDescription
|
|
115
|
+
* @param securityMode
|
|
116
|
+
* @param securityPolicy
|
|
117
|
+
* @return endpoint_description {EndpointDescription|null}
|
|
118
|
+
*/
|
|
119
|
+
getEndpointDescription(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy, endpointUrl: string | null): EndpointDescription | null;
|
|
120
|
+
addEndpointDescription(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy, options?: EndpointDescriptionParams): void;
|
|
121
|
+
addRestrictedEndpointDescription(options: EndpointDescriptionParams): void;
|
|
122
|
+
addStandardEndpointDescriptions(options?: AddStandardEndpointDescriptionsParam): void;
|
|
123
|
+
/**
|
|
124
|
+
* returns the list of end point descriptions.
|
|
125
|
+
*/
|
|
126
|
+
endpointDescriptions(): EndpointDescription[];
|
|
127
|
+
/**
|
|
128
|
+
* @method listen
|
|
129
|
+
* @async
|
|
130
|
+
*/
|
|
131
|
+
listen(callback: (err?: Error) => void): void;
|
|
132
|
+
killClientSockets(callback: (err?: Error) => void): void;
|
|
133
|
+
suspendConnection(callback: (err?: Error) => void): void;
|
|
134
|
+
restoreConnection(callback: (err?: Error) => void): void;
|
|
135
|
+
abruptlyInterruptChannels(): void;
|
|
136
|
+
/**
|
|
137
|
+
* @method shutdown
|
|
138
|
+
* @async
|
|
139
|
+
*/
|
|
140
|
+
shutdown(callback: (err?: Error) => void): void;
|
|
141
|
+
/**
|
|
142
|
+
* @method start
|
|
143
|
+
* @async
|
|
144
|
+
* @param callback
|
|
145
|
+
*/
|
|
146
|
+
start(callback: (err?: Error) => void): void;
|
|
147
|
+
get bytesWritten(): number;
|
|
148
|
+
get bytesRead(): number;
|
|
149
|
+
get transactionsCount(): number;
|
|
150
|
+
get securityTokenCount(): number;
|
|
151
|
+
get activeChannelCount(): number;
|
|
152
|
+
private _dump_statistics;
|
|
153
|
+
private _setup_server;
|
|
154
|
+
private _on_client_connection;
|
|
155
|
+
private _preregisterChannel;
|
|
156
|
+
private _un_pre_registerChannel;
|
|
157
|
+
/**
|
|
158
|
+
* @method _registerChannel
|
|
159
|
+
* @param channel
|
|
160
|
+
* @private
|
|
161
|
+
*/
|
|
162
|
+
private _registerChannel;
|
|
163
|
+
/**
|
|
164
|
+
* @method _unregisterChannel
|
|
165
|
+
* @param channel
|
|
166
|
+
* @private
|
|
167
|
+
*/
|
|
168
|
+
private _unregisterChannel;
|
|
169
|
+
private _end_listen;
|
|
170
|
+
/**
|
|
171
|
+
* shutdown_channel
|
|
172
|
+
* @param channel
|
|
173
|
+
* @param inner_callback
|
|
174
|
+
*/
|
|
175
|
+
private shutdown_channel;
|
|
176
|
+
/**
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
private _prevent_DDOS_Attack;
|
|
180
|
+
}
|