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