node-opcua-client 2.183.1 → 2.184.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 -0
- package/dist/alarms_and_conditions/client_alarm_tools.d.ts.map +1 -0
- package/dist/alarms_and_conditions/client_alarm_tools.js +23 -27
- package/dist/alarms_and_conditions/client_alarm_tools.js.map +1 -1
- package/dist/alarms_and_conditions/client_tools.d.ts +1 -0
- package/dist/alarms_and_conditions/client_tools.d.ts.map +1 -0
- package/dist/alarms_and_conditions/client_tools.js +17 -19
- package/dist/alarms_and_conditions/client_tools.js.map +1 -1
- package/dist/client_base.d.ts +1 -0
- package/dist/client_base.d.ts.map +1 -0
- package/dist/client_base.js +3 -6
- package/dist/client_base.js.map +1 -1
- package/dist/client_monitored_item.d.ts +1 -0
- package/dist/client_monitored_item.d.ts.map +1 -0
- package/dist/client_monitored_item.js +4 -7
- package/dist/client_monitored_item.js.map +1 -1
- package/dist/client_monitored_item_base.d.ts +1 -0
- package/dist/client_monitored_item_base.d.ts.map +1 -0
- package/dist/client_monitored_item_base.js +1 -2
- package/dist/client_monitored_item_group.d.ts +1 -0
- package/dist/client_monitored_item_group.d.ts.map +1 -0
- package/dist/client_monitored_item_group.js +2 -5
- package/dist/client_monitored_item_group.js.map +1 -1
- package/dist/client_monitored_item_toolbox.d.ts +1 -0
- package/dist/client_monitored_item_toolbox.d.ts.map +1 -0
- package/dist/client_monitored_item_toolbox.js +21 -27
- package/dist/client_monitored_item_toolbox.js.map +1 -1
- package/dist/client_session.d.ts +2 -1
- package/dist/client_session.d.ts.map +1 -0
- package/dist/client_session.js +2 -7
- package/dist/client_session.js.map +1 -1
- package/dist/client_session_keepalive_manager.d.ts +1 -0
- package/dist/client_session_keepalive_manager.d.ts.map +1 -0
- package/dist/client_session_keepalive_manager.js +24 -31
- package/dist/client_session_keepalive_manager.js.map +1 -1
- package/dist/client_subscription.d.ts +1 -0
- package/dist/client_subscription.d.ts.map +1 -0
- package/dist/client_subscription.js +1 -5
- package/dist/client_subscription.js.map +1 -1
- package/dist/client_utils.d.ts +1 -0
- package/dist/client_utils.d.ts.map +1 -0
- package/dist/client_utils.js +7 -10
- package/dist/client_utils.js.map +1 -1
- package/dist/common.d.ts +1 -0
- package/dist/common.d.ts.map +1 -0
- package/dist/common.js +1 -2
- package/dist/common.js.map +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -118
- package/dist/index.js.map +1 -1
- package/dist/opcua_client.d.ts +1 -0
- package/dist/opcua_client.d.ts.map +1 -0
- package/dist/opcua_client.js +6 -10
- package/dist/opcua_client.js.map +1 -1
- package/dist/private/client_base_impl.d.ts +1 -0
- package/dist/private/client_base_impl.d.ts.map +1 -0
- package/dist/private/client_base_impl.js +146 -150
- package/dist/private/client_base_impl.js.map +1 -1
- package/dist/private/client_monitored_item_base_impl.d.ts +1 -0
- package/dist/private/client_monitored_item_base_impl.d.ts.map +1 -0
- package/dist/private/client_monitored_item_base_impl.js +1 -2
- package/dist/private/client_monitored_item_base_impl.js.map +1 -1
- package/dist/private/client_monitored_item_group_impl.d.ts +1 -0
- package/dist/private/client_monitored_item_group_impl.d.ts.map +1 -0
- package/dist/private/client_monitored_item_group_impl.js +31 -35
- package/dist/private/client_monitored_item_group_impl.js.map +1 -1
- package/dist/private/client_monitored_item_impl.d.ts +1 -0
- package/dist/private/client_monitored_item_impl.d.ts.map +1 -0
- package/dist/private/client_monitored_item_impl.js +41 -45
- package/dist/private/client_monitored_item_impl.js.map +1 -1
- package/dist/private/client_publish_engine.d.ts +1 -0
- package/dist/private/client_publish_engine.d.ts.map +1 -0
- package/dist/private/client_publish_engine.js +47 -54
- package/dist/private/client_publish_engine.js.map +1 -1
- package/dist/private/client_session_impl.d.ts +1 -0
- package/dist/private/client_session_impl.d.ts.map +1 -0
- package/dist/private/client_session_impl.js +231 -238
- package/dist/private/client_session_impl.js.map +1 -1
- package/dist/private/client_subscription_impl.d.ts +1 -0
- package/dist/private/client_subscription_impl.d.ts.map +1 -0
- package/dist/private/client_subscription_impl.js +93 -102
- package/dist/private/client_subscription_impl.js.map +1 -1
- package/dist/private/i_private_client.d.ts +1 -0
- package/dist/private/i_private_client.d.ts.map +1 -0
- package/dist/private/i_private_client.js +1 -2
- package/dist/private/opcua_client_impl.d.ts +1 -0
- package/dist/private/opcua_client_impl.d.ts.map +1 -0
- package/dist/private/opcua_client_impl.js +138 -145
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/private/performance.d.ts +1 -0
- package/dist/private/performance.d.ts.map +1 -0
- package/dist/private/performance.js +1 -4
- package/dist/private/performance.js.map +1 -1
- package/dist/private/reconnection/client_publish_engine_reconnection.d.ts +1 -0
- package/dist/private/reconnection/client_publish_engine_reconnection.d.ts.map +1 -0
- package/dist/private/reconnection/client_publish_engine_reconnection.js +28 -34
- package/dist/private/reconnection/client_publish_engine_reconnection.js.map +1 -1
- package/dist/private/reconnection/client_reconnection.d.ts +1 -0
- package/dist/private/reconnection/client_reconnection.d.ts.map +1 -0
- package/dist/private/reconnection/client_reconnection.js +1 -4
- package/dist/private/reconnection/client_reconnection.js.map +1 -1
- package/dist/private/reconnection/client_subscription_reconnection.d.ts +1 -0
- package/dist/private/reconnection/client_subscription_reconnection.d.ts.map +1 -0
- package/dist/private/reconnection/client_subscription_reconnection.js +25 -31
- package/dist/private/reconnection/client_subscription_reconnection.js.map +1 -1
- package/dist/private/reconnection/reconnection.d.ts +1 -0
- package/dist/private/reconnection/reconnection.d.ts.map +1 -0
- package/dist/private/reconnection/reconnection.js +50 -59
- package/dist/private/reconnection/reconnection.js.map +1 -1
- package/dist/reverse/client_reverse_connect.d.ts +1 -0
- package/dist/reverse/client_reverse_connect.d.ts.map +1 -0
- package/dist/reverse/client_reverse_connect.js +20 -24
- package/dist/reverse/client_reverse_connect.js.map +1 -1
- package/dist/tools/findservers.d.ts +1 -0
- package/dist/tools/findservers.d.ts.map +1 -0
- package/dist/tools/findservers.js +7 -13
- package/dist/tools/findservers.js.map +1 -1
- package/dist/tools/read_history_server_capabilities.d.ts +1 -0
- package/dist/tools/read_history_server_capabilities.d.ts.map +1 -0
- package/dist/tools/read_history_server_capabilities.js +13 -16
- package/dist/tools/read_history_server_capabilities.js.map +1 -1
- package/dist/user_identity_info.d.ts +2 -1
- package/dist/user_identity_info.d.ts.map +1 -0
- package/dist/user_identity_info.js +1 -2
- package/dist/verify.d.ts +1 -0
- package/dist/verify.d.ts.map +1 -0
- package/dist/verify.js +15 -19
- package/dist/verify.js.map +1 -1
- package/package.json +48 -47
- package/source/alarms_and_conditions/client_alarm_tools.ts +1 -1
- package/source/client_monitored_item_toolbox.ts +1 -1
- package/source/client_session.ts +1 -1
- package/source/index.ts +5 -3
- package/source/private/client_base_impl.ts +5 -2
- package/source/private/client_publish_engine.ts +16 -16
- package/source/private/client_subscription_impl.ts +1 -1
- package/source/private/opcua_client_impl.ts +4 -4
- package/source/private/reconnection/client_publish_engine_reconnection.ts +7 -7
- package/source/private/reconnection/client_subscription_reconnection.ts +5 -5
- package/source/private/reconnection/reconnection.ts +3 -3
- package/source/reverse/client_reverse_connect.ts +1 -1
- package/source/user_identity_info.ts +1 -1
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
/**
|
|
3
2
|
* @module node-opcua-client
|
|
4
3
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.findServersOnNetworkAsync = findServersOnNetworkAsync;
|
|
9
|
-
exports.findServersOnNetwork = findServersOnNetwork;
|
|
10
|
-
const client_base_impl_js_1 = require("../private/client_base_impl.js");
|
|
11
|
-
async function findServersAsync(discoveryServerEndpointUri) {
|
|
12
|
-
const client = new client_base_impl_js_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
|
|
4
|
+
import { ClientBaseImpl } from "../private/client_base_impl.js";
|
|
5
|
+
export async function findServersAsync(discoveryServerEndpointUri) {
|
|
6
|
+
const client = new ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
|
|
13
7
|
try {
|
|
14
8
|
await client.connect(discoveryServerEndpointUri);
|
|
15
9
|
const servers = await client.findServers();
|
|
@@ -20,7 +14,7 @@ async function findServersAsync(discoveryServerEndpointUri) {
|
|
|
20
14
|
await client.disconnect();
|
|
21
15
|
}
|
|
22
16
|
}
|
|
23
|
-
function findServers(discoveryServerEndpointUri, callback) {
|
|
17
|
+
export function findServers(discoveryServerEndpointUri, callback) {
|
|
24
18
|
if (!callback) {
|
|
25
19
|
return findServersAsync(discoveryServerEndpointUri);
|
|
26
20
|
}
|
|
@@ -29,8 +23,8 @@ function findServers(discoveryServerEndpointUri, callback) {
|
|
|
29
23
|
.catch((err) => callback(err));
|
|
30
24
|
return undefined;
|
|
31
25
|
}
|
|
32
|
-
async function findServersOnNetworkAsync(discoveryServerEndpointUri) {
|
|
33
|
-
const client = new
|
|
26
|
+
export async function findServersOnNetworkAsync(discoveryServerEndpointUri) {
|
|
27
|
+
const client = new ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
|
|
34
28
|
try {
|
|
35
29
|
await client.connect(discoveryServerEndpointUri);
|
|
36
30
|
const servers = await client.findServersOnNetwork();
|
|
@@ -40,7 +34,7 @@ async function findServersOnNetworkAsync(discoveryServerEndpointUri) {
|
|
|
40
34
|
await client.disconnect();
|
|
41
35
|
}
|
|
42
36
|
}
|
|
43
|
-
function findServersOnNetwork(discoveryServerEndpointUri, callback) {
|
|
37
|
+
export function findServersOnNetwork(discoveryServerEndpointUri, callback) {
|
|
44
38
|
if (!callback) {
|
|
45
39
|
return findServersOnNetworkAsync(discoveryServerEndpointUri);
|
|
46
40
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"findservers.js","sourceRoot":"","sources":["../../source/tools/findservers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"findservers.js","sourceRoot":"","sources":["../../source/tools/findservers.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AA0B,CAAC,CAAC;QACjD,MAAM,OAAO,GAAG,MAAM,MAAM,CAAC,oBAAoB,EAAE,CAAC;QACpD,OAAO,OAAO,CAAC;IACnB,CAAC;YAAS,CAAC;QACP,MAAM,MAAM,CAAC,UAAU,EAAE,CAAC;IAC9B,CAAC;AACL,CAAC;AAUD,MAAM,UAAU,oBAAoB,CAChC,0BAAkC,EAClC,QAAmE;IAEnE,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,CAAC;IACjE,CAAC;IACD,yBAAyB,CAAC,0BAA0B,CAAC;SAChD,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SAC1C,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACnC,OAAO,SAAS,CAAC;AACrB,CAAC"}
|
|
@@ -5,3 +5,4 @@ export interface HistoryServerCapabilities {
|
|
|
5
5
|
}
|
|
6
6
|
export declare function readHistoryServerCapabilities(session: ClientSession): Promise<HistoryServerCapabilities>;
|
|
7
7
|
export declare function readHistoryServerCapabilities(session: ClientSession, callback: (err: Error | null, capabilities?: HistoryServerCapabilities) => void): void;
|
|
8
|
+
//# sourceMappingURL=read_history_server_capabilities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"read_history_server_capabilities.d.ts","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACtC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;AAC1G,wBAAgB,6BAA6B,CACzC,OAAO,EAAE,aAAa,EACtB,QAAQ,EAAE,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,EAAE,YAAY,CAAC,EAAE,yBAAyB,KAAK,IAAI,GAChF,IAAI,CAAC"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readHistoryServerCapabilities = readHistoryServerCapabilities;
|
|
4
1
|
/**
|
|
5
2
|
* @module node-opcua-client
|
|
6
3
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function readHistoryServerCapabilities(session, callback) {
|
|
4
|
+
import { assert } from "node-opcua-assert";
|
|
5
|
+
import { ObjectIds } from "node-opcua-constants";
|
|
6
|
+
import { AttributeIds } from "node-opcua-data-model";
|
|
7
|
+
import { NodeId } from "node-opcua-nodeid";
|
|
8
|
+
import { makeBrowsePath } from "node-opcua-service-translate-browse-path";
|
|
9
|
+
import { lowerFirstLetter } from "node-opcua-utils";
|
|
10
|
+
export function readHistoryServerCapabilities(session, callback) {
|
|
14
11
|
if (!callback) {
|
|
15
12
|
return new Promise((resolve, reject) => {
|
|
16
13
|
readHistoryServerCapabilities(session, (err, capabilities) => {
|
|
@@ -25,7 +22,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
25
22
|
});
|
|
26
23
|
}
|
|
27
24
|
// display HistoryCapabilities of server
|
|
28
|
-
const browsePath =
|
|
25
|
+
const browsePath = makeBrowsePath(ObjectIds.ObjectsFolder, "/Server/ServerCapabilities.HistoryServerCapabilities");
|
|
29
26
|
return session.translateBrowsePath(browsePath, (err, result) => {
|
|
30
27
|
if (err) {
|
|
31
28
|
return callback(err);
|
|
@@ -40,7 +37,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
40
37
|
result.targets = result.targets || [];
|
|
41
38
|
const historyServerCapabilitiesNodeId = result.targets[0].targetId;
|
|
42
39
|
// (should be ns=0;i=11192)
|
|
43
|
-
|
|
40
|
+
assert(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
|
|
44
41
|
// -------------------------
|
|
45
42
|
const properties = [
|
|
46
43
|
"AccessHistoryDataCapability",
|
|
@@ -67,7 +64,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
67
64
|
"AggregateFunctions/DurationStateNonZero"
|
|
68
65
|
// etc....
|
|
69
66
|
];
|
|
70
|
-
const browsePaths = properties.map((prop) =>
|
|
67
|
+
const browsePaths = properties.map((prop) => makeBrowsePath(historyServerCapabilitiesNodeId, `.${prop}`));
|
|
71
68
|
session.translateBrowsePath(browsePaths, (innerErr, results) => {
|
|
72
69
|
if (innerErr) {
|
|
73
70
|
return callback(innerErr);
|
|
@@ -76,9 +73,9 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
76
73
|
if (!results) {
|
|
77
74
|
return callback(new Error("Internal Error"));
|
|
78
75
|
}
|
|
79
|
-
const nodeIds = results.map((innerResult) => innerResult.statusCode.isGood() && innerResult.targets ? innerResult.targets[0].targetId : new
|
|
76
|
+
const nodeIds = results.map((innerResult) => innerResult.statusCode.isGood() && innerResult.targets ? innerResult.targets[0].targetId : new NodeId());
|
|
80
77
|
const nodesToRead = nodeIds.map((nodeId) => ({
|
|
81
|
-
attributeId:
|
|
78
|
+
attributeId: AttributeIds.Value,
|
|
82
79
|
nodeId /*: coerceNodeId(nodeId)*/
|
|
83
80
|
}));
|
|
84
81
|
const data = {};
|
|
@@ -91,7 +88,7 @@ function readHistoryServerCapabilities(session, callback) {
|
|
|
91
88
|
return callback(new Error("Internal Error"));
|
|
92
89
|
}
|
|
93
90
|
for (let i = 0; i < dataValues.length; i++) {
|
|
94
|
-
const propName =
|
|
91
|
+
const propName = lowerFirstLetter(properties[i]);
|
|
95
92
|
data[propName] = dataValues[i].value;
|
|
96
93
|
}
|
|
97
94
|
callback(null, data);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"read_history_server_capabilities.js","sourceRoot":"","sources":["../../source/tools/read_history_server_capabilities.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAA0C,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAcpD,MAAM,UAAU,6BAA6B,CACzC,OAAsB,EACtB,QAAgF;IAEhF,IAAI,CAAC,QAAQ,EAAE,CAAC;QACZ,OAAO,IAAI,OAAO,CAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC9D,6BAA6B,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE;gBACzD,IAAI,GAAG,EAAE,CAAC;oBACN,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;gBACvB,CAAC;gBACD,IAAI,CAAC,YAAY,EAAE,CAAC;oBAChB,OAAO,MAAM,CAAC,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC,CAAC;gBAChG,CAAC;gBACD,OAAO,CAAC,YAAY,CAAC,CAAC;YAC1B,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACD,wCAAwC;IACxC,MAAM,UAAU,GAAe,cAAc,CAAC,SAAS,CAAC,aAAa,EAAE,sDAAsD,CAAC,CAAC;IAE/H,OAAO,OAAO,CAAC,mBAAmB,CAAC,UAAU,EAAE,CAAC,G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IAAI,CAAC,QAAQ,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,KAAgB,CAAC;gBACpD,CAAC;gBACD,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YACzB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export { AnonymousIdentity, UserIdentityInfo, UserIdentityInfoUserName, UserIdentityInfoX509 } from "node-opcua-pseudo-session";
|
|
1
|
+
export type { AnonymousIdentity, UserIdentityInfo, UserIdentityInfoUserName, UserIdentityInfoX509 } from "node-opcua-pseudo-session";
|
|
2
|
+
//# sourceMappingURL=user_identity_info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"user_identity_info.d.ts","sourceRoot":"","sources":["../source/user_identity_info.ts"],"names":[],"mappings":"AAAA,YAAY,EACR,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,oBAAoB,EACvB,MAAM,2BAA2B,CAAC"}
|
package/dist/verify.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import type { ICertificateStore, OPCUASecureObject } from "node-opcua-common";
|
|
|
2
2
|
import { type Certificate } from "node-opcua-crypto/web";
|
|
3
3
|
export declare function verifyIsOPCUAValidCertificate(certificate: Certificate, certificateFile: string, type: "client" | "server", applicationUri: string): void;
|
|
4
4
|
export declare function performCertificateSanityCheck(secureObject: OPCUASecureObject, serverOrClient: "server" | "client", certificateStore: ICertificateStore, applicationUri: string): Promise<void>;
|
|
5
|
+
//# sourceMappingURL=verify.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAG9E,OAAO,EACH,KAAK,WAAW,EAMnB,MAAM,uBAAuB,CAAC;AAqC/B,wBAAgB,6BAA6B,CACzC,WAAW,EAAE,WAAW,EACxB,eAAe,EAAE,MAAM,EACvB,IAAI,EAAE,QAAQ,GAAG,QAAQ,EACzB,cAAc,EAAE,MAAM,GACvB,IAAI,CAiGN;AAED,wBAAsB,6BAA6B,CAC/C,YAAY,EAAE,iBAAiB,EAC/B,cAAc,EAAE,QAAQ,GAAG,QAAQ,EACnC,gBAAgB,EAAE,iBAAiB,EACnC,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,IAAI,CAAC,CAqDf"}
|
package/dist/verify.js
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const _doDebug = (0, node_opcua_debug_1.checkDebugFlag)("verify");
|
|
10
|
-
const _debugLog = (0, node_opcua_debug_1.make_debugLog)("verify");
|
|
11
|
-
const errorLog = (0, node_opcua_debug_1.make_errorLog)("verify");
|
|
12
|
-
const warningLog = (0, node_opcua_debug_1.make_warningLog)("verify");
|
|
1
|
+
import { createPublicKey } from "node:crypto";
|
|
2
|
+
import { PrivateKeyUnavailableError } from "node-opcua-crypto";
|
|
3
|
+
import { exploreCertificate, explorePrivateKey, extractPublicKeyFromCertificateSync, publicKeyAndPrivateKeyMatches } from "node-opcua-crypto/web";
|
|
4
|
+
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
5
|
+
const _doDebug = checkDebugFlag("verify");
|
|
6
|
+
const _debugLog = make_debugLog("verify");
|
|
7
|
+
const errorLog = make_errorLog("verify");
|
|
8
|
+
const warningLog = make_warningLog("verify");
|
|
13
9
|
/**
|
|
14
10
|
* The opaque-key variant of the certificate/key match check: compares the
|
|
15
11
|
* certificate's SPKI against the one the key-operations provider reports.
|
|
@@ -24,7 +20,7 @@ async function verifyOpaqueKeyMatchesCertificate(secureObject, certificate) {
|
|
|
24
20
|
return;
|
|
25
21
|
}
|
|
26
22
|
const providerSpki = Buffer.from(await keyOperations.getPublicKey());
|
|
27
|
-
const certificateSpki =
|
|
23
|
+
const certificateSpki = createPublicKey(extractPublicKeyFromCertificateSync(certificate)).export({
|
|
28
24
|
type: "spki",
|
|
29
25
|
format: "der"
|
|
30
26
|
});
|
|
@@ -34,8 +30,8 @@ async function verifyOpaqueKeyMatchesCertificate(secureObject, certificate) {
|
|
|
34
30
|
throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate does not carry the key-operations provider's public key ! please fix your configuration");
|
|
35
31
|
}
|
|
36
32
|
}
|
|
37
|
-
function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, applicationUri) {
|
|
38
|
-
const certificateInfo =
|
|
33
|
+
export function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, applicationUri) {
|
|
34
|
+
const certificateInfo = exploreCertificate(certificate);
|
|
39
35
|
const now = new Date();
|
|
40
36
|
if (certificateInfo.tbsCertificate.validity.notBefore.getTime() > now.getTime()) {
|
|
41
37
|
// check that certificate is active
|
|
@@ -117,7 +113,7 @@ function verifyIsOPCUAValidCertificate(certificate, certificateFile, type, appli
|
|
|
117
113
|
`certificateFile = ${certificateFile}`);
|
|
118
114
|
}
|
|
119
115
|
}
|
|
120
|
-
async function performCertificateSanityCheck(secureObject, serverOrClient, certificateStore, applicationUri) {
|
|
116
|
+
export async function performCertificateSanityCheck(secureObject, serverOrClient, certificateStore, applicationUri) {
|
|
121
117
|
// verify that certificate is matching private key, and inform the developer if not
|
|
122
118
|
const certificate = secureObject.getCertificate();
|
|
123
119
|
let privateKey;
|
|
@@ -125,7 +121,7 @@ async function performCertificateSanityCheck(secureObject, serverOrClient, certi
|
|
|
125
121
|
privateKey = secureObject.getPrivateKey();
|
|
126
122
|
}
|
|
127
123
|
catch (err) {
|
|
128
|
-
if (!(err instanceof
|
|
124
|
+
if (!(err instanceof PrivateKeyUnavailableError)) {
|
|
129
125
|
throw err;
|
|
130
126
|
}
|
|
131
127
|
// The key is opaque (HSM/KMS-held): no material to compare or
|
|
@@ -135,7 +131,7 @@ async function performCertificateSanityCheck(secureObject, serverOrClient, certi
|
|
|
135
131
|
await verifyOpaqueKeyMatchesCertificate(secureObject, certificate);
|
|
136
132
|
}
|
|
137
133
|
if (privateKey) {
|
|
138
|
-
if (!
|
|
134
|
+
if (!publicKeyAndPrivateKeyMatches(certificate, privateKey)) {
|
|
139
135
|
errorLog("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match !");
|
|
140
136
|
errorLog(" please check the configuration of the OPCUA Server");
|
|
141
137
|
errorLog(" privateKey= ", secureObject.privateKeyFile);
|
|
@@ -143,7 +139,7 @@ async function performCertificateSanityCheck(secureObject, serverOrClient, certi
|
|
|
143
139
|
throw new Error("[NODE-OPCUA-E01] Configuration error : the certificate and the private key do not match ! please fix your configuration");
|
|
144
140
|
}
|
|
145
141
|
// verify that the certificate provided has the right key length ( at least 2048)
|
|
146
|
-
const privateKeyInfo =
|
|
142
|
+
const privateKeyInfo = explorePrivateKey(privateKey);
|
|
147
143
|
const keyLengthInBits = privateKeyInfo.modulus.length * 8;
|
|
148
144
|
if (keyLengthInBits <= 1024) {
|
|
149
145
|
warningLog(`[NODE-OPCUA-W04] The public/private key pair uses a key length which is equal or lower than 1024 bits. ( key length was ${keyLengthInBits} )\n` +
|
package/dist/verify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../source/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAEH,kBAAkB,EAClB,iBAAiB,EACjB,mCAAmC,EAEnC,6BAA6B,EAChC,MAAM,uB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C,kCAAkC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;YAC1E,QAAQ,CAAC,kCAAkC,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;YAC3E,MAAM,IAAI,KAAK,CACX,yHAAyH,CAC5H,CAAC;QACN,CAAC;QACD,iFAAiF;QACjF,MAAM,cAAc,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QACrD,MAAM,eAAe,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;QAC1D,IAAI,eAAe,IAAI,IAAI,EAAE,CAAC;YAC1B,UAAU,CACN,2HAA2H,eAAe,MAAM;gBAC5I,2FAA2F;gBAC3F,OAAO,cAAc,qEAAqE,CACjG,CAAC;QACN,CAAC;IACL,CAAC;IAED,MAAM,OAAO,GAAG;QACZ,yBAAyB,EAAE,KAAK;KACnC,CAAC;IAEF,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAE9E,gEAAgE;IAChE,8DAA8D;IAC9D,2DAA2D;IAC3D,qCAAqC;IACrC,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,yBAAyB,EAAE,CAAC;QAC5D,UAAU,CAAC,wDAAwD,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,CAAC,eAAe,CAAC,CAAC;IAC3H,CAAC;IAED,6BAA6B,CAAC,WAAW,EAAE,YAAY,CAAC,eAAe,EAAE,cAAc,EAAE,cAAc,CAAC,CAAC;AAC7G,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-client",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.184.0",
|
|
4
5
|
"description": "pure nodejs OPCUA SDK - module client",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"clean": "npx rimraf -g node_modules dist *.tsbuildinfo certificates",
|
|
@@ -19,57 +20,57 @@
|
|
|
19
20
|
"dependencies": {
|
|
20
21
|
"@ster5/global-mutex": "^3.3.0",
|
|
21
22
|
"chalk": "4.1.2",
|
|
22
|
-
"node-opcua-alarm-condition": "2.
|
|
23
|
-
"node-opcua-assert": "2.
|
|
24
|
-
"node-opcua-basic-types": "2.
|
|
25
|
-
"node-opcua-buffer-utils": "2.
|
|
26
|
-
"node-opcua-certificate-manager": "2.
|
|
27
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
28
|
-
"node-opcua-common": "2.
|
|
29
|
-
"node-opcua-constants": "2.
|
|
23
|
+
"node-opcua-alarm-condition": "2.184.0",
|
|
24
|
+
"node-opcua-assert": "2.184.0",
|
|
25
|
+
"node-opcua-basic-types": "2.184.0",
|
|
26
|
+
"node-opcua-buffer-utils": "2.184.0",
|
|
27
|
+
"node-opcua-certificate-manager": "2.184.0",
|
|
28
|
+
"node-opcua-client-dynamic-extension-object": "2.184.0",
|
|
29
|
+
"node-opcua-common": "2.184.0",
|
|
30
|
+
"node-opcua-constants": "2.184.0",
|
|
30
31
|
"node-opcua-crypto": "5.10.1",
|
|
31
|
-
"node-opcua-data-model": "2.
|
|
32
|
-
"node-opcua-data-value": "2.
|
|
33
|
-
"node-opcua-date-time": "2.
|
|
34
|
-
"node-opcua-debug": "2.
|
|
35
|
-
"node-opcua-extension-object": "2.
|
|
36
|
-
"node-opcua-hostname": "2.
|
|
37
|
-
"node-opcua-nodeid": "2.
|
|
38
|
-
"node-opcua-numeric-range": "2.
|
|
39
|
-
"node-opcua-object-registry": "2.
|
|
32
|
+
"node-opcua-data-model": "2.184.0",
|
|
33
|
+
"node-opcua-data-value": "2.184.0",
|
|
34
|
+
"node-opcua-date-time": "2.184.0",
|
|
35
|
+
"node-opcua-debug": "2.184.0",
|
|
36
|
+
"node-opcua-extension-object": "2.184.0",
|
|
37
|
+
"node-opcua-hostname": "2.184.0",
|
|
38
|
+
"node-opcua-nodeid": "2.184.0",
|
|
39
|
+
"node-opcua-numeric-range": "2.184.0",
|
|
40
|
+
"node-opcua-object-registry": "2.184.0",
|
|
40
41
|
"node-opcua-pki": "6.22.0",
|
|
41
|
-
"node-opcua-pseudo-session": "2.
|
|
42
|
-
"node-opcua-schemas": "2.
|
|
43
|
-
"node-opcua-secure-channel": "2.
|
|
44
|
-
"node-opcua-service-browse": "2.
|
|
45
|
-
"node-opcua-service-call": "2.
|
|
46
|
-
"node-opcua-service-discovery": "2.
|
|
47
|
-
"node-opcua-service-endpoints": "2.
|
|
48
|
-
"node-opcua-service-filter": "2.
|
|
49
|
-
"node-opcua-service-history": "2.
|
|
50
|
-
"node-opcua-service-query": "2.
|
|
51
|
-
"node-opcua-service-read": "2.
|
|
52
|
-
"node-opcua-service-register-node": "2.
|
|
53
|
-
"node-opcua-service-secure-channel": "2.
|
|
54
|
-
"node-opcua-service-session": "2.
|
|
55
|
-
"node-opcua-service-subscription": "2.
|
|
56
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
57
|
-
"node-opcua-service-write": "2.
|
|
58
|
-
"node-opcua-status-code": "2.
|
|
59
|
-
"node-opcua-transport": "2.
|
|
60
|
-
"node-opcua-types": "2.
|
|
61
|
-
"node-opcua-utils": "2.
|
|
62
|
-
"node-opcua-variant": "2.
|
|
42
|
+
"node-opcua-pseudo-session": "2.184.0",
|
|
43
|
+
"node-opcua-schemas": "2.184.0",
|
|
44
|
+
"node-opcua-secure-channel": "2.184.0",
|
|
45
|
+
"node-opcua-service-browse": "2.184.0",
|
|
46
|
+
"node-opcua-service-call": "2.184.0",
|
|
47
|
+
"node-opcua-service-discovery": "2.184.0",
|
|
48
|
+
"node-opcua-service-endpoints": "2.184.0",
|
|
49
|
+
"node-opcua-service-filter": "2.184.0",
|
|
50
|
+
"node-opcua-service-history": "2.184.0",
|
|
51
|
+
"node-opcua-service-query": "2.184.0",
|
|
52
|
+
"node-opcua-service-read": "2.184.0",
|
|
53
|
+
"node-opcua-service-register-node": "2.184.0",
|
|
54
|
+
"node-opcua-service-secure-channel": "2.184.0",
|
|
55
|
+
"node-opcua-service-session": "2.184.0",
|
|
56
|
+
"node-opcua-service-subscription": "2.184.0",
|
|
57
|
+
"node-opcua-service-translate-browse-path": "2.184.0",
|
|
58
|
+
"node-opcua-service-write": "2.184.0",
|
|
59
|
+
"node-opcua-status-code": "2.184.0",
|
|
60
|
+
"node-opcua-transport": "2.184.0",
|
|
61
|
+
"node-opcua-types": "2.184.0",
|
|
62
|
+
"node-opcua-utils": "2.184.0",
|
|
63
|
+
"node-opcua-variant": "2.184.0",
|
|
63
64
|
"thenify-ex": "4.4.0"
|
|
64
65
|
},
|
|
65
66
|
"devDependencies": {
|
|
66
67
|
"dequeue": "^1.0.5",
|
|
67
|
-
"node-opcua-address-space": "2.
|
|
68
|
-
"node-opcua-binary-stream": "2.
|
|
69
|
-
"node-opcua-factory": "2.
|
|
70
|
-
"node-opcua-leak-detector": "2.
|
|
71
|
-
"node-opcua-nodesets": "2.
|
|
72
|
-
"node-opcua-test-helpers": "2.
|
|
68
|
+
"node-opcua-address-space": "2.184.0",
|
|
69
|
+
"node-opcua-binary-stream": "2.184.0",
|
|
70
|
+
"node-opcua-factory": "2.184.0",
|
|
71
|
+
"node-opcua-leak-detector": "2.184.0",
|
|
72
|
+
"node-opcua-nodesets": "2.184.0",
|
|
73
|
+
"node-opcua-test-helpers": "2.184.0"
|
|
73
74
|
},
|
|
74
75
|
"eslintConfig": {
|
|
75
76
|
"env": {
|
|
@@ -91,7 +92,7 @@
|
|
|
91
92
|
"internet of things"
|
|
92
93
|
],
|
|
93
94
|
"homepage": "http://node-opcua.github.io/",
|
|
94
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "441a5c63e3a4202eb8de8597acac77a3a49248b7",
|
|
95
96
|
"files": [
|
|
96
97
|
"dist",
|
|
97
98
|
"source"
|
|
@@ -116,7 +116,7 @@ export async function installAlarmMonitoring(session: ClientSession): Promise<Cl
|
|
|
116
116
|
const pojo = fieldsToJson(fields, eventFields);
|
|
117
117
|
const { eventType, eventId, conditionId, conditionName } = pojo;
|
|
118
118
|
|
|
119
|
-
|
|
119
|
+
/* c8 ignore next */
|
|
120
120
|
doDebug &&
|
|
121
121
|
debugLog(
|
|
122
122
|
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ---- ALARM RECEIVED " +
|
|
@@ -85,7 +85,7 @@ export namespace ClientMonitoredItemToolbox {
|
|
|
85
85
|
session.createMonitoredItems(createMonitorItemsRequest, (err?: Error | null, response?: CreateMonitoredItemsResponse) => {
|
|
86
86
|
/* c8 ignore next */
|
|
87
87
|
if (err) {
|
|
88
|
-
|
|
88
|
+
/* c8 ignore next */
|
|
89
89
|
doDebug &&
|
|
90
90
|
debugLog(chalk.red("ClientMonitoredItemBase#_toolbox_monitor: ERROR in createMonitoredItems ", err.message));
|
|
91
91
|
} else {
|
package/source/client_session.ts
CHANGED
|
@@ -66,7 +66,7 @@ import type { DataType, Variant } from "node-opcua-variant";
|
|
|
66
66
|
export { ExtraDataTypeManager } from "node-opcua-client-dynamic-extension-object";
|
|
67
67
|
|
|
68
68
|
export { ExtensionObject } from "node-opcua-extension-object";
|
|
69
|
-
export { ArgumentDefinition, CallMethodRequestLike, MethodId } from "node-opcua-pseudo-session";
|
|
69
|
+
export type { ArgumentDefinition, CallMethodRequestLike, MethodId } from "node-opcua-pseudo-session";
|
|
70
70
|
|
|
71
71
|
import type { ClientSubscription } from "./client_subscription.js";
|
|
72
72
|
|
package/source/index.ts
CHANGED
|
@@ -24,7 +24,8 @@
|
|
|
24
24
|
export * from "node-opcua-alarm-condition";
|
|
25
25
|
export { assert } from "node-opcua-assert";
|
|
26
26
|
export { ServerState, ServiceCounterDataType } from "node-opcua-common";
|
|
27
|
-
export {
|
|
27
|
+
export type { ConnectionStrategyOptions } from "node-opcua-secure-channel";
|
|
28
|
+
export { ClientSecureChannelLayer, SecurityPolicy } from "node-opcua-secure-channel";
|
|
28
29
|
export * from "node-opcua-utils";
|
|
29
30
|
export * from "./alarms_and_conditions/client_alarm_tools.js";
|
|
30
31
|
export * from "./alarms_and_conditions/client_tools.js";
|
|
@@ -66,6 +67,7 @@ export {
|
|
|
66
67
|
setLogLevel,
|
|
67
68
|
setWarningLogger
|
|
68
69
|
} from "node-opcua-debug";
|
|
70
|
+
export type { NodeIdLike } from "node-opcua-nodeid";
|
|
69
71
|
///
|
|
70
72
|
export {
|
|
71
73
|
coerceExpandedNodeId,
|
|
@@ -74,7 +76,6 @@ export {
|
|
|
74
76
|
makeExpandedNodeId,
|
|
75
77
|
makeNodeId,
|
|
76
78
|
NodeId,
|
|
77
|
-
NodeIdLike,
|
|
78
79
|
resolveNodeId,
|
|
79
80
|
sameNodeId
|
|
80
81
|
} from "node-opcua-nodeid";
|
|
@@ -94,6 +95,7 @@ export * from "node-opcua-service-session";
|
|
|
94
95
|
export * from "node-opcua-service-subscription";
|
|
95
96
|
export * from "node-opcua-service-translate-browse-path";
|
|
96
97
|
export * from "node-opcua-service-write";
|
|
97
|
-
export { ErrorCallback
|
|
98
|
+
export type { ErrorCallback } from "node-opcua-status-code";
|
|
99
|
+
export { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
98
100
|
export { DataTypeDefinition } from "node-opcua-types";
|
|
99
101
|
export * from "node-opcua-variant";
|
|
@@ -161,7 +161,7 @@ function __findEndpoint(this: ClientBaseImpl, endpointUrl: string, params: FindE
|
|
|
161
161
|
client.on("backoff", handler as unknown as (retryCount: number, delay: number) => void);
|
|
162
162
|
});
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
/* c8 ignore next */
|
|
165
165
|
if (doDebug) {
|
|
166
166
|
client.on("backoff", (retryCount: number, delay: number) => {
|
|
167
167
|
debugLog(
|
|
@@ -1722,7 +1722,10 @@ export class ClientBaseImpl<Events extends OPCUAClientBaseEvents = OPCUAClientBa
|
|
|
1722
1722
|
|
|
1723
1723
|
clientCertificateManager: this.clientCertificateManager
|
|
1724
1724
|
};
|
|
1725
|
-
|
|
1725
|
+
// through unknown: see the note in base_server.ts, `this` is ClientBaseImpl<Events> and
|
|
1726
|
+
// Events could be a narrower subtype than the helper's parameter declares.
|
|
1727
|
+
const self = this as unknown as ClientBaseImpl;
|
|
1728
|
+
__findEndpoint.call(self, discoveryUrl, params, (err: Error | null, result?: FindEndpointResult) => {
|
|
1726
1729
|
if (err) {
|
|
1727
1730
|
callback(err);
|
|
1728
1731
|
return;
|