node-opcua-server 2.76.0 → 2.77.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/factory.js.map +1 -1
- package/dist/filter/check_where_clause_on_address_space.d.ts +3 -3
- package/dist/filter/check_where_clause_on_address_space.js +22 -22
- package/dist/filter/extract_event_fields.d.ts +10 -10
- package/dist/filter/extract_event_fields.js +17 -17
- 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 -1001
- package/dist/node_sampler.d.ts +3 -3
- package/dist/node_sampler.js +75 -75
- package/dist/opcua_server.d.ts +747 -747
- package/dist/opcua_server.js +2431 -2431
- 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 +819 -817
- package/dist/server_end_point.js.map +1 -1
- package/dist/server_engine.d.ts +317 -317
- package/dist/server_engine.js +1716 -1716
- package/dist/server_publish_engine.d.ts +113 -113
- package/dist/server_publish_engine.js +541 -541
- 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 -1346
- 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 +48 -47
- package/source/factory.ts +2 -2
- package/source/server_end_point.ts +1 -0
|
@@ -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
|
+
}
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransferredSubscription = void 0;
|
|
4
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
5
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
6
|
-
class TransferredSubscription {
|
|
7
|
-
constructor(options) {
|
|
8
|
-
this.id = options.id;
|
|
9
|
-
this._sequence_number_generator = options.generator;
|
|
10
|
-
this.publishEngine = options.publishEngine;
|
|
11
|
-
}
|
|
12
|
-
get hasPendingNotifications() {
|
|
13
|
-
return !!this._pending_notification;
|
|
14
|
-
}
|
|
15
|
-
dispose() {
|
|
16
|
-
this._pending_notification = undefined;
|
|
17
|
-
this.publishEngine = null;
|
|
18
|
-
}
|
|
19
|
-
_publish_pending_notifications() {
|
|
20
|
-
(0, node_opcua_assert_1.default)(this._pending_notification);
|
|
21
|
-
const notificationMessage = this._pending_notification;
|
|
22
|
-
this._pending_notification = undefined;
|
|
23
|
-
const moreNotifications = false;
|
|
24
|
-
const subscriptionId = this.id;
|
|
25
|
-
const response = new node_opcua_types_1.PublishResponse({
|
|
26
|
-
moreNotifications,
|
|
27
|
-
notificationMessage: {
|
|
28
|
-
notificationData: [notificationMessage],
|
|
29
|
-
publishTime: new Date(),
|
|
30
|
-
sequenceNumber: 0xffffffff
|
|
31
|
-
},
|
|
32
|
-
subscriptionId
|
|
33
|
-
});
|
|
34
|
-
// apply sequence number and store in sent_notifications queue
|
|
35
|
-
(0, node_opcua_assert_1.default)(response.notificationMessage.sequenceNumber === 0xffffffff);
|
|
36
|
-
response.notificationMessage.sequenceNumber = this._get_next_sequence_number();
|
|
37
|
-
// xxx this._sent_notifications.push(response.notificationMessage);
|
|
38
|
-
// get available sequence number;
|
|
39
|
-
const availableSequenceNumbers = [response.notificationMessage.sequenceNumber];
|
|
40
|
-
(0, node_opcua_assert_1.default)(!response.notificationMessage ||
|
|
41
|
-
availableSequenceNumbers[availableSequenceNumbers.length - 1] === response.notificationMessage.sequenceNumber);
|
|
42
|
-
response.availableSequenceNumbers = availableSequenceNumbers;
|
|
43
|
-
this.publishEngine._send_response(this, response);
|
|
44
|
-
}
|
|
45
|
-
_get_next_sequence_number() {
|
|
46
|
-
return this._sequence_number_generator ? this._sequence_number_generator.next() : 0;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
exports.TransferredSubscription = TransferredSubscription;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransferredSubscription = void 0;
|
|
4
|
+
const node_opcua_types_1 = require("node-opcua-types");
|
|
5
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
6
|
+
class TransferredSubscription {
|
|
7
|
+
constructor(options) {
|
|
8
|
+
this.id = options.id;
|
|
9
|
+
this._sequence_number_generator = options.generator;
|
|
10
|
+
this.publishEngine = options.publishEngine;
|
|
11
|
+
}
|
|
12
|
+
get hasPendingNotifications() {
|
|
13
|
+
return !!this._pending_notification;
|
|
14
|
+
}
|
|
15
|
+
dispose() {
|
|
16
|
+
this._pending_notification = undefined;
|
|
17
|
+
this.publishEngine = null;
|
|
18
|
+
}
|
|
19
|
+
_publish_pending_notifications() {
|
|
20
|
+
(0, node_opcua_assert_1.default)(this._pending_notification);
|
|
21
|
+
const notificationMessage = this._pending_notification;
|
|
22
|
+
this._pending_notification = undefined;
|
|
23
|
+
const moreNotifications = false;
|
|
24
|
+
const subscriptionId = this.id;
|
|
25
|
+
const response = new node_opcua_types_1.PublishResponse({
|
|
26
|
+
moreNotifications,
|
|
27
|
+
notificationMessage: {
|
|
28
|
+
notificationData: [notificationMessage],
|
|
29
|
+
publishTime: new Date(),
|
|
30
|
+
sequenceNumber: 0xffffffff
|
|
31
|
+
},
|
|
32
|
+
subscriptionId
|
|
33
|
+
});
|
|
34
|
+
// apply sequence number and store in sent_notifications queue
|
|
35
|
+
(0, node_opcua_assert_1.default)(response.notificationMessage.sequenceNumber === 0xffffffff);
|
|
36
|
+
response.notificationMessage.sequenceNumber = this._get_next_sequence_number();
|
|
37
|
+
// xxx this._sent_notifications.push(response.notificationMessage);
|
|
38
|
+
// get available sequence number;
|
|
39
|
+
const availableSequenceNumbers = [response.notificationMessage.sequenceNumber];
|
|
40
|
+
(0, node_opcua_assert_1.default)(!response.notificationMessage ||
|
|
41
|
+
availableSequenceNumbers[availableSequenceNumbers.length - 1] === response.notificationMessage.sequenceNumber);
|
|
42
|
+
response.availableSequenceNumbers = availableSequenceNumbers;
|
|
43
|
+
this.publishEngine._send_response(this, response);
|
|
44
|
+
}
|
|
45
|
+
_get_next_sequence_number() {
|
|
46
|
+
return this._sequence_number_generator ? this._sequence_number_generator.next() : 0;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.TransferredSubscription = TransferredSubscription;
|
|
50
50
|
//# sourceMappingURL=i_server_side_publish_engine.js.map
|
package/dist/i_socket_data.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export interface ISocketData {
|
|
2
|
-
bytesRead: number;
|
|
3
|
-
bytesWritten: number;
|
|
4
|
-
localAddress?: string;
|
|
5
|
-
localPort?: number;
|
|
6
|
-
remoteAddress?: string;
|
|
7
|
-
remoteFamily?: string;
|
|
8
|
-
remotePort?: number;
|
|
9
|
-
timestamp: Date;
|
|
10
|
-
reason: string;
|
|
11
|
-
}
|
|
1
|
+
export interface ISocketData {
|
|
2
|
+
bytesRead: number;
|
|
3
|
+
bytesWritten: number;
|
|
4
|
+
localAddress?: string;
|
|
5
|
+
localPort?: number;
|
|
6
|
+
remoteAddress?: string;
|
|
7
|
+
remoteFamily?: string;
|
|
8
|
+
remotePort?: number;
|
|
9
|
+
timestamp: Date;
|
|
10
|
+
reason: string;
|
|
11
|
+
}
|
package/dist/i_socket_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_socket_data.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-server
|
|
3
|
-
*/
|
|
4
|
-
export * from "./base_server";
|
|
5
|
-
export * from "./server_end_point";
|
|
6
|
-
export * from "./register_server_manager";
|
|
7
|
-
export * from "./register_server_manager_mdns_only";
|
|
8
|
-
export * from "./server_publish_engine";
|
|
9
|
-
export * from "./server_subscription";
|
|
10
|
-
export * from "./server_session";
|
|
11
|
-
export * from "./server_capabilities";
|
|
12
|
-
export * from "./server_engine";
|
|
13
|
-
export * from "./opcua_server";
|
|
14
|
-
export * from "./monitored_item";
|
|
15
|
-
export * from "./user_manager";
|
|
16
|
-
export * from "./helper";
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-server
|
|
3
|
+
*/
|
|
4
|
+
export * from "./base_server";
|
|
5
|
+
export * from "./server_end_point";
|
|
6
|
+
export * from "./register_server_manager";
|
|
7
|
+
export * from "./register_server_manager_mdns_only";
|
|
8
|
+
export * from "./server_publish_engine";
|
|
9
|
+
export * from "./server_subscription";
|
|
10
|
+
export * from "./server_session";
|
|
11
|
+
export * from "./server_capabilities";
|
|
12
|
+
export * from "./server_engine";
|
|
13
|
+
export * from "./opcua_server";
|
|
14
|
+
export * from "./monitored_item";
|
|
15
|
+
export * from "./user_manager";
|
|
16
|
+
export * from "./helper";
|
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
/**
|
|
18
|
-
* @module node-opcua-server
|
|
19
|
-
*/
|
|
20
|
-
__exportStar(require("./base_server"), exports);
|
|
21
|
-
__exportStar(require("./server_end_point"), exports);
|
|
22
|
-
__exportStar(require("./register_server_manager"), exports);
|
|
23
|
-
__exportStar(require("./register_server_manager_mdns_only"), exports);
|
|
24
|
-
__exportStar(require("./server_publish_engine"), exports);
|
|
25
|
-
__exportStar(require("./server_subscription"), exports);
|
|
26
|
-
__exportStar(require("./server_session"), exports);
|
|
27
|
-
__exportStar(require("./server_capabilities"), exports);
|
|
28
|
-
__exportStar(require("./server_engine"), exports);
|
|
29
|
-
__exportStar(require("./opcua_server"), exports);
|
|
30
|
-
__exportStar(require("./monitored_item"), exports);
|
|
31
|
-
__exportStar(require("./user_manager"), exports);
|
|
32
|
-
__exportStar(require("./helper"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @module node-opcua-server
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("./base_server"), exports);
|
|
21
|
+
__exportStar(require("./server_end_point"), exports);
|
|
22
|
+
__exportStar(require("./register_server_manager"), exports);
|
|
23
|
+
__exportStar(require("./register_server_manager_mdns_only"), exports);
|
|
24
|
+
__exportStar(require("./server_publish_engine"), exports);
|
|
25
|
+
__exportStar(require("./server_subscription"), exports);
|
|
26
|
+
__exportStar(require("./server_session"), exports);
|
|
27
|
+
__exportStar(require("./server_capabilities"), exports);
|
|
28
|
+
__exportStar(require("./server_engine"), exports);
|
|
29
|
+
__exportStar(require("./opcua_server"), exports);
|
|
30
|
+
__exportStar(require("./monitored_item"), exports);
|
|
31
|
+
__exportStar(require("./user_manager"), exports);
|
|
32
|
+
__exportStar(require("./helper"), exports);
|
|
33
33
|
//# sourceMappingURL=index.js.map
|
package/dist/monitored_item.d.ts
CHANGED
|
@@ -1,177 +1,177 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
/**
|
|
4
|
-
* @module node-opcua-server
|
|
5
|
-
*/
|
|
6
|
-
import { EventEmitter } from "events";
|
|
7
|
-
import { BaseNode, SessionContext } from "node-opcua-address-space";
|
|
8
|
-
import { UInt32 } from "node-opcua-basic-types";
|
|
9
|
-
import { NodeClass, QualifiedNameOptions } from "node-opcua-data-model";
|
|
10
|
-
import { AttributeIds } from "node-opcua-data-model";
|
|
11
|
-
import { DataValue } from "node-opcua-data-value";
|
|
12
|
-
import { ExtensionObject } from "node-opcua-extension-object";
|
|
13
|
-
import { NodeId } from "node-opcua-nodeid";
|
|
14
|
-
import { NumericRange } from "node-opcua-numeric-range";
|
|
15
|
-
import { ObjectRegistry } from "node-opcua-object-registry";
|
|
16
|
-
import { TimestampsToReturn } from "node-opcua-service-read";
|
|
17
|
-
import { MonitoredItemModifyResult, MonitoredItemNotification, MonitoringMode, MonitoringParameters } from "node-opcua-service-subscription";
|
|
18
|
-
import { StatusCode } from "node-opcua-status-code";
|
|
19
|
-
import { EventFieldList, MonitoringFilter, ReadValueIdOptions, SubscriptionDiagnosticsDataType } from "node-opcua-types";
|
|
20
|
-
export declare type QueueItem = MonitoredItemNotification | EventFieldList;
|
|
21
|
-
export interface MonitoredItemOptions extends MonitoringParameters {
|
|
22
|
-
monitoringMode: MonitoringMode;
|
|
23
|
-
/**
|
|
24
|
-
* the monitoredItem Id assigned by the server to this monitoredItem.
|
|
25
|
-
*/
|
|
26
|
-
monitoredItemId: number;
|
|
27
|
-
itemToMonitor?: ReadValueIdOptions;
|
|
28
|
-
timestampsToReturn?: TimestampsToReturn;
|
|
29
|
-
filter: ExtensionObject | null;
|
|
30
|
-
/**
|
|
31
|
-
* if discardOldest === true, older items are removed from the queue when queue overflows
|
|
32
|
-
*/
|
|
33
|
-
discardOldest: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* the size of the queue.
|
|
36
|
-
*/
|
|
37
|
-
queueSize: number;
|
|
38
|
-
/**
|
|
39
|
-
* the monitored item sampling interval ..
|
|
40
|
-
*/
|
|
41
|
-
samplingInterval: number;
|
|
42
|
-
/**
|
|
43
|
-
* the client handle
|
|
44
|
-
*/
|
|
45
|
-
clientHandle: number;
|
|
46
|
-
}
|
|
47
|
-
export interface BaseNode2 extends EventEmitter {
|
|
48
|
-
nodeId: NodeId;
|
|
49
|
-
browseName: QualifiedNameOptions;
|
|
50
|
-
nodeClass: NodeClass;
|
|
51
|
-
dataType: NodeId;
|
|
52
|
-
addressSpace: any;
|
|
53
|
-
readAttribute(context: SessionContext | null, attributeId: AttributeIds): DataValue;
|
|
54
|
-
}
|
|
55
|
-
declare type TimerKey = NodeJS.Timer;
|
|
56
|
-
export interface ISubscription {
|
|
57
|
-
$session?: any;
|
|
58
|
-
subscriptionDiagnostics: SubscriptionDiagnosticsDataType;
|
|
59
|
-
getMonitoredItem(monitoredItemId: number): MonitoredItem | null;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* a server side monitored item
|
|
63
|
-
*
|
|
64
|
-
* - Once created, the MonitoredItem will raised an "samplingEvent" event every "samplingInterval" millisecond
|
|
65
|
-
* until {{#crossLink "MonitoredItem/terminate:method"}}{{/crossLink}} is called.
|
|
66
|
-
*
|
|
67
|
-
* - It is up to the event receiver to call {{#crossLink "MonitoredItem/recordValue:method"}}{{/crossLink}}.
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
export declare class MonitoredItem extends EventEmitter {
|
|
71
|
-
get node(): BaseNode | null;
|
|
72
|
-
set node(someNode: BaseNode | null);
|
|
73
|
-
static registry: ObjectRegistry;
|
|
74
|
-
static minimumSamplingInterval: number;
|
|
75
|
-
static defaultSamplingInterval: number;
|
|
76
|
-
static maximumSamplingInterval: number;
|
|
77
|
-
samplingInterval: number;
|
|
78
|
-
monitoredItemId: number;
|
|
79
|
-
overflow: boolean;
|
|
80
|
-
oldDataValue?: DataValue;
|
|
81
|
-
monitoringMode: MonitoringMode;
|
|
82
|
-
timestampsToReturn: TimestampsToReturn;
|
|
83
|
-
itemToMonitor: any;
|
|
84
|
-
filter: MonitoringFilter | null;
|
|
85
|
-
discardOldest: boolean;
|
|
86
|
-
queueSize: number;
|
|
87
|
-
clientHandle: UInt32;
|
|
88
|
-
$subscription?: ISubscription;
|
|
89
|
-
_samplingId?: TimerKey | string;
|
|
90
|
-
samplingFunc: ((this: MonitoredItem, value: DataValue, callback: (err: Error | null, dataValue?: DataValue) => void) => void) | null;
|
|
91
|
-
private _node;
|
|
92
|
-
private queue;
|
|
93
|
-
private _semantic_version;
|
|
94
|
-
private _is_sampling;
|
|
95
|
-
private _on_opcua_event_received_callback;
|
|
96
|
-
private _attribute_changed_callback;
|
|
97
|
-
private _value_changed_callback;
|
|
98
|
-
private _semantic_changed_callback;
|
|
99
|
-
private _on_node_disposed_listener;
|
|
100
|
-
private _linkedItems?;
|
|
101
|
-
private _triggeredNotifications?;
|
|
102
|
-
constructor(options: MonitoredItemOptions);
|
|
103
|
-
setNode(node: BaseNode): void;
|
|
104
|
-
setMonitoringMode(monitoringMode: MonitoringMode): void;
|
|
105
|
-
/**
|
|
106
|
-
* Terminate the MonitoredItem.
|
|
107
|
-
* @method terminate
|
|
108
|
-
*
|
|
109
|
-
* This will stop the internal sampling timer.
|
|
110
|
-
*/
|
|
111
|
-
terminate(): void;
|
|
112
|
-
dispose(): void;
|
|
113
|
-
get isSampling(): boolean;
|
|
114
|
-
toString(): string;
|
|
115
|
-
/**
|
|
116
|
-
* @param dataValue the whole dataValue
|
|
117
|
-
* @param skipChangeTest indicates whether recordValue should not check that dataValue is really
|
|
118
|
-
* different from previous one, ( by checking timestamps but also variant value)
|
|
119
|
-
* @private
|
|
120
|
-
*
|
|
121
|
-
* Notes:
|
|
122
|
-
* - recordValue can only be called within timer event
|
|
123
|
-
* - for performance reason, dataValue may be a shared value with the underlying node,
|
|
124
|
-
* therefore recordValue must clone the dataValue to make sure it retains a snapshot
|
|
125
|
-
* of the contain at the time recordValue was called.
|
|
126
|
-
*
|
|
127
|
-
*/
|
|
128
|
-
recordValue(dataValue: DataValue, skipChangeTest: boolean, indexRange?: NumericRange): void;
|
|
129
|
-
hasLinkItem(linkedMonitoredItemId: number): boolean;
|
|
130
|
-
addLinkItem(linkedMonitoredItemId: number): StatusCode;
|
|
131
|
-
removeLinkItem(linkedMonitoredItemId: number): StatusCode;
|
|
132
|
-
/**
|
|
133
|
-
* @internals
|
|
134
|
-
*/
|
|
135
|
-
private triggerLinkedItems;
|
|
136
|
-
get hasMonitoredItemNotifications(): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* @internals
|
|
139
|
-
*/
|
|
140
|
-
private trigger;
|
|
141
|
-
extractMonitoredItemNotifications(bForce?: boolean): QueueItem[];
|
|
142
|
-
modify(timestampsToReturn: TimestampsToReturn, monitoringParameters: MonitoringParameters): MonitoredItemModifyResult;
|
|
143
|
-
resendInitialValues(): Promise<void>;
|
|
144
|
-
/**
|
|
145
|
-
* @method _on_sampling_timer
|
|
146
|
-
* @private
|
|
147
|
-
* request
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
private _on_sampling_timer;
|
|
151
|
-
private _stop_sampling;
|
|
152
|
-
private _on_value_changed;
|
|
153
|
-
private _on_semantic_changed;
|
|
154
|
-
private _on_opcua_event;
|
|
155
|
-
private _getSession;
|
|
156
|
-
private _start_sampling;
|
|
157
|
-
private __start_sampling;
|
|
158
|
-
private _set_parameters;
|
|
159
|
-
private _setOverflowBit;
|
|
160
|
-
private _enqueue_notification;
|
|
161
|
-
private _makeDataChangeNotification;
|
|
162
|
-
/**
|
|
163
|
-
* @method _enqueue_value
|
|
164
|
-
* @param dataValue {DataValue} the dataValue to enqueue
|
|
165
|
-
* @private
|
|
166
|
-
*/
|
|
167
|
-
private _enqueue_value;
|
|
168
|
-
private _makeEventFieldList;
|
|
169
|
-
private _enqueue_event;
|
|
170
|
-
private _empty_queue;
|
|
171
|
-
private _clear_timer;
|
|
172
|
-
private _set_timer;
|
|
173
|
-
private _adjust_queue_to_match_new_queue_size;
|
|
174
|
-
private _adjust_sampling;
|
|
175
|
-
private _on_node_disposed;
|
|
176
|
-
}
|
|
177
|
-
export {};
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/**
|
|
4
|
+
* @module node-opcua-server
|
|
5
|
+
*/
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
|
+
import { BaseNode, SessionContext } from "node-opcua-address-space";
|
|
8
|
+
import { UInt32 } from "node-opcua-basic-types";
|
|
9
|
+
import { NodeClass, QualifiedNameOptions } from "node-opcua-data-model";
|
|
10
|
+
import { AttributeIds } from "node-opcua-data-model";
|
|
11
|
+
import { DataValue } from "node-opcua-data-value";
|
|
12
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
13
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
14
|
+
import { NumericRange } from "node-opcua-numeric-range";
|
|
15
|
+
import { ObjectRegistry } from "node-opcua-object-registry";
|
|
16
|
+
import { TimestampsToReturn } from "node-opcua-service-read";
|
|
17
|
+
import { MonitoredItemModifyResult, MonitoredItemNotification, MonitoringMode, MonitoringParameters } from "node-opcua-service-subscription";
|
|
18
|
+
import { StatusCode } from "node-opcua-status-code";
|
|
19
|
+
import { EventFieldList, MonitoringFilter, ReadValueIdOptions, SubscriptionDiagnosticsDataType } from "node-opcua-types";
|
|
20
|
+
export declare type QueueItem = MonitoredItemNotification | EventFieldList;
|
|
21
|
+
export interface MonitoredItemOptions extends MonitoringParameters {
|
|
22
|
+
monitoringMode: MonitoringMode;
|
|
23
|
+
/**
|
|
24
|
+
* the monitoredItem Id assigned by the server to this monitoredItem.
|
|
25
|
+
*/
|
|
26
|
+
monitoredItemId: number;
|
|
27
|
+
itemToMonitor?: ReadValueIdOptions;
|
|
28
|
+
timestampsToReturn?: TimestampsToReturn;
|
|
29
|
+
filter: ExtensionObject | null;
|
|
30
|
+
/**
|
|
31
|
+
* if discardOldest === true, older items are removed from the queue when queue overflows
|
|
32
|
+
*/
|
|
33
|
+
discardOldest: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* the size of the queue.
|
|
36
|
+
*/
|
|
37
|
+
queueSize: number;
|
|
38
|
+
/**
|
|
39
|
+
* the monitored item sampling interval ..
|
|
40
|
+
*/
|
|
41
|
+
samplingInterval: number;
|
|
42
|
+
/**
|
|
43
|
+
* the client handle
|
|
44
|
+
*/
|
|
45
|
+
clientHandle: number;
|
|
46
|
+
}
|
|
47
|
+
export interface BaseNode2 extends EventEmitter {
|
|
48
|
+
nodeId: NodeId;
|
|
49
|
+
browseName: QualifiedNameOptions;
|
|
50
|
+
nodeClass: NodeClass;
|
|
51
|
+
dataType: NodeId;
|
|
52
|
+
addressSpace: any;
|
|
53
|
+
readAttribute(context: SessionContext | null, attributeId: AttributeIds): DataValue;
|
|
54
|
+
}
|
|
55
|
+
declare type TimerKey = NodeJS.Timer;
|
|
56
|
+
export interface ISubscription {
|
|
57
|
+
$session?: any;
|
|
58
|
+
subscriptionDiagnostics: SubscriptionDiagnosticsDataType;
|
|
59
|
+
getMonitoredItem(monitoredItemId: number): MonitoredItem | null;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* a server side monitored item
|
|
63
|
+
*
|
|
64
|
+
* - Once created, the MonitoredItem will raised an "samplingEvent" event every "samplingInterval" millisecond
|
|
65
|
+
* until {{#crossLink "MonitoredItem/terminate:method"}}{{/crossLink}} is called.
|
|
66
|
+
*
|
|
67
|
+
* - It is up to the event receiver to call {{#crossLink "MonitoredItem/recordValue:method"}}{{/crossLink}}.
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
export declare class MonitoredItem extends EventEmitter {
|
|
71
|
+
get node(): BaseNode | null;
|
|
72
|
+
set node(someNode: BaseNode | null);
|
|
73
|
+
static registry: ObjectRegistry;
|
|
74
|
+
static minimumSamplingInterval: number;
|
|
75
|
+
static defaultSamplingInterval: number;
|
|
76
|
+
static maximumSamplingInterval: number;
|
|
77
|
+
samplingInterval: number;
|
|
78
|
+
monitoredItemId: number;
|
|
79
|
+
overflow: boolean;
|
|
80
|
+
oldDataValue?: DataValue;
|
|
81
|
+
monitoringMode: MonitoringMode;
|
|
82
|
+
timestampsToReturn: TimestampsToReturn;
|
|
83
|
+
itemToMonitor: any;
|
|
84
|
+
filter: MonitoringFilter | null;
|
|
85
|
+
discardOldest: boolean;
|
|
86
|
+
queueSize: number;
|
|
87
|
+
clientHandle: UInt32;
|
|
88
|
+
$subscription?: ISubscription;
|
|
89
|
+
_samplingId?: TimerKey | string;
|
|
90
|
+
samplingFunc: ((this: MonitoredItem, value: DataValue, callback: (err: Error | null, dataValue?: DataValue) => void) => void) | null;
|
|
91
|
+
private _node;
|
|
92
|
+
private queue;
|
|
93
|
+
private _semantic_version;
|
|
94
|
+
private _is_sampling;
|
|
95
|
+
private _on_opcua_event_received_callback;
|
|
96
|
+
private _attribute_changed_callback;
|
|
97
|
+
private _value_changed_callback;
|
|
98
|
+
private _semantic_changed_callback;
|
|
99
|
+
private _on_node_disposed_listener;
|
|
100
|
+
private _linkedItems?;
|
|
101
|
+
private _triggeredNotifications?;
|
|
102
|
+
constructor(options: MonitoredItemOptions);
|
|
103
|
+
setNode(node: BaseNode): void;
|
|
104
|
+
setMonitoringMode(monitoringMode: MonitoringMode): void;
|
|
105
|
+
/**
|
|
106
|
+
* Terminate the MonitoredItem.
|
|
107
|
+
* @method terminate
|
|
108
|
+
*
|
|
109
|
+
* This will stop the internal sampling timer.
|
|
110
|
+
*/
|
|
111
|
+
terminate(): void;
|
|
112
|
+
dispose(): void;
|
|
113
|
+
get isSampling(): boolean;
|
|
114
|
+
toString(): string;
|
|
115
|
+
/**
|
|
116
|
+
* @param dataValue the whole dataValue
|
|
117
|
+
* @param skipChangeTest indicates whether recordValue should not check that dataValue is really
|
|
118
|
+
* different from previous one, ( by checking timestamps but also variant value)
|
|
119
|
+
* @private
|
|
120
|
+
*
|
|
121
|
+
* Notes:
|
|
122
|
+
* - recordValue can only be called within timer event
|
|
123
|
+
* - for performance reason, dataValue may be a shared value with the underlying node,
|
|
124
|
+
* therefore recordValue must clone the dataValue to make sure it retains a snapshot
|
|
125
|
+
* of the contain at the time recordValue was called.
|
|
126
|
+
*
|
|
127
|
+
*/
|
|
128
|
+
recordValue(dataValue: DataValue, skipChangeTest: boolean, indexRange?: NumericRange): void;
|
|
129
|
+
hasLinkItem(linkedMonitoredItemId: number): boolean;
|
|
130
|
+
addLinkItem(linkedMonitoredItemId: number): StatusCode;
|
|
131
|
+
removeLinkItem(linkedMonitoredItemId: number): StatusCode;
|
|
132
|
+
/**
|
|
133
|
+
* @internals
|
|
134
|
+
*/
|
|
135
|
+
private triggerLinkedItems;
|
|
136
|
+
get hasMonitoredItemNotifications(): boolean;
|
|
137
|
+
/**
|
|
138
|
+
* @internals
|
|
139
|
+
*/
|
|
140
|
+
private trigger;
|
|
141
|
+
extractMonitoredItemNotifications(bForce?: boolean): QueueItem[];
|
|
142
|
+
modify(timestampsToReturn: TimestampsToReturn, monitoringParameters: MonitoringParameters): MonitoredItemModifyResult;
|
|
143
|
+
resendInitialValues(): Promise<void>;
|
|
144
|
+
/**
|
|
145
|
+
* @method _on_sampling_timer
|
|
146
|
+
* @private
|
|
147
|
+
* request
|
|
148
|
+
*
|
|
149
|
+
*/
|
|
150
|
+
private _on_sampling_timer;
|
|
151
|
+
private _stop_sampling;
|
|
152
|
+
private _on_value_changed;
|
|
153
|
+
private _on_semantic_changed;
|
|
154
|
+
private _on_opcua_event;
|
|
155
|
+
private _getSession;
|
|
156
|
+
private _start_sampling;
|
|
157
|
+
private __start_sampling;
|
|
158
|
+
private _set_parameters;
|
|
159
|
+
private _setOverflowBit;
|
|
160
|
+
private _enqueue_notification;
|
|
161
|
+
private _makeDataChangeNotification;
|
|
162
|
+
/**
|
|
163
|
+
* @method _enqueue_value
|
|
164
|
+
* @param dataValue {DataValue} the dataValue to enqueue
|
|
165
|
+
* @private
|
|
166
|
+
*/
|
|
167
|
+
private _enqueue_value;
|
|
168
|
+
private _makeEventFieldList;
|
|
169
|
+
private _enqueue_event;
|
|
170
|
+
private _empty_queue;
|
|
171
|
+
private _clear_timer;
|
|
172
|
+
private _set_timer;
|
|
173
|
+
private _adjust_queue_to_match_new_queue_size;
|
|
174
|
+
private _adjust_sampling;
|
|
175
|
+
private _on_node_disposed;
|
|
176
|
+
}
|
|
177
|
+
export {};
|