node-opcua-client 2.180.0 → 2.181.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.
- package/dist/alarms_and_conditions/client_alarm_tools.d.ts +1 -1
- package/dist/alarms_and_conditions/client_tools.js +7 -7
- package/dist/alarms_and_conditions/client_tools.js.map +1 -1
- package/dist/client_base.d.ts +2 -2
- package/dist/client_monitored_item.d.ts +2 -2
- package/dist/client_monitored_item_base.d.ts +1 -1
- package/dist/client_monitored_item_group.d.ts +2 -2
- package/dist/client_monitored_item_toolbox.d.ts +2 -2
- package/dist/client_monitored_item_toolbox.js +2 -2
- package/dist/client_monitored_item_toolbox.js.map +1 -1
- package/dist/client_session.d.ts +1 -1
- package/dist/client_session_keepalive_manager.d.ts +1 -1
- package/dist/client_session_keepalive_manager.js +3 -3
- package/dist/client_session_keepalive_manager.js.map +1 -1
- package/dist/client_subscription.d.ts +17 -4
- package/dist/client_subscription.js.map +1 -1
- package/dist/index.d.ts +17 -17
- package/dist/index.js +18 -18
- package/dist/index.js.map +1 -1
- package/dist/opcua_client.d.ts +4 -4
- package/dist/opcua_client.js +5 -5
- package/dist/opcua_client.js.map +1 -1
- package/dist/private/client_base_impl.d.ts +6 -6
- package/dist/private/client_base_impl.js +19 -16
- package/dist/private/client_base_impl.js.map +1 -1
- package/dist/private/client_monitored_item_group_impl.d.ts +3 -3
- package/dist/private/client_monitored_item_group_impl.js +9 -9
- package/dist/private/client_monitored_item_group_impl.js.map +1 -1
- package/dist/private/client_monitored_item_impl.d.ts +4 -4
- package/dist/private/client_monitored_item_impl.js +10 -10
- package/dist/private/client_monitored_item_impl.js.map +1 -1
- package/dist/private/client_publish_engine.d.ts +3 -3
- package/dist/private/client_publish_engine.js +3 -3
- package/dist/private/client_publish_engine.js.map +1 -1
- package/dist/private/client_session_impl.d.ts +6 -6
- package/dist/private/client_session_impl.js +12 -12
- package/dist/private/client_session_impl.js.map +1 -1
- package/dist/private/client_subscription_impl.d.ts +8 -8
- package/dist/private/client_subscription_impl.js +13 -13
- package/dist/private/client_subscription_impl.js.map +1 -1
- package/dist/private/i_private_client.d.ts +4 -4
- package/dist/private/opcua_client_impl.d.ts +7 -7
- package/dist/private/opcua_client_impl.js +58 -25
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/private/reconnection/client_publish_engine_reconnection.d.ts +1 -1
- package/dist/private/reconnection/client_publish_engine_reconnection.js +5 -5
- package/dist/private/reconnection/client_publish_engine_reconnection.js.map +1 -1
- package/dist/private/reconnection/client_reconnection.d.ts +1 -1
- package/dist/private/reconnection/client_subscription_reconnection.d.ts +1 -1
- package/dist/private/reconnection/client_subscription_reconnection.js +8 -5
- package/dist/private/reconnection/client_subscription_reconnection.js.map +1 -1
- package/dist/private/reconnection/reconnection.d.ts +3 -3
- package/dist/private/reconnection/reconnection.js +4 -4
- package/dist/private/reconnection/reconnection.js.map +1 -1
- package/dist/tools/findservers.js +3 -3
- package/dist/tools/findservers.js.map +1 -1
- package/dist/tools/read_history_server_capabilities.d.ts +1 -1
- package/dist/verify.js +60 -20
- package/dist/verify.js.map +1 -1
- package/package.json +48 -47
- package/source/alarms_and_conditions/client_alarm_tools.ts +3 -3
- package/source/alarms_and_conditions/client_tools.ts +1 -1
- package/source/client_base.ts +2 -2
- package/source/client_monitored_item.ts +2 -2
- package/source/client_monitored_item_base.ts +1 -1
- package/source/client_monitored_item_group.ts +2 -2
- package/source/client_monitored_item_toolbox.ts +8 -8
- package/source/client_session.ts +1 -1
- package/source/client_session_keepalive_manager.ts +5 -5
- package/source/client_subscription.ts +21 -4
- package/source/index.ts +17 -17
- package/source/opcua_client.ts +5 -5
- package/source/private/client_base_impl.ts +21 -13
- package/source/private/client_monitored_item_group_impl.ts +8 -8
- package/source/private/client_monitored_item_impl.ts +8 -8
- package/source/private/client_publish_engine.ts +8 -8
- package/source/private/client_session_impl.ts +13 -13
- package/source/private/client_subscription_impl.ts +11 -11
- package/source/private/i_private_client.ts +4 -4
- package/source/private/opcua_client_impl.ts +85 -30
- package/source/private/reconnection/client_publish_engine_reconnection.ts +5 -5
- package/source/private/reconnection/client_reconnection.ts +1 -1
- package/source/private/reconnection/client_subscription_reconnection.ts +8 -4
- package/source/private/reconnection/reconnection.ts +5 -5
- package/source/tools/findservers.ts +1 -1
- package/source/tools/read_history_server_capabilities.ts +1 -1
- package/source/verify.ts +75 -24
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ClientAlarmList } from "node-opcua-alarm-condition";
|
|
2
|
-
import type { ClientSession } from "../client_session";
|
|
2
|
+
import type { ClientSession } from "../client_session.js";
|
|
3
3
|
export declare function uninstallAlarmMonitoring(session: ClientSession): Promise<void>;
|
|
4
4
|
export declare function installAlarmMonitoring(session: ClientSession): Promise<ClientAlarmList>;
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const node_util_1 = require("node:util");
|
|
7
7
|
const node_opcua_alarm_condition_1 = require("node-opcua-alarm-condition");
|
|
8
8
|
const node_opcua_pseudo_session_1 = require("node-opcua-pseudo-session");
|
|
9
|
-
const
|
|
10
|
-
|
|
9
|
+
const client_session_impl_js_1 = require("../private/client_session_impl.js");
|
|
10
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.disableCondition = () => {
|
|
11
11
|
/** */
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.enableCondition = () => {
|
|
14
14
|
/** */
|
|
15
15
|
};
|
|
16
16
|
function addCommentConditionImpl(conditionId, eventId, comment, callback) {
|
|
@@ -20,7 +20,7 @@ function addCommentConditionImpl(conditionId, eventId, comment, callback) {
|
|
|
20
20
|
(0, node_util_1.callbackify)(node_opcua_alarm_condition_1.callMethodCondition)(this, "AddComment", conditionId, eventId, comment, callback);
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.addCommentCondition = addCommentConditionImpl;
|
|
24
24
|
function findMethodIdImpl(nodeId, methodName, callback) {
|
|
25
25
|
const promise = (0, node_opcua_pseudo_session_1.findMethodId)(this, nodeId, methodName).then((data) => {
|
|
26
26
|
if (data.methodId) {
|
|
@@ -38,7 +38,7 @@ function findMethodIdImpl(nodeId, methodName, callback) {
|
|
|
38
38
|
});
|
|
39
39
|
return undefined;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.findMethodId = findMethodIdImpl;
|
|
42
42
|
function confirmConditionImpl(conditionId, eventId, comment, callback) {
|
|
43
43
|
// ns=0;i=9113 AcknowledgeableConditionType#Confirm
|
|
44
44
|
// note that confirm method is Optionals on condition
|
|
@@ -48,7 +48,7 @@ function confirmConditionImpl(conditionId, eventId, comment, callback) {
|
|
|
48
48
|
(0, node_util_1.callbackify)(node_opcua_alarm_condition_1.confirmCondition)(this, conditionId, eventId, comment, callback);
|
|
49
49
|
return undefined;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.confirmCondition = confirmConditionImpl;
|
|
52
52
|
function acknowledgeConditionImpl(conditionId, eventId, comment, callback) {
|
|
53
53
|
// ns=0;i=9111 AcknowledgeableConditionType#Acknowledge
|
|
54
54
|
if (!callback) {
|
|
@@ -57,5 +57,5 @@ function acknowledgeConditionImpl(conditionId, eventId, comment, callback) {
|
|
|
57
57
|
(0, node_util_1.callbackify)(node_opcua_alarm_condition_1.acknowledgeCondition)(this, conditionId, eventId, comment, callback);
|
|
58
58
|
return undefined;
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
client_session_impl_js_1.ClientSessionImpl.prototype.acknowledgeCondition = acknowledgeConditionImpl;
|
|
61
61
|
//# sourceMappingURL=client_tools.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_tools.js","sourceRoot":"","sources":["../../source/alarms_and_conditions/client_tools.ts"],"names":[],"mappings":";AAAA;;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,CAAC"}
|
package/dist/client_base.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ import type { ApplicationDescription, EndpointDescription } from "node-opcua-ser
|
|
|
13
13
|
import type { ChannelSecurityToken, MessageSecurityMode } from "node-opcua-service-secure-channel";
|
|
14
14
|
import type { ErrorCallback } from "node-opcua-status-code";
|
|
15
15
|
import type { IClientTransportFactory } from "node-opcua-transport";
|
|
16
|
-
import type { Request, Response } from "./common";
|
|
17
|
-
import type { ClientReverseConnect, ReverseConnectExpectation } from "./reverse/client_reverse_connect";
|
|
16
|
+
import type { Request, Response } from "./common.js";
|
|
17
|
+
import type { ClientReverseConnect, ReverseConnectExpectation } from "./reverse/client_reverse_connect.js";
|
|
18
18
|
export type FindServersRequestLike = FindServersRequestOptions;
|
|
19
19
|
export type FindServersOnNetworkRequestLike = FindServersOnNetworkRequestOptions;
|
|
20
20
|
export type CreateSecureChannelCallbackFunc = (err: Error | null, secureChannel?: ClientSecureChannelLayer) => void;
|
|
@@ -6,8 +6,8 @@ import { type DataValue, TimestampsToReturn } from "node-opcua-data-value";
|
|
|
6
6
|
import type { ReadValueIdOptions } from "node-opcua-service-read";
|
|
7
7
|
import type { MonitoringParametersOptions } from "node-opcua-types";
|
|
8
8
|
import type { Variant } from "node-opcua-variant";
|
|
9
|
-
import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
|
|
10
|
-
import type { ClientSubscription } from "./client_subscription";
|
|
9
|
+
import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base.js";
|
|
10
|
+
import type { ClientSubscription } from "./client_subscription.js";
|
|
11
11
|
export interface ClientMonitoredItem extends ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction, EventEmitter {
|
|
12
12
|
on(event: "changed", eventHandler: (dataValue: DataValue) => void): this;
|
|
13
13
|
on(event: "changed", eventHandler: (values: Variant[]) => void): this;
|
|
@@ -12,7 +12,7 @@ import type { TimestampsToReturn } from "node-opcua-service-read";
|
|
|
12
12
|
import type { MonitoredItemCreateResult, MonitoredItemModifyResult, MonitoringMode, MonitoringParameters, MonitoringParametersOptions } from "node-opcua-service-subscription";
|
|
13
13
|
import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
|
|
14
14
|
import type { Variant } from "node-opcua-variant";
|
|
15
|
-
import type { ClientSubscription } from "./client_subscription";
|
|
15
|
+
import type { ClientSubscription } from "./client_subscription.js";
|
|
16
16
|
export interface ClientMonitoredItemOrGroupAction {
|
|
17
17
|
modify(parameters: MonitoringParametersOptions, timestampsToReturn?: TimestampsToReturn): Promise<MonitoredItemModifyResult>;
|
|
18
18
|
modify(parameters: MonitoringParametersOptions, callback: Callback<MonitoredItemModifyResult>): void;
|
|
@@ -5,8 +5,8 @@ import type { EventEmitter } from "node:events";
|
|
|
5
5
|
import type { DataValue, TimestampsToReturn } from "node-opcua-data-value";
|
|
6
6
|
import type { ReadValueIdOptions } from "node-opcua-service-read";
|
|
7
7
|
import type { MonitoringParametersOptions } from "node-opcua-types";
|
|
8
|
-
import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base";
|
|
9
|
-
import type { ClientSubscription } from "./client_subscription";
|
|
8
|
+
import type { ClientMonitoredItemBase, ClientMonitoredItemOrGroupAction } from "./client_monitored_item_base.js";
|
|
9
|
+
import type { ClientSubscription } from "./client_subscription.js";
|
|
10
10
|
export interface ClientMonitoredItemGroup extends EventEmitter, ClientMonitoredItemOrGroupAction {
|
|
11
11
|
on(event: "changed", eventHandler: (monitoredItem: ClientMonitoredItemBase, dataValue: DataValue, index: number) => void): this;
|
|
12
12
|
on(event: "err", eventHandler: (message: string) => void): this;
|
|
@@ -2,8 +2,8 @@ import type { TimestampsToReturn } from "node-opcua-data-value";
|
|
|
2
2
|
import { type MonitoredItemModifyResult, type MonitoringMode } from "node-opcua-service-subscription";
|
|
3
3
|
import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
|
|
4
4
|
import type { MonitoringParametersOptions } from "node-opcua-types";
|
|
5
|
-
import type { ClientMonitoredItemBase } from "./client_monitored_item_base";
|
|
6
|
-
import type { ClientSubscription } from "./client_subscription";
|
|
5
|
+
import type { ClientMonitoredItemBase } from "./client_monitored_item_base.js";
|
|
6
|
+
import type { ClientSubscription } from "./client_subscription.js";
|
|
7
7
|
export interface ClientMonitoredItemBaseEx extends ClientMonitoredItemBase {
|
|
8
8
|
internalSetMonitoringMode(monitoringMode: MonitoringMode): void;
|
|
9
9
|
}
|
|
@@ -11,8 +11,8 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
11
11
|
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
12
12
|
const node_opcua_debug_1 = require("node-opcua-debug");
|
|
13
13
|
const node_opcua_service_subscription_1 = require("node-opcua-service-subscription");
|
|
14
|
-
const debugLog = (0, node_opcua_debug_1.make_debugLog)(
|
|
15
|
-
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(
|
|
14
|
+
const debugLog = (0, node_opcua_debug_1.make_debugLog)("client_monitored_item_toolbox");
|
|
15
|
+
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("client_monitored_item_toolbox");
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_monitored_item_toolbox.js","sourceRoot":"","sources":["../source/client_monitored_item_toolbox.ts"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,kDAA0B;AAE1B,yDAA2C;AAG3C,uDAAiE;AACjE,qFASyC;AASzC,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,
|
|
1
|
+
{"version":3,"file":"client_monitored_item_toolbox.js","sourceRoot":"","sources":["../source/client_monitored_item_toolbox.ts"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,kDAA0B;AAE1B,yDAA2C;AAG3C,uDAAiE;AACjE,qFASyC;AASzC,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,+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AAO,CAAC,CAAC,aAAa,EAAE,EAAE;gBACrC,aAAa,CAAC,yBAAyB,CAAC,cAAc,CAAC,CAAC;YAC5D,CAAC,CAAC,CAAC;YACH,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC;YAC1C,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC,CAAC,CAAC;IACP,CAAC;IAhCe,qDAA0B,6BAgCzC,CAAA;AACL,CAAC,EAhKgB,0BAA0B,0CAA1B,0BAA0B,QAgK1C"}
|
package/dist/client_session.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ import type { DataType, Variant } from "node-opcua-variant";
|
|
|
22
22
|
export { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
|
|
23
23
|
export { ExtensionObject } from "node-opcua-extension-object";
|
|
24
24
|
export { ArgumentDefinition, CallMethodRequestLike, MethodId } from "node-opcua-pseudo-session";
|
|
25
|
-
import type { ClientSubscription } from "./client_subscription";
|
|
25
|
+
import type { ClientSubscription } from "./client_subscription.js";
|
|
26
26
|
export interface MonitoredItemData {
|
|
27
27
|
clientHandles: Uint32Array;
|
|
28
28
|
serverHandles: Uint32Array;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { EventEmitter } from "node:events";
|
|
5
5
|
import { ServerState } from "node-opcua-common";
|
|
6
|
-
import type { ClientSessionImpl } from "./private/client_session_impl";
|
|
6
|
+
import type { ClientSessionImpl } from "./private/client_session_impl.js";
|
|
7
7
|
export interface ClientSessionKeepAliveManagerEvents {
|
|
8
8
|
on(event: "keepalive", eventHandler: (lastKnownServerState: ServerState, count: number) => void): this;
|
|
9
9
|
on(event: "failure", eventHandler: () => void): this;
|
|
@@ -18,9 +18,9 @@ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
|
18
18
|
const node_opcua_secure_channel_1 = require("node-opcua-secure-channel");
|
|
19
19
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
20
20
|
const serverStatusStateNodeId = (0, node_opcua_nodeid_1.coerceNodeId)(node_opcua_constants_1.VariableIds.Server_ServerStatus_State);
|
|
21
|
-
const debugLog = (0, node_opcua_debug_1.make_debugLog)(
|
|
22
|
-
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(
|
|
23
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)(
|
|
21
|
+
const debugLog = (0, node_opcua_debug_1.make_debugLog)("client_session_keepalive_manager");
|
|
22
|
+
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("client_session_keepalive_manager");
|
|
23
|
+
const warningLog = (0, node_opcua_debug_1.make_warningLog)("client_session_keepalive_manager");
|
|
24
24
|
const maxBackoffInterval = 60_000;
|
|
25
25
|
class ClientSessionKeepAliveManager extends node_events_1.EventEmitter {
|
|
26
26
|
session;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_session_keepalive_manager.js","sourceRoot":"","sources":["../source/client_session_keepalive_manager.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,6CAA2C;AAC3C,kDAA0B;AAC1B,yDAA2C;AAC3C,mEAAsD;AACtD,yDAAgD;AAChD,+DAAmD;AAEnD,uDAAkF;AAClF,yDAAiD;AACjD,yEAAsG;AACtG,mEAAqD;AAIrD,MAAM,uBAAuB,GAAG,IAAA,gCAAY,EAAC,kCAAW,CAAC,yBAAyB,CAAC,CAAC;AAEpF,MAAM,QAAQ,GAAG,IAAA,gCAAa,EAAC,
|
|
1
|
+
{"version":3,"file":"client_session_keepalive_manager.js","sourceRoot":"","sources":["../source/client_session_keepalive_manager.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;AAEH,6CAA2C;AAC3C,kDAA0B;AAC1B,yDAA2C;AAC3C,mEAAsD;AACtD,yDAAgD;AAChD,+DAAmD;AAEnD,uDAAkF;AAClF,yDAAiD;AACjD,yEAAsG;AACtG,mEAAqD;AAIrD,MAAM,uBA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,mBAAmB,GAAG,CAAC,CAAC;gBAC7B,iBAAiB;gBACjB,OAAO,IAAI,QAAQ,CAAC,gBAAgB,CAAC,CAAC;gBACtC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;gBACxD,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAChC,CAAC,CACJ,CAAC;QACN,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AApPD,sEAoPC;AAED,SAAS,mBAAmB,CAAC,MAA0B;IACnD,IAAI,CAAC,MAAM;QAAE,OAAO;IAEpB,MAAM,OAAO,GAAoC,MAAM,CAAC,cAAc,CAAC;IACvE,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO;IACX,CAAC;IACD,OAAO,CAAC,oBAAoB,EAAE,CAAC;AACnC,CAAC"}
|
|
@@ -8,10 +8,10 @@ import type { IBasicSubscription } from "node-opcua-pseudo-session";
|
|
|
8
8
|
import type { ReadValueIdOptions, TimestampsToReturn } from "node-opcua-service-read";
|
|
9
9
|
import type { MonitoringMode, MonitoringParametersOptions, NotificationMessage, SetTriggeringResponse } from "node-opcua-service-subscription";
|
|
10
10
|
import type { Callback, ErrorCallback, StatusCode } from "node-opcua-status-code";
|
|
11
|
-
import type { ClientMonitoredItem } from "./client_monitored_item";
|
|
12
|
-
import type { ClientMonitoredItemBase } from "./client_monitored_item_base";
|
|
13
|
-
import type { ClientMonitoredItemGroup } from "./client_monitored_item_group";
|
|
14
|
-
import type { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session";
|
|
11
|
+
import type { ClientMonitoredItem } from "./client_monitored_item.js";
|
|
12
|
+
import type { ClientMonitoredItemBase } from "./client_monitored_item_base.js";
|
|
13
|
+
import type { ClientMonitoredItemGroup } from "./client_monitored_item_group.js";
|
|
14
|
+
import type { ClientSession, MonitoredItemData, SubscriptionId } from "./client_session.js";
|
|
15
15
|
export interface ClientSubscriptionOptions {
|
|
16
16
|
requestedPublishingInterval?: number;
|
|
17
17
|
requestedLifetimeCount?: number;
|
|
@@ -193,6 +193,19 @@ export declare interface ClientSubscription {
|
|
|
193
193
|
* @event terminated
|
|
194
194
|
*/
|
|
195
195
|
on(event: "terminated", eventHandler: () => void): this;
|
|
196
|
+
/**
|
|
197
|
+
* notify the observers that the subscription has been recreated with a new subscriptionId.
|
|
198
|
+
*
|
|
199
|
+
* This happens when the client repairs a broken connection and the server could not
|
|
200
|
+
* transfer the original subscription (TransferSubscriptions not supported or refused,
|
|
201
|
+
* or the subscription had already timed out and been deleted on the server). In that
|
|
202
|
+
* case the client silently creates a new subscription on the server, and `subscriptionId`
|
|
203
|
+
* is updated to reflect it. Since `started` is only emitted once, applications that need
|
|
204
|
+
* to track the current subscriptionId (for logging, diagnostics, or correlating it with
|
|
205
|
+
* server-side state) should listen to this event as well.
|
|
206
|
+
* @event subscriptionId_changed
|
|
207
|
+
*/
|
|
208
|
+
on(event: "subscriptionId_changed", eventHandler: (subscriptionId: SubscriptionId, previousSubscriptionId: SubscriptionId) => void): this;
|
|
196
209
|
/**
|
|
197
210
|
* notify the observers that a new monitored item has been added to the subscription.
|
|
198
211
|
* @event item_added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client_subscription.js","sourceRoot":"","sources":["../source/client_subscription.ts"],"names":[],"mappings":";AAAA;;GAEG;;;
|
|
1
|
+
{"version":3,"file":"client_subscription.js","sourceRoot":"","sources":["../source/client_subscription.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AA4TH,iHAAiH;AACjH,8LAA8L;AAC9L,MAAa,kBAAkB;IACpB,MAAM,CAAC,MAAM,CAAC,cAA6B,EAAE,QAAmC;QACnF,mBAAmB;QACnB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IACM,MAAM,CAAC,iBAAiB,GAAG,KAAK,CAAC;;AAL5C,gDAMC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -25,23 +25,23 @@ export { assert } from "node-opcua-assert";
|
|
|
25
25
|
export { ServerState, ServiceCounterDataType } from "node-opcua-common";
|
|
26
26
|
export { ClientSecureChannelLayer, ConnectionStrategyOptions, SecurityPolicy } from "node-opcua-secure-channel";
|
|
27
27
|
export * from "node-opcua-utils";
|
|
28
|
-
export * from "./alarms_and_conditions/client_alarm_tools";
|
|
29
|
-
export * from "./alarms_and_conditions/client_tools";
|
|
30
|
-
export * from "./alarms_and_conditions/client_tools";
|
|
31
|
-
export * from "./client_base";
|
|
32
|
-
export * from "./client_monitored_item";
|
|
33
|
-
export * from "./client_monitored_item_base";
|
|
34
|
-
export * from "./client_monitored_item_group";
|
|
35
|
-
export * from "./client_session";
|
|
36
|
-
export * from "./client_subscription";
|
|
37
|
-
export * from "./client_utils";
|
|
38
|
-
export * from "./opcua_client";
|
|
39
|
-
export { ClientSidePublishEngine } from "./private/client_publish_engine";
|
|
40
|
-
export * from "./reverse/client_reverse_connect";
|
|
41
|
-
export * from "./tools/findservers";
|
|
42
|
-
export * from "./tools/read_history_server_capabilities";
|
|
43
|
-
export * from "./user_identity_info";
|
|
44
|
-
export * from "./verify";
|
|
28
|
+
export * from "./alarms_and_conditions/client_alarm_tools.js";
|
|
29
|
+
export * from "./alarms_and_conditions/client_tools.js";
|
|
30
|
+
export * from "./alarms_and_conditions/client_tools.js";
|
|
31
|
+
export * from "./client_base.js";
|
|
32
|
+
export * from "./client_monitored_item.js";
|
|
33
|
+
export * from "./client_monitored_item_base.js";
|
|
34
|
+
export * from "./client_monitored_item_group.js";
|
|
35
|
+
export * from "./client_session.js";
|
|
36
|
+
export * from "./client_subscription.js";
|
|
37
|
+
export * from "./client_utils.js";
|
|
38
|
+
export * from "./opcua_client.js";
|
|
39
|
+
export { ClientSidePublishEngine } from "./private/client_publish_engine.js";
|
|
40
|
+
export * from "./reverse/client_reverse_connect.js";
|
|
41
|
+
export * from "./tools/findservers.js";
|
|
42
|
+
export * from "./tools/read_history_server_capabilities.js";
|
|
43
|
+
export * from "./user_identity_info.js";
|
|
44
|
+
export * from "./verify.js";
|
|
45
45
|
import * as utils1 from "node-opcua-utils";
|
|
46
46
|
export declare const utils: typeof utils1;
|
|
47
47
|
import * as crypto_util1 from "node-opcua-crypto/web";
|
package/dist/index.js
CHANGED
|
@@ -69,24 +69,24 @@ var node_opcua_secure_channel_1 = require("node-opcua-secure-channel");
|
|
|
69
69
|
Object.defineProperty(exports, "ClientSecureChannelLayer", { enumerable: true, get: function () { return node_opcua_secure_channel_1.ClientSecureChannelLayer; } });
|
|
70
70
|
Object.defineProperty(exports, "SecurityPolicy", { enumerable: true, get: function () { return node_opcua_secure_channel_1.SecurityPolicy; } });
|
|
71
71
|
__exportStar(require("node-opcua-utils"), exports);
|
|
72
|
-
__exportStar(require("./alarms_and_conditions/client_alarm_tools"), exports);
|
|
73
|
-
__exportStar(require("./alarms_and_conditions/client_tools"), exports);
|
|
74
|
-
__exportStar(require("./alarms_and_conditions/client_tools"), exports);
|
|
75
|
-
__exportStar(require("./client_base"), exports);
|
|
76
|
-
__exportStar(require("./client_monitored_item"), exports);
|
|
77
|
-
__exportStar(require("./client_monitored_item_base"), exports);
|
|
78
|
-
__exportStar(require("./client_monitored_item_group"), exports);
|
|
79
|
-
__exportStar(require("./client_session"), exports);
|
|
80
|
-
__exportStar(require("./client_subscription"), exports);
|
|
81
|
-
__exportStar(require("./client_utils"), exports);
|
|
82
|
-
__exportStar(require("./opcua_client"), exports);
|
|
83
|
-
var
|
|
84
|
-
Object.defineProperty(exports, "ClientSidePublishEngine", { enumerable: true, get: function () { return
|
|
85
|
-
__exportStar(require("./reverse/client_reverse_connect"), exports);
|
|
86
|
-
__exportStar(require("./tools/findservers"), exports);
|
|
87
|
-
__exportStar(require("./tools/read_history_server_capabilities"), exports);
|
|
88
|
-
__exportStar(require("./user_identity_info"), exports);
|
|
89
|
-
__exportStar(require("./verify"), exports);
|
|
72
|
+
__exportStar(require("./alarms_and_conditions/client_alarm_tools.js"), exports);
|
|
73
|
+
__exportStar(require("./alarms_and_conditions/client_tools.js"), exports);
|
|
74
|
+
__exportStar(require("./alarms_and_conditions/client_tools.js"), exports);
|
|
75
|
+
__exportStar(require("./client_base.js"), exports);
|
|
76
|
+
__exportStar(require("./client_monitored_item.js"), exports);
|
|
77
|
+
__exportStar(require("./client_monitored_item_base.js"), exports);
|
|
78
|
+
__exportStar(require("./client_monitored_item_group.js"), exports);
|
|
79
|
+
__exportStar(require("./client_session.js"), exports);
|
|
80
|
+
__exportStar(require("./client_subscription.js"), exports);
|
|
81
|
+
__exportStar(require("./client_utils.js"), exports);
|
|
82
|
+
__exportStar(require("./opcua_client.js"), exports);
|
|
83
|
+
var client_publish_engine_js_1 = require("./private/client_publish_engine.js");
|
|
84
|
+
Object.defineProperty(exports, "ClientSidePublishEngine", { enumerable: true, get: function () { return client_publish_engine_js_1.ClientSidePublishEngine; } });
|
|
85
|
+
__exportStar(require("./reverse/client_reverse_connect.js"), exports);
|
|
86
|
+
__exportStar(require("./tools/findservers.js"), exports);
|
|
87
|
+
__exportStar(require("./tools/read_history_server_capabilities.js"), exports);
|
|
88
|
+
__exportStar(require("./user_identity_info.js"), exports);
|
|
89
|
+
__exportStar(require("./verify.js"), exports);
|
|
90
90
|
const utils1 = __importStar(require("node-opcua-utils"));
|
|
91
91
|
exports.utils = utils1;
|
|
92
92
|
const crypto_util1 = __importStar(require("node-opcua-crypto/web"));
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,6DAA2C;AAC3C,uDAA2C;AAAlC,2GAAA,MAAM,OAAA;AACf,uDAAwE;AAA/D,gHAAA,WAAW,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAC5C,uEAAgH;AAAvG,qIAAA,wBAAwB,OAAA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,OAAA;AACd,uHAAA,kBAAkB,OAAA;AAClB,+GAAA,UAAU,OAAA;AACV,2GAAA,MAAM,OAAA;AAEN,kHAAA,aAAa,OAAA;AACb,+GAAA,UAAU,OAAA;AAEd,4DAA0C;AAC1C,4DAA0C;AAC1C,4DAA0C;AAC1C,0DAAwC;AACxC,+DAA6C;AAC7C,+DAA6C;AAC7C,+DAA6C;AAC7C,4DAA0C;AAC1C,6DAA2C;AAC3C,2DAAyC;AACzC,0DAAwC;AACxC,oEAAkD;AAClD,6DAA2C;AAC3C,kEAAgD;AAChD,2EAAyD;AACzD,2DAAyC;AACzC,iEAAgF;AAAxD,oHAAA,UAAU,OAAA;AAAE,qHAAA,WAAW,OAAA;AAC/C,qDAAsD;AAA7C,sHAAA,kBAAkB,OAAA;AAC3B,qDAAmC"}
|
package/dist/opcua_client.d.ts
CHANGED
|
@@ -5,10 +5,10 @@ import type { DataTypeExtractStrategy } from "node-opcua-client-dynamic-extensio
|
|
|
5
5
|
import type { ResponseCallback } from "node-opcua-pseudo-session";
|
|
6
6
|
import type { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
|
|
7
7
|
import type { CallbackT, ErrorCallback, StatusCode } from "node-opcua-status-code";
|
|
8
|
-
import type { FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseEvents, OPCUAClientBaseOptions } from "./client_base";
|
|
9
|
-
import type { ClientSession } from "./client_session";
|
|
10
|
-
import type { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription";
|
|
11
|
-
import type { UserIdentityInfo } from "./user_identity_info";
|
|
8
|
+
import type { FindServersRequestLike, GetEndpointsOptions, OPCUAClientBase, OPCUAClientBaseEvents, OPCUAClientBaseOptions } from "./client_base.js";
|
|
9
|
+
import type { ClientSession } from "./client_session.js";
|
|
10
|
+
import type { ClientSubscription, ClientSubscriptionOptions } from "./client_subscription.js";
|
|
11
|
+
import type { UserIdentityInfo } from "./user_identity_info.js";
|
|
12
12
|
export interface OPCUAClientOptions extends OPCUAClientBaseOptions {
|
|
13
13
|
/**
|
|
14
14
|
* the requested session timeout in CreateSession (ms)
|
package/dist/opcua_client.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.OPCUAClient = void 0;
|
|
7
|
-
const
|
|
7
|
+
const opcua_client_impl_js_1 = require("./private/opcua_client_impl.js");
|
|
8
8
|
/**
|
|
9
9
|
* Factory class for creating OPC UA client instances.
|
|
10
10
|
*
|
|
@@ -27,7 +27,7 @@ class OPCUAClient {
|
|
|
27
27
|
* @returns a configured OPC UA client ready to connect
|
|
28
28
|
*/
|
|
29
29
|
static create(options) {
|
|
30
|
-
return new
|
|
30
|
+
return new opcua_client_impl_js_1.OPCUAClientImpl(options);
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
33
|
* Convenience method to create a client, connect, and establish
|
|
@@ -51,13 +51,13 @@ class OPCUAClient {
|
|
|
51
51
|
* ```
|
|
52
52
|
*/
|
|
53
53
|
static async createSession(endpointUrl, userIdentity, clientOptions) {
|
|
54
|
-
return
|
|
54
|
+
return opcua_client_impl_js_1.OPCUAClientImpl.createSession(endpointUrl, userIdentity, clientOptions);
|
|
55
55
|
}
|
|
56
56
|
static set minimumRevisedSessionTimeout(minimumRevisedSessionTimeout) {
|
|
57
|
-
|
|
57
|
+
opcua_client_impl_js_1.OPCUAClientImpl.minimumRevisedSessionTimeout = minimumRevisedSessionTimeout;
|
|
58
58
|
}
|
|
59
59
|
static get minimumRevisedSessionTimeout() {
|
|
60
|
-
return
|
|
60
|
+
return opcua_client_impl_js_1.OPCUAClientImpl.minimumRevisedSessionTimeout;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
exports.OPCUAClient = OPCUAClient;
|
package/dist/opcua_client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opcua_client.js","sourceRoot":"","sources":["../source/opcua_client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAeH,
|
|
1
|
+
{"version":3,"file":"opcua_client.js","sourceRoot":"","sources":["../source/opcua_client.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAeH,yEAAiE;AA6MjE;;;;;;;;;;;;GAYG;AACH,wKAAwK;AACxK,MAAa,WAAW;IACpB;;;;;OAKG;IACI,MAAM,CAAC,MAAM,CAAC,OAA2B;QAC5C,OAAO,IAAI,sCAAe,CAAC,OAAO,CAA2B,CAAC;IAClE,CAAC;IACD;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,MAAM,CAAC,KAAK,CAAC,aAAa,CAC7B,WAAmB,EACnB,YAA+B,EAC/B,aAAkC;QAElC,OAAO,sCAAe,CAAC,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;IACnF,CAAC;IACM,MAAM,KAAK,4BAA4B,CAAC,4BAAoC;QAC/E,sCAAe,CAAC,4BAA4B,GAAG,4BAA4B,CAAC;IAChF,CAAC;IACM,MAAM,KAAK,4BAA4B;QAC1C,OAAO,sCAAe,CAAC,4BAA4B,CAAC;IACxD,CAAC;CACJ;AA5CD,kCA4CC"}
|
|
@@ -6,12 +6,12 @@ import { type ServerOnNetwork } from "node-opcua-service-discovery";
|
|
|
6
6
|
import { type ApplicationDescription, type EndpointDescription } from "node-opcua-service-endpoints";
|
|
7
7
|
import { MessageSecurityMode } from "node-opcua-service-secure-channel";
|
|
8
8
|
import { type ErrorCallback } from "node-opcua-status-code";
|
|
9
|
-
import { type CreateSecureChannelCallbackFunc, type FindServersOnNetworkRequestLike, type FindServersRequestLike, type GetEndpointsOptions, OPCUAClientBase, type OPCUAClientBaseEvents, type OPCUAClientBaseOptions } from "../client_base";
|
|
10
|
-
import type { Request, Response } from "../common";
|
|
11
|
-
import type { ClientReverseConnect, ReverseConnectExpectation } from "../reverse/client_reverse_connect";
|
|
12
|
-
import type { UserIdentityInfo } from "../user_identity_info";
|
|
13
|
-
import type { ClientSessionImpl } from "./client_session_impl";
|
|
14
|
-
import type { IClientBase } from "./i_private_client";
|
|
9
|
+
import { type CreateSecureChannelCallbackFunc, type FindServersOnNetworkRequestLike, type FindServersRequestLike, type GetEndpointsOptions, OPCUAClientBase, type OPCUAClientBaseEvents, type OPCUAClientBaseOptions } from "../client_base.js";
|
|
10
|
+
import type { Request, Response } from "../common.js";
|
|
11
|
+
import type { ClientReverseConnect, ReverseConnectExpectation } from "../reverse/client_reverse_connect.js";
|
|
12
|
+
import type { UserIdentityInfo } from "../user_identity_info.js";
|
|
13
|
+
import type { ClientSessionImpl } from "./client_session_impl.js";
|
|
14
|
+
import type { IClientBase } from "./i_private_client.js";
|
|
15
15
|
type InternalClientState = "uninitialized" | "disconnected" | "connecting" | "connected" | "panic" | "reconnecting" | "reconnecting_newchannel_connected" | "disconnecting";
|
|
16
16
|
/**
|
|
17
17
|
* @internal
|
|
@@ -27,12 +27,12 @@ const node_opcua_service_session_1 = require("node-opcua-service-session");
|
|
|
27
27
|
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
28
28
|
const node_opcua_transport_1 = require("node-opcua-transport");
|
|
29
29
|
const node_opcua_utils_1 = require("node-opcua-utils");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const debugLog = (0, node_opcua_debug_1.make_debugLog)(
|
|
33
|
-
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)(
|
|
34
|
-
const errorLog = (0, node_opcua_debug_1.make_errorLog)(
|
|
35
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)(
|
|
30
|
+
const client_base_js_1 = require("../client_base.js");
|
|
31
|
+
const verify_js_1 = require("../verify.js");
|
|
32
|
+
const debugLog = (0, node_opcua_debug_1.make_debugLog)("client_base_impl");
|
|
33
|
+
const doDebug = (0, node_opcua_debug_1.checkDebugFlag)("client_base_impl");
|
|
34
|
+
const errorLog = (0, node_opcua_debug_1.make_errorLog)("client_base_impl");
|
|
35
|
+
const warningLog = (0, node_opcua_debug_1.make_warningLog)("client_base_impl");
|
|
36
36
|
function makeCertificateThumbPrint(certificate) {
|
|
37
37
|
if (!certificate)
|
|
38
38
|
return null;
|
|
@@ -720,8 +720,11 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
720
720
|
else {
|
|
721
721
|
// Disk path — create default cert if missing
|
|
722
722
|
await this.createDefaultCertificate();
|
|
723
|
+
const hasOpaqueKey = typeof this.clientCertificateManager.isPrivateKeyOpaque ===
|
|
724
|
+
"function" &&
|
|
725
|
+
this.clientCertificateManager.isPrivateKeyOpaque();
|
|
723
726
|
// c8 ignore next
|
|
724
|
-
if (!node_fs_1.default.existsSync(this.privateKeyFile)) {
|
|
727
|
+
if (!hasOpaqueKey && !node_fs_1.default.existsSync(this.privateKeyFile)) {
|
|
725
728
|
throw new Error(` cannot locate private key file ${this.privateKeyFile}`);
|
|
726
729
|
}
|
|
727
730
|
// Resolve the (possibly passphrase-encrypted) private key once,
|
|
@@ -748,7 +751,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
748
751
|
// calls trustCertificate and verifyCertificate which each acquire
|
|
749
752
|
// withLock2 internally, so an outer withLock2 would cause a deadlock
|
|
750
753
|
// on the same file-based mutex.
|
|
751
|
-
await (0,
|
|
754
|
+
await (0, verify_js_1.performCertificateSanityCheck)(this, "client", this.clientCertificateManager, this._getBuiltApplicationUri());
|
|
752
755
|
}
|
|
753
756
|
_internalState = "uninitialized";
|
|
754
757
|
_handleUnrecoverableConnectionFailure(err, callback) {
|
|
@@ -758,7 +761,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
758
761
|
// synchronous throw out of _connectStep2 (e.g. an invalid SecureChannel config) lands here
|
|
759
762
|
// WITHOUT the error-branch unregister ever running, which would otherwise leak the client.
|
|
760
763
|
// unregister() is idempotent (a no-op when the client was never registered or already removed).
|
|
761
|
-
|
|
764
|
+
client_base_js_1.OPCUAClientBase.registry.unregister(this);
|
|
762
765
|
this.emit("connection_failed", err);
|
|
763
766
|
this._setInternalState("disconnected");
|
|
764
767
|
callback(err);
|
|
@@ -768,7 +771,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
768
771
|
doDebug && debugLog(err.message);
|
|
769
772
|
// see _handleUnrecoverableConnectionFailure: idempotent unregister guards against a leaked
|
|
770
773
|
// client when a connect attempt fails before the error-branch unregister runs.
|
|
771
|
-
|
|
774
|
+
client_base_js_1.OPCUAClientBase.registry.unregister(this);
|
|
772
775
|
this.emit("connection_failed", err);
|
|
773
776
|
this._setInternalState("disconnected");
|
|
774
777
|
callback(err);
|
|
@@ -918,7 +921,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
918
921
|
(0, node_opcua_assert_1.assert)(this._secureChannel === null);
|
|
919
922
|
this.endpointUrl = endpointUrl;
|
|
920
923
|
this._clockAdjuster = this._clockAdjuster || new ClockAdjustment();
|
|
921
|
-
|
|
924
|
+
client_base_js_1.OPCUAClientBase.registry.register(this);
|
|
922
925
|
// c8 ignore next
|
|
923
926
|
doDebug && debugLog("__connectStep2 ", this._internalState);
|
|
924
927
|
this._internal_create_secure_channel(this.connectionStrategy, (err) => {
|
|
@@ -926,7 +929,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
926
929
|
this._handleSuccessfulConnection(callback);
|
|
927
930
|
}
|
|
928
931
|
else {
|
|
929
|
-
|
|
932
|
+
client_base_js_1.OPCUAClientBase.registry.unregister(this);
|
|
930
933
|
if (this._clockAdjuster) {
|
|
931
934
|
this._clockAdjuster.dispose();
|
|
932
935
|
this._clockAdjuster = undefined;
|
|
@@ -1235,7 +1238,7 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
1235
1238
|
this._sessions = [];
|
|
1236
1239
|
}
|
|
1237
1240
|
(0, node_opcua_assert_1.assert)(this._sessions.length === 0, " attempt to disconnect a client with live sessions ");
|
|
1238
|
-
|
|
1241
|
+
client_base_js_1.OPCUAClientBase.registry.unregister(this);
|
|
1239
1242
|
if (this._clockAdjuster) {
|
|
1240
1243
|
this._clockAdjuster.dispose();
|
|
1241
1244
|
this._clockAdjuster = undefined;
|
|
@@ -1646,13 +1649,13 @@ class ClientBaseImpl extends node_opcua_common_1.OPCUASecureObject {
|
|
|
1646
1649
|
// c8 ignore next
|
|
1647
1650
|
if (doDebug) {
|
|
1648
1651
|
debugLog("Disconnected following reconnection failure", err2.message);
|
|
1649
|
-
debugLog(`I will retry OPCUA client reconnection in ${
|
|
1652
|
+
debugLog(`I will retry OPCUA client reconnection in ${client_base_js_1.OPCUAClientBase.retryDelay / 1000} seconds`);
|
|
1650
1653
|
}
|
|
1651
1654
|
this.#insideRepairConnection = false;
|
|
1652
1655
|
this.#shouldRepairAgain = false;
|
|
1653
1656
|
this._destroy_secure_channel();
|
|
1654
1657
|
// this._setInternalState("reconnecting_failed");
|
|
1655
|
-
setTimeout(() => this._repairConnection(),
|
|
1658
|
+
setTimeout(() => this._repairConnection(), client_base_js_1.OPCUAClientBase.retryDelay);
|
|
1656
1659
|
return;
|
|
1657
1660
|
}
|
|
1658
1661
|
else {
|
|
@@ -1724,7 +1727,7 @@ ClientBaseImpl.prototype.disconnect = (0, thenify_ex_1.withCallback)(ClientBaseI
|
|
|
1724
1727
|
ClientBaseImpl.prototype.getEndpoints = (0, thenify_ex_1.withCallback)(ClientBaseImpl.prototype.getEndpoints);
|
|
1725
1728
|
ClientBaseImpl.prototype.findServers = (0, thenify_ex_1.withCallback)(ClientBaseImpl.prototype.findServers);
|
|
1726
1729
|
ClientBaseImpl.prototype.findServersOnNetwork = (0, thenify_ex_1.withCallback)(ClientBaseImpl.prototype.findServersOnNetwork);
|
|
1727
|
-
|
|
1730
|
+
client_base_js_1.OPCUAClientBase.create = (options) => {
|
|
1728
1731
|
return new ClientBaseImpl(options);
|
|
1729
1732
|
};
|
|
1730
1733
|
//# sourceMappingURL=client_base_impl.js.map
|