node-opcua-client 2.98.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 -0
- package/dist/alarms_and_conditions/client_alarm.js +110 -0
- package/dist/alarms_and_conditions/client_alarm.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -0
- package/dist/alarms_and_conditions/client_alarm_list.js +98 -0
- package/dist/alarms_and_conditions/client_alarm_list.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -0
- package/dist/alarms_and_conditions/client_alarm_tools.js +157 -0
- package/dist/alarms_and_conditions/client_alarm_tools.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +193 -0
- package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -0
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +119 -0
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js.map +1 -0
- package/dist/alarms_and_conditions/client_tools.d.ts +7 -0
- package/dist/alarms_and_conditions/client_tools.js +180 -0
- package/dist/alarms_and_conditions/client_tools.js.map +1 -0
- package/dist/client_base.d.ts +277 -0
- package/dist/client_base.js +15 -0
- package/dist/client_base.js.map +1 -0
- package/dist/client_monitored_item.d.ts +21 -0
- package/dist/client_monitored_item.js +12 -0
- package/dist/client_monitored_item.js.map +1 -0
- package/dist/client_monitored_item_base.d.ts +39 -0
- package/dist/client_monitored_item_base.js +3 -0
- package/dist/client_monitored_item_base.js.map +1 -0
- package/dist/client_monitored_item_group.d.ts +21 -0
- package/dist/client_monitored_item_group.js +14 -0
- package/dist/client_monitored_item_group.js.map +1 -0
- package/dist/client_monitored_item_toolbox.d.ts +15 -0
- package/dist/client_monitored_item_toolbox.js +117 -0
- package/dist/client_monitored_item_toolbox.js.map +1 -0
- package/dist/client_session.d.ts +529 -0
- package/dist/client_session.js +11 -0
- package/dist/client_session.js.map +1 -0
- package/dist/client_session_keepalive_manager.d.ts +34 -0
- package/dist/client_session_keepalive_manager.js +150 -0
- package/dist/client_session_keepalive_manager.js.map +1 -0
- package/dist/client_subscription.d.ts +241 -0
- package/dist/client_subscription.js +15 -0
- package/dist/client_subscription.js.map +1 -0
- package/dist/client_utils.d.ts +22 -0
- package/dist/client_utils.js +88 -0
- package/dist/client_utils.js.map +1 -0
- package/dist/common.d.ts +17 -0
- package/dist/common.js +6 -0
- package/dist/common.js.map +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.js +95 -0
- package/dist/index.js.map +1 -0
- package/dist/opcua_client.d.ts +118 -0
- package/dist/opcua_client.js +34 -0
- package/dist/opcua_client.js.map +1 -0
- package/dist/private/client_base_impl.d.ts +160 -0
- package/dist/private/client_base_impl.js +1349 -0
- package/dist/private/client_base_impl.js.map +1 -0
- package/dist/private/client_monitored_item_base_impl.d.ts +3 -0
- package/dist/private/client_monitored_item_base_impl.js +5 -0
- package/dist/private/client_monitored_item_base_impl.js.map +1 -0
- package/dist/private/client_monitored_item_group_impl.d.ts +53 -0
- package/dist/private/client_monitored_item_group_impl.js +162 -0
- package/dist/private/client_monitored_item_group_impl.js.map +1 -0
- package/dist/private/client_monitored_item_impl.d.ts +93 -0
- package/dist/private/client_monitored_item_impl.js +305 -0
- package/dist/private/client_monitored_item_impl.js.map +1 -0
- package/dist/private/client_publish_engine.d.ts +62 -0
- package/dist/private/client_publish_engine.js +409 -0
- package/dist/private/client_publish_engine.js.map +1 -0
- package/dist/private/client_session_impl.d.ts +631 -0
- package/dist/private/client_session_impl.js +1349 -0
- package/dist/private/client_session_impl.js.map +1 -0
- package/dist/private/client_subscription_impl.d.ts +93 -0
- package/dist/private/client_subscription_impl.js +780 -0
- package/dist/private/client_subscription_impl.js.map +1 -0
- package/dist/private/i_private_client.d.ts +21 -0
- package/dist/private/i_private_client.js +3 -0
- package/dist/private/i_private_client.js.map +1 -0
- package/dist/private/opcua_client_impl.d.ts +166 -0
- package/dist/private/opcua_client_impl.js +1001 -0
- package/dist/private/opcua_client_impl.js.map +1 -0
- package/dist/private/performance.d.ts +1 -0
- package/dist/private/performance.js +19 -0
- package/dist/private/performance.js.map +1 -0
- package/dist/reconnection.d.ts +9 -0
- package/dist/reconnection.js +382 -0
- package/dist/reconnection.js.map +1 -0
- package/dist/tools/findservers.d.ts +20 -0
- package/dist/tools/findservers.js +62 -0
- package/dist/tools/findservers.js.map +1 -0
- package/dist/tools/read_history_server_capabilities.d.ts +6 -0
- package/dist/tools/read_history_server_capabilities.js +99 -0
- package/dist/tools/read_history_server_capabilities.js.map +1 -0
- package/dist/user_identity_info.d.ts +1 -0
- package/dist/user_identity_info.js +3 -0
- package/dist/user_identity_info.js.map +1 -0
- package/dist/verify.d.ts +5 -0
- package/dist/verify.js +135 -0
- package/dist/verify.js.map +1 -0
- package/package.json +48 -44
- package/.nycrc.json +0 -14
- package/test_helpers/create_certificates.js +0 -1
- package/typedoc.js +0 -20
|
@@ -0,0 +1,631 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
/**
|
|
4
|
+
* @module node-opcua-client-private
|
|
5
|
+
*/
|
|
6
|
+
import { EventEmitter } from "events";
|
|
7
|
+
import { AggregateFunction } from "node-opcua-constants";
|
|
8
|
+
import { DateTime } from "node-opcua-basic-types";
|
|
9
|
+
import { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
|
|
10
|
+
import { Certificate, Nonce } from "node-opcua-crypto";
|
|
11
|
+
import { LocalizedTextLike } from "node-opcua-data-model";
|
|
12
|
+
import { DataValue } from "node-opcua-data-value";
|
|
13
|
+
import { ExtensionObject } from "node-opcua-extension-object";
|
|
14
|
+
import { NodeId, NodeIdLike } from "node-opcua-nodeid";
|
|
15
|
+
import { IBasicTransportSettings } from "node-opcua-pseudo-session";
|
|
16
|
+
import { AnyConstructorFunc } from "node-opcua-schemas";
|
|
17
|
+
import { SignatureData } from "node-opcua-secure-channel";
|
|
18
|
+
import { BrowseResult } from "node-opcua-service-browse";
|
|
19
|
+
import { CallMethodResult } from "node-opcua-service-call";
|
|
20
|
+
import { EndpointDescription } from "node-opcua-service-endpoints";
|
|
21
|
+
import { HistoryReadRequest, HistoryReadResponse, HistoryReadResult } from "node-opcua-service-history";
|
|
22
|
+
import { QueryFirstResponse } from "node-opcua-service-query";
|
|
23
|
+
import { ReadValueIdOptions } from "node-opcua-service-read";
|
|
24
|
+
import { CreateMonitoredItemsResponse, CreateSubscriptionResponse, DeleteMonitoredItemsResponse, DeleteSubscriptionsResponse, ModifyMonitoredItemsResponse, ModifySubscriptionResponse, PublishRequest, PublishResponse, RepublishRequest, RepublishResponse, SetMonitoringModeResponse, SetTriggeringRequestOptions, SetTriggeringResponse, TransferSubscriptionsResponse } from "node-opcua-service-subscription";
|
|
25
|
+
import { BrowsePath, BrowsePathResult } from "node-opcua-service-translate-browse-path";
|
|
26
|
+
import { StatusCode, Callback, CallbackT } from "node-opcua-status-code";
|
|
27
|
+
import { ErrorCallback } from "node-opcua-status-code";
|
|
28
|
+
import { AggregateConfigurationOptions, HistoryReadValueIdOptions, WriteValueOptions } from "node-opcua-types";
|
|
29
|
+
import { VariantLike } from "node-opcua-variant";
|
|
30
|
+
import { ArgumentDefinition, BrowseDescriptionLike, CallMethodRequestLike, ClientSession, CreateMonitoredItemsRequestLike, CreateSubscriptionRequestLike, DeleteMonitoredItemsRequestLike, DeleteSubscriptionsRequestLike, MethodId, ModifyMonitoredItemsRequestLike, ModifySubscriptionRequestLike, MonitoredItemData, NodeAttributes, QueryFirstRequestLike, SetMonitoringModeRequestLike, SubscriptionId, TransferSubscriptionsRequestLike, HistoryReadValueIdOptions2, ExtraReadHistoryValueParameters } from "../client_session";
|
|
31
|
+
import { ClientSubscription } from "../client_subscription";
|
|
32
|
+
import { Request, Response } from "../common";
|
|
33
|
+
import { UserIdentityInfo } from "../user_identity_info";
|
|
34
|
+
import { ClientSidePublishEngine } from "./client_publish_engine";
|
|
35
|
+
import { IClientBase } from "./i_private_client";
|
|
36
|
+
export type ResponseCallback<T> = (err: Error | null, response?: T) => void;
|
|
37
|
+
type EmptyCallback = (err?: Error) => void;
|
|
38
|
+
export interface Reconnectable {
|
|
39
|
+
_reconnecting: {
|
|
40
|
+
reconnecting: boolean;
|
|
41
|
+
pendingCallbacks: EmptyCallback[];
|
|
42
|
+
};
|
|
43
|
+
pendingTransactions: any[];
|
|
44
|
+
pendingTransactionsCount: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @class ClientSession
|
|
48
|
+
* @param client {OPCUAClientImpl}
|
|
49
|
+
* @constructor
|
|
50
|
+
* @private
|
|
51
|
+
*/
|
|
52
|
+
export declare class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
53
|
+
timeout: number;
|
|
54
|
+
authenticationToken?: NodeId;
|
|
55
|
+
requestedMaxReferencesPerNode: number;
|
|
56
|
+
sessionId: NodeId;
|
|
57
|
+
lastRequestSentTime: Date;
|
|
58
|
+
lastResponseReceivedTime: Date;
|
|
59
|
+
serverCertificate: Certificate;
|
|
60
|
+
userIdentityInfo?: UserIdentityInfo;
|
|
61
|
+
name: string;
|
|
62
|
+
serverNonce?: Nonce;
|
|
63
|
+
serverSignature?: SignatureData;
|
|
64
|
+
serverEndpoints: EndpointDescription[];
|
|
65
|
+
_client: IClientBase | null;
|
|
66
|
+
_closed: boolean;
|
|
67
|
+
private _reconnecting;
|
|
68
|
+
/**
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
71
|
+
_closeEventHasBeenEmitted: boolean;
|
|
72
|
+
private _publishEngine;
|
|
73
|
+
private _keepAliveManager?;
|
|
74
|
+
private _namespaceArray?;
|
|
75
|
+
private recursive_repair_detector;
|
|
76
|
+
constructor(client: IClientBase);
|
|
77
|
+
getTransportSettings(): IBasicTransportSettings;
|
|
78
|
+
/**
|
|
79
|
+
* the endpoint on which this session is operating
|
|
80
|
+
* @property endpoint
|
|
81
|
+
* @type {EndpointDescription}
|
|
82
|
+
*/
|
|
83
|
+
get endpoint(): EndpointDescription;
|
|
84
|
+
get subscriptionCount(): number;
|
|
85
|
+
get isReconnecting(): boolean;
|
|
86
|
+
getPublishEngine(): ClientSidePublishEngine;
|
|
87
|
+
changeUser(userIdentityInfo: UserIdentityInfo): Promise<StatusCode>;
|
|
88
|
+
changeUser(userIdentityInfo: UserIdentityInfo, callback: CallbackT<StatusCode>): void;
|
|
89
|
+
/**
|
|
90
|
+
* @method browse
|
|
91
|
+
* @async
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
*
|
|
95
|
+
* ```javascript
|
|
96
|
+
* session.browse("RootFolder",function(err,browseResult) {
|
|
97
|
+
* if(err) return callback(err);
|
|
98
|
+
* console.log(browseResult.toString());
|
|
99
|
+
* callback();
|
|
100
|
+
* } );
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
*
|
|
106
|
+
* ``` javascript
|
|
107
|
+
* const browseDescription = {
|
|
108
|
+
* nodeId: "ObjectsFolder",
|
|
109
|
+
* referenceTypeId: "Organizes",
|
|
110
|
+
* browseDirection: BrowseDirection.Inverse,
|
|
111
|
+
* includeSubtypes: true,
|
|
112
|
+
* nodeClassMask: 0,
|
|
113
|
+
* resultMask: 63
|
|
114
|
+
* }
|
|
115
|
+
* session.browse(browseDescription,function(err, browseResult) {
|
|
116
|
+
* if(err) return callback(err);
|
|
117
|
+
* console.log(browseResult.toString());
|
|
118
|
+
* callback();
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
* @example
|
|
122
|
+
*
|
|
123
|
+
* ``` javascript
|
|
124
|
+
* session.browse([ "RootFolder", "ObjectsFolder"],function(err, browseResults) {
|
|
125
|
+
* assert(browseResults.length === 2);
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ``` javascript
|
|
131
|
+
* const browseDescriptions = [
|
|
132
|
+
* {
|
|
133
|
+
* nodeId: "ObjectsFolder",
|
|
134
|
+
* referenceTypeId: "Organizes",
|
|
135
|
+
* browseDirection: BrowseDirection.Inverse,
|
|
136
|
+
* includeSubtypes: true,
|
|
137
|
+
* nodeClassMask: 0,
|
|
138
|
+
* resultMask: 63
|
|
139
|
+
* },
|
|
140
|
+
* // {...}
|
|
141
|
+
* ]
|
|
142
|
+
* session.browse(browseDescriptions,function(err, browseResults) {
|
|
143
|
+
*
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
*
|
|
148
|
+
*/
|
|
149
|
+
browse(nodeToBrowse: BrowseDescriptionLike, callback: ResponseCallback<BrowseResult>): void;
|
|
150
|
+
browse(nodesToBrowse: BrowseDescriptionLike[], callback: ResponseCallback<BrowseResult[]>): void;
|
|
151
|
+
browse(nodeToBrowse: BrowseDescriptionLike): Promise<BrowseResult>;
|
|
152
|
+
browse(nodesToBrowse: BrowseDescriptionLike[]): Promise<BrowseResult[]>;
|
|
153
|
+
browseNext(continuationPoint: Buffer, releaseContinuationPoints: boolean, callback: ResponseCallback<BrowseResult>): void;
|
|
154
|
+
browseNext(continuationPoints: Buffer[], releaseContinuationPoints: boolean, callback: ResponseCallback<BrowseResult[]>): void;
|
|
155
|
+
browseNext(continuationPoint: Buffer, releaseContinuationPoints: boolean): Promise<BrowseResult>;
|
|
156
|
+
browseNext(continuationPoints: Buffer[], releaseContinuationPoints: boolean): Promise<BrowseResult[]>;
|
|
157
|
+
/**
|
|
158
|
+
* @method readVariableValue
|
|
159
|
+
* @async
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
*
|
|
163
|
+
* ```javascript
|
|
164
|
+
* session.readVariableValue("ns=2;s=Furnace_1.Temperature",function(err,dataValue) {
|
|
165
|
+
* if(err) { return callback(err); }
|
|
166
|
+
* if (dataValue.isGood()) {
|
|
167
|
+
* }
|
|
168
|
+
* console.log(dataValue.toString());
|
|
169
|
+
* callback();
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
*
|
|
175
|
+
* ```javascript
|
|
176
|
+
* session.readVariableValue(["ns=0;i=2257","ns=0;i=2258"],function(err,dataValues) {
|
|
177
|
+
* if (!err) {
|
|
178
|
+
* console.log(dataValues[0].toString());
|
|
179
|
+
* console.log(dataValues[1].toString());
|
|
180
|
+
* }
|
|
181
|
+
* });
|
|
182
|
+
* ```
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```javascript
|
|
186
|
+
* const dataValues = await session.readVariableValue(["ns=1;s=Temperature","ns=1;s=Pressure"]);
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
readVariableValue(nodeId: NodeIdLike, callback: ResponseCallback<DataValue>): void;
|
|
190
|
+
readVariableValue(nodeIds: NodeIdLike[], callback: ResponseCallback<DataValue[]>): void;
|
|
191
|
+
readVariableValue(nodeId: NodeIdLike): Promise<DataValue>;
|
|
192
|
+
readVariableValue(nodeIds: NodeIdLike[]): Promise<DataValue[]>;
|
|
193
|
+
/**
|
|
194
|
+
* @method readHistoryValue
|
|
195
|
+
* @async
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
*
|
|
199
|
+
* ```javascript
|
|
200
|
+
* // es5
|
|
201
|
+
* session.readHistoryValue(
|
|
202
|
+
* "ns=5;s=Simulation Examples.Functions.Sine1",
|
|
203
|
+
* "2015-06-10T09:00:00.000Z",
|
|
204
|
+
* "2015-06-10T09:01:00.000Z", function(err,dataValues) {
|
|
205
|
+
*
|
|
206
|
+
* });
|
|
207
|
+
* ```
|
|
208
|
+
*
|
|
209
|
+
* ```javascript
|
|
210
|
+
* // es6
|
|
211
|
+
* const dataValues = await session.readHistoryValue(
|
|
212
|
+
* "ns=5;s=Simulation Examples.Functions.Sine1",
|
|
213
|
+
* "2015-06-10T09:00:00.000Z",
|
|
214
|
+
* "2015-06-10T09:01:00.000Z");
|
|
215
|
+
* ```
|
|
216
|
+
* @param nodeToRead the read value id
|
|
217
|
+
* @param start the start time in UTC format
|
|
218
|
+
* @param end the end time in UTC format
|
|
219
|
+
* @param callback
|
|
220
|
+
*/
|
|
221
|
+
readHistoryValue(nodesToRead: NodeIdLike[] | HistoryReadValueIdOptions2[], start: DateTime, end: DateTime, callback: (err: Error | null, results?: HistoryReadResult[]) => void): void;
|
|
222
|
+
readHistoryValue(nodesToRead: NodeIdLike[] | HistoryReadValueIdOptions2[], start: DateTime, end: DateTime, options: ExtraReadHistoryValueParameters | undefined, callback: (err: Error | null, results?: HistoryReadResult[]) => void): void;
|
|
223
|
+
readHistoryValue(nodesToRead: NodeIdLike[] | HistoryReadValueIdOptions2[], start: DateTime, end: DateTime, options?: ExtraReadHistoryValueParameters): Promise<HistoryReadResult[]>;
|
|
224
|
+
readHistoryValue(nodeToRead: NodeIdLike | HistoryReadValueIdOptions2, start: DateTime, end: DateTime, callback: (err: Error | null, results?: HistoryReadResult) => void): void;
|
|
225
|
+
readHistoryValue(nodeToRead: NodeIdLike | HistoryReadValueIdOptions2, start: DateTime, end: DateTime, options: ExtraReadHistoryValueParameters | undefined, callback: (err: Error | null, results?: HistoryReadResult) => void): void;
|
|
226
|
+
readHistoryValue(nodeToRead: NodeIdLike | HistoryReadValueIdOptions2, start: DateTime, end: DateTime, parameters: ExtraReadHistoryValueParameters): Promise<HistoryReadResult>;
|
|
227
|
+
historyRead(request: HistoryReadRequest, callback: Callback<HistoryReadResponse>): void;
|
|
228
|
+
historyRead(request: HistoryReadRequest): Promise<HistoryReadResponse>;
|
|
229
|
+
readAggregateValue(nodesToRead: HistoryReadValueIdOptions[], startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction[], processingInterval: number, callback: Callback<HistoryReadResult[]>): void;
|
|
230
|
+
readAggregateValue(nodesToRead: HistoryReadValueIdOptions[], startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction[], processingInterval: number): Promise<HistoryReadResult[]>;
|
|
231
|
+
readAggregateValue(nodeToRead: HistoryReadValueIdOptions, startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction, processingInterval: number, callback: Callback<HistoryReadResult>): void;
|
|
232
|
+
readAggregateValue(nodeToRead: HistoryReadValueIdOptions, startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction, processingInterval: number): Promise<HistoryReadResult>;
|
|
233
|
+
readAggregateValue(nodesToRead: HistoryReadValueIdOptions[], startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction[], processingInterval: number, aggregateConfiguration: AggregateConfigurationOptions, callback: Callback<HistoryReadResult[]>): void;
|
|
234
|
+
readAggregateValue(nodesToRead: HistoryReadValueIdOptions[], startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction[], processingInterval: number, aggregateConfiguration: AggregateConfigurationOptions): Promise<HistoryReadResult[]>;
|
|
235
|
+
readAggregateValue(nodeToRead: HistoryReadValueIdOptions, startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction, processingInterval: number, aggregateConfiguration: AggregateConfigurationOptions, callback: Callback<HistoryReadResult>): void;
|
|
236
|
+
readAggregateValue(nodeToRead: HistoryReadValueIdOptions, startTime: DateTime, endTime: DateTime, aggregateFn: AggregateFunction, processingInterval: number, aggregateConfiguration: AggregateConfigurationOptions): Promise<HistoryReadResult>;
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
* @method write
|
|
240
|
+
* @param nodesToWrite {WriteValue[]} - the array of value to write. One or more elements.
|
|
241
|
+
* @param {Function} callback - the callback function
|
|
242
|
+
* @param callback.err {object|null} the error if write has failed or null if OK
|
|
243
|
+
* @param callback.statusCodes {StatusCode[]} - an array of status code of each write
|
|
244
|
+
* @async
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
*
|
|
248
|
+
* const nodesToWrite = [
|
|
249
|
+
* {
|
|
250
|
+
* nodeId: "ns=1;s=SetPoint1",
|
|
251
|
+
* attributeId: opcua.AttributeIds.Value,
|
|
252
|
+
* value: {
|
|
253
|
+
* statusCode: Good,
|
|
254
|
+
* value: {
|
|
255
|
+
* dataType: opcua.DataType.Double,
|
|
256
|
+
* value: 100.0
|
|
257
|
+
* }
|
|
258
|
+
* }
|
|
259
|
+
* },
|
|
260
|
+
* {
|
|
261
|
+
* nodeId: "ns=1;s=SetPoint2",
|
|
262
|
+
* attributeIds opcua.AttributeIds.Value,
|
|
263
|
+
* value: {
|
|
264
|
+
* statusCode: Good,
|
|
265
|
+
* value: {
|
|
266
|
+
* dataType: opcua.DataType.Double,
|
|
267
|
+
* value: 45.0
|
|
268
|
+
* }
|
|
269
|
+
* }
|
|
270
|
+
* }
|
|
271
|
+
* ];
|
|
272
|
+
* session.write(nodesToWrite,function (err,statusCodes) {
|
|
273
|
+
* if(err) { return callback(err);}
|
|
274
|
+
* //
|
|
275
|
+
* });
|
|
276
|
+
*
|
|
277
|
+
* @method write
|
|
278
|
+
* @param nodeToWrite {WriteValue} - the value to write
|
|
279
|
+
* @param callback - the callback function
|
|
280
|
+
* @param callback.err {object|null} the error if write has failed or null if OK
|
|
281
|
+
* @param callback.statusCode {StatusCodes} - the status code of the write
|
|
282
|
+
* @async
|
|
283
|
+
*
|
|
284
|
+
* @example
|
|
285
|
+
*
|
|
286
|
+
* const nodeToWrite = {
|
|
287
|
+
* nodeId: "ns=1;s=SetPoint",
|
|
288
|
+
* attributeId: opcua.AttributeIds.Value,
|
|
289
|
+
* value: {
|
|
290
|
+
* statusCode: Good,
|
|
291
|
+
* value: {
|
|
292
|
+
* dataType: opcua.DataType.Double,
|
|
293
|
+
* value: 100.0
|
|
294
|
+
* }
|
|
295
|
+
* }
|
|
296
|
+
* };
|
|
297
|
+
* session.write(nodeToWrite,function (err,statusCode) {
|
|
298
|
+
* if(err) { return callback(err);}
|
|
299
|
+
* //
|
|
300
|
+
* });
|
|
301
|
+
*
|
|
302
|
+
*
|
|
303
|
+
* @method write
|
|
304
|
+
* @param nodeToWrite {WriteValue} - the value to write
|
|
305
|
+
* @return {Promise<StatusCode>}
|
|
306
|
+
* @async
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
*
|
|
310
|
+
* ```javascript
|
|
311
|
+
* session.write(nodeToWrite).then(function(statusCode) { });
|
|
312
|
+
* ```
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
*
|
|
316
|
+
* ```javascript
|
|
317
|
+
* const statusCode = await session.write(nodeToWrite);
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @method write
|
|
321
|
+
* @param nodesToWrite {Array<WriteValue>} - the value to write
|
|
322
|
+
* @return {Promise<Array<StatusCode>>}
|
|
323
|
+
* @async
|
|
324
|
+
*
|
|
325
|
+
* @example
|
|
326
|
+
* ```javascript
|
|
327
|
+
* session.write(nodesToWrite).then(function(statusCodes) { });
|
|
328
|
+
* ```
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```javascript
|
|
332
|
+
* const statusCodes = await session.write(nodesToWrite);
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
write(nodeToWrite: WriteValueOptions, callback: ResponseCallback<StatusCode>): void;
|
|
336
|
+
write(nodesToWrite: WriteValueOptions[], callback: ResponseCallback<StatusCode[]>): void;
|
|
337
|
+
write(nodesToWrite: WriteValueOptions[]): Promise<StatusCode[]>;
|
|
338
|
+
write(nodeToWrite: WriteValueOptions): Promise<StatusCode>;
|
|
339
|
+
/**
|
|
340
|
+
*
|
|
341
|
+
* @method writeSingleNode
|
|
342
|
+
* @async
|
|
343
|
+
* @param nodeId {NodeId} - the node id of the node to write
|
|
344
|
+
* @param value {Variant} - the value to write
|
|
345
|
+
* @param callback {Function}
|
|
346
|
+
* @param callback.err {object|null} the error if write has failed or null if OK
|
|
347
|
+
* @param callback.statusCode {StatusCode} - the status code of the write
|
|
348
|
+
*
|
|
349
|
+
* @method writeSingleNode
|
|
350
|
+
* @async
|
|
351
|
+
* @param nodeId {NodeId} - the node id of the node to write
|
|
352
|
+
* @param value {Variant} - the value to write
|
|
353
|
+
* @return {Promise<StatusCode>} - the status code of the write
|
|
354
|
+
*
|
|
355
|
+
* @deprecated
|
|
356
|
+
*/
|
|
357
|
+
writeSingleNode(nodeId: NodeIdLike, value: VariantLike, callback: ResponseCallback<StatusCode>): void;
|
|
358
|
+
writeSingleNode(nodeId: NodeIdLike, value: VariantLike): Promise<StatusCode>;
|
|
359
|
+
/**
|
|
360
|
+
* @method readAllAttributes
|
|
361
|
+
*
|
|
362
|
+
* @example
|
|
363
|
+
*
|
|
364
|
+
*
|
|
365
|
+
* ``` javascript
|
|
366
|
+
* session.readAllAttributes("ns=2;s=Furnace_1.Temperature",function(err,data) {
|
|
367
|
+
* if(data.statusCode.isGood()) {
|
|
368
|
+
* console.log(" nodeId = ",data.nodeId.toString());
|
|
369
|
+
* console.log(" browseName = ",data.browseName.toString());
|
|
370
|
+
* console.log(" description = ",data.description.toString());
|
|
371
|
+
* console.log(" value = ",data.value.toString()));
|
|
372
|
+
* }
|
|
373
|
+
* });
|
|
374
|
+
* ```
|
|
375
|
+
*
|
|
376
|
+
* @async
|
|
377
|
+
* @param nodes array of nodeId to read
|
|
378
|
+
* @param node nodeId to read
|
|
379
|
+
* @param callback
|
|
380
|
+
*/
|
|
381
|
+
readAllAttributes(node: NodeIdLike, callback: (err: Error | null, data?: NodeAttributes) => void): void;
|
|
382
|
+
readAllAttributes(nodes: NodeIdLike[], callback: (err: Error | null, data?: NodeAttributes[]) => void): void;
|
|
383
|
+
/**
|
|
384
|
+
* @method read (form1)
|
|
385
|
+
*
|
|
386
|
+
* @async
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
*
|
|
390
|
+
* ```javascript
|
|
391
|
+
* ```
|
|
392
|
+
*
|
|
393
|
+
* form1: reading a single node
|
|
394
|
+
*
|
|
395
|
+
* ``` javascript
|
|
396
|
+
* const nodeToRead = {
|
|
397
|
+
* nodeId: "ns=2;s=Furnace_1.Temperature",
|
|
398
|
+
* attributeId: AttributeIds.BrowseName
|
|
399
|
+
* };
|
|
400
|
+
*
|
|
401
|
+
* session.read(nodeToRead,function(err,dataValue) {
|
|
402
|
+
* if (!err) {
|
|
403
|
+
* console.log(dataValue.toString());
|
|
404
|
+
* }
|
|
405
|
+
* });
|
|
406
|
+
* ```
|
|
407
|
+
*
|
|
408
|
+
*
|
|
409
|
+
* @method read (form2)
|
|
410
|
+
* @param nodesToRead {Array<ReadValueId>} - an array of nodeId to read or a ReadValueId
|
|
411
|
+
* @param [maxAge] {Number}
|
|
412
|
+
* @param callback {Function} - the callback function
|
|
413
|
+
* @param callback.err {Error|null} - the error or null if the transaction was OK}
|
|
414
|
+
* @param callback.dataValues {Array<DataValue>}
|
|
415
|
+
* @async
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
*
|
|
419
|
+
* ``` javascript
|
|
420
|
+
* const nodesToRead = [
|
|
421
|
+
* {
|
|
422
|
+
* nodeId: "ns=2;s=Furnace_1.Temperature",
|
|
423
|
+
* attributeId: AttributeIds.BrowseName
|
|
424
|
+
* }
|
|
425
|
+
* ];
|
|
426
|
+
* session.read(nodesToRead,function(err,dataValues) {
|
|
427
|
+
* if (!err) {
|
|
428
|
+
* dataValues.forEach(dataValue=>console.log(dataValue.toString()));
|
|
429
|
+
* }
|
|
430
|
+
* });
|
|
431
|
+
* ```
|
|
432
|
+
*
|
|
433
|
+
*/
|
|
434
|
+
read(nodeToRead: ReadValueIdOptions, maxAge: number, callback: ResponseCallback<DataValue>): void;
|
|
435
|
+
read(nodesToRead: ReadValueIdOptions[], maxAge: number, callback: ResponseCallback<DataValue[]>): void;
|
|
436
|
+
read(nodeToRead: ReadValueIdOptions, callback: ResponseCallback<DataValue>): void;
|
|
437
|
+
read(nodesToRead: ReadValueIdOptions[], callback: ResponseCallback<DataValue[]>): void;
|
|
438
|
+
read(nodeToRead: ReadValueIdOptions, maxAge?: number): Promise<DataValue>;
|
|
439
|
+
read(nodeToRead: ReadValueIdOptions[], maxAge?: number): Promise<DataValue[]>;
|
|
440
|
+
emitCloseEvent(statusCode: StatusCode): void;
|
|
441
|
+
createSubscription(options: CreateSubscriptionRequestLike, callback?: ResponseCallback<CreateSubscriptionResponse>): any;
|
|
442
|
+
/**
|
|
443
|
+
* @method createSubscription2
|
|
444
|
+
* @param createSubscriptionRequest
|
|
445
|
+
* @param callback
|
|
446
|
+
*
|
|
447
|
+
*
|
|
448
|
+
* subscription.on("error', function(err){ ... });
|
|
449
|
+
* subscription.on("terminate',function(err){ ... });
|
|
450
|
+
* const monitoredItem = await subscription.monitor(itemToMonitor,monitoringParameters,requestedParameters);
|
|
451
|
+
* monitoredItem.on("changed",function( dataValue) {...});
|
|
452
|
+
*
|
|
453
|
+
*/
|
|
454
|
+
createSubscription2(createSubscriptionRequest: CreateSubscriptionRequestLike): Promise<ClientSubscription>;
|
|
455
|
+
createSubscription2(createSubscriptionRequest: CreateSubscriptionRequestLike, callback: (err: Error | null, subscription?: ClientSubscription) => void): void;
|
|
456
|
+
deleteSubscriptions(options: DeleteSubscriptionsRequestLike, callback?: ResponseCallback<DeleteSubscriptionsResponse>): any;
|
|
457
|
+
setTriggering(request: SetTriggeringRequestOptions, callback?: ResponseCallback<SetTriggeringResponse>): any;
|
|
458
|
+
/**
|
|
459
|
+
* @method transferSubscriptions
|
|
460
|
+
* @async
|
|
461
|
+
*/
|
|
462
|
+
transferSubscriptions(options: TransferSubscriptionsRequestLike, callback?: ResponseCallback<TransferSubscriptionsResponse>): any;
|
|
463
|
+
createMonitoredItems(options: CreateMonitoredItemsRequestLike, callback?: ResponseCallback<CreateMonitoredItemsResponse>): any;
|
|
464
|
+
modifyMonitoredItems(options: ModifyMonitoredItemsRequestLike, callback?: ResponseCallback<ModifyMonitoredItemsResponse>): any;
|
|
465
|
+
/**
|
|
466
|
+
*
|
|
467
|
+
* @method modifySubscription
|
|
468
|
+
* @async
|
|
469
|
+
* @param options {ModifySubscriptionRequest}
|
|
470
|
+
* @param callback {Function}
|
|
471
|
+
* @param callback.err {Error|null} - the Error if the async method has failed
|
|
472
|
+
* @param callback.response {ModifySubscriptionResponse} - the response
|
|
473
|
+
*/
|
|
474
|
+
modifySubscription(options: ModifySubscriptionRequestLike, callback?: ResponseCallback<ModifySubscriptionResponse>): any;
|
|
475
|
+
setMonitoringMode(options: SetMonitoringModeRequestLike, callback?: ResponseCallback<SetMonitoringModeResponse>): any;
|
|
476
|
+
/**
|
|
477
|
+
*
|
|
478
|
+
* @method publish
|
|
479
|
+
* @async
|
|
480
|
+
* @param options {PublishRequest}
|
|
481
|
+
* @param callback {Function}
|
|
482
|
+
* @param callback.err {Error|null} - the Error if the async method has failed
|
|
483
|
+
* @param callback.response {PublishResponse} - the response
|
|
484
|
+
*/
|
|
485
|
+
publish(options: PublishRequest, callback: (err: Error | null, response?: PublishResponse) => void): void;
|
|
486
|
+
/**
|
|
487
|
+
*
|
|
488
|
+
* @method republish
|
|
489
|
+
* @async
|
|
490
|
+
* @param options {RepublishRequest}
|
|
491
|
+
* @param callback the callback
|
|
492
|
+
*/
|
|
493
|
+
republish(options: RepublishRequest, callback: (err: Error | null, response?: RepublishResponse) => void): void;
|
|
494
|
+
/**
|
|
495
|
+
*
|
|
496
|
+
* @method deleteMonitoredItems
|
|
497
|
+
* @async
|
|
498
|
+
* @param options {DeleteMonitoredItemsRequest}
|
|
499
|
+
* @param callback {Function}
|
|
500
|
+
* @param callback.err {Error|null} - the Error if the async method has failed
|
|
501
|
+
*/
|
|
502
|
+
deleteMonitoredItems(options: DeleteMonitoredItemsRequestLike, callback: (err: Error | null, response?: DeleteMonitoredItemsResponse) => void): void;
|
|
503
|
+
/**
|
|
504
|
+
*
|
|
505
|
+
* @method setPublishingMode
|
|
506
|
+
* @async
|
|
507
|
+
*/
|
|
508
|
+
setPublishingMode(publishingEnabled: boolean, subscriptionId: SubscriptionId): Promise<StatusCode>;
|
|
509
|
+
setPublishingMode(publishingEnabled: boolean, subscriptionIds: SubscriptionId[]): Promise<StatusCode[]>;
|
|
510
|
+
setPublishingMode(publishingEnabled: boolean, subscriptionId: SubscriptionId, callback: (err: Error | null, statusCode?: StatusCode) => void): void;
|
|
511
|
+
setPublishingMode(publishingEnabled: boolean, subscriptionIds: SubscriptionId[], callback: (err: Error | null, statusCodes?: StatusCode[]) => void): void;
|
|
512
|
+
/**
|
|
513
|
+
*
|
|
514
|
+
* @method translateBrowsePath
|
|
515
|
+
* @async
|
|
516
|
+
* @param browsePath {BrowsePath|Array<BrowsePath>}
|
|
517
|
+
* @param callback {Function}
|
|
518
|
+
* @param callback.err {Error|null}
|
|
519
|
+
* @param callback.response {BrowsePathResult|Array<BrowsePathResult>}
|
|
520
|
+
*
|
|
521
|
+
*
|
|
522
|
+
*
|
|
523
|
+
*/
|
|
524
|
+
translateBrowsePath(browsePath: BrowsePath, callback: ResponseCallback<BrowsePathResult>): void;
|
|
525
|
+
translateBrowsePath(browsesPath: BrowsePath[], callback: ResponseCallback<BrowsePathResult[]>): void;
|
|
526
|
+
translateBrowsePath(browsePath: BrowsePath): Promise<BrowsePathResult>;
|
|
527
|
+
translateBrowsePath(browsePaths: BrowsePath[]): Promise<BrowsePathResult[]>;
|
|
528
|
+
channelId(): number;
|
|
529
|
+
isChannelValid(): boolean;
|
|
530
|
+
performMessageTransaction(request: Request, callback: (err: Error | null, response?: Response) => void): void;
|
|
531
|
+
processTransactionQueue: (request: Request, callback: (err: Error | null, response?: Response) => void) => void;
|
|
532
|
+
_performMessageTransaction(request: Request, callback: (err: Error | null, response?: Response) => void): void;
|
|
533
|
+
/**
|
|
534
|
+
* evaluate the remaining time for the session
|
|
535
|
+
*
|
|
536
|
+
*
|
|
537
|
+
* evaluate the time in milliseconds that the session will live
|
|
538
|
+
* on the server end from now.
|
|
539
|
+
* The remaining live time is calculated based on when the last message was sent to the server
|
|
540
|
+
* and the session timeout.
|
|
541
|
+
*
|
|
542
|
+
* * In normal operation , when server and client communicates on a regular
|
|
543
|
+
* basis, evaluateRemainingLifetime will return a number slightly below
|
|
544
|
+
* session.timeout
|
|
545
|
+
*
|
|
546
|
+
* * when the client and server cannot communicate due to a network issue
|
|
547
|
+
* (or a server crash), evaluateRemainingLifetime returns the estimated number
|
|
548
|
+
* of milliseconds before the server (if not crash) will keep the session alive
|
|
549
|
+
* on its end to allow a automatic reconnection with session.
|
|
550
|
+
*
|
|
551
|
+
* * When evaluateRemainingLifetime returns zero , this mean that
|
|
552
|
+
* the session has probably ended on the server side and will have to be recreated
|
|
553
|
+
* from scratch in case of a reconnection.
|
|
554
|
+
*
|
|
555
|
+
* @return the number of milliseconds before session expires
|
|
556
|
+
*/
|
|
557
|
+
evaluateRemainingLifetime(): number;
|
|
558
|
+
_terminatePublishEngine(): void;
|
|
559
|
+
/**
|
|
560
|
+
*
|
|
561
|
+
* @method close
|
|
562
|
+
* @async
|
|
563
|
+
* @param [deleteSubscription=true] {Boolean}
|
|
564
|
+
* @param callback {Function}
|
|
565
|
+
*/
|
|
566
|
+
close(callback: ErrorCallback): void;
|
|
567
|
+
close(deleteSubscription: boolean, callback: ErrorCallback): void;
|
|
568
|
+
close(deleteSubscription?: boolean): Promise<void>;
|
|
569
|
+
/**
|
|
570
|
+
* @method hasBeenClosed
|
|
571
|
+
* @return {Boolean}
|
|
572
|
+
*/
|
|
573
|
+
hasBeenClosed(): boolean;
|
|
574
|
+
call(methodToCall: CallMethodRequestLike): Promise<CallMethodResult>;
|
|
575
|
+
call(methodToCall: CallMethodRequestLike[]): Promise<CallMethodResult[]>;
|
|
576
|
+
call(methodToCall: CallMethodRequestLike, callback: ResponseCallback<CallMethodResult>): void;
|
|
577
|
+
call(methodsToCall: CallMethodRequestLike[], callback: ResponseCallback<CallMethodResult[]>): void;
|
|
578
|
+
/**
|
|
579
|
+
* @method getMonitoredItems
|
|
580
|
+
* @param subscriptionId {UInt32} the subscription Id to return
|
|
581
|
+
* @param callback {Function}
|
|
582
|
+
* @param callback.err {Error}
|
|
583
|
+
* @param callback.monitoredItems the monitored Items
|
|
584
|
+
* @param callback.monitoredItems the monitored Items
|
|
585
|
+
*/
|
|
586
|
+
getMonitoredItems(subscriptionId: SubscriptionId): Promise<MonitoredItemData>;
|
|
587
|
+
getMonitoredItems(subscriptionId: SubscriptionId, callback: ResponseCallback<MonitoredItemData>): void;
|
|
588
|
+
/**
|
|
589
|
+
* @method getArgumentDefinition
|
|
590
|
+
* extract the argument definition of a method
|
|
591
|
+
* @param methodId the method nodeId to get argument definition from
|
|
592
|
+
* @async
|
|
593
|
+
*
|
|
594
|
+
*/
|
|
595
|
+
getArgumentDefinition(methodId: MethodId): Promise<ArgumentDefinition>;
|
|
596
|
+
getArgumentDefinition(methodId: MethodId, callback: ResponseCallback<ArgumentDefinition>): void;
|
|
597
|
+
registerNodes(nodesToRegister: NodeIdLike[]): Promise<NodeId[]>;
|
|
598
|
+
registerNodes(nodesToRegister: NodeIdLike[], callback: (err: Error | null, registeredNodeIds?: NodeId[]) => void): void;
|
|
599
|
+
unregisterNodes(nodesToUnregister: NodeIdLike[]): Promise<void>;
|
|
600
|
+
unregisterNodes(nodesToUnregister: NodeIdLike[], callback: (err?: Error) => void): void;
|
|
601
|
+
queryFirst(queryFirstRequest: QueryFirstRequestLike): Promise<QueryFirstResponse>;
|
|
602
|
+
queryFirst(queryFirstRequest: QueryFirstRequestLike, callback: ResponseCallback<QueryFirstResponse>): void;
|
|
603
|
+
startKeepAliveManager(): void;
|
|
604
|
+
stopKeepAliveManager(): void;
|
|
605
|
+
dispose(): void;
|
|
606
|
+
toString(): string;
|
|
607
|
+
getBuiltInDataType(...args: any[]): any;
|
|
608
|
+
resumePublishEngine(): void;
|
|
609
|
+
readNamespaceArray(): Promise<string[]>;
|
|
610
|
+
readNamespaceArray(callback: (err: Error | null, namespaceArray?: string[]) => void): void;
|
|
611
|
+
getNamespaceIndex(namespaceUri: string): number;
|
|
612
|
+
disableCondition(): void;
|
|
613
|
+
enableCondition(): void;
|
|
614
|
+
addCommentCondition(_conditionId: NodeIdLike, _eventId: Buffer, _comment: LocalizedTextLike, _callback?: Callback<StatusCode>): any;
|
|
615
|
+
confirmCondition(_conditionId: NodeIdLike, _eventId: Buffer, _comment: LocalizedTextLike, _callback?: Callback<StatusCode>): any;
|
|
616
|
+
acknowledgeCondition(_conditionId: NodeId, _eventId: Buffer, _comment: LocalizedTextLike, _callback?: Callback<StatusCode>): any;
|
|
617
|
+
findMethodId(_nodeId: NodeIdLike, _methodName: string, _callback?: ResponseCallback<NodeId>): any;
|
|
618
|
+
_callMethodCondition(_methodName: string, _conditionId: NodeIdLike, _eventId: Buffer, _comment: LocalizedTextLike, _callback: Callback<StatusCode>): void;
|
|
619
|
+
extractNamespaceDataType(): Promise<ExtraDataTypeManager>;
|
|
620
|
+
getExtensionObjectConstructor(dataTypeNodeId: NodeId): Promise<AnyConstructorFunc>;
|
|
621
|
+
/**
|
|
622
|
+
*
|
|
623
|
+
* @param dataType
|
|
624
|
+
* @param pojo
|
|
625
|
+
* @async
|
|
626
|
+
*/
|
|
627
|
+
constructExtensionObject(dataType: NodeId, pojo: Record<string, any>): Promise<ExtensionObject>;
|
|
628
|
+
private _defaultRequest;
|
|
629
|
+
private recreate_session_and_reperform_transaction;
|
|
630
|
+
}
|
|
631
|
+
export {};
|