node-opcua-client 2.117.0 → 2.118.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_dump_event.d.ts +2 -2
- package/dist/alarms_and_conditions/client_alarm_tools_dump_event.js.map +1 -1
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.d.ts +2 -2
- package/dist/alarms_and_conditions/client_alarm_tools_extractConditionFields.js.map +1 -1
- package/dist/alarms_and_conditions/client_tools.js +5 -25
- package/dist/alarms_and_conditions/client_tools.js.map +1 -1
- package/dist/client_utils.d.ts +2 -2
- package/dist/client_utils.js +2 -2
- package/dist/client_utils.js.map +1 -1
- package/dist/private/client_base_impl.js +12 -35
- package/dist/private/client_base_impl.js.map +1 -1
- package/dist/private/client_publish_engine.js +3 -26
- package/dist/private/client_publish_engine.js.map +1 -1
- package/dist/private/client_session_impl.js +7 -1
- package/dist/private/client_session_impl.js.map +1 -1
- package/dist/private/client_subscription_impl.js +4 -27
- package/dist/private/client_subscription_impl.js.map +1 -1
- package/dist/private/opcua_client_impl.js +2 -25
- package/dist/private/opcua_client_impl.js.map +1 -1
- package/dist/tools/findservers.js +4 -24
- package/dist/tools/findservers.js.map +1 -1
- package/package.json +39 -39
- package/source/alarms_and_conditions/client_alarm_tools_dump_event.ts +5 -5
- package/source/alarms_and_conditions/client_alarm_tools_extractConditionFields.ts +2 -2
- package/source/alarms_and_conditions/client_tools.ts +1 -1
- package/source/client_utils.ts +8 -5
- package/source/private/client_base_impl.ts +3 -3
- package/source/private/client_publish_engine.ts +1 -1
- package/source/private/client_session_impl.ts +17 -8
- package/source/private/client_subscription_impl.ts +5 -5
- package/source/private/opcua_client_impl.ts +1 -1
- package/source/tools/findservers.ts +1 -1
|
@@ -1,39 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
6
|
exports.findServersOnNetwork = exports.findServers = void 0;
|
|
27
7
|
/**
|
|
28
8
|
* @module node-opcua-client
|
|
29
9
|
*/
|
|
30
|
-
const
|
|
10
|
+
const async_1 = __importDefault(require("async"));
|
|
31
11
|
const client_base_impl_1 = require("../private/client_base_impl");
|
|
32
12
|
function findServers(discoveryServerEndpointUri, callback) {
|
|
33
13
|
const client = new client_base_impl_1.ClientBaseImpl({ connectionStrategy: { maxRetry: 3 } });
|
|
34
14
|
let servers = [];
|
|
35
15
|
let endpoints = [];
|
|
36
|
-
|
|
16
|
+
async_1.default.series([
|
|
37
17
|
(innerCallback) => {
|
|
38
18
|
client.connect(discoveryServerEndpointUri, innerCallback);
|
|
39
19
|
},
|
|
@@ -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.ts"],"names":[],"mappings":";;;;;;AAAA;;GAEG;AACH,kDAA0B;AAK1B,kEAA6D;AAkB7D,SAAgB,WAAW,CACvB,0BAAkC,EAClC,QAAkE;IAElE,MAAM,MAAM,GAAG,IAAI,iCAAc,CAAC,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3E,IAAI,OAAO,GAA6B,EAAE,CAAC;IAC3C,IAAI,SAAS,GAA0B,EAAE,CAAC;IAE1C,eAAK,CAAC,MAAM,CACR;QACI,CAAC,aAA4B,EAAE,EAAE;YAC7B,MAAM,CAAC,OAAO,CAAC,0BAA0B,EAAE,aAAa,CAAC,CAAC;QAC9D,CAAC;QAED,CAAC,aAA4B,EAAE,EAAE;YAC7B,MAAM,CAAC,WAAW,CAAC,CAAC,GAAiB,EAAE,QAAmC,EAAE,EAAE;gBAC1E,IAAI,QAAQ,EAAE;oBACV,OAAO,GAAG,QAAQ,CAAC;iBACtB;gBACD,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;QACP,CAAC;QAED,CAAC,aAA4B,EAAE,EAAE;YAC7B,MAAM,CAAC,YAAY,CAAC,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,GAAiB,EAAE,UAAkC,EAAE,EAAE;gBACtG,IAAI,UAAU,EAAE;oBACZ,SAAS,GAAG,UAAU,CAAC;iBAC1B;gBACD,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACzC,CAAC,CAAC,CAAC;QACP,CAAC;KACJ,EACD,CAAC,GAAG,EAAE,EAAE;QACJ,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;YACnB,QAAS,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;QACxD,CAAC,CAAC,CAAC;IACP,CAAC,CACJ,CAAC;AACN,CAAC;AAvCD,kCAuCC;AAUD,SAAgB,oBAAoB,CAChC,0BAAkC,EAClC,QAAmE;IAEnE,MAAM,MAAM,GAAG,IAAI,iCAAc,CAAC,EAAE,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAE3E,MAAM,CAAC,OAAO,CAAC,0BAA0B,EAAE,CAAC,GAAW,EAAE,EAAE;QACvD,IAAI,CAAC,GAAG,EAAE;YACN,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;gBAC1C,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;oBACnB,QAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;gBAC7B,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC;SACN;aAAM;YACH,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE;gBACnB,QAAS,CAAC,GAAG,CAAC,CAAC;YACnB,CAAC,CAAC,CAAC;SACN;IACL,CAAC,CAAC,CAAC;AACP,CAAC;AAnBD,oDAmBC;AAED,iCAAiC;AACjC,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,MAAM,CAAC,OAAe,CAAC,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAE,MAAM,CAAC,OAAe,CAAC,oBAAoB,CAAC,CAAC;AACjH,MAAM,CAAC,OAAe,CAAC,WAAW,GAAG,OAAO,CAAC,YAAY,CAAE,MAAM,CAAC,OAAe,CAAC,WAAW,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-client",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.118.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module client",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "npx rimraf node_modules dist *.tsbuildinfo certificates",
|
|
@@ -18,54 +18,54 @@
|
|
|
18
18
|
"async": "^3.2.5",
|
|
19
19
|
"chalk": "4.1.2",
|
|
20
20
|
"node-opcua-assert": "2.105.0",
|
|
21
|
-
"node-opcua-basic-types": "2.
|
|
21
|
+
"node-opcua-basic-types": "2.118.0",
|
|
22
22
|
"node-opcua-buffer-utils": "2.117.0",
|
|
23
|
-
"node-opcua-certificate-manager": "2.
|
|
24
|
-
"node-opcua-client-dynamic-extension-object": "2.
|
|
25
|
-
"node-opcua-common": "2.
|
|
23
|
+
"node-opcua-certificate-manager": "2.118.0",
|
|
24
|
+
"node-opcua-client-dynamic-extension-object": "2.118.0",
|
|
25
|
+
"node-opcua-common": "2.118.0",
|
|
26
26
|
"node-opcua-constants": "2.114.0",
|
|
27
|
-
"node-opcua-crypto": "4.
|
|
28
|
-
"node-opcua-data-model": "2.
|
|
29
|
-
"node-opcua-data-value": "2.
|
|
30
|
-
"node-opcua-date-time": "2.
|
|
31
|
-
"node-opcua-debug": "2.
|
|
32
|
-
"node-opcua-extension-object": "2.
|
|
33
|
-
"node-opcua-hostname": "2.
|
|
34
|
-
"node-opcua-nodeid": "2.
|
|
35
|
-
"node-opcua-object-registry": "2.
|
|
36
|
-
"node-opcua-pki": "4.
|
|
37
|
-
"node-opcua-pseudo-session": "2.
|
|
38
|
-
"node-opcua-schemas": "2.
|
|
39
|
-
"node-opcua-secure-channel": "2.
|
|
40
|
-
"node-opcua-service-browse": "2.
|
|
41
|
-
"node-opcua-service-call": "2.
|
|
42
|
-
"node-opcua-service-discovery": "2.
|
|
43
|
-
"node-opcua-service-endpoints": "2.
|
|
44
|
-
"node-opcua-service-filter": "2.
|
|
45
|
-
"node-opcua-service-history": "2.
|
|
46
|
-
"node-opcua-service-query": "2.
|
|
47
|
-
"node-opcua-service-read": "2.
|
|
48
|
-
"node-opcua-service-register-node": "2.
|
|
49
|
-
"node-opcua-service-secure-channel": "2.
|
|
50
|
-
"node-opcua-service-session": "2.
|
|
51
|
-
"node-opcua-service-subscription": "2.
|
|
52
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
53
|
-
"node-opcua-service-write": "2.
|
|
27
|
+
"node-opcua-crypto": "4.6.2",
|
|
28
|
+
"node-opcua-data-model": "2.118.0",
|
|
29
|
+
"node-opcua-data-value": "2.118.0",
|
|
30
|
+
"node-opcua-date-time": "2.118.0",
|
|
31
|
+
"node-opcua-debug": "2.118.0",
|
|
32
|
+
"node-opcua-extension-object": "2.118.0",
|
|
33
|
+
"node-opcua-hostname": "2.118.0",
|
|
34
|
+
"node-opcua-nodeid": "2.118.0",
|
|
35
|
+
"node-opcua-object-registry": "2.118.0",
|
|
36
|
+
"node-opcua-pki": "4.8.1",
|
|
37
|
+
"node-opcua-pseudo-session": "2.118.0",
|
|
38
|
+
"node-opcua-schemas": "2.118.0",
|
|
39
|
+
"node-opcua-secure-channel": "2.118.0",
|
|
40
|
+
"node-opcua-service-browse": "2.118.0",
|
|
41
|
+
"node-opcua-service-call": "2.118.0",
|
|
42
|
+
"node-opcua-service-discovery": "2.118.0",
|
|
43
|
+
"node-opcua-service-endpoints": "2.118.0",
|
|
44
|
+
"node-opcua-service-filter": "2.118.0",
|
|
45
|
+
"node-opcua-service-history": "2.118.0",
|
|
46
|
+
"node-opcua-service-query": "2.118.0",
|
|
47
|
+
"node-opcua-service-read": "2.118.0",
|
|
48
|
+
"node-opcua-service-register-node": "2.118.0",
|
|
49
|
+
"node-opcua-service-secure-channel": "2.118.0",
|
|
50
|
+
"node-opcua-service-session": "2.118.0",
|
|
51
|
+
"node-opcua-service-subscription": "2.118.0",
|
|
52
|
+
"node-opcua-service-translate-browse-path": "2.118.0",
|
|
53
|
+
"node-opcua-service-write": "2.118.0",
|
|
54
54
|
"node-opcua-status-code": "2.117.0",
|
|
55
|
-
"node-opcua-types": "2.
|
|
55
|
+
"node-opcua-types": "2.118.0",
|
|
56
56
|
"node-opcua-utils": "2.117.0",
|
|
57
|
-
"node-opcua-variant": "2.
|
|
57
|
+
"node-opcua-variant": "2.118.0",
|
|
58
58
|
"thenify": "^3.3.1"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@types/underscore": "^1.11.14",
|
|
62
62
|
"dequeue": "^1.0.5",
|
|
63
63
|
"mocha": "^10.2.0",
|
|
64
|
-
"node-opcua-address-space": "2.
|
|
64
|
+
"node-opcua-address-space": "2.118.0",
|
|
65
65
|
"node-opcua-binary-stream": "2.117.0",
|
|
66
|
-
"node-opcua-factory": "2.
|
|
67
|
-
"node-opcua-leak-detector": "2.
|
|
68
|
-
"node-opcua-nodesets": "2.
|
|
66
|
+
"node-opcua-factory": "2.118.0",
|
|
67
|
+
"node-opcua-leak-detector": "2.118.0",
|
|
68
|
+
"node-opcua-nodesets": "2.118.0",
|
|
69
69
|
"should": "^13.2.3",
|
|
70
70
|
"sinon": "^17.0.1",
|
|
71
71
|
"underscore": "^1.13.6"
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"internet of things"
|
|
91
91
|
],
|
|
92
92
|
"homepage": "http://node-opcua.github.io/",
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "6210aaa97b43554e3982113041963b2720e50a95",
|
|
94
94
|
"files": [
|
|
95
95
|
"dist",
|
|
96
96
|
"source"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { AttributeIds } from "node-opcua-data-model";
|
|
3
3
|
import { NodeId } from "node-opcua-nodeid";
|
|
4
|
-
import {
|
|
4
|
+
import { IBasicSessionReadAsyncSimple } from "node-opcua-pseudo-session";
|
|
5
5
|
import { DataType, Variant, VariantLike } from "node-opcua-variant";
|
|
6
6
|
|
|
7
7
|
import { make_warningLog } from "node-opcua-debug";
|
|
@@ -14,8 +14,8 @@ const warningLog = make_warningLog("ClientAlarmTool");
|
|
|
14
14
|
* @param fields
|
|
15
15
|
* @param eventFields
|
|
16
16
|
*/
|
|
17
|
-
export async function dumpEvent(session:
|
|
18
|
-
async function getBrowseName(_session:
|
|
17
|
+
export async function dumpEvent(session: IBasicSessionReadAsyncSimple, fields: string[], eventFields: Variant[]): Promise<void> {
|
|
18
|
+
async function getBrowseName(_session: IBasicSessionReadAsyncSimple, nodeId: NodeId): Promise<string> {
|
|
19
19
|
const dataValue = await _session.read({
|
|
20
20
|
attributeId: AttributeIds.BrowseName,
|
|
21
21
|
nodeId
|
|
@@ -30,7 +30,7 @@ export async function dumpEvent(session: IBasicSession, fields: string[], eventF
|
|
|
30
30
|
function w(str: string, l: number): string {
|
|
31
31
|
return (str || "").toString().padEnd(l, " ").substring(0, l);
|
|
32
32
|
}
|
|
33
|
-
async function __dumpEvent1(_session:
|
|
33
|
+
async function __dumpEvent1(_session: IBasicSessionReadAsyncSimple, _fields: any, variant: VariantLike, index: number) {
|
|
34
34
|
if (variant.dataType === DataType.Null) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
@@ -54,7 +54,7 @@ export async function dumpEvent(session: IBasicSession, fields: string[], eventF
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
async function __dumpEvent(_session:
|
|
57
|
+
async function __dumpEvent(_session: IBasicSessionReadAsyncSimple, _fields: string[], _eventFields: Variant[]) {
|
|
58
58
|
let index = 0;
|
|
59
59
|
const promises = [];
|
|
60
60
|
for (const variant of _eventFields) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NodeIdLike } from "node-opcua-nodeid";
|
|
2
|
-
import {
|
|
2
|
+
import { simpleBrowsePathsToString, extractFields, ISessionForExtractField } from "node-opcua-pseudo-session";
|
|
3
3
|
|
|
4
|
-
export async function extractConditionFields(session:
|
|
4
|
+
export async function extractConditionFields(session: ISessionForExtractField, conditionNodeId: NodeIdLike): Promise<string[]> {
|
|
5
5
|
// conditionNodeId could be a Object of type ConditionType
|
|
6
6
|
// or it could be directly a ObjectType which is a subType of ConditionType
|
|
7
7
|
const p = await extractFields(session, conditionNodeId);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// tslint:disable:no-empty
|
|
5
5
|
// tslint:disable: only-arrow-functions
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import async from "async";
|
|
8
8
|
import { assert } from "node-opcua-assert";
|
|
9
9
|
import { LocalizedText, LocalizedTextLike } from "node-opcua-data-model";
|
|
10
10
|
import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug";
|
package/source/client_utils.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { NodeIdLike, resolveNodeId } from "node-opcua-nodeid";
|
|
|
8
8
|
import { ReadValueIdOptions } from "node-opcua-service-read";
|
|
9
9
|
import { BrowsePath, BrowsePathResult } from "node-opcua-service-translate-browse-path";
|
|
10
10
|
import { Variant } from "node-opcua-variant";
|
|
11
|
-
import {
|
|
11
|
+
import { IBasicSessionReadAsyncMultiple, IBasicSessionTranslateBrowsePathAsyncMultiple } from "node-opcua-pseudo-session";
|
|
12
12
|
|
|
13
13
|
const hasPropertyRefId = resolveNodeId("HasProperty");
|
|
14
14
|
|
|
@@ -44,8 +44,11 @@ interface AnalogDataItemSnapshot {
|
|
|
44
44
|
* @param nodeId
|
|
45
45
|
* @param callback
|
|
46
46
|
*/
|
|
47
|
-
export async function readUAAnalogItem(
|
|
48
|
-
|
|
47
|
+
export async function readUAAnalogItem(
|
|
48
|
+
session: IBasicSessionTranslateBrowsePathAsyncMultiple & IBasicSessionReadAsyncMultiple,
|
|
49
|
+
nodeId: NodeIdLike
|
|
50
|
+
): Promise<AnalogDataItemSnapshot> {
|
|
51
|
+
const browsePaths = [
|
|
49
52
|
browsePathPropertyRequest(nodeId, "EngineeringUnits"),
|
|
50
53
|
browsePathPropertyRequest(nodeId, "EURange"),
|
|
51
54
|
browsePathPropertyRequest(nodeId, "InstrumentRange"),
|
|
@@ -61,9 +64,9 @@ export async function readUAAnalogItem(session: IBasicSessionAsync, nodeId: Node
|
|
|
61
64
|
valuePrecision: null
|
|
62
65
|
};
|
|
63
66
|
|
|
64
|
-
const browsePathResults = await session.translateBrowsePath(
|
|
67
|
+
const browsePathResults = await session.translateBrowsePath(browsePaths);
|
|
65
68
|
|
|
66
|
-
const actions: (
|
|
69
|
+
const actions: ((readResult: DataValue) => void)[] = [];
|
|
67
70
|
const nodesToRead: ReadValueIdOptions[] = [];
|
|
68
71
|
|
|
69
72
|
function processProperty(browsePathResult: BrowsePathResult, propertyName: string) {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* @module node-opcua-client-private
|
|
3
3
|
*/
|
|
4
4
|
// tslint:disable:no-unused-expression
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import async from "async";
|
|
8
8
|
import chalk from "chalk";
|
|
9
9
|
import { withLock } from "@ster5/global-mutex";
|
|
10
10
|
import { assert } from "node-opcua-assert";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module node-opcua-client-private
|
|
3
3
|
*/
|
|
4
4
|
import { types } from "util";
|
|
5
|
-
import
|
|
5
|
+
import async from "async";
|
|
6
6
|
import chalk from "chalk";
|
|
7
7
|
import { assert } from "node-opcua-assert";
|
|
8
8
|
import { checkDebugFlag, make_debugLog, make_warningLog } from "node-opcua-debug";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
PseudoDataValue
|
|
17
17
|
} from "node-opcua-client-dynamic-extension-object";
|
|
18
18
|
import { Certificate, Nonce } from "node-opcua-crypto";
|
|
19
|
-
import {
|
|
19
|
+
import { BrowseDirection, LocalizedTextLike } from "node-opcua-data-model";
|
|
20
20
|
import { DataValue } from "node-opcua-data-value";
|
|
21
21
|
import { checkDebugFlag, make_debugLog, make_errorLog, make_warningLog } from "node-opcua-debug";
|
|
22
22
|
import { ExtensionObject } from "node-opcua-extension-object";
|
|
@@ -24,12 +24,12 @@ import { coerceNodeId, NodeId, NodeIdLike, resolveNodeId } from "node-opcua-node
|
|
|
24
24
|
import {
|
|
25
25
|
getBuiltInDataType,
|
|
26
26
|
getArgumentDefinitionHelper,
|
|
27
|
-
IBasicSession,
|
|
28
27
|
IBasicTransportSettings,
|
|
29
28
|
readAllAttributes,
|
|
30
29
|
NodeAttributes,
|
|
31
30
|
ResponseCallback,
|
|
32
|
-
BrowseDescriptionLike
|
|
31
|
+
BrowseDescriptionLike,
|
|
32
|
+
IBasicSessionAsync2
|
|
33
33
|
} from "node-opcua-pseudo-session";
|
|
34
34
|
import { AnyConstructorFunc } from "node-opcua-schemas";
|
|
35
35
|
import { ClientSecureChannelLayer, requestHandleNotSetValue, SignatureData } from "node-opcua-secure-channel";
|
|
@@ -102,7 +102,7 @@ import {
|
|
|
102
102
|
UserTokenType,
|
|
103
103
|
WriteValueOptions
|
|
104
104
|
} from "node-opcua-types";
|
|
105
|
-
import { buffer_ellipsis, getFunctionParameterNames, isNullOrUndefined
|
|
105
|
+
import { buffer_ellipsis, getFunctionParameterNames, isNullOrUndefined } from "node-opcua-utils";
|
|
106
106
|
import { DataType, Variant, VariantLike } from "node-opcua-variant";
|
|
107
107
|
|
|
108
108
|
import {
|
|
@@ -1836,7 +1836,13 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
|
1836
1836
|
const methodId = args[0] as MethodId;
|
|
1837
1837
|
const callback = args[1] as ResponseCallback<ArgumentDefinition>;
|
|
1838
1838
|
assert(typeof callback === "function");
|
|
1839
|
-
return getArgumentDefinitionHelper(this, methodId
|
|
1839
|
+
return getArgumentDefinitionHelper(this, methodId)
|
|
1840
|
+
.then((result) => {
|
|
1841
|
+
callback!(null, result);
|
|
1842
|
+
})
|
|
1843
|
+
.catch((err) => {
|
|
1844
|
+
callback(err);
|
|
1845
|
+
});
|
|
1840
1846
|
}
|
|
1841
1847
|
|
|
1842
1848
|
public async registerNodes(nodesToRegister: NodeIdLike[]): Promise<NodeId[]>;
|
|
@@ -2215,12 +2221,15 @@ export class ClientSessionImpl extends EventEmitter implements ClientSession {
|
|
|
2215
2221
|
}
|
|
2216
2222
|
|
|
2217
2223
|
type promoteOpaqueStructure3WithCallbackFunc = (
|
|
2218
|
-
session:
|
|
2224
|
+
session: IBasicSessionAsync2,
|
|
2219
2225
|
callMethodResults: CallMethodResult[],
|
|
2220
2226
|
callback: ErrorCallback
|
|
2221
2227
|
) => void;
|
|
2222
2228
|
|
|
2223
|
-
async function promoteOpaqueStructure2(
|
|
2229
|
+
async function promoteOpaqueStructure2(
|
|
2230
|
+
session: IBasicSessionAsync2,
|
|
2231
|
+
callMethodResult: CallMethodResult
|
|
2232
|
+
): Promise<void> {
|
|
2224
2233
|
if (!callMethodResult || !callMethodResult.outputArguments || callMethodResult.outputArguments.length === 0) {
|
|
2225
2234
|
return;
|
|
2226
2235
|
}
|
|
@@ -2242,7 +2251,7 @@ function countOpaqueStructures(callMethodResults: CallMethodResult[]): number {
|
|
|
2242
2251
|
}, 0);
|
|
2243
2252
|
return opaqueStructureCount;
|
|
2244
2253
|
}
|
|
2245
|
-
async function promoteOpaqueStructure3(session:
|
|
2254
|
+
async function promoteOpaqueStructure3(session: IBasicSessionAsync2, callMethodResults: CallMethodResult[]): Promise<void> {
|
|
2246
2255
|
const opaqueStructureCount = countOpaqueStructures(callMethodResults);
|
|
2247
2256
|
if (0 === opaqueStructureCount) return;
|
|
2248
2257
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
// tslint:disable:unified-signatures
|
|
5
5
|
import { EventEmitter } from "events";
|
|
6
|
-
import
|
|
6
|
+
import async from "async";
|
|
7
7
|
import chalk from "chalk";
|
|
8
8
|
|
|
9
9
|
import { assert } from "node-opcua-assert";
|
|
@@ -35,9 +35,9 @@ import {
|
|
|
35
35
|
|
|
36
36
|
import { StatusCode, StatusCodes } from "node-opcua-status-code";
|
|
37
37
|
import { Callback, ErrorCallback } from "node-opcua-status-code";
|
|
38
|
-
import
|
|
38
|
+
import { isNullOrUndefined } from "node-opcua-utils";
|
|
39
39
|
import { promoteOpaqueStructureInNotificationData } from "node-opcua-client-dynamic-extension-object";
|
|
40
|
-
import { createMonitoredItemsLimit,
|
|
40
|
+
import { createMonitoredItemsLimit, IBasicSessionReadAsync, readOperationLimits } from "node-opcua-pseudo-session";
|
|
41
41
|
|
|
42
42
|
import { IBasicSessionWithSubscription } from "node-opcua-pseudo-session";
|
|
43
43
|
import { ClientMonitoredItemBase } from "../client_monitored_item_base";
|
|
@@ -123,7 +123,7 @@ function displayKeepAliveWarning(sessionTimeout: number, maxKeepAliveCount: numb
|
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
function createMonitoredItemsAndRespectOperationalLimits(
|
|
126
|
-
session:
|
|
126
|
+
session: IBasicSessionReadAsync & IBasicSessionWithSubscription,
|
|
127
127
|
createMonitorItemsRequest: CreateMonitoredItemsRequest,
|
|
128
128
|
callback: (err: Error | null, response?: CreateMonitoredItemsResponse) => void
|
|
129
129
|
) {
|
|
@@ -208,7 +208,7 @@ export class ClientSubscriptionImpl extends EventEmitter implements ClientSubscr
|
|
|
208
208
|
);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
options.maxNotificationsPerPublish =
|
|
211
|
+
options.maxNotificationsPerPublish = isNullOrUndefined(options.maxNotificationsPerPublish)
|
|
212
212
|
? 0
|
|
213
213
|
: options.maxNotificationsPerPublish;
|
|
214
214
|
|