node-opcua-client 2.71.0 → 2.72.2

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 (81) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +45 -43
  2. package/dist/alarms_and_conditions/client_alarm.js +101 -84
  3. package/dist/alarms_and_conditions/client_alarm.js.map +1 -1
  4. package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -21
  5. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  6. package/dist/alarms_and_conditions/client_alarm_list.js.map +1 -1
  7. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  8. package/dist/alarms_and_conditions/client_alarm_tools.js +152 -139
  9. package/dist/alarms_and_conditions/client_alarm_tools.js.map +1 -1
  10. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  11. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +190 -190
  12. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  13. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -73
  14. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +8 -8
  15. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +120 -120
  16. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  17. package/dist/alarms_and_conditions/client_tools.js +180 -180
  18. package/dist/alarms_and_conditions/client_tools.js.map +1 -1
  19. package/dist/client_base.d.ts +294 -290
  20. package/dist/client_base.js +13 -13
  21. package/dist/client_base.js.map +1 -1
  22. package/dist/client_monitored_item.d.ts +21 -21
  23. package/dist/client_monitored_item.js +11 -11
  24. package/dist/client_monitored_item_base.d.ts +39 -39
  25. package/dist/client_monitored_item_base.js +2 -2
  26. package/dist/client_monitored_item_group.d.ts +18 -18
  27. package/dist/client_monitored_item_group.js +13 -13
  28. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  29. package/dist/client_monitored_item_toolbox.js +117 -117
  30. package/dist/client_session.d.ts +484 -484
  31. package/dist/client_session.js +10 -10
  32. package/dist/client_session_keepalive_manager.d.ts +34 -34
  33. package/dist/client_session_keepalive_manager.js +150 -150
  34. package/dist/client_subscription.d.ts +241 -241
  35. package/dist/client_subscription.js +14 -14
  36. package/dist/client_utils.d.ts +22 -22
  37. package/dist/client_utils.js +88 -88
  38. package/dist/common.d.ts +17 -17
  39. package/dist/common.js +5 -5
  40. package/dist/index.d.ts +55 -55
  41. package/dist/index.js +93 -93
  42. package/dist/opcua_client.d.ts +132 -132
  43. package/dist/opcua_client.js +33 -33
  44. package/dist/opcua_client.js.map +1 -1
  45. package/dist/private/client_base_impl.d.ts +169 -169
  46. package/dist/private/client_base_impl.js +1324 -1316
  47. package/dist/private/client_base_impl.js.map +1 -1
  48. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  49. package/dist/private/client_monitored_item_base_impl.js +4 -4
  50. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  51. package/dist/private/client_monitored_item_group_impl.js +159 -159
  52. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  53. package/dist/private/client_monitored_item_impl.js +304 -304
  54. package/dist/private/client_publish_engine.d.ts +62 -62
  55. package/dist/private/client_publish_engine.js +408 -408
  56. package/dist/private/client_session_impl.d.ts +621 -621
  57. package/dist/private/client_session_impl.js +1301 -1301
  58. package/dist/private/client_subscription_impl.d.ts +93 -93
  59. package/dist/private/client_subscription_impl.js +743 -734
  60. package/dist/private/client_subscription_impl.js.map +1 -1
  61. package/dist/private/i_private_client.d.ts +18 -18
  62. package/dist/private/i_private_client.js +2 -2
  63. package/dist/private/opcua_client_impl.d.ts +169 -169
  64. package/dist/private/opcua_client_impl.js +978 -978
  65. package/dist/reconnection.d.ts +9 -9
  66. package/dist/reconnection.js +362 -362
  67. package/dist/tools/findservers.d.ts +20 -20
  68. package/dist/tools/findservers.js +61 -61
  69. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  70. package/dist/tools/read_history_server_capabilities.js +99 -99
  71. package/dist/verify.d.ts +5 -5
  72. package/dist/verify.js +134 -134
  73. package/package.json +30 -30
  74. package/source/alarms_and_conditions/client_alarm.ts +21 -1
  75. package/source/alarms_and_conditions/client_alarm_list.ts +6 -2
  76. package/source/alarms_and_conditions/client_alarm_tools.ts +32 -15
  77. package/source/alarms_and_conditions/client_tools.ts +4 -4
  78. package/source/client_base.ts +6 -3
  79. package/source/opcua_client.ts +0 -2
  80. package/source/private/client_base_impl.ts +22 -13
  81. package/source/private/client_subscription_impl.ts +8 -0
@@ -1 +1 @@
1
- {"version":3,"file":"client_tools.js","sourceRoot":"","sources":["../../source/alarms_and_conditions/client_tools.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,0BAA0B;AAC1B,uCAAuC;;;AAEvC,+BAA+B;AAC/B,yDAA2C;AAC3C,iEAAyE;AACzE,uDAAkF;AAClF,yDAAoF;AACpF,qEAA8E;AAC9E,uGAA4F;AAC5F,mEAAiE;AACjE,2DAAuD;AAKvD,wEAAmE;AAGnE,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,OAAO,GAAG,IAAA,iCAAc,EAAC,UAAU,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAA,kCAAe,EAAC,UAAU,CAAC,CAAC;AAK/C,SAAgB,oBAAoB,CAAC,YAAgC,EAAE,QAAwB;IAC3F,MAAM,aAAa,GAAG,YAAsC,CAAC;IAC7D,MAAM,UAAU,GAAG,aAAa,CAAC,aAAa,CAAC,OAAQ,CAAC;IAExD,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IAEnD,IAAA,0BAAM,EAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,4CAA4C,CAAC,CAAC;IAC/E,IAAA,0BAAM,EAAC,OAAO,QAAQ,KAAK,UAAU,CAAC,CAAC;IAEvC,MAAM,mBAAmB,GAAG,IAAA,iCAAa,EAAC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
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 the client to close and disconnect the communication with server
143
+ *
144
+ * ### note
145
+ * > once the client has disconnected, it cannot reconnect to the server
146
+ * you'll need to recreate a new Client object to reconnect to the server.
147
+ */
148
+ disconnect(): Promise<void>;
149
+ disconnect(callback: ErrorCallback): void;
150
+ findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
151
+ getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
152
+ getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
153
+ getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
154
+ findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
155
+ findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
156
+ findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
157
+ findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
158
+ findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
159
+ findServersOnNetwork(options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
160
+ }
161
+ export interface OPCUAClientBase extends EventEmitter {
162
+ /**
163
+ * this Event is raised when the initial connection has succeeded
164
+ * @param event
165
+ * @param eventHandler
166
+ */
167
+ on(event: "connected", eventHandler: () => void): this;
168
+ /**
169
+ * this Event is raised when the initial connection has failed
170
+ * @param event
171
+ * @param eventHandler
172
+ */
173
+ on(event: "connection_failed", eventHandler: (err: Error) => void): this;
174
+ /**
175
+ * this Event is raised when a failing connection is about to be tried again
176
+ * @param event
177
+ * @param eventHandler
178
+ */
179
+ on(event: "backoff", eventHandler: (count: number, delay: number) => void): this;
180
+ /**
181
+ * this event is raised when the client has encountered a connection failure and
182
+ * and is going to reconnection mode.
183
+ * You can intercept start_reconnection event to pause your interaction with the remote
184
+ * OPCUA server.
185
+ * @param event
186
+ * @param eventHandler
187
+ */
188
+ on(event: "start_reconnection", eventHandler: () => void): this;
189
+ /**
190
+ * this event is raised when the client has failed one attempt to reconnect to the server
191
+ * This event will be raised if the socket has successfully being created to the server but
192
+ * if something went wrong during the reconnection process.
193
+ * @param event
194
+ * @param eventHandler
195
+ */
196
+ on(event: "reconnection_attempt_has_failed", eventHandler: (err: Error, message: string) => void): this;
197
+ /**
198
+ * this event is raised after the client has successfully managed to re-establish the connection with
199
+ * the remote OPCUA Server.
200
+ * You can intercept after_reconnection event to resume your interaction with the remote
201
+ * OPCUA server.
202
+ *
203
+ * @param event
204
+ * @param eventHandler
205
+ */
206
+ on(event: "after_reconnection", eventHandler: (err?: Error) => void): this;
207
+ /**
208
+ * the event is raised when the connection has been aborted by the remote OPCUA Server
209
+ * @param event
210
+ * @param eventHandler
211
+ */
212
+ on(event: "abort", eventHandler: () => void): this;
213
+ /**
214
+ * this event is raised when the connection is closed
215
+ * @param event
216
+ * @param eventHandler
217
+ */
218
+ on(event: "close", eventHandler: () => void): this;
219
+ /**
220
+ * this event is raised when the client is sending a message chunk to the server
221
+ * (advanced use only)
222
+ * @param event
223
+ * @param eventHandler
224
+ */
225
+ on(event: "send_chunk", eventHandler: (chunk: Buffer) => void): this;
226
+ /**
227
+ * this event is raised when the client has received a new message chunk from the servers
228
+ * (advanced use only)
229
+ * @param event
230
+ * @param eventHandler
231
+ */
232
+ on(event: "receive_chunk", eventHandler: (chunk: Buffer) => void): this;
233
+ on(event: "send_request", eventHandler: (request: Request) => void): this;
234
+ on(event: "receive_response", eventHandler: (response: Response) => void): this;
235
+ /**
236
+ * this event is raised when the current security token has reached 75% of its lifetime and is therefore
237
+ * about to expired.
238
+ * @param event
239
+ * @param eventHandler
240
+ */
241
+ on(event: "lifetime_75", eventHandler: (token: ChannelSecurityToken) => void): this;
242
+ /**
243
+ * this event is raised after the (about ) security token as been renewed
244
+ * and renegotiated with the server.to expire
245
+ * @param event
246
+ * @param eventHandler
247
+ */
248
+ on(event: "security_token_renewed", eventHandler: () => void): this;
249
+ /**
250
+ * this event is raised when the connection has been broken
251
+ * @param event
252
+ * @param eventHandler
253
+ */
254
+ on(event: "connection_lost", eventHandler: () => void): this;
255
+ /**
256
+ * this event is raised when a broken connection with the remote Server has been reestablished
257
+ * @param event
258
+ * @param eventHandler
259
+ */
260
+ on(event: "connection_reestablished", eventHandler: () => void): this;
261
+ /**
262
+ * This event is raised when a request sent to the remote OPCUA server has reach it's timeout value without
263
+ * a Response from the server.
264
+ * @param event
265
+ * @param eventHandler
266
+ */
267
+ on(event: "timed_out_request", eventHandler: (request: Request) => void): this;
268
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
269
+ }
270
+ export interface OPCUAClientBase {
271
+ readonly endpoint?: EndpointDescription;
272
+ readonly isReconnecting: boolean;
273
+ readonly transactionsPerformed: number;
274
+ readonly knowsServerEndpoint: boolean;
275
+ readonly reconnectOnFailure: boolean;
276
+ readonly bytesRead: number;
277
+ readonly bytesWritten: number;
278
+ readonly securityMode: MessageSecurityMode;
279
+ readonly securityPolicy: SecurityPolicy;
280
+ readonly serverCertificate?: Certificate;
281
+ readonly clientName: string;
282
+ readonly protocolVersion: 0;
283
+ readonly defaultSecureTokenLifetime: number;
284
+ readonly tokenRenewalInterval: number;
285
+ readonly connectionStrategy: ConnectionStrategy;
286
+ readonly keepPendingSessionsOnDisconnect: boolean;
287
+ readonly endpointUrl: string;
288
+ readonly keepSessionAlive: boolean;
289
+ readonly applicationName: string;
290
+ }
291
+ export declare class OPCUAClientBase {
292
+ static registry: ObjectRegistry;
293
+ static create(options: OPCUAClientBaseOptions): OPCUAClientBase;
294
+ }