node-opcua-server 2.73.1 → 2.76.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 +3 -1
- 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/filter/check_where_clause_on_address_space.d.ts +3 -0
- package/dist/filter/check_where_clause_on_address_space.js +23 -0
- package/dist/filter/check_where_clause_on_address_space.js.map +1 -0
- package/dist/filter/extract_event_fields.d.ts +10 -0
- package/dist/filter/extract_event_fields.js +18 -0
- package/dist/filter/extract_event_fields.js.map +1 -0
- package/dist/helper.d.ts +10 -10
- package/dist/helper.js +75 -75
- 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 +16 -16
- package/dist/index.js +32 -32
- package/dist/monitored_item.d.ts +177 -177
- package/dist/monitored_item.js +1001 -999
- package/dist/monitored_item.js.map +1 -1
- package/dist/node_sampler.d.ts +3 -3
- package/dist/node_sampler.js +75 -75
- package/dist/opcua_server.d.ts +747 -650
- package/dist/opcua_server.js +2431 -2394
- 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 +96 -96
- 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 +55 -55
- package/dist/server_capabilities.d.ts +148 -148
- package/dist/server_capabilities.js +92 -92
- package/dist/server_end_point.d.ts +183 -183
- package/dist/server_end_point.js +817 -817
- package/dist/server_engine.d.ts +317 -317
- package/dist/server_engine.js +1716 -1716
- package/dist/server_publish_engine.d.ts +113 -112
- package/dist/server_publish_engine.js +541 -535
- package/dist/server_publish_engine.js.map +1 -1
- package/dist/server_publish_engine_for_orphan_subscriptions.d.ts +16 -16
- package/dist/server_publish_engine_for_orphan_subscriptions.js +51 -51
- package/dist/server_session.d.ts +182 -182
- package/dist/server_session.js +739 -739
- package/dist/server_subscription.d.ts +421 -421
- package/dist/server_subscription.js +1346 -1345
- package/dist/server_subscription.js.map +1 -1
- package/dist/sessions_compatible_for_transfer.d.ts +2 -2
- package/dist/sessions_compatible_for_transfer.js +39 -39
- package/dist/user_manager.d.ts +32 -32
- package/dist/user_manager.js +74 -74
- package/dist/user_manager_ua.d.ts +3 -3
- package/dist/user_manager_ua.js +39 -39
- package/dist/validate_filter.d.ts +5 -5
- package/dist/validate_filter.js +60 -60
- package/package.json +50 -51
- package/source/filter/check_where_clause_on_address_space.ts +29 -0
- package/source/filter/extract_event_fields.ts +21 -0
- package/source/monitored_item.ts +5 -11
- package/source/opcua_server.ts +175 -36
- package/source/server_publish_engine.ts +24 -19
- package/source/server_subscription.ts +11 -10
package/dist/factory.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-server
|
|
3
|
-
*/
|
|
4
|
-
import { ExtensionObject } from "node-opcua-extension-object";
|
|
5
|
-
import { ExpandedNodeId } from "node-opcua-nodeid";
|
|
6
|
-
export interface EngineForFactory {
|
|
7
|
-
}
|
|
8
|
-
export declare class Factory {
|
|
9
|
-
engine: EngineForFactory;
|
|
10
|
-
constructor(engine: EngineForFactory);
|
|
11
|
-
constructObject(id: ExpandedNodeId): ExtensionObject;
|
|
12
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-server
|
|
3
|
+
*/
|
|
4
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
5
|
+
import { ExpandedNodeId } from "node-opcua-nodeid";
|
|
6
|
+
export interface EngineForFactory {
|
|
7
|
+
}
|
|
8
|
+
export declare class Factory {
|
|
9
|
+
engine: EngineForFactory;
|
|
10
|
+
constructor(engine: EngineForFactory);
|
|
11
|
+
constructObject(id: ExpandedNodeId): ExtensionObject;
|
|
12
|
+
}
|
package/dist/factory.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-server
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.Factory = void 0;
|
|
7
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
-
const node_opcua_extension_object_1 = require("node-opcua-extension-object");
|
|
9
|
-
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
10
|
-
class Factory {
|
|
11
|
-
constructor(engine) {
|
|
12
|
-
(0, node_opcua_assert_1.assert)(engine !== null && typeof engine === "object");
|
|
13
|
-
this.engine = engine;
|
|
14
|
-
}
|
|
15
|
-
constructObject(id) {
|
|
16
|
-
const obj = (0, node_opcua_factory_1.constructObject)(id);
|
|
17
|
-
if (!(obj instanceof node_opcua_extension_object_1.ExtensionObject)) {
|
|
18
|
-
throw new Error("Internal Error constructObject");
|
|
19
|
-
}
|
|
20
|
-
return obj;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
exports.Factory = Factory;
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-server
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Factory = void 0;
|
|
7
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
+
const node_opcua_extension_object_1 = require("node-opcua-extension-object");
|
|
9
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
10
|
+
class Factory {
|
|
11
|
+
constructor(engine) {
|
|
12
|
+
(0, node_opcua_assert_1.assert)(engine !== null && typeof engine === "object");
|
|
13
|
+
this.engine = engine;
|
|
14
|
+
}
|
|
15
|
+
constructObject(id) {
|
|
16
|
+
const obj = (0, node_opcua_factory_1.constructObject)(id);
|
|
17
|
+
if (!(obj instanceof node_opcua_extension_object_1.ExtensionObject)) {
|
|
18
|
+
throw new Error("Internal Error constructObject");
|
|
19
|
+
}
|
|
20
|
+
return obj;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Factory = Factory;
|
|
24
24
|
//# sourceMappingURL=factory.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { IAddressSpace, ISessionContext, IEventData } from "node-opcua-address-space-base";
|
|
2
|
+
import { ContentFilter } from "node-opcua-types";
|
|
3
|
+
export declare function checkWhereClauseOnAdressSpace(addressSpace: IAddressSpace, sessionContext: ISessionContext, whereClause: ContentFilter, eventData: IEventData): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkWhereClauseOnAdressSpace = void 0;
|
|
4
|
+
const node_opcua_service_filter_1 = require("node-opcua-service-filter");
|
|
5
|
+
const node_opcua_service_filter_2 = require("node-opcua-service-filter");
|
|
6
|
+
function checkWhereClauseOnAdressSpace(addressSpace, sessionContext, whereClause, eventData) {
|
|
7
|
+
// const filterContext: FilterContext = {
|
|
8
|
+
// addressSpace,
|
|
9
|
+
// sessionContext,
|
|
10
|
+
// rootNode: eventData.$eventDataSource!,
|
|
11
|
+
// extractValue(operand: FilterOperand) {
|
|
12
|
+
// if (operand instanceof SimpleAttributeOperand) {
|
|
13
|
+
// return extractEventFields(filterContext.sessionContext, [operand], eventData)[0];
|
|
14
|
+
// } else {
|
|
15
|
+
// return new Variant({ dataType: DataType.Null });
|
|
16
|
+
// }
|
|
17
|
+
// }
|
|
18
|
+
// };
|
|
19
|
+
const filterContext = new node_opcua_service_filter_2.FilterContextOnAddressSpace(sessionContext, eventData);
|
|
20
|
+
return (0, node_opcua_service_filter_1.checkFilter)(filterContext, whereClause);
|
|
21
|
+
}
|
|
22
|
+
exports.checkWhereClauseOnAdressSpace = checkWhereClauseOnAdressSpace;
|
|
23
|
+
//# sourceMappingURL=check_where_clause_on_address_space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check_where_clause_on_address_space.js","sourceRoot":"","sources":["../../source/filter/check_where_clause_on_address_space.ts"],"names":[],"mappings":";;;AACA,yEAAwD;AACxD,yEAAwE;AAGxE,SAAgB,6BAA6B,CACzC,YAA2B,EAC3B,cAA+B,EAC/B,WAA0B,EAC1B,SAAqB;IAIrB,yCAAyC;IACzC,oBAAoB;IACpB,sBAAsB;IACtB,6CAA6C;IAC7C,6CAA6C;IAC7C,2DAA2D;IAC3D,gGAAgG;IAChG,mBAAmB;IACnB,+DAA+D;IAC/D,YAAY;IACZ,QAAQ;IACR,KAAK;IACL,MAAM,aAAa,GAAG,IAAI,uDAA2B,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAEjF,OAAO,IAAA,uCAAW,EAAC,aAAa,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAvBD,sEAuBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IEventData, ISessionContext } from "node-opcua-address-space-base";
|
|
2
|
+
import { SimpleAttributeOperand } from "node-opcua-types";
|
|
3
|
+
import { Variant } from "node-opcua-variant";
|
|
4
|
+
/**
|
|
5
|
+
* @method extractEventFields
|
|
6
|
+
* extract a array of eventFields from a event node, matching the selectClauses
|
|
7
|
+
* @param selectClauses
|
|
8
|
+
* @param eventData : a pseudo Node that provides a browse Method and a readValue(nodeId)
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractEventFields(sessionContext: ISessionContext, selectClauses: SimpleAttributeOperand[], eventData: IEventData): Variant[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractEventFields = void 0;
|
|
4
|
+
const node_opcua_service_filter_1 = require("node-opcua-service-filter");
|
|
5
|
+
const node_opcua_service_filter_2 = require("node-opcua-service-filter");
|
|
6
|
+
//
|
|
7
|
+
/**
|
|
8
|
+
* @method extractEventFields
|
|
9
|
+
* extract a array of eventFields from a event node, matching the selectClauses
|
|
10
|
+
* @param selectClauses
|
|
11
|
+
* @param eventData : a pseudo Node that provides a browse Method and a readValue(nodeId)
|
|
12
|
+
*/
|
|
13
|
+
function extractEventFields(sessionContext, selectClauses, eventData) {
|
|
14
|
+
const context = new node_opcua_service_filter_2.FilterContextOnAddressSpace(sessionContext, eventData);
|
|
15
|
+
return (0, node_opcua_service_filter_1.extractEventFieldsBase)(context, selectClauses);
|
|
16
|
+
}
|
|
17
|
+
exports.extractEventFields = extractEventFields;
|
|
18
|
+
//# sourceMappingURL=extract_event_fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract_event_fields.js","sourceRoot":"","sources":["../../source/filter/extract_event_fields.ts"],"names":[],"mappings":";;;AACA,yEAAmE;AACnE,yEAAwE;AAGxE,EAAE;AAEF;;;;;GAKG;AACH,SAAgB,kBAAkB,CAC9B,cAA+B,EAC/B,aAAuC,EACvC,SAAqB;IAErB,MAAM,OAAO,GAAG,IAAI,uDAA2B,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;IAC3E,OAAO,IAAA,kDAAsB,EAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC1D,CAAC;AAPD,gDAOC"}
|
package/dist/helper.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { OPCUAServer } from "./opcua_server";
|
|
2
|
-
import { ServerEngine } from "./server_engine";
|
|
3
|
-
import { Subscription } from "./server_subscription";
|
|
4
|
-
/**
|
|
5
|
-
*
|
|
6
|
-
* @private
|
|
7
|
-
*/
|
|
8
|
-
export declare function installSessionLogging(server: OPCUAServer): void;
|
|
9
|
-
export declare function installSubscriptionMonitoring(subscription: Subscription): void;
|
|
10
|
-
export declare function installSessionLoggingOnEngine(serverEngine: ServerEngine): void;
|
|
1
|
+
import { OPCUAServer } from "./opcua_server";
|
|
2
|
+
import { ServerEngine } from "./server_engine";
|
|
3
|
+
import { Subscription } from "./server_subscription";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
export declare function installSessionLogging(server: OPCUAServer): void;
|
|
9
|
+
export declare function installSubscriptionMonitoring(subscription: Subscription): void;
|
|
10
|
+
export declare function installSessionLoggingOnEngine(serverEngine: ServerEngine): void;
|
package/dist/helper.js
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.installSessionLoggingOnEngine = exports.installSubscriptionMonitoring = exports.installSessionLogging = void 0;
|
|
4
|
-
const util = require("util");
|
|
5
|
-
const server_subscription_1 = require("./server_subscription");
|
|
6
|
-
const consolelog = (...args) => {
|
|
7
|
-
const d = new Date();
|
|
8
|
-
const t = d.toTimeString().split(" ")[0] + "." + d.getMilliseconds().toString().padStart(3, "0");
|
|
9
|
-
console.log.apply(console, [t, ...args]);
|
|
10
|
-
};
|
|
11
|
-
const doDebug = false;
|
|
12
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
function installSessionLogging(server) {
|
|
17
|
-
installSessionLoggingOnEngine(server.engine);
|
|
18
|
-
}
|
|
19
|
-
exports.installSessionLogging = installSessionLogging;
|
|
20
|
-
const info = (subscription) => {
|
|
21
|
-
var _a;
|
|
22
|
-
return util.format(subscription.subscriptionId, server_subscription_1.SubscriptionState[subscription.state].padEnd(9), subscription.state, "kac=", subscription.currentKeepAliveCount.toString().padStart(3) +
|
|
23
|
-
"/" +
|
|
24
|
-
subscription.maxKeepAliveCount.toString().padStart(3), "ltc=", subscription.currentLifetimeCount.toString().padStart(3) +
|
|
25
|
-
"/" +
|
|
26
|
-
subscription.lifeTimeCount.toString().padStart(3), "prc=", (_a = subscription.publishEngine) === null || _a === void 0 ? void 0 : _a.pendingPublishRequestCount.toString().padStart(3), "pi=", subscription.publishingInterval);
|
|
27
|
-
};
|
|
28
|
-
function installSubscriptionMonitoring(subscription) {
|
|
29
|
-
consolelog("new_subscription", subscription.subscriptionId, info(subscription));
|
|
30
|
-
subscription.on("lifeTimeExpired", () => {
|
|
31
|
-
consolelog("lifeTimeExpired".padEnd(45), info(subscription));
|
|
32
|
-
});
|
|
33
|
-
if (true || doDebug) {
|
|
34
|
-
subscription.on("lifeTimeCounterChanged", (ltc) => {
|
|
35
|
-
consolelog("subscription lifeTimeCounterChanged".padEnd(45), info(subscription));
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
subscription.on("expired", () => {
|
|
39
|
-
consolelog("subscription expired".padEnd(45), info(subscription));
|
|
40
|
-
});
|
|
41
|
-
subscription.on("stateChanged", (state) => {
|
|
42
|
-
consolelog("subscription stateChanged".padEnd(45), info(subscription));
|
|
43
|
-
});
|
|
44
|
-
subscription.on("terminate", () => {
|
|
45
|
-
consolelog("subscription terminated".padEnd(45), info(subscription));
|
|
46
|
-
});
|
|
47
|
-
subscription.on("keepalive", () => {
|
|
48
|
-
consolelog("subscription keepalive".padEnd(45), info(subscription));
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
exports.installSubscriptionMonitoring = installSubscriptionMonitoring;
|
|
52
|
-
function installSessionLoggingOnEngine(serverEngine) {
|
|
53
|
-
function on_create_session(session) {
|
|
54
|
-
try {
|
|
55
|
-
session.on("activate_session", function () {
|
|
56
|
-
consolelog("activate_session");
|
|
57
|
-
});
|
|
58
|
-
session.on("statusChanged", (status) => {
|
|
59
|
-
consolelog("session status changed: ", status);
|
|
60
|
-
});
|
|
61
|
-
session.on("new_subscription", function (subscription) {
|
|
62
|
-
installSubscriptionMonitoring(subscription);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
catch (err) {
|
|
66
|
-
consolelog(err.message);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
serverEngine.on("create_session", on_create_session);
|
|
70
|
-
serverEngine.once("session_closed", function (session) {
|
|
71
|
-
consolelog("session is closed");
|
|
72
|
-
serverEngine.removeListener("create_session", on_create_session);
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
exports.installSessionLoggingOnEngine = installSessionLoggingOnEngine;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.installSessionLoggingOnEngine = exports.installSubscriptionMonitoring = exports.installSessionLogging = void 0;
|
|
4
|
+
const util = require("util");
|
|
5
|
+
const server_subscription_1 = require("./server_subscription");
|
|
6
|
+
const consolelog = (...args) => {
|
|
7
|
+
const d = new Date();
|
|
8
|
+
const t = d.toTimeString().split(" ")[0] + "." + d.getMilliseconds().toString().padStart(3, "0");
|
|
9
|
+
console.log.apply(console, [t, ...args]);
|
|
10
|
+
};
|
|
11
|
+
const doDebug = false;
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
function installSessionLogging(server) {
|
|
17
|
+
installSessionLoggingOnEngine(server.engine);
|
|
18
|
+
}
|
|
19
|
+
exports.installSessionLogging = installSessionLogging;
|
|
20
|
+
const info = (subscription) => {
|
|
21
|
+
var _a;
|
|
22
|
+
return util.format(subscription.subscriptionId, server_subscription_1.SubscriptionState[subscription.state].padEnd(9), subscription.state, "kac=", subscription.currentKeepAliveCount.toString().padStart(3) +
|
|
23
|
+
"/" +
|
|
24
|
+
subscription.maxKeepAliveCount.toString().padStart(3), "ltc=", subscription.currentLifetimeCount.toString().padStart(3) +
|
|
25
|
+
"/" +
|
|
26
|
+
subscription.lifeTimeCount.toString().padStart(3), "prc=", (_a = subscription.publishEngine) === null || _a === void 0 ? void 0 : _a.pendingPublishRequestCount.toString().padStart(3), "pi=", subscription.publishingInterval);
|
|
27
|
+
};
|
|
28
|
+
function installSubscriptionMonitoring(subscription) {
|
|
29
|
+
consolelog("new_subscription", subscription.subscriptionId, info(subscription));
|
|
30
|
+
subscription.on("lifeTimeExpired", () => {
|
|
31
|
+
consolelog("lifeTimeExpired".padEnd(45), info(subscription));
|
|
32
|
+
});
|
|
33
|
+
if (true || doDebug) {
|
|
34
|
+
subscription.on("lifeTimeCounterChanged", (ltc) => {
|
|
35
|
+
consolelog("subscription lifeTimeCounterChanged".padEnd(45), info(subscription));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
subscription.on("expired", () => {
|
|
39
|
+
consolelog("subscription expired".padEnd(45), info(subscription));
|
|
40
|
+
});
|
|
41
|
+
subscription.on("stateChanged", (state) => {
|
|
42
|
+
consolelog("subscription stateChanged".padEnd(45), info(subscription));
|
|
43
|
+
});
|
|
44
|
+
subscription.on("terminate", () => {
|
|
45
|
+
consolelog("subscription terminated".padEnd(45), info(subscription));
|
|
46
|
+
});
|
|
47
|
+
subscription.on("keepalive", () => {
|
|
48
|
+
consolelog("subscription keepalive".padEnd(45), info(subscription));
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.installSubscriptionMonitoring = installSubscriptionMonitoring;
|
|
52
|
+
function installSessionLoggingOnEngine(serverEngine) {
|
|
53
|
+
function on_create_session(session) {
|
|
54
|
+
try {
|
|
55
|
+
session.on("activate_session", function () {
|
|
56
|
+
consolelog("activate_session");
|
|
57
|
+
});
|
|
58
|
+
session.on("statusChanged", (status) => {
|
|
59
|
+
consolelog("session status changed: ", status);
|
|
60
|
+
});
|
|
61
|
+
session.on("new_subscription", function (subscription) {
|
|
62
|
+
installSubscriptionMonitoring(subscription);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
consolelog(err.message);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
serverEngine.on("create_session", on_create_session);
|
|
70
|
+
serverEngine.once("session_closed", function (session) {
|
|
71
|
+
consolelog("session is closed");
|
|
72
|
+
serverEngine.removeListener("create_session", on_create_session);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
exports.installSessionLoggingOnEngine = installSessionLoggingOnEngine;
|
|
76
76
|
//# sourceMappingURL=helper.js.map
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
export interface HistoryServerCapabilitiesOptions {
|
|
2
|
-
accessHistoryDataCapability?: boolean;
|
|
3
|
-
accessHistoryEventsCapability?: boolean;
|
|
4
|
-
maxReturnDataValues?: number;
|
|
5
|
-
maxReturnEventValues?: number;
|
|
6
|
-
insertDataCapability?: boolean;
|
|
7
|
-
replaceDataCapability?: boolean;
|
|
8
|
-
updateDataCapability?: boolean;
|
|
9
|
-
deleteRawCapability?: boolean;
|
|
10
|
-
deleteAtTimeCapability?: boolean;
|
|
11
|
-
insertEventCapability?: boolean;
|
|
12
|
-
replaceEventCapability?: boolean;
|
|
13
|
-
updateEventCapability?: boolean;
|
|
14
|
-
deleteEventCapability?: boolean;
|
|
15
|
-
insertAnnotationCapability?: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
*/
|
|
19
|
-
export declare class HistoryServerCapabilities {
|
|
20
|
-
accessHistoryDataCapability: boolean;
|
|
21
|
-
accessHistoryEventsCapability: boolean;
|
|
22
|
-
maxReturnDataValues: number;
|
|
23
|
-
maxReturnEventValues: number;
|
|
24
|
-
insertDataCapability: boolean;
|
|
25
|
-
replaceDataCapability: boolean;
|
|
26
|
-
updateDataCapability: boolean;
|
|
27
|
-
deleteRawCapability: boolean;
|
|
28
|
-
deleteAtTimeCapability: boolean;
|
|
29
|
-
insertEventCapability: boolean;
|
|
30
|
-
replaceEventCapability: boolean;
|
|
31
|
-
updateEventCapability: boolean;
|
|
32
|
-
deleteEventCapability: boolean;
|
|
33
|
-
insertAnnotationCapability: boolean;
|
|
34
|
-
constructor(options?: HistoryServerCapabilitiesOptions);
|
|
35
|
-
}
|
|
1
|
+
export interface HistoryServerCapabilitiesOptions {
|
|
2
|
+
accessHistoryDataCapability?: boolean;
|
|
3
|
+
accessHistoryEventsCapability?: boolean;
|
|
4
|
+
maxReturnDataValues?: number;
|
|
5
|
+
maxReturnEventValues?: number;
|
|
6
|
+
insertDataCapability?: boolean;
|
|
7
|
+
replaceDataCapability?: boolean;
|
|
8
|
+
updateDataCapability?: boolean;
|
|
9
|
+
deleteRawCapability?: boolean;
|
|
10
|
+
deleteAtTimeCapability?: boolean;
|
|
11
|
+
insertEventCapability?: boolean;
|
|
12
|
+
replaceEventCapability?: boolean;
|
|
13
|
+
updateEventCapability?: boolean;
|
|
14
|
+
deleteEventCapability?: boolean;
|
|
15
|
+
insertAnnotationCapability?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
*/
|
|
19
|
+
export declare class HistoryServerCapabilities {
|
|
20
|
+
accessHistoryDataCapability: boolean;
|
|
21
|
+
accessHistoryEventsCapability: boolean;
|
|
22
|
+
maxReturnDataValues: number;
|
|
23
|
+
maxReturnEventValues: number;
|
|
24
|
+
insertDataCapability: boolean;
|
|
25
|
+
replaceDataCapability: boolean;
|
|
26
|
+
updateDataCapability: boolean;
|
|
27
|
+
deleteRawCapability: boolean;
|
|
28
|
+
deleteAtTimeCapability: boolean;
|
|
29
|
+
insertEventCapability: boolean;
|
|
30
|
+
replaceEventCapability: boolean;
|
|
31
|
+
updateEventCapability: boolean;
|
|
32
|
+
deleteEventCapability: boolean;
|
|
33
|
+
insertAnnotationCapability: boolean;
|
|
34
|
+
constructor(options?: HistoryServerCapabilitiesOptions);
|
|
35
|
+
}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HistoryServerCapabilities = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-server
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
-
/**
|
|
9
|
-
*/
|
|
10
|
-
class HistoryServerCapabilities {
|
|
11
|
-
constructor(options) {
|
|
12
|
-
options = options || {};
|
|
13
|
-
function coerceBool(value, defaultValue) {
|
|
14
|
-
if (undefined === value) {
|
|
15
|
-
return defaultValue;
|
|
16
|
-
}
|
|
17
|
-
(0, node_opcua_assert_1.assert)(typeof value === "boolean");
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
function coerceUInt32(value, defaultValue) {
|
|
21
|
-
if (undefined === value) {
|
|
22
|
-
return defaultValue;
|
|
23
|
-
}
|
|
24
|
-
(0, node_opcua_assert_1.assert)(typeof value === "number");
|
|
25
|
-
return value;
|
|
26
|
-
}
|
|
27
|
-
this.accessHistoryDataCapability = coerceBool(options.accessHistoryDataCapability, false);
|
|
28
|
-
this.accessHistoryEventsCapability = coerceBool(options.accessHistoryEventsCapability, false);
|
|
29
|
-
this.maxReturnDataValues = coerceUInt32(options.maxReturnDataValues, 0);
|
|
30
|
-
this.maxReturnEventValues = coerceUInt32(options.maxReturnEventValues, 0);
|
|
31
|
-
this.insertDataCapability = coerceBool(options.insertDataCapability, false);
|
|
32
|
-
this.replaceDataCapability = coerceBool(options.replaceDataCapability, false);
|
|
33
|
-
this.updateDataCapability = coerceBool(options.updateDataCapability, false);
|
|
34
|
-
this.deleteRawCapability = coerceBool(options.deleteRawCapability, false);
|
|
35
|
-
this.deleteAtTimeCapability = coerceBool(options.deleteAtTimeCapability, false);
|
|
36
|
-
this.insertEventCapability = coerceBool(options.insertEventCapability, false);
|
|
37
|
-
this.replaceEventCapability = coerceBool(options.replaceEventCapability, false);
|
|
38
|
-
this.updateEventCapability = coerceBool(options.updateEventCapability, false);
|
|
39
|
-
this.deleteEventCapability = coerceBool(options.deleteEventCapability, false);
|
|
40
|
-
this.insertAnnotationCapability = coerceBool(options.insertAnnotationCapability, false);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
exports.HistoryServerCapabilities = HistoryServerCapabilities;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HistoryServerCapabilities = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-server
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
+
/**
|
|
9
|
+
*/
|
|
10
|
+
class HistoryServerCapabilities {
|
|
11
|
+
constructor(options) {
|
|
12
|
+
options = options || {};
|
|
13
|
+
function coerceBool(value, defaultValue) {
|
|
14
|
+
if (undefined === value) {
|
|
15
|
+
return defaultValue;
|
|
16
|
+
}
|
|
17
|
+
(0, node_opcua_assert_1.assert)(typeof value === "boolean");
|
|
18
|
+
return value;
|
|
19
|
+
}
|
|
20
|
+
function coerceUInt32(value, defaultValue) {
|
|
21
|
+
if (undefined === value) {
|
|
22
|
+
return defaultValue;
|
|
23
|
+
}
|
|
24
|
+
(0, node_opcua_assert_1.assert)(typeof value === "number");
|
|
25
|
+
return value;
|
|
26
|
+
}
|
|
27
|
+
this.accessHistoryDataCapability = coerceBool(options.accessHistoryDataCapability, false);
|
|
28
|
+
this.accessHistoryEventsCapability = coerceBool(options.accessHistoryEventsCapability, false);
|
|
29
|
+
this.maxReturnDataValues = coerceUInt32(options.maxReturnDataValues, 0);
|
|
30
|
+
this.maxReturnEventValues = coerceUInt32(options.maxReturnEventValues, 0);
|
|
31
|
+
this.insertDataCapability = coerceBool(options.insertDataCapability, false);
|
|
32
|
+
this.replaceDataCapability = coerceBool(options.replaceDataCapability, false);
|
|
33
|
+
this.updateDataCapability = coerceBool(options.updateDataCapability, false);
|
|
34
|
+
this.deleteRawCapability = coerceBool(options.deleteRawCapability, false);
|
|
35
|
+
this.deleteAtTimeCapability = coerceBool(options.deleteAtTimeCapability, false);
|
|
36
|
+
this.insertEventCapability = coerceBool(options.insertEventCapability, false);
|
|
37
|
+
this.replaceEventCapability = coerceBool(options.replaceEventCapability, false);
|
|
38
|
+
this.updateEventCapability = coerceBool(options.updateEventCapability, false);
|
|
39
|
+
this.deleteEventCapability = coerceBool(options.deleteEventCapability, false);
|
|
40
|
+
this.insertAnnotationCapability = coerceBool(options.insertAnnotationCapability, false);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.HistoryServerCapabilities = HistoryServerCapabilities;
|
|
44
44
|
//# sourceMappingURL=history_server_capabilities.js.map
|
package/dist/i_channel_data.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { AsymmetricAlgorithmSecurityHeader, MessageSecurityMode, SecurityPolicy } from "node-opcua-secure-channel";
|
|
3
|
-
export interface IChannelData {
|
|
4
|
-
channelId: number | null;
|
|
5
|
-
clientCertificate: Buffer | null;
|
|
6
|
-
clientNonce: Buffer | null;
|
|
7
|
-
clientSecurityHeader: any;
|
|
8
|
-
securityHeader: AsymmetricAlgorithmSecurityHeader | null;
|
|
9
|
-
securityMode: MessageSecurityMode;
|
|
10
|
-
securityPolicy: SecurityPolicy;
|
|
11
|
-
timeout: number;
|
|
12
|
-
transactionsCount: number;
|
|
13
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AsymmetricAlgorithmSecurityHeader, MessageSecurityMode, SecurityPolicy } from "node-opcua-secure-channel";
|
|
3
|
+
export interface IChannelData {
|
|
4
|
+
channelId: number | null;
|
|
5
|
+
clientCertificate: Buffer | null;
|
|
6
|
+
clientNonce: Buffer | null;
|
|
7
|
+
clientSecurityHeader: any;
|
|
8
|
+
securityHeader: AsymmetricAlgorithmSecurityHeader | null;
|
|
9
|
+
securityMode: MessageSecurityMode;
|
|
10
|
+
securityPolicy: SecurityPolicy;
|
|
11
|
+
timeout: number;
|
|
12
|
+
transactionsCount: number;
|
|
13
|
+
}
|
package/dist/i_channel_data.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=i_channel_data.js.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-server
|
|
4
|
-
*/
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
import { ErrorCallback } from "node-opcua-status-code";
|
|
7
|
-
export interface IRegisterServerManager extends EventEmitter {
|
|
8
|
-
discoveryServerEndpointUrl: string;
|
|
9
|
-
start(callback: ErrorCallback): void;
|
|
10
|
-
stop(callback: ErrorCallback): void;
|
|
11
|
-
dispose(): void;
|
|
12
|
-
on(eventName: "serverRegistrationPending", eventHandler: () => void): this;
|
|
13
|
-
on(eventName: "serverRegistered", eventHandler: () => void): this;
|
|
14
|
-
on(eventName: "serverRegistrationRenewed", eventHandler: () => void): this;
|
|
15
|
-
on(eventName: "serverUnregistered", eventHandler: () => void): this;
|
|
16
|
-
}
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-server
|
|
4
|
+
*/
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
import { ErrorCallback } from "node-opcua-status-code";
|
|
7
|
+
export interface IRegisterServerManager extends EventEmitter {
|
|
8
|
+
discoveryServerEndpointUrl: string;
|
|
9
|
+
start(callback: ErrorCallback): void;
|
|
10
|
+
stop(callback: ErrorCallback): void;
|
|
11
|
+
dispose(): void;
|
|
12
|
+
on(eventName: "serverRegistrationPending", eventHandler: () => void): this;
|
|
13
|
+
on(eventName: "serverRegistered", eventHandler: () => void): this;
|
|
14
|
+
on(eventName: "serverRegistrationRenewed", eventHandler: () => void): this;
|
|
15
|
+
on(eventName: "serverUnregistered", eventHandler: () => void): this;
|
|
16
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
//# sourceMappingURL=i_register_server_manager.js.map
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { PublishResponseOptions, StatusChangeNotification } from "node-opcua-types";
|
|
2
|
-
import { Subscription } from "./server_subscription";
|
|
3
|
-
export interface INotifMsg {
|
|
4
|
-
subscriptionId: number;
|
|
5
|
-
sequenceNumber: number;
|
|
6
|
-
notificationData: any;
|
|
7
|
-
moreNotifications: boolean;
|
|
8
|
-
}
|
|
9
|
-
export interface IServerSidePublishEngine {
|
|
10
|
-
on_close_subscription(subscription: IClosedOrTransferredSubscription): void;
|
|
11
|
-
readonly pendingPublishRequestCount: number;
|
|
12
|
-
_on_tick(): void;
|
|
13
|
-
send_keep_alive_response(subscriptionId: number, future_sequence_number: number): boolean;
|
|
14
|
-
_send_response(subscription: Subscription, options: PublishResponseOptions): void;
|
|
15
|
-
}
|
|
16
|
-
export interface IClosedOrTransferredSubscription {
|
|
17
|
-
readonly hasPendingNotifications: boolean;
|
|
18
|
-
dispose(): void;
|
|
19
|
-
readonly id: number;
|
|
20
|
-
_publish_pending_notifications(): void;
|
|
21
|
-
}
|
|
22
|
-
export declare class TransferredSubscription implements IClosedOrTransferredSubscription {
|
|
23
|
-
id: number;
|
|
24
|
-
publishEngine: any;
|
|
25
|
-
_pending_notification?: StatusChangeNotification;
|
|
26
|
-
private _sequence_number_generator;
|
|
27
|
-
constructor(options: {
|
|
28
|
-
id: number;
|
|
29
|
-
generator: any;
|
|
30
|
-
publishEngine: any;
|
|
31
|
-
});
|
|
32
|
-
get hasPendingNotifications(): boolean;
|
|
33
|
-
dispose(): void;
|
|
34
|
-
_publish_pending_notifications(): void;
|
|
35
|
-
private _get_next_sequence_number;
|
|
36
|
-
}
|
|
1
|
+
import { PublishResponseOptions, StatusChangeNotification } from "node-opcua-types";
|
|
2
|
+
import { Subscription } from "./server_subscription";
|
|
3
|
+
export interface INotifMsg {
|
|
4
|
+
subscriptionId: number;
|
|
5
|
+
sequenceNumber: number;
|
|
6
|
+
notificationData: any;
|
|
7
|
+
moreNotifications: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IServerSidePublishEngine {
|
|
10
|
+
on_close_subscription(subscription: IClosedOrTransferredSubscription): void;
|
|
11
|
+
readonly pendingPublishRequestCount: number;
|
|
12
|
+
_on_tick(): void;
|
|
13
|
+
send_keep_alive_response(subscriptionId: number, future_sequence_number: number): boolean;
|
|
14
|
+
_send_response(subscription: Subscription, options: PublishResponseOptions): void;
|
|
15
|
+
}
|
|
16
|
+
export interface IClosedOrTransferredSubscription {
|
|
17
|
+
readonly hasPendingNotifications: boolean;
|
|
18
|
+
dispose(): void;
|
|
19
|
+
readonly id: number;
|
|
20
|
+
_publish_pending_notifications(): void;
|
|
21
|
+
}
|
|
22
|
+
export declare class TransferredSubscription implements IClosedOrTransferredSubscription {
|
|
23
|
+
id: number;
|
|
24
|
+
publishEngine: any;
|
|
25
|
+
_pending_notification?: StatusChangeNotification;
|
|
26
|
+
private _sequence_number_generator;
|
|
27
|
+
constructor(options: {
|
|
28
|
+
id: number;
|
|
29
|
+
generator: any;
|
|
30
|
+
publishEngine: any;
|
|
31
|
+
});
|
|
32
|
+
get hasPendingNotifications(): boolean;
|
|
33
|
+
dispose(): void;
|
|
34
|
+
_publish_pending_notifications(): void;
|
|
35
|
+
private _get_next_sequence_number;
|
|
36
|
+
}
|