node-opcua-client 2.97.0 → 2.98.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +49 -49
  2. package/dist/alarms_and_conditions/client_alarm.js +109 -109
  3. package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -25
  4. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  5. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  6. package/dist/alarms_and_conditions/client_alarm_tools.js +156 -156
  7. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  8. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +192 -192
  9. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  10. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +72 -72
  11. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
  12. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -3
  13. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +118 -118
  14. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  15. package/dist/alarms_and_conditions/client_tools.js +179 -179
  16. package/dist/client_base.d.ts +277 -277
  17. package/dist/client_base.js +14 -14
  18. package/dist/client_base.js.map +1 -1
  19. package/dist/client_monitored_item.d.ts +21 -21
  20. package/dist/client_monitored_item.js +11 -11
  21. package/dist/client_monitored_item_base.d.ts +39 -39
  22. package/dist/client_monitored_item_base.js +2 -2
  23. package/dist/client_monitored_item_group.d.ts +21 -21
  24. package/dist/client_monitored_item_group.js +13 -13
  25. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  26. package/dist/client_monitored_item_toolbox.js +116 -116
  27. package/dist/client_session.d.ts +529 -529
  28. package/dist/client_session.js +10 -10
  29. package/dist/client_session_keepalive_manager.d.ts +34 -34
  30. package/dist/client_session_keepalive_manager.js +149 -149
  31. package/dist/client_subscription.d.ts +241 -241
  32. package/dist/client_subscription.js +14 -14
  33. package/dist/client_subscription.js.map +1 -1
  34. package/dist/client_utils.d.ts +22 -22
  35. package/dist/client_utils.js +87 -87
  36. package/dist/common.d.ts +17 -17
  37. package/dist/common.js +5 -5
  38. package/dist/index.d.ts +56 -56
  39. package/dist/index.js +94 -94
  40. package/dist/opcua_client.d.ts +118 -118
  41. package/dist/opcua_client.js +33 -33
  42. package/dist/private/client_base_impl.d.ts +160 -160
  43. package/dist/private/client_base_impl.js +1348 -1348
  44. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  45. package/dist/private/client_monitored_item_base_impl.js +4 -4
  46. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  47. package/dist/private/client_monitored_item_group_impl.js +159 -159
  48. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  49. package/dist/private/client_monitored_item_impl.js +304 -304
  50. package/dist/private/client_publish_engine.d.ts +62 -62
  51. package/dist/private/client_publish_engine.js +408 -408
  52. package/dist/private/client_publish_engine.js.map +1 -1
  53. package/dist/private/client_session_impl.d.ts +631 -631
  54. package/dist/private/client_session_impl.js +1348 -1348
  55. package/dist/private/client_subscription_impl.d.ts +93 -93
  56. package/dist/private/client_subscription_impl.js +763 -763
  57. package/dist/private/i_private_client.d.ts +21 -21
  58. package/dist/private/i_private_client.js +2 -2
  59. package/dist/private/opcua_client_impl.d.ts +166 -166
  60. package/dist/private/opcua_client_impl.js +1000 -1000
  61. package/dist/private/opcua_client_impl.js.map +1 -1
  62. package/dist/private/performance.d.ts +1 -1
  63. package/dist/private/performance.js +18 -18
  64. package/dist/reconnection.d.ts +9 -9
  65. package/dist/reconnection.js +381 -381
  66. package/dist/tools/findservers.d.ts +20 -20
  67. package/dist/tools/findservers.js +61 -61
  68. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  69. package/dist/tools/read_history_server_capabilities.js +98 -98
  70. package/dist/user_identity_info.d.ts +1 -1
  71. package/dist/user_identity_info.js +2 -2
  72. package/dist/verify.d.ts +5 -5
  73. package/dist/verify.js +134 -134
  74. package/package.json +49 -45
  75. package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +1 -1
  76. package/.nycrc.json +0 -14
  77. package/test_helpers/create_certificates.js +0 -1
  78. package/typedoc.js +0 -20
@@ -1,20 +1,20 @@
1
- import { ServerOnNetwork } from "node-opcua-service-discovery";
2
- import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
3
- export interface FindServerResults {
4
- servers: ApplicationDescription[];
5
- endpoints: EndpointDescription[];
6
- }
7
- /**
8
- * extract the server endpoints exposed by a discovery server
9
- * @method findServers
10
- * @async
11
- * @param discoveryServerEndpointUri
12
- * @param callback
13
- */
14
- export declare function findServers(discoveryServerEndpointUri: string, callback: (err: Error | null, result?: FindServerResults) => void): void;
15
- export declare function findServers(discoveryServerEndpointUri: string): Promise<FindServerResults>;
16
- /**
17
- * extract the server endpoints exposed by a discovery server
18
- */
19
- export declare function findServersOnNetwork(discoveryServerEndpointUri: string): Promise<ServerOnNetwork[]>;
20
- export declare function findServersOnNetwork(discoveryServerEndpointUri: string, callback: (err: Error | null, servers?: ServerOnNetwork[]) => void): void;
1
+ import { ServerOnNetwork } from "node-opcua-service-discovery";
2
+ import { ApplicationDescription, EndpointDescription } from "node-opcua-service-endpoints";
3
+ export interface FindServerResults {
4
+ servers: ApplicationDescription[];
5
+ endpoints: EndpointDescription[];
6
+ }
7
+ /**
8
+ * extract the server endpoints exposed by a discovery server
9
+ * @method findServers
10
+ * @async
11
+ * @param discoveryServerEndpointUri
12
+ * @param callback
13
+ */
14
+ export declare function findServers(discoveryServerEndpointUri: string, callback: (err: Error | null, result?: FindServerResults) => void): void;
15
+ export declare function findServers(discoveryServerEndpointUri: string): Promise<FindServerResults>;
16
+ /**
17
+ * extract the server endpoints exposed by a discovery server
18
+ */
19
+ export declare function findServersOnNetwork(discoveryServerEndpointUri: string): Promise<ServerOnNetwork[]>;
20
+ export declare function findServersOnNetwork(discoveryServerEndpointUri: string, callback: (err: Error | null, servers?: ServerOnNetwork[]) => void): void;
@@ -1,62 +1,62 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findServersOnNetwork = exports.findServers = void 0;
4
- /**
5
- * @module node-opcua-client
6
- */
7
- const async = require("async");
8
- const client_base_impl_1 = require("../private/client_base_impl");
9
- function findServers(discoveryServerEndpointUri, callback) {
10
- const client = new client_base_impl_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
11
- let servers = [];
12
- let endpoints = [];
13
- async.series([
14
- (innerCallback) => {
15
- client.connect(discoveryServerEndpointUri, innerCallback);
16
- },
17
- (innerCallback) => {
18
- client.findServers((err, _servers) => {
19
- if (_servers) {
20
- servers = _servers;
21
- }
22
- innerCallback(err ? err : undefined);
23
- });
24
- },
25
- (innerCallback) => {
26
- client.getEndpoints({ endpointUrl: undefined }, (err, _endpoints) => {
27
- if (_endpoints) {
28
- endpoints = _endpoints;
29
- }
30
- innerCallback(err ? err : undefined);
31
- });
32
- }
33
- ], (err) => {
34
- client.disconnect(() => {
35
- callback(err ? err : null, { servers, endpoints });
36
- });
37
- });
38
- }
39
- exports.findServers = findServers;
40
- function findServersOnNetwork(discoveryServerEndpointUri, callback) {
41
- const client = new client_base_impl_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
42
- client.connect(discoveryServerEndpointUri, (err) => {
43
- if (!err) {
44
- client.findServersOnNetwork((err1, servers) => {
45
- client.disconnect(() => {
46
- callback(err1, servers);
47
- });
48
- });
49
- }
50
- else {
51
- client.disconnect(() => {
52
- callback(err);
53
- });
54
- }
55
- });
56
- }
57
- exports.findServersOnNetwork = findServersOnNetwork;
58
- // tslint:disable:no-var-requires
59
- const thenify = require("thenify");
60
- module.exports.findServersOnNetwork = thenify.withCallback(module.exports.findServersOnNetwork);
61
- module.exports.findServers = thenify.withCallback(module.exports.findServers);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.findServersOnNetwork = exports.findServers = void 0;
4
+ /**
5
+ * @module node-opcua-client
6
+ */
7
+ const async = require("async");
8
+ const client_base_impl_1 = require("../private/client_base_impl");
9
+ function findServers(discoveryServerEndpointUri, callback) {
10
+ const client = new client_base_impl_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
11
+ let servers = [];
12
+ let endpoints = [];
13
+ async.series([
14
+ (innerCallback) => {
15
+ client.connect(discoveryServerEndpointUri, innerCallback);
16
+ },
17
+ (innerCallback) => {
18
+ client.findServers((err, _servers) => {
19
+ if (_servers) {
20
+ servers = _servers;
21
+ }
22
+ innerCallback(err ? err : undefined);
23
+ });
24
+ },
25
+ (innerCallback) => {
26
+ client.getEndpoints({ endpointUrl: undefined }, (err, _endpoints) => {
27
+ if (_endpoints) {
28
+ endpoints = _endpoints;
29
+ }
30
+ innerCallback(err ? err : undefined);
31
+ });
32
+ }
33
+ ], (err) => {
34
+ client.disconnect(() => {
35
+ callback(err ? err : null, { servers, endpoints });
36
+ });
37
+ });
38
+ }
39
+ exports.findServers = findServers;
40
+ function findServersOnNetwork(discoveryServerEndpointUri, callback) {
41
+ const client = new client_base_impl_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
42
+ client.connect(discoveryServerEndpointUri, (err) => {
43
+ if (!err) {
44
+ client.findServersOnNetwork((err1, servers) => {
45
+ client.disconnect(() => {
46
+ callback(err1, servers);
47
+ });
48
+ });
49
+ }
50
+ else {
51
+ client.disconnect(() => {
52
+ callback(err);
53
+ });
54
+ }
55
+ });
56
+ }
57
+ exports.findServersOnNetwork = findServersOnNetwork;
58
+ // tslint:disable:no-var-requires
59
+ const thenify = require("thenify");
60
+ module.exports.findServersOnNetwork = thenify.withCallback(module.exports.findServersOnNetwork);
61
+ module.exports.findServers = thenify.withCallback(module.exports.findServers);
62
62
  //# sourceMappingURL=findservers.js.map
@@ -1,6 +1,6 @@
1
- import { ClientSession } from "../client_session";
2
- export interface HistoryServerCapabilities {
3
- [key: string]: any;
4
- }
5
- export declare function readHistoryServerCapabilities(session: ClientSession): Promise<HistoryServerCapabilities>;
6
- export declare function readHistoryServerCapabilities(session: ClientSession, callback: (err: Error | null, capabilities?: HistoryServerCapabilities) => void): void;
1
+ import { ClientSession } from "../client_session";
2
+ export interface HistoryServerCapabilities {
3
+ [key: string]: any;
4
+ }
5
+ export declare function readHistoryServerCapabilities(session: ClientSession): Promise<HistoryServerCapabilities>;
6
+ export declare function readHistoryServerCapabilities(session: ClientSession, callback: (err: Error | null, capabilities?: HistoryServerCapabilities) => void): void;
@@ -1,99 +1,99 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.readHistoryServerCapabilities = void 0;
4
- /**
5
- * @module node-opcua-client
6
- */
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_constants_1 = require("node-opcua-constants");
9
- const node_opcua_data_model_1 = require("node-opcua-data-model");
10
- const node_opcua_nodeid_1 = require("node-opcua-nodeid");
11
- const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
12
- const node_opcua_utils_1 = require("node-opcua-utils");
13
- function readHistoryServerCapabilities(session, callback) {
14
- if (!callback) {
15
- throw new Error("Internal error");
16
- }
17
- // display HistoryCapabilities of server
18
- const browsePath = (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(node_opcua_constants_1.ObjectIds.ObjectsFolder, "/Server/ServerCapabilities.HistoryServerCapabilities");
19
- session.translateBrowsePath(browsePath, (err, result) => {
20
- if (err) {
21
- return callback(err);
22
- }
23
- /* istanbul ignore next */
24
- if (!result) {
25
- return callback(new Error("Internal Error"));
26
- }
27
- if (result.statusCode.isNotGood()) {
28
- return callback(new Error("StatusCode = " + result.statusCode.toString()));
29
- }
30
- result.targets = result.targets || [];
31
- const historyServerCapabilitiesNodeId = result.targets[0].targetId;
32
- // (should be ns=0;i=11192)
33
- (0, node_opcua_assert_1.assert)(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
34
- // -------------------------
35
- const properties = [
36
- "AccessHistoryDataCapability",
37
- "AccessHistoryEventsCapability",
38
- "DeleteAtTimeCapability",
39
- "DeleteRawCapability",
40
- "DeleteEventCapability",
41
- "InsertAnnotationCapability",
42
- "InsertDataCapability",
43
- "InsertEventCapability",
44
- "ReplaceDataCapability",
45
- "ReplaceEventCapability",
46
- "UpdateDataCapability",
47
- "UpdateEventCapability",
48
- "MaxReturnDataValues",
49
- "MaxReturnEventValues",
50
- "AggregateFunctions/AnnotationCount",
51
- "AggregateFunctions/Average",
52
- "AggregateFunctions/Count",
53
- "AggregateFunctions/Delta",
54
- "AggregateFunctions/DeltaBounds",
55
- "AggregateFunctions/DurationBad",
56
- "AggregateFunctions/DurationGood",
57
- "AggregateFunctions/DurationStateNonZero"
58
- // etc....
59
- ];
60
- const browsePaths = properties.map((prop) => (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(historyServerCapabilitiesNodeId, "." + prop));
61
- session.translateBrowsePath(browsePaths, (innerErr, results) => {
62
- if (innerErr) {
63
- return callback(innerErr);
64
- }
65
- /* istanbul ignore next */
66
- if (!results) {
67
- return callback(new Error("Internal Error"));
68
- }
69
- const nodeIds = results.map((innerResult) => innerResult.statusCode.isGood() && innerResult.targets
70
- ? innerResult.targets[0].targetId
71
- : new node_opcua_nodeid_1.NodeId());
72
- const nodesToRead = nodeIds.map((nodeId) => ({
73
- attributeId: node_opcua_data_model_1.AttributeIds.Value,
74
- nodeId /*: coerceNodeId(nodeId)*/
75
- }));
76
- const data = {};
77
- session.read(nodesToRead, (err2, dataValues) => {
78
- if (err2) {
79
- return callback(err2);
80
- }
81
- /* istanbul ignore next */
82
- if (!dataValues) {
83
- return callback(new Error("Internal Error"));
84
- }
85
- for (let i = 0; i < dataValues.length; i++) {
86
- const propName = (0, node_opcua_utils_1.lowerFirstLetter)(properties[i]);
87
- data[propName] = dataValues[i].value;
88
- }
89
- callback(null, data);
90
- });
91
- });
92
- });
93
- }
94
- exports.readHistoryServerCapabilities = readHistoryServerCapabilities;
95
- // tslint:disable:no-var-requires
96
- const thenify = require("thenify");
97
- const opts = { multiArgs: false };
98
- module.exports.readHistoryServerCapabilities = thenify.withCallback(module.exports.readHistoryServerCapabilities, opts);
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.readHistoryServerCapabilities = void 0;
4
+ /**
5
+ * @module node-opcua-client
6
+ */
7
+ const node_opcua_assert_1 = require("node-opcua-assert");
8
+ const node_opcua_constants_1 = require("node-opcua-constants");
9
+ const node_opcua_data_model_1 = require("node-opcua-data-model");
10
+ const node_opcua_nodeid_1 = require("node-opcua-nodeid");
11
+ const node_opcua_service_translate_browse_path_1 = require("node-opcua-service-translate-browse-path");
12
+ const node_opcua_utils_1 = require("node-opcua-utils");
13
+ function readHistoryServerCapabilities(session, callback) {
14
+ if (!callback) {
15
+ throw new Error("Internal error");
16
+ }
17
+ // display HistoryCapabilities of server
18
+ const browsePath = (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(node_opcua_constants_1.ObjectIds.ObjectsFolder, "/Server/ServerCapabilities.HistoryServerCapabilities");
19
+ session.translateBrowsePath(browsePath, (err, result) => {
20
+ if (err) {
21
+ return callback(err);
22
+ }
23
+ /* istanbul ignore next */
24
+ if (!result) {
25
+ return callback(new Error("Internal Error"));
26
+ }
27
+ if (result.statusCode.isNotGood()) {
28
+ return callback(new Error("StatusCode = " + result.statusCode.toString()));
29
+ }
30
+ result.targets = result.targets || [];
31
+ const historyServerCapabilitiesNodeId = result.targets[0].targetId;
32
+ // (should be ns=0;i=11192)
33
+ (0, node_opcua_assert_1.assert)(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
34
+ // -------------------------
35
+ const properties = [
36
+ "AccessHistoryDataCapability",
37
+ "AccessHistoryEventsCapability",
38
+ "DeleteAtTimeCapability",
39
+ "DeleteRawCapability",
40
+ "DeleteEventCapability",
41
+ "InsertAnnotationCapability",
42
+ "InsertDataCapability",
43
+ "InsertEventCapability",
44
+ "ReplaceDataCapability",
45
+ "ReplaceEventCapability",
46
+ "UpdateDataCapability",
47
+ "UpdateEventCapability",
48
+ "MaxReturnDataValues",
49
+ "MaxReturnEventValues",
50
+ "AggregateFunctions/AnnotationCount",
51
+ "AggregateFunctions/Average",
52
+ "AggregateFunctions/Count",
53
+ "AggregateFunctions/Delta",
54
+ "AggregateFunctions/DeltaBounds",
55
+ "AggregateFunctions/DurationBad",
56
+ "AggregateFunctions/DurationGood",
57
+ "AggregateFunctions/DurationStateNonZero"
58
+ // etc....
59
+ ];
60
+ const browsePaths = properties.map((prop) => (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(historyServerCapabilitiesNodeId, "." + prop));
61
+ session.translateBrowsePath(browsePaths, (innerErr, results) => {
62
+ if (innerErr) {
63
+ return callback(innerErr);
64
+ }
65
+ /* istanbul ignore next */
66
+ if (!results) {
67
+ return callback(new Error("Internal Error"));
68
+ }
69
+ const nodeIds = results.map((innerResult) => innerResult.statusCode.isGood() && innerResult.targets
70
+ ? innerResult.targets[0].targetId
71
+ : new node_opcua_nodeid_1.NodeId());
72
+ const nodesToRead = nodeIds.map((nodeId) => ({
73
+ attributeId: node_opcua_data_model_1.AttributeIds.Value,
74
+ nodeId /*: coerceNodeId(nodeId)*/
75
+ }));
76
+ const data = {};
77
+ session.read(nodesToRead, (err2, dataValues) => {
78
+ if (err2) {
79
+ return callback(err2);
80
+ }
81
+ /* istanbul ignore next */
82
+ if (!dataValues) {
83
+ return callback(new Error("Internal Error"));
84
+ }
85
+ for (let i = 0; i < dataValues.length; i++) {
86
+ const propName = (0, node_opcua_utils_1.lowerFirstLetter)(properties[i]);
87
+ data[propName] = dataValues[i].value;
88
+ }
89
+ callback(null, data);
90
+ });
91
+ });
92
+ });
93
+ }
94
+ exports.readHistoryServerCapabilities = readHistoryServerCapabilities;
95
+ // tslint:disable:no-var-requires
96
+ const thenify = require("thenify");
97
+ const opts = { multiArgs: false };
98
+ module.exports.readHistoryServerCapabilities = thenify.withCallback(module.exports.readHistoryServerCapabilities, opts);
99
99
  //# sourceMappingURL=read_history_server_capabilities.js.map
@@ -1 +1 @@
1
- export { UserIdentityInfoUserName, UserIdentityInfoX509, AnonymousIdentity, UserIdentityInfo } from "node-opcua-pseudo-session";
1
+ export { UserIdentityInfoUserName, UserIdentityInfoX509, AnonymousIdentity, UserIdentityInfo } from "node-opcua-pseudo-session";
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=user_identity_info.js.map
package/dist/verify.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { OPCUACertificateManager } from "node-opcua-certificate-manager";
2
- import { OPCUASecureObject } from "node-opcua-common";
3
- import { Certificate } from "node-opcua-crypto";
4
- export declare function verifyIsOPCUAValidCertificate(certificate: Certificate, certificateFile: string, type: "client" | "server", applicationUri: string): void;
5
- export declare function performCertificateSanityCheck(this: OPCUASecureObject, serverOrClient: "server" | "client", certificateManager: OPCUACertificateManager, applicationUri: string): Promise<void>;
1
+ import { OPCUACertificateManager } from "node-opcua-certificate-manager";
2
+ import { OPCUASecureObject } from "node-opcua-common";
3
+ import { Certificate } from "node-opcua-crypto";
4
+ export declare function verifyIsOPCUAValidCertificate(certificate: Certificate, certificateFile: string, type: "client" | "server", applicationUri: string): void;
5
+ export declare function performCertificateSanityCheck(this: OPCUASecureObject, serverOrClient: "server" | "client", certificateManager: OPCUACertificateManager, applicationUri: string): Promise<void>;