node-opcua-client 2.75.0 → 2.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/alarms_and_conditions/client_alarm.d.ts +49 -49
  2. package/dist/alarms_and_conditions/client_alarm.js +109 -109
  3. package/dist/alarms_and_conditions/client_alarm_list.d.ts +25 -25
  4. package/dist/alarms_and_conditions/client_alarm_list.js +97 -97
  5. package/dist/alarms_and_conditions/client_alarm_tools.d.ts +4 -4
  6. package/dist/alarms_and_conditions/client_alarm_tools.js +156 -156
  7. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.d.ts +18 -18
  8. package/dist/alarms_and_conditions/client_alarm_tools_acknowledge_all_conditions.js +192 -192
  9. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.d.ts +9 -9
  10. package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js +73 -73
  11. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +3 -3
  12. package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js +118 -118
  13. package/dist/alarms_and_conditions/client_tools.d.ts +7 -7
  14. package/dist/alarms_and_conditions/client_tools.js +180 -180
  15. package/dist/client_base.d.ts +277 -277
  16. package/dist/client_base.js +14 -14
  17. package/dist/client_monitored_item.d.ts +21 -21
  18. package/dist/client_monitored_item.js +11 -11
  19. package/dist/client_monitored_item_base.d.ts +39 -39
  20. package/dist/client_monitored_item_base.js +2 -2
  21. package/dist/client_monitored_item_group.d.ts +18 -18
  22. package/dist/client_monitored_item_group.js +13 -13
  23. package/dist/client_monitored_item_toolbox.d.ts +15 -15
  24. package/dist/client_monitored_item_toolbox.js +117 -117
  25. package/dist/client_session.d.ts +484 -484
  26. package/dist/client_session.js +10 -10
  27. package/dist/client_session_keepalive_manager.d.ts +34 -34
  28. package/dist/client_session_keepalive_manager.js +150 -150
  29. package/dist/client_subscription.d.ts +241 -241
  30. package/dist/client_subscription.js +14 -14
  31. package/dist/client_utils.d.ts +22 -22
  32. package/dist/client_utils.js +88 -88
  33. package/dist/common.d.ts +17 -17
  34. package/dist/common.js +5 -5
  35. package/dist/index.d.ts +55 -55
  36. package/dist/index.js +93 -93
  37. package/dist/opcua_client.d.ts +132 -132
  38. package/dist/opcua_client.js +33 -33
  39. package/dist/private/client_base_impl.d.ts +157 -157
  40. package/dist/private/client_base_impl.js +1337 -1337
  41. package/dist/private/client_monitored_item_base_impl.d.ts +3 -3
  42. package/dist/private/client_monitored_item_base_impl.js +4 -4
  43. package/dist/private/client_monitored_item_group_impl.d.ts +53 -53
  44. package/dist/private/client_monitored_item_group_impl.js +159 -159
  45. package/dist/private/client_monitored_item_impl.d.ts +93 -93
  46. package/dist/private/client_monitored_item_impl.js +305 -305
  47. package/dist/private/client_publish_engine.d.ts +62 -62
  48. package/dist/private/client_publish_engine.js +408 -408
  49. package/dist/private/client_session_impl.d.ts +621 -621
  50. package/dist/private/client_session_impl.js +1302 -1302
  51. package/dist/private/client_subscription_impl.d.ts +93 -93
  52. package/dist/private/client_subscription_impl.js +748 -748
  53. package/dist/private/i_private_client.d.ts +18 -18
  54. package/dist/private/i_private_client.js +2 -2
  55. package/dist/private/opcua_client_impl.d.ts +169 -169
  56. package/dist/private/opcua_client_impl.js +981 -981
  57. package/dist/reconnection.d.ts +9 -9
  58. package/dist/reconnection.js +408 -408
  59. package/dist/tools/findservers.d.ts +20 -20
  60. package/dist/tools/findservers.js +61 -61
  61. package/dist/tools/read_history_server_capabilities.d.ts +6 -6
  62. package/dist/tools/read_history_server_capabilities.js +99 -99
  63. package/dist/verify.d.ts +5 -5
  64. package/dist/verify.js +134 -134
  65. package/package.json +46 -46
@@ -1,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,100 +1,100 @@
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_status_code_1 = require("node-opcua-status-code");
13
- const node_opcua_utils_1 = require("node-opcua-utils");
14
- function readHistoryServerCapabilities(session, callback) {
15
- if (!callback) {
16
- throw new Error("Internal error");
17
- }
18
- // display HistoryCapabilities of server
19
- const browsePath = (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(node_opcua_constants_1.ObjectIds.ObjectsFolder, "/Server/ServerCapabilities.HistoryServerCapabilities");
20
- session.translateBrowsePath(browsePath, (err, result) => {
21
- if (err) {
22
- return callback(err);
23
- }
24
- /* istanbul ignore next */
25
- if (!result) {
26
- return callback(new Error("Internal Error"));
27
- }
28
- if (result.statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
29
- return callback(new Error("StatusCode = " + result.statusCode.toString()));
30
- }
31
- result.targets = result.targets || [];
32
- const historyServerCapabilitiesNodeId = result.targets[0].targetId;
33
- // (should be ns=0;i=11192)
34
- (0, node_opcua_assert_1.assert)(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
35
- // -------------------------
36
- const properties = [
37
- "AccessHistoryDataCapability",
38
- "AccessHistoryEventsCapability",
39
- "DeleteAtTimeCapability",
40
- "DeleteRawCapability",
41
- "DeleteEventCapability",
42
- "InsertAnnotationCapability",
43
- "InsertDataCapability",
44
- "InsertEventCapability",
45
- "ReplaceDataCapability",
46
- "ReplaceEventCapability",
47
- "UpdateDataCapability",
48
- "UpdateEventCapability",
49
- "MaxReturnDataValues",
50
- "MaxReturnEventValues",
51
- "AggregateFunctions/AnnotationCount",
52
- "AggregateFunctions/Average",
53
- "AggregateFunctions/Count",
54
- "AggregateFunctions/Delta",
55
- "AggregateFunctions/DeltaBounds",
56
- "AggregateFunctions/DurationBad",
57
- "AggregateFunctions/DurationGood",
58
- "AggregateFunctions/DurationStateNonZero"
59
- // etc....
60
- ];
61
- const browsePaths = properties.map((prop) => (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(historyServerCapabilitiesNodeId, "." + prop));
62
- session.translateBrowsePath(browsePaths, (innerErr, results) => {
63
- if (innerErr) {
64
- return callback(innerErr);
65
- }
66
- /* istanbul ignore next */
67
- if (!results) {
68
- return callback(new Error("Internal Error"));
69
- }
70
- const nodeIds = results.map((innerResult) => innerResult.statusCode === node_opcua_status_code_1.StatusCodes.Good && innerResult.targets
71
- ? innerResult.targets[0].targetId
72
- : new node_opcua_nodeid_1.NodeId());
73
- const nodesToRead = nodeIds.map((nodeId) => ({
74
- attributeId: node_opcua_data_model_1.AttributeIds.Value,
75
- nodeId /*: coerceNodeId(nodeId)*/
76
- }));
77
- const data = {};
78
- session.read(nodesToRead, (err2, dataValues) => {
79
- if (err2) {
80
- return callback(err2);
81
- }
82
- /* istanbul ignore next */
83
- if (!dataValues) {
84
- return callback(new Error("Internal Error"));
85
- }
86
- for (let i = 0; i < dataValues.length; i++) {
87
- const propName = (0, node_opcua_utils_1.lowerFirstLetter)(properties[i]);
88
- data[propName] = dataValues[i].value;
89
- }
90
- callback(null, data);
91
- });
92
- });
93
- });
94
- }
95
- exports.readHistoryServerCapabilities = readHistoryServerCapabilities;
96
- // tslint:disable:no-var-requires
97
- const thenify = require("thenify");
98
- const opts = { multiArgs: false };
99
- 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_status_code_1 = require("node-opcua-status-code");
13
+ const node_opcua_utils_1 = require("node-opcua-utils");
14
+ function readHistoryServerCapabilities(session, callback) {
15
+ if (!callback) {
16
+ throw new Error("Internal error");
17
+ }
18
+ // display HistoryCapabilities of server
19
+ const browsePath = (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(node_opcua_constants_1.ObjectIds.ObjectsFolder, "/Server/ServerCapabilities.HistoryServerCapabilities");
20
+ session.translateBrowsePath(browsePath, (err, result) => {
21
+ if (err) {
22
+ return callback(err);
23
+ }
24
+ /* istanbul ignore next */
25
+ if (!result) {
26
+ return callback(new Error("Internal Error"));
27
+ }
28
+ if (result.statusCode !== node_opcua_status_code_1.StatusCodes.Good) {
29
+ return callback(new Error("StatusCode = " + result.statusCode.toString()));
30
+ }
31
+ result.targets = result.targets || [];
32
+ const historyServerCapabilitiesNodeId = result.targets[0].targetId;
33
+ // (should be ns=0;i=11192)
34
+ (0, node_opcua_assert_1.assert)(historyServerCapabilitiesNodeId.toString() === "ns=0;i=11192");
35
+ // -------------------------
36
+ const properties = [
37
+ "AccessHistoryDataCapability",
38
+ "AccessHistoryEventsCapability",
39
+ "DeleteAtTimeCapability",
40
+ "DeleteRawCapability",
41
+ "DeleteEventCapability",
42
+ "InsertAnnotationCapability",
43
+ "InsertDataCapability",
44
+ "InsertEventCapability",
45
+ "ReplaceDataCapability",
46
+ "ReplaceEventCapability",
47
+ "UpdateDataCapability",
48
+ "UpdateEventCapability",
49
+ "MaxReturnDataValues",
50
+ "MaxReturnEventValues",
51
+ "AggregateFunctions/AnnotationCount",
52
+ "AggregateFunctions/Average",
53
+ "AggregateFunctions/Count",
54
+ "AggregateFunctions/Delta",
55
+ "AggregateFunctions/DeltaBounds",
56
+ "AggregateFunctions/DurationBad",
57
+ "AggregateFunctions/DurationGood",
58
+ "AggregateFunctions/DurationStateNonZero"
59
+ // etc....
60
+ ];
61
+ const browsePaths = properties.map((prop) => (0, node_opcua_service_translate_browse_path_1.makeBrowsePath)(historyServerCapabilitiesNodeId, "." + prop));
62
+ session.translateBrowsePath(browsePaths, (innerErr, results) => {
63
+ if (innerErr) {
64
+ return callback(innerErr);
65
+ }
66
+ /* istanbul ignore next */
67
+ if (!results) {
68
+ return callback(new Error("Internal Error"));
69
+ }
70
+ const nodeIds = results.map((innerResult) => innerResult.statusCode === node_opcua_status_code_1.StatusCodes.Good && innerResult.targets
71
+ ? innerResult.targets[0].targetId
72
+ : new node_opcua_nodeid_1.NodeId());
73
+ const nodesToRead = nodeIds.map((nodeId) => ({
74
+ attributeId: node_opcua_data_model_1.AttributeIds.Value,
75
+ nodeId /*: coerceNodeId(nodeId)*/
76
+ }));
77
+ const data = {};
78
+ session.read(nodesToRead, (err2, dataValues) => {
79
+ if (err2) {
80
+ return callback(err2);
81
+ }
82
+ /* istanbul ignore next */
83
+ if (!dataValues) {
84
+ return callback(new Error("Internal Error"));
85
+ }
86
+ for (let i = 0; i < dataValues.length; i++) {
87
+ const propName = (0, node_opcua_utils_1.lowerFirstLetter)(properties[i]);
88
+ data[propName] = dataValues[i].value;
89
+ }
90
+ callback(null, data);
91
+ });
92
+ });
93
+ });
94
+ }
95
+ exports.readHistoryServerCapabilities = readHistoryServerCapabilities;
96
+ // tslint:disable:no-var-requires
97
+ const thenify = require("thenify");
98
+ const opts = { multiArgs: false };
99
+ module.exports.readHistoryServerCapabilities = thenify.withCallback(module.exports.readHistoryServerCapabilities, opts);
100
100
  //# sourceMappingURL=read_history_server_capabilities.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>;