node-opcua-client 2.97.0 → 2.98.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +49 -49
  2. package/dist/alarms_and_conditions/client_alarm.js +109 -109
  3. package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -25
  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 +156 -156
  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 +192 -192
  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 +72 -72
  11. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
  12. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -3
  13. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +118 -118
  14. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  15. package/dist/alarms_and_conditions/client_tools.js +179 -179
  16. package/dist/client_base.d.ts +277 -277
  17. package/dist/client_base.js +14 -14
  18. package/dist/client_base.js.map +1 -1
  19. package/dist/client_monitored_item.d.ts +21 -21
  20. package/dist/client_monitored_item.js +11 -11
  21. package/dist/client_monitored_item_base.d.ts +39 -39
  22. package/dist/client_monitored_item_base.js +2 -2
  23. package/dist/client_monitored_item_group.d.ts +21 -21
  24. package/dist/client_monitored_item_group.js +13 -13
  25. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  26. package/dist/client_monitored_item_toolbox.js +116 -116
  27. package/dist/client_session.d.ts +529 -529
  28. package/dist/client_session.js +10 -10
  29. package/dist/client_session_keepalive_manager.d.ts +34 -34
  30. package/dist/client_session_keepalive_manager.js +149 -149
  31. package/dist/client_subscription.d.ts +241 -241
  32. package/dist/client_subscription.js +14 -14
  33. package/dist/client_subscription.js.map +1 -1
  34. package/dist/client_utils.d.ts +22 -22
  35. package/dist/client_utils.js +87 -87
  36. package/dist/common.d.ts +17 -17
  37. package/dist/common.js +5 -5
  38. package/dist/index.d.ts +56 -56
  39. package/dist/index.js +94 -94
  40. package/dist/opcua_client.d.ts +118 -118
  41. package/dist/opcua_client.js +33 -33
  42. package/dist/private/client_base_impl.d.ts +160 -160
  43. package/dist/private/client_base_impl.js +1348 -1348
  44. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  45. package/dist/private/client_monitored_item_base_impl.js +4 -4
  46. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  47. package/dist/private/client_monitored_item_group_impl.js +159 -159
  48. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  49. package/dist/private/client_monitored_item_impl.js +304 -304
  50. package/dist/private/client_publish_engine.d.ts +62 -62
  51. package/dist/private/client_publish_engine.js +408 -408
  52. package/dist/private/client_publish_engine.js.map +1 -1
  53. package/dist/private/client_session_impl.d.ts +631 -631
  54. package/dist/private/client_session_impl.js +1348 -1348
  55. package/dist/private/client_subscription_impl.d.ts +93 -93
  56. package/dist/private/client_subscription_impl.js +763 -763
  57. package/dist/private/i_private_client.d.ts +21 -21
  58. package/dist/private/i_private_client.js +2 -2
  59. package/dist/private/opcua_client_impl.d.ts +166 -166
  60. package/dist/private/opcua_client_impl.js +1000 -1000
  61. package/dist/private/opcua_client_impl.js.map +1 -1
  62. package/dist/private/performance.d.ts +1 -1
  63. package/dist/private/performance.js +18 -18
  64. package/dist/reconnection.d.ts +9 -9
  65. package/dist/reconnection.js +381 -381
  66. package/dist/tools/findservers.d.ts +20 -20
  67. package/dist/tools/findservers.js +61 -61
  68. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  69. package/dist/tools/read_history_server_capabilities.js +98 -98
  70. package/dist/user_identity_info.d.ts +1 -1
  71. package/dist/user_identity_info.js +2 -2
  72. package/dist/verify.d.ts +5 -5
  73. package/dist/verify.js +134 -134
  74. package/package.json +49 -45
  75. package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -1
  76. package/.nycrc.json +0 -14
  77. package/test_helpers/create_certificates.js +0 -1
  78. package/typedoc.js +0 -20
@@ -1,118 +1,118 @@
1
- /**
2
- * @module node-opcua-client
3
- */
4
- import { Certificate } from "node-opcua-crypto";
5
- import { ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
6
- import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
7
- import { MessageSecurityMode } from "node-opcua-service-secure-channel";
8
- import { CallbackT, ErrorCallback, StatusCode } from "node-opcua-status-code";
9
- import { FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseOptions } from "./client_base";
10
- import { ClientSession, ResponseCallback } from "./client_session";
11
- import { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription";
12
- import { UserIdentityInfo } from "./user_identity_info";
13
- export interface OPCUAClientOptions extends OPCUAClientBaseOptions {
14
- /**
15
- * the requested session timeout in CreateSession (ms)
16
- *
17
- * Note:
18
- * - make sure that this value is large enough, especially larger than the
19
- * time between two transactions to the server.
20
- *
21
- * - If your client establishes a subscription with the server, make sure that
22
- * (maxKeepAliveCount * publishingInterval) calculated with negotiated values
23
- * from the server stay by large below the session time out, as you make
24
- * encountered unexpected behavior.
25
- *
26
- * @default 60000 - default value is 60 secondes
27
- */
28
- requestedSessionTimeout?: number;
29
- /**
30
- * @deprecated(use endpointMustExist instead)
31
- */
32
- endpoint_must_exist?: boolean;
33
- /**
34
- * set to false if the client should accept server endpoint mismatch
35
- * @default true
36
- */
37
- endpointMustExist?: boolean;
38
- connectionStrategy?: ConnectionStrategyOptions;
39
- /** the server certificate. */
40
- serverCertificate?: Certificate;
41
- /***
42
- * default secure token lifetime in ms
43
- */
44
- defaultSecureTokenLifetime?: number;
45
- /**
46
- * the security mode
47
- * @default MessageSecurityMode.None
48
- */
49
- securityMode?: MessageSecurityMode | string;
50
- /**
51
- * the security policy
52
- * @default SecurityPolicy.None
53
- */
54
- securityPolicy?: SecurityPolicy | string;
55
- /**
56
- * @default false
57
- */
58
- keepSessionAlive?: boolean;
59
- /**
60
- * client certificate pem file.
61
- * @default "certificates/client_self-signed_cert_2048.pem"
62
- */
63
- certificateFile?: string;
64
- /**
65
- * client private key pem file.
66
- * @default "certificates/client_key_2048.pem"
67
- */
68
- privateKeyFile?: string;
69
- /**
70
- * a client name string that will be used to generate session names.
71
- */
72
- clientName?: string;
73
- }
74
- export interface OPCUAClient extends OPCUAClientBase {
75
- connect(endpointUrl: string): Promise<void>;
76
- connect(endpointUrl: string, callback: ErrorCallback): void;
77
- disconnect(): Promise<void>;
78
- disconnect(callback: ErrorCallback): void;
79
- getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
80
- getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
81
- getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
82
- findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
83
- findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
84
- findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
85
- createSession(userIdentityInfo?: UserIdentityInfo): Promise<ClientSession>;
86
- createSession(userIdentityInfo: UserIdentityInfo, callback: (err: Error | null, session?: ClientSession) => void): void;
87
- createSession(callback: (err: Error | null, session?: ClientSession) => void): void;
88
- createSession2(userIdentityInfo?: UserIdentityInfo): Promise<ClientSession>;
89
- createSession2(userIdentityInfo: UserIdentityInfo, callback: (err: Error | null, session?: ClientSession) => void): void;
90
- createSession2(callback: (err: Error | null, session?: ClientSession) => void): void;
91
- /** @deprecated */
92
- changeSessionIdentity(session: ClientSession, userIdentityInfo: UserIdentityInfo): Promise<StatusCode>;
93
- changeSessionIdentity(session: ClientSession, userIdentityInfo: UserIdentityInfo, callback: CallbackT<StatusCode>): void;
94
- closeSession(session: ClientSession, deleteSubscriptions: boolean): Promise<void>;
95
- closeSession(session: ClientSession, deleteSubscriptions: boolean, callback: (err?: Error) => void): void;
96
- reactivateSession(session: ClientSession): Promise<void>;
97
- reactivateSession(session: ClientSession, callback: (err?: Error) => void): void;
98
- createDefaultCertificate(): Promise<void>;
99
- }
100
- export interface EndpointWithUserIdentity {
101
- endpointUrl: string;
102
- userIdentity: UserIdentityInfo;
103
- }
104
- export type WithSessionFunc = (session: ClientSession) => Promise<void>;
105
- export type WithSessionFuncP<T> = (session: ClientSession) => Promise<T>;
106
- export type WithSubscriptionFunc = (session: ClientSession, subscription: ClientSubscription) => Promise<void>;
107
- export type WithSubscriptionFuncP<T> = (session: ClientSession, subscription: ClientSubscription) => Promise<T>;
108
- export interface OPCUAClient {
109
- withSessionAsync<T>(endpointUrl: string | EndpointWithUserIdentity, inner_func: WithSessionFuncP<T>): Promise<T>;
110
- withSession(endpointUrl: string | EndpointWithUserIdentity, inner_func: (session: ClientSession, done: (err?: Error) => void) => void, callback: (err?: Error) => void): void;
111
- withSubscriptionAsync<T>(endpointUrl: string | EndpointWithUserIdentity, parameters: ClientSubscriptionOptions, inner_func: WithSubscriptionFuncP<T>): Promise<T>;
112
- }
113
- export declare class OPCUAClient {
114
- static create(options: OPCUAClientOptions): OPCUAClient;
115
- static createSession(endpointUrl: string, userIdentity?: UserIdentityInfo, clientOptions?: OPCUAClientOptions): Promise<ClientSession>;
116
- static set minimumRevisedSessionTimeout(minimumRevisedSessionTimeout: number);
117
- static get minimumRevisedSessionTimeout(): number;
118
- }
1
+ /**
2
+ * @module node-opcua-client
3
+ */
4
+ import { Certificate } from "node-opcua-crypto";
5
+ import { ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
6
+ import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
7
+ import { MessageSecurityMode } from "node-opcua-service-secure-channel";
8
+ import { CallbackT, ErrorCallback, StatusCode } from "node-opcua-status-code";
9
+ import { FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseOptions } from "./client_base";
10
+ import { ClientSession, ResponseCallback } from "./client_session";
11
+ import { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription";
12
+ import { UserIdentityInfo } from "./user_identity_info";
13
+ export interface OPCUAClientOptions extends OPCUAClientBaseOptions {
14
+ /**
15
+ * the requested session timeout in CreateSession (ms)
16
+ *
17
+ * Note:
18
+ * - make sure that this value is large enough, especially larger than the
19
+ * time between two transactions to the server.
20
+ *
21
+ * - If your client establishes a subscription with the server, make sure that
22
+ * (maxKeepAliveCount * publishingInterval) calculated with negotiated values
23
+ * from the server stay by large below the session time out, as you make
24
+ * encountered unexpected behavior.
25
+ *
26
+ * @default 60000 - default value is 60 secondes
27
+ */
28
+ requestedSessionTimeout?: number;
29
+ /**
30
+ * @deprecated(use endpointMustExist instead)
31
+ */
32
+ endpoint_must_exist?: boolean;
33
+ /**
34
+ * set to false if the client should accept server endpoint mismatch
35
+ * @default true
36
+ */
37
+ endpointMustExist?: boolean;
38
+ connectionStrategy?: ConnectionStrategyOptions;
39
+ /** the server certificate. */
40
+ serverCertificate?: Certificate;
41
+ /***
42
+ * default secure token lifetime in ms
43
+ */
44
+ defaultSecureTokenLifetime?: number;
45
+ /**
46
+ * the security mode
47
+ * @default MessageSecurityMode.None
48
+ */
49
+ securityMode?: MessageSecurityMode | string;
50
+ /**
51
+ * the security policy
52
+ * @default SecurityPolicy.None
53
+ */
54
+ securityPolicy?: SecurityPolicy | string;
55
+ /**
56
+ * @default false
57
+ */
58
+ keepSessionAlive?: boolean;
59
+ /**
60
+ * client certificate pem file.
61
+ * @default "certificates/client_self-signed_cert_2048.pem"
62
+ */
63
+ certificateFile?: string;
64
+ /**
65
+ * client private key pem file.
66
+ * @default "certificates/client_key_2048.pem"
67
+ */
68
+ privateKeyFile?: string;
69
+ /**
70
+ * a client name string that will be used to generate session names.
71
+ */
72
+ clientName?: string;
73
+ }
74
+ export interface OPCUAClient extends OPCUAClientBase {
75
+ connect(endpointUrl: string): Promise<void>;
76
+ connect(endpointUrl: string, callback: ErrorCallback): void;
77
+ disconnect(): Promise<void>;
78
+ disconnect(callback: ErrorCallback): void;
79
+ getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
80
+ getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
81
+ getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
82
+ findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
83
+ findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
84
+ findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
85
+ createSession(userIdentityInfo?: UserIdentityInfo): Promise<ClientSession>;
86
+ createSession(userIdentityInfo: UserIdentityInfo, callback: (err: Error | null, session?: ClientSession) => void): void;
87
+ createSession(callback: (err: Error | null, session?: ClientSession) => void): void;
88
+ createSession2(userIdentityInfo?: UserIdentityInfo): Promise<ClientSession>;
89
+ createSession2(userIdentityInfo: UserIdentityInfo, callback: (err: Error | null, session?: ClientSession) => void): void;
90
+ createSession2(callback: (err: Error | null, session?: ClientSession) => void): void;
91
+ /** @deprecated */
92
+ changeSessionIdentity(session: ClientSession, userIdentityInfo: UserIdentityInfo): Promise<StatusCode>;
93
+ changeSessionIdentity(session: ClientSession, userIdentityInfo: UserIdentityInfo, callback: CallbackT<StatusCode>): void;
94
+ closeSession(session: ClientSession, deleteSubscriptions: boolean): Promise<void>;
95
+ closeSession(session: ClientSession, deleteSubscriptions: boolean, callback: (err?: Error) => void): void;
96
+ reactivateSession(session: ClientSession): Promise<void>;
97
+ reactivateSession(session: ClientSession, callback: (err?: Error) => void): void;
98
+ createDefaultCertificate(): Promise<void>;
99
+ }
100
+ export interface EndpointWithUserIdentity {
101
+ endpointUrl: string;
102
+ userIdentity: UserIdentityInfo;
103
+ }
104
+ export type WithSessionFunc = (session: ClientSession) => Promise<void>;
105
+ export type WithSessionFuncP<T> = (session: ClientSession) => Promise<T>;
106
+ export type WithSubscriptionFunc = (session: ClientSession, subscription: ClientSubscription) => Promise<void>;
107
+ export type WithSubscriptionFuncP<T> = (session: ClientSession, subscription: ClientSubscription) => Promise<T>;
108
+ export interface OPCUAClient {
109
+ withSessionAsync<T>(endpointUrl: string | EndpointWithUserIdentity, inner_func: WithSessionFuncP<T>): Promise<T>;
110
+ withSession(endpointUrl: string | EndpointWithUserIdentity, inner_func: (session: ClientSession, done: (err?: Error) => void) => void, callback: (err?: Error) => void): void;
111
+ withSubscriptionAsync<T>(endpointUrl: string | EndpointWithUserIdentity, parameters: ClientSubscriptionOptions, inner_func: WithSubscriptionFuncP<T>): Promise<T>;
112
+ }
113
+ export declare class OPCUAClient {
114
+ static create(options: OPCUAClientOptions): OPCUAClient;
115
+ static createSession(endpointUrl: string, userIdentity?: UserIdentityInfo, clientOptions?: OPCUAClientOptions): Promise<ClientSession>;
116
+ static set minimumRevisedSessionTimeout(minimumRevisedSessionTimeout: number);
117
+ static get minimumRevisedSessionTimeout(): number;
118
+ }
@@ -1,34 +1,34 @@
1
- "use strict";
2
- /**
3
- * @module node-opcua-client
4
- */
5
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
- return new (P || (P = Promise))(function (resolve, reject) {
8
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
- step((generator = generator.apply(thisArg, _arguments || [])).next());
12
- });
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.OPCUAClient = void 0;
16
- const opcua_client_impl_1 = require("./private/opcua_client_impl");
17
- class OPCUAClient {
18
- static create(options) {
19
- return new opcua_client_impl_1.OPCUAClientImpl(options);
20
- }
21
- static createSession(endpointUrl, userIdentity, clientOptions) {
22
- return __awaiter(this, void 0, void 0, function* () {
23
- return opcua_client_impl_1.OPCUAClientImpl.createSession(endpointUrl, userIdentity, clientOptions);
24
- });
25
- }
26
- static set minimumRevisedSessionTimeout(minimumRevisedSessionTimeout) {
27
- opcua_client_impl_1.OPCUAClientImpl.minimumRevisedSessionTimeout = minimumRevisedSessionTimeout;
28
- }
29
- static get minimumRevisedSessionTimeout() {
30
- return opcua_client_impl_1.OPCUAClientImpl.minimumRevisedSessionTimeout;
31
- }
32
- }
33
- exports.OPCUAClient = OPCUAClient;
1
+ "use strict";
2
+ /**
3
+ * @module node-opcua-client
4
+ */
5
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
6
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
7
+ return new (P || (P = Promise))(function (resolve, reject) {
8
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
9
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
10
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
11
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
12
+ });
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OPCUAClient = void 0;
16
+ const opcua_client_impl_1 = require("./private/opcua_client_impl");
17
+ class OPCUAClient {
18
+ static create(options) {
19
+ return new opcua_client_impl_1.OPCUAClientImpl(options);
20
+ }
21
+ static createSession(endpointUrl, userIdentity, clientOptions) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ return opcua_client_impl_1.OPCUAClientImpl.createSession(endpointUrl, userIdentity, clientOptions);
24
+ });
25
+ }
26
+ static set minimumRevisedSessionTimeout(minimumRevisedSessionTimeout) {
27
+ opcua_client_impl_1.OPCUAClientImpl.minimumRevisedSessionTimeout = minimumRevisedSessionTimeout;
28
+ }
29
+ static get minimumRevisedSessionTimeout() {
30
+ return opcua_client_impl_1.OPCUAClientImpl.minimumRevisedSessionTimeout;
31
+ }
32
+ }
33
+ exports.OPCUAClient = OPCUAClient;
34
34
  //# sourceMappingURL=opcua_client.js.map
@@ -1,160 +1,160 @@
1
- import { OPCUASecureObject } from "node-opcua-common";
2
- import { Certificate, Nonce } from "node-opcua-crypto";
3
- import { IBasicTransportSettings } from "node-opcua-pseudo-session";
4
- import { ClientSecureChannelLayer, ConnectionStrategy, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
5
- import { ServerOnNetwork } from "node-opcua-service-discovery";
6
- import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
7
- import { MessageSecurityMode } from "node-opcua-service-secure-channel";
8
- import { ErrorCallback } from "node-opcua-status-code";
9
- import { OPCUACertificateManager } from "node-opcua-certificate-manager";
10
- import { ResponseCallback } from "../client_session";
11
- import { Request, Response } from "../common";
12
- import { CreateSecureChannelCallbackFunc, FindServersOnNetworkRequestLike, FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseOptions } from "../client_base";
13
- import { UserIdentityInfo } from "../user_identity_info";
14
- import { ClientSessionImpl } from "./client_session_impl";
15
- import { IClientBase } from "./i_private_client";
16
- type InternalClientState = "uninitialized" | "disconnected" | "connecting" | "connected" | "reconnecting" | "reconnecting_newchannel_connected" | "disconnecting";
17
- /**
18
- * @internal
19
- */
20
- export declare class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase, IClientBase {
21
- /**
22
- * total number of requests that been canceled due to timeout
23
- */
24
- get timedOutRequestCount(): number;
25
- /**
26
- * total number of transactions performed by the client
27
- x */
28
- get transactionsPerformed(): number;
29
- /**
30
- * is true when the client has already requested the server end points.
31
- */
32
- get knowsServerEndpoint(): boolean;
33
- /**
34
- * true if the client is trying to reconnect to the server after a connection break.
35
- */
36
- get isReconnecting(): boolean;
37
- /**
38
- * true if the connection strategy is set to automatically try to reconnect in case of failure
39
- */
40
- get reconnectOnFailure(): boolean;
41
- /**
42
- * total number of bytes read by the client
43
- */
44
- get bytesRead(): number;
45
- /**
46
- * total number of bytes written by the client
47
- */
48
- get bytesWritten(): number;
49
- securityMode: MessageSecurityMode;
50
- securityPolicy: SecurityPolicy;
51
- serverCertificate?: Certificate;
52
- clientName: string;
53
- protocolVersion: 0;
54
- defaultSecureTokenLifetime: number;
55
- tokenRenewalInterval: number;
56
- connectionStrategy: ConnectionStrategy;
57
- keepPendingSessionsOnDisconnect: boolean;
58
- endpointUrl: string;
59
- discoveryUrl: string;
60
- readonly applicationName: string;
61
- private _applicationUri;
62
- /**
63
- * true if session shall periodically probe the server to keep the session alive and prevent timeout
64
- */
65
- keepSessionAlive: boolean;
66
- _sessions: ClientSessionImpl[];
67
- protected _serverEndpoints: EndpointDescription[];
68
- _secureChannel: ClientSecureChannelLayer | null;
69
- protected disconnecting: boolean;
70
- private _byteRead;
71
- private _byteWritten;
72
- private _timedOutRequestCount;
73
- private _transactionsPerformed;
74
- private _reconnectionIsCanceled;
75
- private _clockAdjuster?;
76
- private _tmpClient?;
77
- private _instanceNumber;
78
- private _transportSettings;
79
- clientCertificateManager: OPCUACertificateManager;
80
- protected _setInternalState(internalState: InternalClientState): void;
81
- emit(eventName: string | symbol, ...others: any[]): boolean;
82
- constructor(options?: OPCUAClientBaseOptions);
83
- private _cancel_reconnection;
84
- _recreate_secure_channel(callback: ErrorCallback): void;
85
- _internal_create_secure_channel(connectionStrategy: ConnectionStrategyOptions, callback: CreateSecureChannelCallbackFunc): void;
86
- static createCertificate(clientCertificateManager: OPCUACertificateManager, certificateFile: string, applicationName: string, applicationUri: string): Promise<void>;
87
- createDefaultCertificate(): Promise<void>;
88
- protected _getBuiltApplicationUri(): string;
89
- protected initializeCM(): Promise<void>;
90
- protected _internalState: InternalClientState;
91
- protected _handleUnrecoverableConnectionFailure(err: Error, callback: ErrorCallback): void;
92
- private _handleDisconnectionWhileConnecting;
93
- private _handleSuccessfulConnection;
94
- /**
95
- * connect the OPC-UA client to a server end point.
96
- * @async
97
- */
98
- connect(endpointUrl: string): Promise<void>;
99
- connect(endpointUrl: string, callback: ErrorCallback): void;
100
- /**
101
- * @private
102
- */
103
- _connectStep2(endpointUrl: string, callback: ErrorCallback): void;
104
- getClientNonce(): Nonce | null;
105
- performMessageTransaction(request: Request, callback: ResponseCallback<Response>): void;
106
- /**
107
- *
108
- * return the endpoint information matching security mode and security policy.
109
- * @method findEndpoint
110
- */
111
- findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
112
- /**
113
- *
114
- * return the endpoint information matching the specified url , security mode and security policy.
115
- * @method findEndpoint
116
- */
117
- findEndpoint(endpointUrl: string, securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
118
- getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
119
- getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
120
- getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
121
- /**
122
- * @deprecated
123
- */
124
- getEndpointsRequest(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
125
- /**
126
- * @method findServers
127
- */
128
- findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
129
- findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
130
- findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
131
- findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
132
- findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
133
- findServersOnNetwork(options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
134
- _removeSession(session: ClientSessionImpl): void;
135
- private _closeSession;
136
- closeSession(...args: any[]): any;
137
- disconnect(): Promise<void>;
138
- disconnect(callback: ErrorCallback): void;
139
- _on_connection_reestablished(callback: ErrorCallback): void;
140
- toString(): string;
141
- getSessions(): ClientSessionImpl[];
142
- getTransportSettings(): IBasicTransportSettings;
143
- protected _addSession(session: ClientSessionImpl): void;
144
- private fetchServerCertificate;
145
- private _accumulate_statistics;
146
- private _destroy_secure_channel;
147
- private _close_pending_sessions;
148
- private _install_secure_channel_event_handlers;
149
- _inside_repairConnection: boolean;
150
- private _repairConnection;
151
- private _finalReconnectionStep;
152
- /**
153
- *
154
- * @internal
155
- * @private
156
- */
157
- __createSession_step2(session: ClientSessionImpl, callback: (err: Error | null, session?: ClientSessionImpl) => void): void;
158
- _activateSession(session: ClientSessionImpl, userIdentity: UserIdentityInfo, callback: (err: Error | null, session?: ClientSessionImpl) => void): void;
159
- }
160
- export {};
1
+ import { OPCUASecureObject } from "node-opcua-common";
2
+ import { Certificate, Nonce } from "node-opcua-crypto";
3
+ import { IBasicTransportSettings } from "node-opcua-pseudo-session";
4
+ import { ClientSecureChannelLayer, ConnectionStrategy, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
5
+ import { ServerOnNetwork } from "node-opcua-service-discovery";
6
+ import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
7
+ import { MessageSecurityMode } from "node-opcua-service-secure-channel";
8
+ import { ErrorCallback } from "node-opcua-status-code";
9
+ import { OPCUACertificateManager } from "node-opcua-certificate-manager";
10
+ import { ResponseCallback } from "../client_session";
11
+ import { Request, Response } from "../common";
12
+ import { CreateSecureChannelCallbackFunc, FindServersOnNetworkRequestLike, FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseOptions } from "../client_base";
13
+ import { UserIdentityInfo } from "../user_identity_info";
14
+ import { ClientSessionImpl } from "./client_session_impl";
15
+ import { IClientBase } from "./i_private_client";
16
+ type InternalClientState = "uninitialized" | "disconnected" | "connecting" | "connected" | "reconnecting" | "reconnecting_newchannel_connected" | "disconnecting";
17
+ /**
18
+ * @internal
19
+ */
20
+ export declare class ClientBaseImpl extends OPCUASecureObject implements OPCUAClientBase, IClientBase {
21
+ /**
22
+ * total number of requests that been canceled due to timeout
23
+ */
24
+ get timedOutRequestCount(): number;
25
+ /**
26
+ * total number of transactions performed by the client
27
+ x */
28
+ get transactionsPerformed(): number;
29
+ /**
30
+ * is true when the client has already requested the server end points.
31
+ */
32
+ get knowsServerEndpoint(): boolean;
33
+ /**
34
+ * true if the client is trying to reconnect to the server after a connection break.
35
+ */
36
+ get isReconnecting(): boolean;
37
+ /**
38
+ * true if the connection strategy is set to automatically try to reconnect in case of failure
39
+ */
40
+ get reconnectOnFailure(): boolean;
41
+ /**
42
+ * total number of bytes read by the client
43
+ */
44
+ get bytesRead(): number;
45
+ /**
46
+ * total number of bytes written by the client
47
+ */
48
+ get bytesWritten(): number;
49
+ securityMode: MessageSecurityMode;
50
+ securityPolicy: SecurityPolicy;
51
+ serverCertificate?: Certificate;
52
+ clientName: string;
53
+ protocolVersion: 0;
54
+ defaultSecureTokenLifetime: number;
55
+ tokenRenewalInterval: number;
56
+ connectionStrategy: ConnectionStrategy;
57
+ keepPendingSessionsOnDisconnect: boolean;
58
+ endpointUrl: string;
59
+ discoveryUrl: string;
60
+ readonly applicationName: string;
61
+ private _applicationUri;
62
+ /**
63
+ * true if session shall periodically probe the server to keep the session alive and prevent timeout
64
+ */
65
+ keepSessionAlive: boolean;
66
+ _sessions: ClientSessionImpl[];
67
+ protected _serverEndpoints: EndpointDescription[];
68
+ _secureChannel: ClientSecureChannelLayer | null;
69
+ protected disconnecting: boolean;
70
+ private _byteRead;
71
+ private _byteWritten;
72
+ private _timedOutRequestCount;
73
+ private _transactionsPerformed;
74
+ private _reconnectionIsCanceled;
75
+ private _clockAdjuster?;
76
+ private _tmpClient?;
77
+ private _instanceNumber;
78
+ private _transportSettings;
79
+ clientCertificateManager: OPCUACertificateManager;
80
+ protected _setInternalState(internalState: InternalClientState): void;
81
+ emit(eventName: string | symbol, ...others: any[]): boolean;
82
+ constructor(options?: OPCUAClientBaseOptions);
83
+ private _cancel_reconnection;
84
+ _recreate_secure_channel(callback: ErrorCallback): void;
85
+ _internal_create_secure_channel(connectionStrategy: ConnectionStrategyOptions, callback: CreateSecureChannelCallbackFunc): void;
86
+ static createCertificate(clientCertificateManager: OPCUACertificateManager, certificateFile: string, applicationName: string, applicationUri: string): Promise<void>;
87
+ createDefaultCertificate(): Promise<void>;
88
+ protected _getBuiltApplicationUri(): string;
89
+ protected initializeCM(): Promise<void>;
90
+ protected _internalState: InternalClientState;
91
+ protected _handleUnrecoverableConnectionFailure(err: Error, callback: ErrorCallback): void;
92
+ private _handleDisconnectionWhileConnecting;
93
+ private _handleSuccessfulConnection;
94
+ /**
95
+ * connect the OPC-UA client to a server end point.
96
+ * @async
97
+ */
98
+ connect(endpointUrl: string): Promise<void>;
99
+ connect(endpointUrl: string, callback: ErrorCallback): void;
100
+ /**
101
+ * @private
102
+ */
103
+ _connectStep2(endpointUrl: string, callback: ErrorCallback): void;
104
+ getClientNonce(): Nonce | null;
105
+ performMessageTransaction(request: Request, callback: ResponseCallback<Response>): void;
106
+ /**
107
+ *
108
+ * return the endpoint information matching security mode and security policy.
109
+ * @method findEndpoint
110
+ */
111
+ findEndpointForSecurity(securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
112
+ /**
113
+ *
114
+ * return the endpoint information matching the specified url , security mode and security policy.
115
+ * @method findEndpoint
116
+ */
117
+ findEndpoint(endpointUrl: string, securityMode: MessageSecurityMode, securityPolicy: SecurityPolicy): EndpointDescription | undefined;
118
+ getEndpoints(options?: GetEndpointsOptions): Promise<EndpointDescription[]>;
119
+ getEndpoints(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
120
+ getEndpoints(callback: ResponseCallback<EndpointDescription[]>): void;
121
+ /**
122
+ * @deprecated
123
+ */
124
+ getEndpointsRequest(options: GetEndpointsOptions, callback: ResponseCallback<EndpointDescription[]>): void;
125
+ /**
126
+ * @method findServers
127
+ */
128
+ findServers(options?: FindServersRequestLike): Promise<ApplicationDescription[]>;
129
+ findServers(options: FindServersRequestLike, callback: ResponseCallback<ApplicationDescription[]>): void;
130
+ findServers(callback: ResponseCallback<ApplicationDescription[]>): void;
131
+ findServersOnNetwork(options?: FindServersOnNetworkRequestLike): Promise<ServerOnNetwork[]>;
132
+ findServersOnNetwork(callback: ResponseCallback<ServerOnNetwork[]>): void;
133
+ findServersOnNetwork(options: FindServersOnNetworkRequestLike, callback: ResponseCallback<ServerOnNetwork[]>): void;
134
+ _removeSession(session: ClientSessionImpl): void;
135
+ private _closeSession;
136
+ closeSession(...args: any[]): any;
137
+ disconnect(): Promise<void>;
138
+ disconnect(callback: ErrorCallback): void;
139
+ _on_connection_reestablished(callback: ErrorCallback): void;
140
+ toString(): string;
141
+ getSessions(): ClientSessionImpl[];
142
+ getTransportSettings(): IBasicTransportSettings;
143
+ protected _addSession(session: ClientSessionImpl): void;
144
+ private fetchServerCertificate;
145
+ private _accumulate_statistics;
146
+ private _destroy_secure_channel;
147
+ private _close_pending_sessions;
148
+ private _install_secure_channel_event_handlers;
149
+ _inside_repairConnection: boolean;
150
+ private _repairConnection;
151
+ private _finalReconnectionStep;
152
+ /**
153
+ *
154
+ * @internal
155
+ * @private
156
+ */
157
+ __createSession_step2(session: ClientSessionImpl, callback: (err: Error | null, session?: ClientSessionImpl) => void): void;
158
+ _activateSession(session: ClientSessionImpl, userIdentity: UserIdentityInfo, callback: (err: Error | null, session?: ClientSessionImpl) => void): void;
159
+ }
160
+ export {};