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