node-opcua-client 2.97.0 → 2.98.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/alarms_and_conditions/client_alarm.d.ts +49 -49
- package/dist/alarms_and_conditions/client_alarm.js +109 -109
- package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -25
- package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
- package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
- package/dist/alarms_and_conditions/client_alarm_tools.js +156 -156
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +192 -192
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +72 -72
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -3
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +118 -118
- package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
- package/dist/alarms_and_conditions/client_tools.js +179 -179
- package/dist/client_base.d.ts +277 -277
- package/dist/client_base.js +14 -14
- package/dist/client_base.js.map +1 -1
- package/dist/client_monitored_item.d.ts +21 -21
- package/dist/client_monitored_item.js +11 -11
- package/dist/client_monitored_item_base.d.ts +39 -39
- package/dist/client_monitored_item_base.js +2 -2
- package/dist/client_monitored_item_group.d.ts +21 -21
- package/dist/client_monitored_item_group.js +13 -13
- package/dist/client_monitored_item_toolbox.d.ts +15 -15
- package/dist/client_monitored_item_toolbox.js +116 -116
- package/dist/client_session.d.ts +529 -529
- package/dist/client_session.js +10 -10
- package/dist/client_session_keepalive_manager.d.ts +34 -34
- package/dist/client_session_keepalive_manager.js +149 -149
- package/dist/client_subscription.d.ts +241 -241
- package/dist/client_subscription.js +14 -14
- package/dist/client_subscription.js.map +1 -1
- package/dist/client_utils.d.ts +22 -22
- package/dist/client_utils.js +87 -87
- package/dist/common.d.ts +17 -17
- package/dist/common.js +5 -5
- package/dist/index.d.ts +56 -56
- package/dist/index.js +94 -94
- package/dist/opcua_client.d.ts +118 -118
- package/dist/opcua_client.js +33 -33
- package/dist/private/client_base_impl.d.ts +160 -160
- package/dist/private/client_base_impl.js +1348 -1348
- package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
- package/dist/private/client_monitored_item_base_impl.js +4 -4
- package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
- package/dist/private/client_monitored_item_group_impl.js +159 -159
- package/dist/private/client_monitored_item_impl.d.ts +93 -93
- package/dist/private/client_monitored_item_impl.js +304 -304
- package/dist/private/client_publish_engine.d.ts +62 -62
- package/dist/private/client_publish_engine.js +408 -408
- package/dist/private/client_publish_engine.js.map +1 -1
- package/dist/private/client_session_impl.d.ts +631 -631
- package/dist/private/client_session_impl.js +1348 -1348
- package/dist/private/client_subscription_impl.d.ts +93 -93
- package/dist/private/client_subscription_impl.js +763 -763
- package/dist/private/i_private_client.d.ts +21 -21
- package/dist/private/i_private_client.js +2 -2
- package/dist/private/opcua_client_impl.d.ts +166 -166
- package/dist/private/opcua_client_impl.js +1000 -1000
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/private/performance.d.ts +1 -1
- package/dist/private/performance.js +18 -18
- package/dist/reconnection.d.ts +9 -9
- package/dist/reconnection.js +381 -381
- package/dist/tools/findservers.d.ts +20 -20
- package/dist/tools/findservers.js +61 -61
- package/dist/tools/read_history_server_capabilities.d.ts +6 -6
- package/dist/tools/read_history_server_capabilities.js +98 -98
- package/dist/user_identity_info.d.ts +1 -1
- package/dist/user_identity_info.js +2 -2
- package/dist/verify.d.ts +5 -5
- package/dist/verify.js +134 -134
- package/package.json +49 -45
- package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -1
- package/.nycrc.json +0 -14
- package/test_helpers/create_certificates.js +0 -1
- package/typedoc.js +0 -20
|
@@ -1,241 +1,241 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-client
|
|
3
|
-
*/
|
|
4
|
-
/// <reference types="node" />
|
|
5
|
-
import { EventEmitter } from "events";
|
|
6
|
-
import { Byte, Double, UInt32 } from "node-opcua-basic-types";
|
|
7
|
-
import { DiagnosticInfo } from "node-opcua-data-model";
|
|
8
|
-
import { ReadValueIdOptions, TimestampsToReturn } from "node-opcua-service-read";
|
|
9
|
-
import { MonitoringMode, MonitoringParametersOptions, NotificationMessage, SetTriggeringResponse } from "node-opcua-service-subscription";
|
|
10
|
-
import { Callback, StatusCode } from "node-opcua-status-code";
|
|
11
|
-
import { ErrorCallback } from "node-opcua-status-code";
|
|
12
|
-
import { ClientMonitoredItem } from "./client_monitored_item";
|
|
13
|
-
import { ClientMonitoredItemBase } from "./client_monitored_item_base";
|
|
14
|
-
import { ClientMonitoredItemGroup } from "./client_monitored_item_group";
|
|
15
|
-
import { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session";
|
|
16
|
-
export interface ClientSubscriptionOptions {
|
|
17
|
-
requestedPublishingInterval?: number;
|
|
18
|
-
requestedLifetimeCount?: number;
|
|
19
|
-
requestedMaxKeepAliveCount?: number;
|
|
20
|
-
maxNotificationsPerPublish?: number;
|
|
21
|
-
publishingEnabled?: boolean;
|
|
22
|
-
priority?: number;
|
|
23
|
-
}
|
|
24
|
-
export type ClientHandle = number;
|
|
25
|
-
export interface ClientMonitoredItemBaseMap {
|
|
26
|
-
[key: string]: ClientMonitoredItemBase;
|
|
27
|
-
}
|
|
28
|
-
export interface ModifySubscriptionOptions {
|
|
29
|
-
requestedPublishingInterval?: Double;
|
|
30
|
-
requestedLifetimeCount?: UInt32;
|
|
31
|
-
requestedMaxKeepAliveCount?: UInt32;
|
|
32
|
-
maxNotificationsPerPublish?: UInt32;
|
|
33
|
-
priority?: Byte;
|
|
34
|
-
}
|
|
35
|
-
export interface ModifySubscriptionResult {
|
|
36
|
-
revisedPublishingInterval: Double;
|
|
37
|
-
revisedLifetimeCount: UInt32;
|
|
38
|
-
revisedMaxKeepAliveCount: UInt32;
|
|
39
|
-
}
|
|
40
|
-
export interface ClientSubscription extends EventEmitter {
|
|
41
|
-
subscriptionId: SubscriptionId;
|
|
42
|
-
publishingInterval: number;
|
|
43
|
-
lifetimeCount: number;
|
|
44
|
-
maxKeepAliveCount: number;
|
|
45
|
-
maxNotificationsPerPublish: number;
|
|
46
|
-
publishingEnabled: boolean;
|
|
47
|
-
priority: number;
|
|
48
|
-
monitoredItems: ClientMonitoredItemBaseMap;
|
|
49
|
-
timeoutHint: number;
|
|
50
|
-
/**
|
|
51
|
-
* return the session associated with the subscription.
|
|
52
|
-
* (may throw if the session is not valid)
|
|
53
|
-
*/
|
|
54
|
-
session: ClientSession;
|
|
55
|
-
/**
|
|
56
|
-
* return true if the subscription is attached to a valid session
|
|
57
|
-
*/
|
|
58
|
-
hasSession: boolean;
|
|
59
|
-
/**
|
|
60
|
-
* true is the subscription is fully active
|
|
61
|
-
*/
|
|
62
|
-
isActive: boolean;
|
|
63
|
-
/**
|
|
64
|
-
* add a monitor item to the subscription
|
|
65
|
-
*
|
|
66
|
-
* @method monitor
|
|
67
|
-
*
|
|
68
|
-
* Monitoring a simple Value Change
|
|
69
|
-
* ---------------------------------
|
|
70
|
-
*
|
|
71
|
-
* @example:
|
|
72
|
-
*
|
|
73
|
-
* clientSubscription.monitor(
|
|
74
|
-
* // itemToMonitor:
|
|
75
|
-
* {
|
|
76
|
-
* nodeId: "ns=0;i=2258",
|
|
77
|
-
* attributeId: AttributeIds.Value,
|
|
78
|
-
* indexRange: null,
|
|
79
|
-
* dataEncoding: { namespaceIndex: 0, name: null }
|
|
80
|
-
* },
|
|
81
|
-
* // requestedParameters:
|
|
82
|
-
* {
|
|
83
|
-
* samplingInterval: 3000,
|
|
84
|
-
* filter: null,
|
|
85
|
-
* queueSize: 1,
|
|
86
|
-
* discardOldest: true
|
|
87
|
-
* },
|
|
88
|
-
* TimestampsToReturn.Neither
|
|
89
|
-
* );
|
|
90
|
-
*
|
|
91
|
-
* Monitoring a Value Change With a DataChange Filter
|
|
92
|
-
* ---------------------------------------------------
|
|
93
|
-
*
|
|
94
|
-
* options.trigger {DataChangeTrigger} {Status|StatusValue|StatusValueTimestamp}
|
|
95
|
-
* options.deadbandType {DeadbandType} {None|Absolute|Percent}
|
|
96
|
-
* options.deadbandValue {Double}
|
|
97
|
-
*
|
|
98
|
-
* @example:
|
|
99
|
-
*
|
|
100
|
-
* clientSubscription.monitor(
|
|
101
|
-
* // itemToMonitor:
|
|
102
|
-
* {
|
|
103
|
-
* nodeId: "ns=0;i=2258",
|
|
104
|
-
* attributeId: AttributeIds.Value,
|
|
105
|
-
* },
|
|
106
|
-
* // requestedParameters:
|
|
107
|
-
* {
|
|
108
|
-
* samplingInterval: 3000,
|
|
109
|
-
* filter: new DataChangeFilter({
|
|
110
|
-
* trigger: DataChangeTrigger.StatusValue,
|
|
111
|
-
* deadbandType: DeadbandType.Absolute,
|
|
112
|
-
* deadbandValue: 0.1
|
|
113
|
-
* }),
|
|
114
|
-
* queueSize: 1,
|
|
115
|
-
* discardOldest: true
|
|
116
|
-
* },
|
|
117
|
-
* TimestampsToReturn.Neither
|
|
118
|
-
* );
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* Monitoring an Event
|
|
122
|
-
* -------------------
|
|
123
|
-
*
|
|
124
|
-
* If the monitor attributeId is EventNotifier then the filter must be specified
|
|
125
|
-
*
|
|
126
|
-
* @example:
|
|
127
|
-
*
|
|
128
|
-
* var filter = new EventFilter({
|
|
129
|
-
* selectClauses: [
|
|
130
|
-
* { browsePath: [ {name: 'ActiveState' }, {name: 'id'} ]},
|
|
131
|
-
* { browsePath: [ {name: 'ConditionName'} ]}
|
|
132
|
-
* ],
|
|
133
|
-
* whereClause: []
|
|
134
|
-
* });
|
|
135
|
-
*
|
|
136
|
-
* clientSubscription.monitor(
|
|
137
|
-
* // itemToMonitor:
|
|
138
|
-
* {
|
|
139
|
-
* nodeId: "ns=0;i=2258",
|
|
140
|
-
* attributeId: AttributeIds.EventNotifier,
|
|
141
|
-
* indexRange: null,
|
|
142
|
-
* dataEncoding: { namespaceIndex: 0, name: null }
|
|
143
|
-
* },
|
|
144
|
-
* // requestedParameters:
|
|
145
|
-
* {
|
|
146
|
-
* samplingInterval: 3000,
|
|
147
|
-
*
|
|
148
|
-
* filter: filter,
|
|
149
|
-
*
|
|
150
|
-
* queueSize: 1,
|
|
151
|
-
* discardOldest: true
|
|
152
|
-
* },
|
|
153
|
-
* TimestampsToReturn.Neither
|
|
154
|
-
* );
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
*/
|
|
162
|
-
monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, monitoringMode?: MonitoringMode): Promise<ClientMonitoredItem>;
|
|
163
|
-
monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, monitoringMode: MonitoringMode, callback: Callback<ClientMonitoredItem>): void;
|
|
164
|
-
/**
|
|
165
|
-
* @method monitorItems
|
|
166
|
-
* @param itemsToMonitor
|
|
167
|
-
* @param requestedParameters
|
|
168
|
-
* @param timestampsToReturn
|
|
169
|
-
* @return a ClientMonitoredItemGroup
|
|
170
|
-
* @async
|
|
171
|
-
*/
|
|
172
|
-
monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): Promise<ClientMonitoredItemGroup>;
|
|
173
|
-
/**
|
|
174
|
-
* @method monitorItems
|
|
175
|
-
* @param itemsToMonitor
|
|
176
|
-
* @param requestedParameters
|
|
177
|
-
* @param timestampsToReturn
|
|
178
|
-
* @param done
|
|
179
|
-
* @async
|
|
180
|
-
*/
|
|
181
|
-
monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, callback: Callback<ClientMonitoredItemGroup>): void;
|
|
182
|
-
getMonitoredItems(): Promise<MonitoredItemData>;
|
|
183
|
-
getMonitoredItems(callback: (err: Error | null, result?: MonitoredItemData) => void): void;
|
|
184
|
-
modify(options: ModifySubscriptionOptions, callback: Callback<ModifySubscriptionResult>): void;
|
|
185
|
-
modify(options: ModifySubscriptionOptions): Promise<ModifySubscriptionResult>;
|
|
186
|
-
setTriggering(triggeringItem: ClientMonitoredItemBase, linksToAdd: ClientMonitoredItemBase[] | null, linksToRemove: ClientMonitoredItemBase[] | null, callback: Callback<SetTriggeringResponse>): void;
|
|
187
|
-
setTriggering(triggeringItem: ClientMonitoredItemBase, linksToAdd: ClientMonitoredItemBase[] | null, linksToRemove: ClientMonitoredItemBase[] | null): Promise<SetTriggeringResponse>;
|
|
188
|
-
terminate(): Promise<void>;
|
|
189
|
-
terminate(callback: ErrorCallback): void;
|
|
190
|
-
}
|
|
191
|
-
export declare interface ClientSubscription {
|
|
192
|
-
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
193
|
-
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
194
|
-
/**
|
|
195
|
-
* notify the observers that the subscription has now started
|
|
196
|
-
* @event started
|
|
197
|
-
*/
|
|
198
|
-
on(event: "started", eventHandler: (subscriptionId: number) => void): this;
|
|
199
|
-
/**
|
|
200
|
-
* notify the observers tha the client subscription has terminated
|
|
201
|
-
* @event terminated
|
|
202
|
-
*/
|
|
203
|
-
on(event: "terminated", eventHandler: () => void): this;
|
|
204
|
-
/**
|
|
205
|
-
* notify the observers that a new monitored item has been added to the subscription.
|
|
206
|
-
* @event item_added
|
|
207
|
-
*/
|
|
208
|
-
on(event: "item_added", eventHandler: (monitoredItem: ClientMonitoredItem) => void): this;
|
|
209
|
-
/**
|
|
210
|
-
* notify the observers that a keep alive Publish Response has been received from the server.
|
|
211
|
-
* @event keepalive
|
|
212
|
-
*/
|
|
213
|
-
on(event: "keepalive", eventHandler: () => void): this;
|
|
214
|
-
/**
|
|
215
|
-
* notify the observers that an error has occurred
|
|
216
|
-
* @event internal_error
|
|
217
|
-
* @param event
|
|
218
|
-
* @param eventHandler
|
|
219
|
-
*/
|
|
220
|
-
on(event: "internal_error", eventHandler: (err: Error) => void): this;
|
|
221
|
-
on(event: "raw_notification", eventHandler: (notificationMessage: NotificationMessage) => void): this;
|
|
222
|
-
/**
|
|
223
|
-
* notify the observers that some notifications has been received from the server in a PublishResponse
|
|
224
|
-
* each modified monitored Item
|
|
225
|
-
* @event received_notifications
|
|
226
|
-
*/
|
|
227
|
-
on(event: "received_notifications", eventHandler: (notificationMessage: NotificationMessage) => void): this;
|
|
228
|
-
/**
|
|
229
|
-
* notify the observers that the server has send a status changed notification (such as BadTimeout )
|
|
230
|
-
* @event status_changed
|
|
231
|
-
*/
|
|
232
|
-
on(event: "status_changed", eventHandler: (status: StatusCode, diagnosticInfo: DiagnosticInfo) => void): this;
|
|
233
|
-
on(event: "error", eventHandler: (err: Error) => void): this;
|
|
234
|
-
}
|
|
235
|
-
export declare interface ClientSubscription {
|
|
236
|
-
_createMonitoredItem(itemToMonitor: ReadValueIdOptions, monitoringParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): ClientMonitoredItem;
|
|
237
|
-
}
|
|
238
|
-
export declare class ClientSubscription {
|
|
239
|
-
static create(clientSession: ClientSession, options: ClientSubscriptionOptions): ClientSubscription;
|
|
240
|
-
static ignoreNextWarning: boolean;
|
|
241
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-client
|
|
3
|
+
*/
|
|
4
|
+
/// <reference types="node" />
|
|
5
|
+
import { EventEmitter } from "events";
|
|
6
|
+
import { Byte, Double, UInt32 } from "node-opcua-basic-types";
|
|
7
|
+
import { DiagnosticInfo } from "node-opcua-data-model";
|
|
8
|
+
import { ReadValueIdOptions, TimestampsToReturn } from "node-opcua-service-read";
|
|
9
|
+
import { MonitoringMode, MonitoringParametersOptions, NotificationMessage, SetTriggeringResponse } from "node-opcua-service-subscription";
|
|
10
|
+
import { Callback, StatusCode } from "node-opcua-status-code";
|
|
11
|
+
import { ErrorCallback } from "node-opcua-status-code";
|
|
12
|
+
import { ClientMonitoredItem } from "./client_monitored_item";
|
|
13
|
+
import { ClientMonitoredItemBase } from "./client_monitored_item_base";
|
|
14
|
+
import { ClientMonitoredItemGroup } from "./client_monitored_item_group";
|
|
15
|
+
import { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session";
|
|
16
|
+
export interface ClientSubscriptionOptions {
|
|
17
|
+
requestedPublishingInterval?: number;
|
|
18
|
+
requestedLifetimeCount?: number;
|
|
19
|
+
requestedMaxKeepAliveCount?: number;
|
|
20
|
+
maxNotificationsPerPublish?: number;
|
|
21
|
+
publishingEnabled?: boolean;
|
|
22
|
+
priority?: number;
|
|
23
|
+
}
|
|
24
|
+
export type ClientHandle = number;
|
|
25
|
+
export interface ClientMonitoredItemBaseMap {
|
|
26
|
+
[key: string]: ClientMonitoredItemBase;
|
|
27
|
+
}
|
|
28
|
+
export interface ModifySubscriptionOptions {
|
|
29
|
+
requestedPublishingInterval?: Double;
|
|
30
|
+
requestedLifetimeCount?: UInt32;
|
|
31
|
+
requestedMaxKeepAliveCount?: UInt32;
|
|
32
|
+
maxNotificationsPerPublish?: UInt32;
|
|
33
|
+
priority?: Byte;
|
|
34
|
+
}
|
|
35
|
+
export interface ModifySubscriptionResult {
|
|
36
|
+
revisedPublishingInterval: Double;
|
|
37
|
+
revisedLifetimeCount: UInt32;
|
|
38
|
+
revisedMaxKeepAliveCount: UInt32;
|
|
39
|
+
}
|
|
40
|
+
export interface ClientSubscription extends EventEmitter {
|
|
41
|
+
subscriptionId: SubscriptionId;
|
|
42
|
+
publishingInterval: number;
|
|
43
|
+
lifetimeCount: number;
|
|
44
|
+
maxKeepAliveCount: number;
|
|
45
|
+
maxNotificationsPerPublish: number;
|
|
46
|
+
publishingEnabled: boolean;
|
|
47
|
+
priority: number;
|
|
48
|
+
monitoredItems: ClientMonitoredItemBaseMap;
|
|
49
|
+
timeoutHint: number;
|
|
50
|
+
/**
|
|
51
|
+
* return the session associated with the subscription.
|
|
52
|
+
* (may throw if the session is not valid)
|
|
53
|
+
*/
|
|
54
|
+
session: ClientSession;
|
|
55
|
+
/**
|
|
56
|
+
* return true if the subscription is attached to a valid session
|
|
57
|
+
*/
|
|
58
|
+
hasSession: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* true is the subscription is fully active
|
|
61
|
+
*/
|
|
62
|
+
isActive: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* add a monitor item to the subscription
|
|
65
|
+
*
|
|
66
|
+
* @method monitor
|
|
67
|
+
*
|
|
68
|
+
* Monitoring a simple Value Change
|
|
69
|
+
* ---------------------------------
|
|
70
|
+
*
|
|
71
|
+
* @example:
|
|
72
|
+
*
|
|
73
|
+
* clientSubscription.monitor(
|
|
74
|
+
* // itemToMonitor:
|
|
75
|
+
* {
|
|
76
|
+
* nodeId: "ns=0;i=2258",
|
|
77
|
+
* attributeId: AttributeIds.Value,
|
|
78
|
+
* indexRange: null,
|
|
79
|
+
* dataEncoding: { namespaceIndex: 0, name: null }
|
|
80
|
+
* },
|
|
81
|
+
* // requestedParameters:
|
|
82
|
+
* {
|
|
83
|
+
* samplingInterval: 3000,
|
|
84
|
+
* filter: null,
|
|
85
|
+
* queueSize: 1,
|
|
86
|
+
* discardOldest: true
|
|
87
|
+
* },
|
|
88
|
+
* TimestampsToReturn.Neither
|
|
89
|
+
* );
|
|
90
|
+
*
|
|
91
|
+
* Monitoring a Value Change With a DataChange Filter
|
|
92
|
+
* ---------------------------------------------------
|
|
93
|
+
*
|
|
94
|
+
* options.trigger {DataChangeTrigger} {Status|StatusValue|StatusValueTimestamp}
|
|
95
|
+
* options.deadbandType {DeadbandType} {None|Absolute|Percent}
|
|
96
|
+
* options.deadbandValue {Double}
|
|
97
|
+
*
|
|
98
|
+
* @example:
|
|
99
|
+
*
|
|
100
|
+
* clientSubscription.monitor(
|
|
101
|
+
* // itemToMonitor:
|
|
102
|
+
* {
|
|
103
|
+
* nodeId: "ns=0;i=2258",
|
|
104
|
+
* attributeId: AttributeIds.Value,
|
|
105
|
+
* },
|
|
106
|
+
* // requestedParameters:
|
|
107
|
+
* {
|
|
108
|
+
* samplingInterval: 3000,
|
|
109
|
+
* filter: new DataChangeFilter({
|
|
110
|
+
* trigger: DataChangeTrigger.StatusValue,
|
|
111
|
+
* deadbandType: DeadbandType.Absolute,
|
|
112
|
+
* deadbandValue: 0.1
|
|
113
|
+
* }),
|
|
114
|
+
* queueSize: 1,
|
|
115
|
+
* discardOldest: true
|
|
116
|
+
* },
|
|
117
|
+
* TimestampsToReturn.Neither
|
|
118
|
+
* );
|
|
119
|
+
*
|
|
120
|
+
*
|
|
121
|
+
* Monitoring an Event
|
|
122
|
+
* -------------------
|
|
123
|
+
*
|
|
124
|
+
* If the monitor attributeId is EventNotifier then the filter must be specified
|
|
125
|
+
*
|
|
126
|
+
* @example:
|
|
127
|
+
*
|
|
128
|
+
* var filter = new EventFilter({
|
|
129
|
+
* selectClauses: [
|
|
130
|
+
* { browsePath: [ {name: 'ActiveState' }, {name: 'id'} ]},
|
|
131
|
+
* { browsePath: [ {name: 'ConditionName'} ]}
|
|
132
|
+
* ],
|
|
133
|
+
* whereClause: []
|
|
134
|
+
* });
|
|
135
|
+
*
|
|
136
|
+
* clientSubscription.monitor(
|
|
137
|
+
* // itemToMonitor:
|
|
138
|
+
* {
|
|
139
|
+
* nodeId: "ns=0;i=2258",
|
|
140
|
+
* attributeId: AttributeIds.EventNotifier,
|
|
141
|
+
* indexRange: null,
|
|
142
|
+
* dataEncoding: { namespaceIndex: 0, name: null }
|
|
143
|
+
* },
|
|
144
|
+
* // requestedParameters:
|
|
145
|
+
* {
|
|
146
|
+
* samplingInterval: 3000,
|
|
147
|
+
*
|
|
148
|
+
* filter: filter,
|
|
149
|
+
*
|
|
150
|
+
* queueSize: 1,
|
|
151
|
+
* discardOldest: true
|
|
152
|
+
* },
|
|
153
|
+
* TimestampsToReturn.Neither
|
|
154
|
+
* );
|
|
155
|
+
*
|
|
156
|
+
*
|
|
157
|
+
*
|
|
158
|
+
*
|
|
159
|
+
*
|
|
160
|
+
*
|
|
161
|
+
*/
|
|
162
|
+
monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, monitoringMode?: MonitoringMode): Promise<ClientMonitoredItem>;
|
|
163
|
+
monitor(itemToMonitor: ReadValueIdOptions, requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, monitoringMode: MonitoringMode, callback: Callback<ClientMonitoredItem>): void;
|
|
164
|
+
/**
|
|
165
|
+
* @method monitorItems
|
|
166
|
+
* @param itemsToMonitor
|
|
167
|
+
* @param requestedParameters
|
|
168
|
+
* @param timestampsToReturn
|
|
169
|
+
* @return a ClientMonitoredItemGroup
|
|
170
|
+
* @async
|
|
171
|
+
*/
|
|
172
|
+
monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): Promise<ClientMonitoredItemGroup>;
|
|
173
|
+
/**
|
|
174
|
+
* @method monitorItems
|
|
175
|
+
* @param itemsToMonitor
|
|
176
|
+
* @param requestedParameters
|
|
177
|
+
* @param timestampsToReturn
|
|
178
|
+
* @param done
|
|
179
|
+
* @async
|
|
180
|
+
*/
|
|
181
|
+
monitorItems(itemsToMonitor: ReadValueIdOptions[], requestedParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn, callback: Callback<ClientMonitoredItemGroup>): void;
|
|
182
|
+
getMonitoredItems(): Promise<MonitoredItemData>;
|
|
183
|
+
getMonitoredItems(callback: (err: Error | null, result?: MonitoredItemData) => void): void;
|
|
184
|
+
modify(options: ModifySubscriptionOptions, callback: Callback<ModifySubscriptionResult>): void;
|
|
185
|
+
modify(options: ModifySubscriptionOptions): Promise<ModifySubscriptionResult>;
|
|
186
|
+
setTriggering(triggeringItem: ClientMonitoredItemBase, linksToAdd: ClientMonitoredItemBase[] | null, linksToRemove: ClientMonitoredItemBase[] | null, callback: Callback<SetTriggeringResponse>): void;
|
|
187
|
+
setTriggering(triggeringItem: ClientMonitoredItemBase, linksToAdd: ClientMonitoredItemBase[] | null, linksToRemove: ClientMonitoredItemBase[] | null): Promise<SetTriggeringResponse>;
|
|
188
|
+
terminate(): Promise<void>;
|
|
189
|
+
terminate(callback: ErrorCallback): void;
|
|
190
|
+
}
|
|
191
|
+
export declare interface ClientSubscription {
|
|
192
|
+
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
193
|
+
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
194
|
+
/**
|
|
195
|
+
* notify the observers that the subscription has now started
|
|
196
|
+
* @event started
|
|
197
|
+
*/
|
|
198
|
+
on(event: "started", eventHandler: (subscriptionId: number) => void): this;
|
|
199
|
+
/**
|
|
200
|
+
* notify the observers tha the client subscription has terminated
|
|
201
|
+
* @event terminated
|
|
202
|
+
*/
|
|
203
|
+
on(event: "terminated", eventHandler: () => void): this;
|
|
204
|
+
/**
|
|
205
|
+
* notify the observers that a new monitored item has been added to the subscription.
|
|
206
|
+
* @event item_added
|
|
207
|
+
*/
|
|
208
|
+
on(event: "item_added", eventHandler: (monitoredItem: ClientMonitoredItem) => void): this;
|
|
209
|
+
/**
|
|
210
|
+
* notify the observers that a keep alive Publish Response has been received from the server.
|
|
211
|
+
* @event keepalive
|
|
212
|
+
*/
|
|
213
|
+
on(event: "keepalive", eventHandler: () => void): this;
|
|
214
|
+
/**
|
|
215
|
+
* notify the observers that an error has occurred
|
|
216
|
+
* @event internal_error
|
|
217
|
+
* @param event
|
|
218
|
+
* @param eventHandler
|
|
219
|
+
*/
|
|
220
|
+
on(event: "internal_error", eventHandler: (err: Error) => void): this;
|
|
221
|
+
on(event: "raw_notification", eventHandler: (notificationMessage: NotificationMessage) => void): this;
|
|
222
|
+
/**
|
|
223
|
+
* notify the observers that some notifications has been received from the server in a PublishResponse
|
|
224
|
+
* each modified monitored Item
|
|
225
|
+
* @event received_notifications
|
|
226
|
+
*/
|
|
227
|
+
on(event: "received_notifications", eventHandler: (notificationMessage: NotificationMessage) => void): this;
|
|
228
|
+
/**
|
|
229
|
+
* notify the observers that the server has send a status changed notification (such as BadTimeout )
|
|
230
|
+
* @event status_changed
|
|
231
|
+
*/
|
|
232
|
+
on(event: "status_changed", eventHandler: (status: StatusCode, diagnosticInfo: DiagnosticInfo) => void): this;
|
|
233
|
+
on(event: "error", eventHandler: (err: Error) => void): this;
|
|
234
|
+
}
|
|
235
|
+
export declare interface ClientSubscription {
|
|
236
|
+
_createMonitoredItem(itemToMonitor: ReadValueIdOptions, monitoringParameters: MonitoringParametersOptions, timestampsToReturn: TimestampsToReturn): ClientMonitoredItem;
|
|
237
|
+
}
|
|
238
|
+
export declare class ClientSubscription {
|
|
239
|
+
static create(clientSession: ClientSession, options: ClientSubscriptionOptions): ClientSubscription;
|
|
240
|
+
static ignoreNextWarning: boolean;
|
|
241
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @module node-opcua-client
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ClientSubscription = void 0;
|
|
7
|
-
class ClientSubscription {
|
|
8
|
-
static create(clientSession, options) {
|
|
9
|
-
/* istanbul ignore next*/
|
|
10
|
-
throw new Error("Not Implemented");
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
ClientSubscription
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-client
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClientSubscription = void 0;
|
|
7
|
+
class ClientSubscription {
|
|
8
|
+
static create(clientSession, options) {
|
|
9
|
+
/* istanbul ignore next*/
|
|
10
|
+
throw new Error("Not Implemented");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
ClientSubscription.ignoreNextWarning = false;
|
|
14
|
+
exports.ClientSubscription = ClientSubscription;
|
|
15
15
|
//# sourceMappingURL=client_subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_subscription.js","sourceRoot":"","sources":["../source/client_subscription.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAgTH,MAAa,kBAAkB;IACpB,MAAM,CAAC,MAAM,CAAC,aAA4B,EAAE,OAAkC;QACjF,yBAAyB;QACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;;
|
|
1
|
+
{"version":3,"file":"client_subscription.js","sourceRoot":"","sources":["../source/client_subscription.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAgTH,MAAa,kBAAkB;IACpB,MAAM,CAAC,MAAM,CAAC,aAA4B,EAAE,OAAkC;QACjF,yBAAyB;QACzB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;;AACa,oCAAiB,GAAG,KAAK,CAAC;AAL/B,gDAAkB"}
|
package/dist/client_utils.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module node-opcua-client
|
|
3
|
-
*/
|
|
4
|
-
import { NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
-
import { Variant } from "node-opcua-variant";
|
|
6
|
-
import { ClientSession, ResponseCallback } from "./client_session";
|
|
7
|
-
interface AnalogDataItemSnapshot {
|
|
8
|
-
engineeringUnits: Variant | null;
|
|
9
|
-
engineeringUnitsRange: Variant | null;
|
|
10
|
-
instrumentRange: Variant | null;
|
|
11
|
-
valuePrecision: Variant | null;
|
|
12
|
-
definition: Variant | null;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* @method readUAAnalogItem
|
|
16
|
-
* @param session
|
|
17
|
-
* @param nodeId
|
|
18
|
-
* @param callback
|
|
19
|
-
*/
|
|
20
|
-
export declare function readUAAnalogItem(session: ClientSession, nodeId: NodeIdLike): Promise<AnalogDataItemSnapshot>;
|
|
21
|
-
export declare function readUAAnalogItem(session: ClientSession, nodeId: NodeIdLike, callback: ResponseCallback<AnalogDataItemSnapshot>): void;
|
|
22
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @module node-opcua-client
|
|
3
|
+
*/
|
|
4
|
+
import { NodeIdLike } from "node-opcua-nodeid";
|
|
5
|
+
import { Variant } from "node-opcua-variant";
|
|
6
|
+
import { ClientSession, ResponseCallback } from "./client_session";
|
|
7
|
+
interface AnalogDataItemSnapshot {
|
|
8
|
+
engineeringUnits: Variant | null;
|
|
9
|
+
engineeringUnitsRange: Variant | null;
|
|
10
|
+
instrumentRange: Variant | null;
|
|
11
|
+
valuePrecision: Variant | null;
|
|
12
|
+
definition: Variant | null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @method readUAAnalogItem
|
|
16
|
+
* @param session
|
|
17
|
+
* @param nodeId
|
|
18
|
+
* @param callback
|
|
19
|
+
*/
|
|
20
|
+
export declare function readUAAnalogItem(session: ClientSession, nodeId: NodeIdLike): Promise<AnalogDataItemSnapshot>;
|
|
21
|
+
export declare function readUAAnalogItem(session: ClientSession, nodeId: NodeIdLike, callback: ResponseCallback<AnalogDataItemSnapshot>): void;
|
|
22
|
+
export {};
|