node-opcua-client 2.70.3 → 2.71.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.
Files changed (66) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +43 -43
  2. package/dist/alarms_and_conditions/client_alarm.js +84 -84
  3. package/dist/alarms_and_conditions/client_alarm_list.d.ts +21 -21
  4. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  5. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  6. package/dist/alarms_and_conditions/client_alarm_tools.js +139 -139
  7. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  8. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +190 -190
  9. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  10. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -73
  11. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +8 -8
  12. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +120 -120
  13. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  14. package/dist/alarms_and_conditions/client_tools.js +180 -180
  15. package/dist/client_base.d.ts +290 -290
  16. package/dist/client_base.js +13 -13
  17. package/dist/client_monitored_item.d.ts +21 -21
  18. package/dist/client_monitored_item.js +11 -11
  19. package/dist/client_monitored_item_base.d.ts +39 -39
  20. package/dist/client_monitored_item_base.js +2 -2
  21. package/dist/client_monitored_item_group.d.ts +18 -18
  22. package/dist/client_monitored_item_group.js +13 -13
  23. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  24. package/dist/client_monitored_item_toolbox.js +117 -117
  25. package/dist/client_session.d.ts +484 -484
  26. package/dist/client_session.js +10 -10
  27. package/dist/client_session_keepalive_manager.d.ts +34 -34
  28. package/dist/client_session_keepalive_manager.js +150 -150
  29. package/dist/client_subscription.d.ts +241 -241
  30. package/dist/client_subscription.js +14 -14
  31. package/dist/client_utils.d.ts +22 -22
  32. package/dist/client_utils.js +88 -88
  33. package/dist/common.d.ts +17 -17
  34. package/dist/common.js +5 -5
  35. package/dist/index.d.ts +55 -55
  36. package/dist/index.js +93 -93
  37. package/dist/opcua_client.d.ts +132 -132
  38. package/dist/opcua_client.js +33 -33
  39. package/dist/private/client_base_impl.d.ts +169 -169
  40. package/dist/private/client_base_impl.js +1316 -1316
  41. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  42. package/dist/private/client_monitored_item_base_impl.js +4 -4
  43. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  44. package/dist/private/client_monitored_item_group_impl.js +159 -159
  45. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  46. package/dist/private/client_monitored_item_impl.js +304 -304
  47. package/dist/private/client_publish_engine.d.ts +62 -62
  48. package/dist/private/client_publish_engine.js +408 -408
  49. package/dist/private/client_session_impl.d.ts +621 -621
  50. package/dist/private/client_session_impl.js +1301 -1301
  51. package/dist/private/client_subscription_impl.d.ts +93 -93
  52. package/dist/private/client_subscription_impl.js +734 -734
  53. package/dist/private/i_private_client.d.ts +18 -18
  54. package/dist/private/i_private_client.js +2 -2
  55. package/dist/private/opcua_client_impl.d.ts +169 -169
  56. package/dist/private/opcua_client_impl.js +978 -978
  57. package/dist/reconnection.d.ts +9 -9
  58. package/dist/reconnection.js +362 -362
  59. package/dist/tools/findservers.d.ts +20 -20
  60. package/dist/tools/findservers.js +61 -61
  61. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  62. package/dist/tools/read_history_server_capabilities.js +99 -99
  63. package/dist/verify.d.ts +5 -5
  64. package/dist/verify.js +134 -134
  65. package/package.json +44 -44
  66. package/source/client_session.ts +14 -14
@@ -1,290 +1,290 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- /**
4
- * @module node-opcua-client
5
- */
6
- import { EventEmitter } from "events";
7
- import { LocaleId } from "node-opcua-basic-types";
8
- import { OPCUACertificateManager } from "node-opcua-certificate-manager";
9
- import { OPCUASecureObject } from "node-opcua-common";
10
- import { Certificate } from "node-opcua-crypto";
11
- import { ObjectRegistry } from "node-opcua-object-registry";
12
- import { ClientSecureChannelLayer, ConnectionStrategy, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
13
- import { FindServersOnNetworkRequestOptions, FindServersRequestOptions, ServerOnNetwork } from "node-opcua-service-discovery";
14
- import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
15
- import { ChannelSecurityToken, MessageSecurityMode } from "node-opcua-service-secure-channel";
16
- import { ErrorCallback } from "node-opcua-status-code";
17
- import { ResponseCallback } from "./client_session";
18
- import { Request, Response } from "./common";
19
- export declare type FindServersRequestLike = FindServersRequestOptions;
20
- export declare type FindServersOnNetworkRequestLike = FindServersOnNetworkRequestOptions;
21
- export declare type CreateSecureChannelCallbackFunc = (err: Error | null, secureChannel?: ClientSecureChannelLayer) => void;
22
- export interface FindEndpointOptions {
23
- securityMode: MessageSecurityMode;
24
- securityPolicy: SecurityPolicy;
25
- connectionStrategy: ConnectionStrategyOptions;
26
- certificateFile: string;
27
- privateKeyFile: string;
28
- applicationName: string;
29
- applicationUri: string;
30
- clientCertificateManager: OPCUACertificateManager;
31
- }
32
- export interface FindEndpointResult {
33
- selectedEndpoint: EndpointDescription;
34
- endpoints: EndpointDescription[];
35
- }
36
- export declare type FindEndpointCallback = (err: Error | null, result?: FindEndpointResult) => void;
37
- export interface TransportSettings {
38
- maxChunkCount?: number;
39
- /**
40
- * @advanced
41
- */
42
- maxMessageSize?: number;
43
- /**
44
- * @advanced
45
- */
46
- sendBufferSize?: number;
47
- /**
48
- * @advanced
49
- */
50
- receiveBufferSize?: number;
51
- }
52
- export interface OPCUAClientBaseOptions {
53
- /**
54
- * the client application name
55
- * @default "NodeOPCUA-Client"
56
- */
57
- applicationName?: string;
58
- /**
59
- * the application Uri
60
- * @default: `urn:${hostname}:${applicationName}`
61
- */
62
- applicationUri?: string;
63
- connectionStrategy?: ConnectionStrategyOptions;
64
- /**
65
- * if not specify or set to 0 , token renewal will happen
66
- * around 75% of the defaultSecureTokenLifetime
67
- */
68
- tokenRenewalInterval?: number;
69
- /**
70
- * if set to true, pending session will not be automatically closed when disconnect is called
71
- */
72
- keepPendingSessionsOnDisconnect?: boolean;
73
- /**
74
- * the server certificate.
75
- */
76
- serverCertificate?: Certificate;
77
- /**
78
- * default secure token lifetime in ms
79
- */
80
- defaultSecureTokenLifetime?: number;
81
- /**
82
- * the security mode
83
- * @default MessageSecurityMode.None
84
- */
85
- securityMode?: MessageSecurityMode | string;
86
- /**
87
- * the security policy
88
- * @default SecurityPolicy.None
89
- */
90
- securityPolicy?: SecurityPolicy | string;
91
- /**
92
- * can be set when the client doesn't create subscription. In this case,
93
- * the client will send a dummy request on a regular basis to keep the
94
- * connection active.
95
- * @default false
96
- */
97
- keepSessionAlive?: boolean;
98
- /**
99
- * certificate Manager
100
- */
101
- clientCertificateManager?: OPCUACertificateManager;
102
- /**
103
- * client certificate pem file.
104
- * @default `${clientCertificateManager/rootFolder}/own/certs/client_certificate.pem"
105
- */
106
- certificateFile?: string;
107
- /**
108
- * client private key pem file.
109
- * @default `${clientCertificateManager/rootFolder}/own/private/private_key.pem"
110
- */
111
- privateKeyFile?: string;
112
- /**
113
- * a client name string that will be used to generate session names.
114
- */
115
- clientName?: string;
116
- /**
117
- * discovery url:
118
- */
119
- discoveryUrl?: string;
120
- /**
121
- * @advanced
122
- */
123
- transportSettings?: TransportSettings;
124
- }
125
- export interface GetEndpointsOptions {
126
- endpointUrl?: string;
127
- localeIds?: LocaleId[];
128
- profileUris?: string[];
129
- }
130
- export interface OPCUAClientBase extends OPCUASecureObject {
131
- /**
132
- * certificate Manager
133
- */
134
- readonly clientCertificateManager: OPCUACertificateManager;
135
- /***
136
- *
137
- * @param endpointUrl the endpoint of the server to connect to ( i.e "opc.tcp://machine.name:3434/name" )
138
- */
139
- connect(endpointUrl: string): Promise<void>;
140
- connect(endpointUrl: string, callback: ErrorCallback): void;
141
- /***
142
- * causes client to close and disconnect the communication with server
143
- */
144
- disconnect(): Promise<void>;
145
- disconnect(callback: ErrorCallback): void;
146
- findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
147
- getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
148
- getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
149
- getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
150
- findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
151
- findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
152
- findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
153
- findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
154
- findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
155
- findServersOnNetwork(options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
156
- }
157
- export interface OPCUAClientBase extends EventEmitter {
158
- /**
159
- * this Event is raised when the initial connection has succeeded
160
- * @param event
161
- * @param eventHandler
162
- */
163
- on(event: "connected", eventHandler: () => void): this;
164
- /**
165
- * this Event is raised when the initial connection has failed
166
- * @param event
167
- * @param eventHandler
168
- */
169
- on(event: "connection_failed", eventHandler: (err: Error) => void): this;
170
- /**
171
- * this Event is raised when a failing connection is about to be tried again
172
- * @param event
173
- * @param eventHandler
174
- */
175
- on(event: "backoff", eventHandler: (count: number, delay: number) => void): this;
176
- /**
177
- * this event is raised when the client has encountered a connection failure and
178
- * and is going to reconnection mode.
179
- * You can intercept start_reconnection event to pause your interaction with the remote
180
- * OPCUA server.
181
- * @param event
182
- * @param eventHandler
183
- */
184
- on(event: "start_reconnection", eventHandler: () => void): this;
185
- /**
186
- * this event is raised when the client has failed one attempt to reconnect to the server
187
- * This event will be raised if the socket has successfully being created to the server but
188
- * if something went wrong during the reconnection process.
189
- * @param event
190
- * @param eventHandler
191
- */
192
- on(event: "reconnection_attempt_has_failed", eventHandler: (err: Error, message: string) => void): this;
193
- /**
194
- * this event is raised after the client has successfully managed to re-establish the connection with
195
- * the remote OPCUA Server.
196
- * You can intercept after_reconnection event to resume your interaction with the remote
197
- * OPCUA server.
198
- *
199
- * @param event
200
- * @param eventHandler
201
- */
202
- on(event: "after_reconnection", eventHandler: (err?: Error) => void): this;
203
- /**
204
- * the event is raised when the connection has been aborted by the remote OPCUA Server
205
- * @param event
206
- * @param eventHandler
207
- */
208
- on(event: "abort", eventHandler: () => void): this;
209
- /**
210
- * this event is raised when the connection is closed
211
- * @param event
212
- * @param eventHandler
213
- */
214
- on(event: "close", eventHandler: () => void): this;
215
- /**
216
- * this event is raised when the client is sending a message chunk to the server
217
- * (advanced use only)
218
- * @param event
219
- * @param eventHandler
220
- */
221
- on(event: "send_chunk", eventHandler: (chunk: Buffer) => void): this;
222
- /**
223
- * this event is raised when the client has received a new message chunk from the servers
224
- * (advanced use only)
225
- * @param event
226
- * @param eventHandler
227
- */
228
- on(event: "receive_chunk", eventHandler: (chunk: Buffer) => void): this;
229
- on(event: "send_request", eventHandler: (request: Request) => void): this;
230
- on(event: "receive_response", eventHandler: (response: Response) => void): this;
231
- /**
232
- * this event is raised when the current security token has reached 75% of its lifetime and is therefore
233
- * about to expired.
234
- * @param event
235
- * @param eventHandler
236
- */
237
- on(event: "lifetime_75", eventHandler: (token: ChannelSecurityToken) => void): this;
238
- /**
239
- * this event is raised after the (about ) security token as been renewed
240
- * and renegotiated with the server.to expire
241
- * @param event
242
- * @param eventHandler
243
- */
244
- on(event: "security_token_renewed", eventHandler: () => void): this;
245
- /**
246
- * this event is raised when the connection has been broken
247
- * @param event
248
- * @param eventHandler
249
- */
250
- on(event: "connection_lost", eventHandler: () => void): this;
251
- /**
252
- * this event is raised when a broken connection with the remote Server has been reestablished
253
- * @param event
254
- * @param eventHandler
255
- */
256
- on(event: "connection_reestablished", eventHandler: () => void): this;
257
- /**
258
- * This event is raised when a request sent to the remote OPCUA server has reach it's timeout value without
259
- * a Response from the server.
260
- * @param event
261
- * @param eventHandler
262
- */
263
- on(event: "timed_out_request", eventHandler: (request: Request) => void): this;
264
- on(event: string | symbol, listener: (...args: any[]) => void): this;
265
- }
266
- export interface OPCUAClientBase {
267
- readonly endpoint?: EndpointDescription;
268
- readonly isReconnecting: boolean;
269
- readonly transactionsPerformed: number;
270
- readonly knowsServerEndpoint: boolean;
271
- readonly reconnectOnFailure: boolean;
272
- readonly bytesRead: number;
273
- readonly bytesWritten: number;
274
- readonly securityMode: MessageSecurityMode;
275
- readonly securityPolicy: SecurityPolicy;
276
- readonly serverCertificate?: Certificate;
277
- readonly clientName: string;
278
- readonly protocolVersion: 0;
279
- readonly defaultSecureTokenLifetime: number;
280
- readonly tokenRenewalInterval: number;
281
- readonly connectionStrategy: ConnectionStrategy;
282
- readonly keepPendingSessionsOnDisconnect: boolean;
283
- readonly endpointUrl: string;
284
- readonly keepSessionAlive: boolean;
285
- readonly applicationName: string;
286
- }
287
- export declare class OPCUAClientBase {
288
- static registry: ObjectRegistry;
289
- static create(options: OPCUAClientBaseOptions): OPCUAClientBase;
290
- }
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /**
4
+ * @module node-opcua-client
5
+ */
6
+ import { EventEmitter } from "events";
7
+ import { LocaleId } from "node-opcua-basic-types";
8
+ import { OPCUACertificateManager } from "node-opcua-certificate-manager";
9
+ import { OPCUASecureObject } from "node-opcua-common";
10
+ import { Certificate } from "node-opcua-crypto";
11
+ import { ObjectRegistry } from "node-opcua-object-registry";
12
+ import { ClientSecureChannelLayer, ConnectionStrategy, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
13
+ import { FindServersOnNetworkRequestOptions, FindServersRequestOptions, ServerOnNetwork } from "node-opcua-service-discovery";
14
+ import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
15
+ import { ChannelSecurityToken, MessageSecurityMode } from "node-opcua-service-secure-channel";
16
+ import { ErrorCallback } from "node-opcua-status-code";
17
+ import { ResponseCallback } from "./client_session";
18
+ import { Request, Response } from "./common";
19
+ export declare type FindServersRequestLike = FindServersRequestOptions;
20
+ export declare type FindServersOnNetworkRequestLike = FindServersOnNetworkRequestOptions;
21
+ export declare type CreateSecureChannelCallbackFunc = (err: Error | null, secureChannel?: ClientSecureChannelLayer) => void;
22
+ export interface FindEndpointOptions {
23
+ securityMode: MessageSecurityMode;
24
+ securityPolicy: SecurityPolicy;
25
+ connectionStrategy: ConnectionStrategyOptions;
26
+ certificateFile: string;
27
+ privateKeyFile: string;
28
+ applicationName: string;
29
+ applicationUri: string;
30
+ clientCertificateManager: OPCUACertificateManager;
31
+ }
32
+ export interface FindEndpointResult {
33
+ selectedEndpoint: EndpointDescription;
34
+ endpoints: EndpointDescription[];
35
+ }
36
+ export declare type FindEndpointCallback = (err: Error | null, result?: FindEndpointResult) => void;
37
+ export interface TransportSettings {
38
+ maxChunkCount?: number;
39
+ /**
40
+ * @advanced
41
+ */
42
+ maxMessageSize?: number;
43
+ /**
44
+ * @advanced
45
+ */
46
+ sendBufferSize?: number;
47
+ /**
48
+ * @advanced
49
+ */
50
+ receiveBufferSize?: number;
51
+ }
52
+ export interface OPCUAClientBaseOptions {
53
+ /**
54
+ * the client application name
55
+ * @default "NodeOPCUA-Client"
56
+ */
57
+ applicationName?: string;
58
+ /**
59
+ * the application Uri
60
+ * @default: `urn:${hostname}:${applicationName}`
61
+ */
62
+ applicationUri?: string;
63
+ connectionStrategy?: ConnectionStrategyOptions;
64
+ /**
65
+ * if not specify or set to 0 , token renewal will happen
66
+ * around 75% of the defaultSecureTokenLifetime
67
+ */
68
+ tokenRenewalInterval?: number;
69
+ /**
70
+ * if set to true, pending session will not be automatically closed when disconnect is called
71
+ */
72
+ keepPendingSessionsOnDisconnect?: boolean;
73
+ /**
74
+ * the server certificate.
75
+ */
76
+ serverCertificate?: Certificate;
77
+ /**
78
+ * default secure token lifetime in ms
79
+ */
80
+ defaultSecureTokenLifetime?: number;
81
+ /**
82
+ * the security mode
83
+ * @default MessageSecurityMode.None
84
+ */
85
+ securityMode?: MessageSecurityMode | string;
86
+ /**
87
+ * the security policy
88
+ * @default SecurityPolicy.None
89
+ */
90
+ securityPolicy?: SecurityPolicy | string;
91
+ /**
92
+ * can be set when the client doesn't create subscription. In this case,
93
+ * the client will send a dummy request on a regular basis to keep the
94
+ * connection active.
95
+ * @default false
96
+ */
97
+ keepSessionAlive?: boolean;
98
+ /**
99
+ * certificate Manager
100
+ */
101
+ clientCertificateManager?: OPCUACertificateManager;
102
+ /**
103
+ * client certificate pem file.
104
+ * @default `${clientCertificateManager/rootFolder}/own/certs/client_certificate.pem"
105
+ */
106
+ certificateFile?: string;
107
+ /**
108
+ * client private key pem file.
109
+ * @default `${clientCertificateManager/rootFolder}/own/private/private_key.pem"
110
+ */
111
+ privateKeyFile?: string;
112
+ /**
113
+ * a client name string that will be used to generate session names.
114
+ */
115
+ clientName?: string;
116
+ /**
117
+ * discovery url:
118
+ */
119
+ discoveryUrl?: string;
120
+ /**
121
+ * @advanced
122
+ */
123
+ transportSettings?: TransportSettings;
124
+ }
125
+ export interface GetEndpointsOptions {
126
+ endpointUrl?: string;
127
+ localeIds?: LocaleId[];
128
+ profileUris?: string[];
129
+ }
130
+ export interface OPCUAClientBase extends OPCUASecureObject {
131
+ /**
132
+ * certificate Manager
133
+ */
134
+ readonly clientCertificateManager: OPCUACertificateManager;
135
+ /***
136
+ *
137
+ * @param endpointUrl the endpoint of the server to connect to ( i.e "opc.tcp://machine.name:3434/name" )
138
+ */
139
+ connect(endpointUrl: string): Promise<void>;
140
+ connect(endpointUrl: string, callback: ErrorCallback): void;
141
+ /***
142
+ * causes client to close and disconnect the communication with server
143
+ */
144
+ disconnect(): Promise<void>;
145
+ disconnect(callback: ErrorCallback): void;
146
+ findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
147
+ getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
148
+ getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
149
+ getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
150
+ findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
151
+ findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
152
+ findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
153
+ findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
154
+ findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
155
+ findServersOnNetwork(options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
156
+ }
157
+ export interface OPCUAClientBase extends EventEmitter {
158
+ /**
159
+ * this Event is raised when the initial connection has succeeded
160
+ * @param event
161
+ * @param eventHandler
162
+ */
163
+ on(event: "connected", eventHandler: () => void): this;
164
+ /**
165
+ * this Event is raised when the initial connection has failed
166
+ * @param event
167
+ * @param eventHandler
168
+ */
169
+ on(event: "connection_failed", eventHandler: (err: Error) => void): this;
170
+ /**
171
+ * this Event is raised when a failing connection is about to be tried again
172
+ * @param event
173
+ * @param eventHandler
174
+ */
175
+ on(event: "backoff", eventHandler: (count: number, delay: number) => void): this;
176
+ /**
177
+ * this event is raised when the client has encountered a connection failure and
178
+ * and is going to reconnection mode.
179
+ * You can intercept start_reconnection event to pause your interaction with the remote
180
+ * OPCUA server.
181
+ * @param event
182
+ * @param eventHandler
183
+ */
184
+ on(event: "start_reconnection", eventHandler: () => void): this;
185
+ /**
186
+ * this event is raised when the client has failed one attempt to reconnect to the server
187
+ * This event will be raised if the socket has successfully being created to the server but
188
+ * if something went wrong during the reconnection process.
189
+ * @param event
190
+ * @param eventHandler
191
+ */
192
+ on(event: "reconnection_attempt_has_failed", eventHandler: (err: Error, message: string) => void): this;
193
+ /**
194
+ * this event is raised after the client has successfully managed to re-establish the connection with
195
+ * the remote OPCUA Server.
196
+ * You can intercept after_reconnection event to resume your interaction with the remote
197
+ * OPCUA server.
198
+ *
199
+ * @param event
200
+ * @param eventHandler
201
+ */
202
+ on(event: "after_reconnection", eventHandler: (err?: Error) => void): this;
203
+ /**
204
+ * the event is raised when the connection has been aborted by the remote OPCUA Server
205
+ * @param event
206
+ * @param eventHandler
207
+ */
208
+ on(event: "abort", eventHandler: () => void): this;
209
+ /**
210
+ * this event is raised when the connection is closed
211
+ * @param event
212
+ * @param eventHandler
213
+ */
214
+ on(event: "close", eventHandler: () => void): this;
215
+ /**
216
+ * this event is raised when the client is sending a message chunk to the server
217
+ * (advanced use only)
218
+ * @param event
219
+ * @param eventHandler
220
+ */
221
+ on(event: "send_chunk", eventHandler: (chunk: Buffer) => void): this;
222
+ /**
223
+ * this event is raised when the client has received a new message chunk from the servers
224
+ * (advanced use only)
225
+ * @param event
226
+ * @param eventHandler
227
+ */
228
+ on(event: "receive_chunk", eventHandler: (chunk: Buffer) => void): this;
229
+ on(event: "send_request", eventHandler: (request: Request) => void): this;
230
+ on(event: "receive_response", eventHandler: (response: Response) => void): this;
231
+ /**
232
+ * this event is raised when the current security token has reached 75% of its lifetime and is therefore
233
+ * about to expired.
234
+ * @param event
235
+ * @param eventHandler
236
+ */
237
+ on(event: "lifetime_75", eventHandler: (token: ChannelSecurityToken) => void): this;
238
+ /**
239
+ * this event is raised after the (about ) security token as been renewed
240
+ * and renegotiated with the server.to expire
241
+ * @param event
242
+ * @param eventHandler
243
+ */
244
+ on(event: "security_token_renewed", eventHandler: () => void): this;
245
+ /**
246
+ * this event is raised when the connection has been broken
247
+ * @param event
248
+ * @param eventHandler
249
+ */
250
+ on(event: "connection_lost", eventHandler: () => void): this;
251
+ /**
252
+ * this event is raised when a broken connection with the remote Server has been reestablished
253
+ * @param event
254
+ * @param eventHandler
255
+ */
256
+ on(event: "connection_reestablished", eventHandler: () => void): this;
257
+ /**
258
+ * This event is raised when a request sent to the remote OPCUA server has reach it's timeout value without
259
+ * a Response from the server.
260
+ * @param event
261
+ * @param eventHandler
262
+ */
263
+ on(event: "timed_out_request", eventHandler: (request: Request) => void): this;
264
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
265
+ }
266
+ export interface OPCUAClientBase {
267
+ readonly endpoint?: EndpointDescription;
268
+ readonly isReconnecting: boolean;
269
+ readonly transactionsPerformed: number;
270
+ readonly knowsServerEndpoint: boolean;
271
+ readonly reconnectOnFailure: boolean;
272
+ readonly bytesRead: number;
273
+ readonly bytesWritten: number;
274
+ readonly securityMode: MessageSecurityMode;
275
+ readonly securityPolicy: SecurityPolicy;
276
+ readonly serverCertificate?: Certificate;
277
+ readonly clientName: string;
278
+ readonly protocolVersion: 0;
279
+ readonly defaultSecureTokenLifetime: number;
280
+ readonly tokenRenewalInterval: number;
281
+ readonly connectionStrategy: ConnectionStrategy;
282
+ readonly keepPendingSessionsOnDisconnect: boolean;
283
+ readonly endpointUrl: string;
284
+ readonly keepSessionAlive: boolean;
285
+ readonly applicationName: string;
286
+ }
287
+ export declare class OPCUAClientBase {
288
+ static registry: ObjectRegistry;
289
+ static create(options: OPCUAClientBaseOptions): OPCUAClientBase;
290
+ }
@@ -1,14 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OPCUAClientBase = void 0;
4
- const node_opcua_object_registry_1 = require("node-opcua-object-registry");
5
- class OPCUAClientBase {
6
- static create(options) {
7
- /* istanbul ignore next*/
8
- options;
9
- throw new Error("Not Implemented");
10
- }
11
- }
12
- exports.OPCUAClientBase = OPCUAClientBase;
13
- OPCUAClientBase.registry = new node_opcua_object_registry_1.ObjectRegistry();
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OPCUAClientBase = void 0;
4
+ const node_opcua_object_registry_1 = require("node-opcua-object-registry");
5
+ class OPCUAClientBase {
6
+ static create(options) {
7
+ /* istanbul ignore next*/
8
+ options;
9
+ throw new Error("Not Implemented");
10
+ }
11
+ }
12
+ exports.OPCUAClientBase = OPCUAClientBase;
13
+ OPCUAClientBase.registry = new node_opcua_object_registry_1.ObjectRegistry();
14
14
  //# sourceMappingURL=client_base.js.map
@@ -1,21 +1,21 @@
1
- /// <reference types="node" />
2
- /**
3
- * @module node-opcua-client
4
- */
5
- import { EventEmitter } from "events";
6
- import { DataValue, TimestampsToReturn } from "node-opcua-data-value";
7
- import { ReadValueIdOptions } from "node-opcua-service-read";
8
- import { Variant } from "node-opcua-variant";
9
- import { MonitoringParametersOptions } from "node-opcua-types";
10
- import { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
11
- import { ClientSubscription } from "./client_subscription";
12
- export interface ClientMonitoredItem extends ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction, EventEmitter {
13
- on(event: "changed", eventHandler: (dataValue: DataValue) => void): this;
14
- on(event: "changed", eventHandler: (values: Variant[]) => void): this;
15
- on(event: "terminated", eventHandler: () => void): this;
16
- on(event: "initialized", eventHandler: () => void): this;
17
- on(event: "err", eventHandler: (message: string) => void): this;
18
- }
19
- export declare class ClientMonitoredItem {
20
- static create(subscription: ClientSubscription, itemToMonitor: ReadValueIdOptions, monitoringParameters: MonitoringParametersOptions, timestampsToReturn?: TimestampsToReturn): ClientMonitoredItem;
21
- }
1
+ /// <reference types="node" />
2
+ /**
3
+ * @module node-opcua-client
4
+ */
5
+ import { EventEmitter } from "events";
6
+ import { DataValue, TimestampsToReturn } from "node-opcua-data-value";
7
+ import { ReadValueIdOptions } from "node-opcua-service-read";
8
+ import { Variant } from "node-opcua-variant";
9
+ import { MonitoringParametersOptions } from "node-opcua-types";
10
+ import { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
11
+ import { ClientSubscription } from "./client_subscription";
12
+ export interface ClientMonitoredItem extends ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction, EventEmitter {
13
+ on(event: "changed", eventHandler: (dataValue: DataValue) => void): this;
14
+ on(event: "changed", eventHandler: (values: Variant[]) => void): this;
15
+ on(event: "terminated", eventHandler: () => void): this;
16
+ on(event: "initialized", eventHandler: () => void): this;
17
+ on(event: "err", eventHandler: (message: string) => void): this;
18
+ }
19
+ export declare class ClientMonitoredItem {
20
+ static create(subscription: ClientSubscription, itemToMonitor: ReadValueIdOptions, monitoringParameters: MonitoringParametersOptions, timestampsToReturn?: TimestampsToReturn): ClientMonitoredItem;
21
+ }