node-opcua-convert-nodeset-to-javascript 2.76.1 → 2.76.2
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/convert_namespace_to_typescript.d.ts +3 -3
- package/dist/convert_namespace_to_typescript.js +182 -182
- package/dist/convert_to_typescript.d.ts +110 -110
- package/dist/convert_to_typescript.js +987 -987
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -19
- package/dist/main.d.ts +1 -1
- package/dist/main.js +74 -74
- package/dist/official_namespaces.d.ts +23 -23
- package/dist/official_namespaces.js +35 -35
- package/dist/options.d.ts +5 -5
- package/dist/options.js +2 -2
- package/dist/private/cache.d.ts +59 -59
- package/dist/private/cache.js +221 -221
- package/dist/private/to_filename.d.ts +1 -1
- package/dist/private/to_filename.js +9 -9
- package/dist/private/utils.d.ts +31 -31
- package/dist/private/utils.js +289 -289
- package/dist/private-stuff.d.ts +4 -4
- package/dist/private-stuff.js +20 -20
- package/dist/walk_through.d.ts +13 -13
- package/dist/walk_through.js +86 -86
- package/package.json +14 -14
- package/tsconfig-generated.json +4 -1
package/dist/walk_through.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { IBasicSession } from "node-opcua-pseudo-session";
|
|
2
|
-
import { ReferenceDescription } from "node-opcua-types";
|
|
3
|
-
export interface ReferenceDescriptionEx extends ReferenceDescription {
|
|
4
|
-
parent: ReferenceDescriptionEx;
|
|
5
|
-
}
|
|
6
|
-
export interface NodeVisitor {
|
|
7
|
-
visit(reference: ReferenceDescriptionEx, level: number): Promise<void>;
|
|
8
|
-
}
|
|
9
|
-
export declare function walkThroughReferenceTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
10
|
-
export declare function walkThroughDataTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
11
|
-
export declare function walkThroughInterfaceTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
12
|
-
export declare function walkThroughObjectTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
13
|
-
export declare function walkThroughVariableTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
1
|
+
import { IBasicSession } from "node-opcua-pseudo-session";
|
|
2
|
+
import { ReferenceDescription } from "node-opcua-types";
|
|
3
|
+
export interface ReferenceDescriptionEx extends ReferenceDescription {
|
|
4
|
+
parent: ReferenceDescriptionEx;
|
|
5
|
+
}
|
|
6
|
+
export interface NodeVisitor {
|
|
7
|
+
visit(reference: ReferenceDescriptionEx, level: number): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function walkThroughReferenceTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
10
|
+
export declare function walkThroughDataTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
11
|
+
export declare function walkThroughInterfaceTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
12
|
+
export declare function walkThroughObjectTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
|
13
|
+
export declare function walkThroughVariableTypes(session: IBasicSession, nodeVisitor?: NodeVisitor): Promise<void>;
|
package/dist/walk_through.js
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.walkThroughVariableTypes = exports.walkThroughObjectTypes = exports.walkThroughInterfaceTypes = exports.walkThroughDataTypes = exports.walkThroughReferenceTypes = void 0;
|
|
13
|
-
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
14
|
-
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
15
|
-
const node_opcua_types_1 = require("node-opcua-types");
|
|
16
|
-
function _walkThroughTypes(session, nodeId, visitor, level, parent) {
|
|
17
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
-
level = level || 0;
|
|
19
|
-
if (!parent) {
|
|
20
|
-
const dataValues = yield session.read([
|
|
21
|
-
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName },
|
|
22
|
-
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.NodeClass }
|
|
23
|
-
]);
|
|
24
|
-
const browseName = dataValues[0].value.value;
|
|
25
|
-
const nodeClass = dataValues[1].value.value;
|
|
26
|
-
parent = new node_opcua_types_1.ReferenceDescription({
|
|
27
|
-
isForward: true,
|
|
28
|
-
nodeId: nodeId,
|
|
29
|
-
browseName,
|
|
30
|
-
nodeClass,
|
|
31
|
-
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype")
|
|
32
|
-
// typeDefinition,
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
const browseResult = yield session.browse({
|
|
36
|
-
browseDirection: node_opcua_data_model_1.BrowseDirection.Forward,
|
|
37
|
-
nodeId,
|
|
38
|
-
includeSubtypes: true,
|
|
39
|
-
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype"),
|
|
40
|
-
resultMask: 0xff
|
|
41
|
-
});
|
|
42
|
-
for (const reference of browseResult.references || []) {
|
|
43
|
-
if (visitor) {
|
|
44
|
-
const r = reference;
|
|
45
|
-
r.parent = parent;
|
|
46
|
-
yield visitor.visit(r, level);
|
|
47
|
-
}
|
|
48
|
-
yield _walkThroughTypes(session, reference.nodeId, visitor, level + 1, reference);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
function walkThroughReferenceTypes(session, nodeVisitor) {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const baseReferenceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("References");
|
|
55
|
-
yield _walkThroughTypes(session, baseReferenceTypeNodeId, nodeVisitor);
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
exports.walkThroughReferenceTypes = walkThroughReferenceTypes;
|
|
59
|
-
function walkThroughDataTypes(session, nodeVisitor) {
|
|
60
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const baseDataTypeTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseDataType");
|
|
62
|
-
yield _walkThroughTypes(session, baseDataTypeTypeNodeId, nodeVisitor);
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
exports.walkThroughDataTypes = walkThroughDataTypes;
|
|
66
|
-
function walkThroughInterfaceTypes(session, nodeVisitor) {
|
|
67
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
-
const baseInterfaceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseInterfaceType");
|
|
69
|
-
yield _walkThroughTypes(session, baseInterfaceTypeNodeId, nodeVisitor);
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
exports.walkThroughInterfaceTypes = walkThroughInterfaceTypes;
|
|
73
|
-
function walkThroughObjectTypes(session, nodeVisitor) {
|
|
74
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
const baseObjectType = (0, node_opcua_nodeid_1.resolveNodeId)("BaseObjectType");
|
|
76
|
-
yield _walkThroughTypes(session, baseObjectType, nodeVisitor);
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
exports.walkThroughObjectTypes = walkThroughObjectTypes;
|
|
80
|
-
function walkThroughVariableTypes(session, nodeVisitor) {
|
|
81
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
-
const baseObjectType = (0, node_opcua_nodeid_1.resolveNodeId)("BaseVariableType");
|
|
83
|
-
yield _walkThroughTypes(session, baseObjectType, nodeVisitor);
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
exports.walkThroughVariableTypes = walkThroughVariableTypes;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.walkThroughVariableTypes = exports.walkThroughObjectTypes = exports.walkThroughInterfaceTypes = exports.walkThroughDataTypes = exports.walkThroughReferenceTypes = void 0;
|
|
13
|
+
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
14
|
+
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
15
|
+
const node_opcua_types_1 = require("node-opcua-types");
|
|
16
|
+
function _walkThroughTypes(session, nodeId, visitor, level, parent) {
|
|
17
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
18
|
+
level = level || 0;
|
|
19
|
+
if (!parent) {
|
|
20
|
+
const dataValues = yield session.read([
|
|
21
|
+
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName },
|
|
22
|
+
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.NodeClass }
|
|
23
|
+
]);
|
|
24
|
+
const browseName = dataValues[0].value.value;
|
|
25
|
+
const nodeClass = dataValues[1].value.value;
|
|
26
|
+
parent = new node_opcua_types_1.ReferenceDescription({
|
|
27
|
+
isForward: true,
|
|
28
|
+
nodeId: nodeId,
|
|
29
|
+
browseName,
|
|
30
|
+
nodeClass,
|
|
31
|
+
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype")
|
|
32
|
+
// typeDefinition,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
const browseResult = yield session.browse({
|
|
36
|
+
browseDirection: node_opcua_data_model_1.BrowseDirection.Forward,
|
|
37
|
+
nodeId,
|
|
38
|
+
includeSubtypes: true,
|
|
39
|
+
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype"),
|
|
40
|
+
resultMask: 0xff
|
|
41
|
+
});
|
|
42
|
+
for (const reference of browseResult.references || []) {
|
|
43
|
+
if (visitor) {
|
|
44
|
+
const r = reference;
|
|
45
|
+
r.parent = parent;
|
|
46
|
+
yield visitor.visit(r, level);
|
|
47
|
+
}
|
|
48
|
+
yield _walkThroughTypes(session, reference.nodeId, visitor, level + 1, reference);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
function walkThroughReferenceTypes(session, nodeVisitor) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const baseReferenceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("References");
|
|
55
|
+
yield _walkThroughTypes(session, baseReferenceTypeNodeId, nodeVisitor);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
exports.walkThroughReferenceTypes = walkThroughReferenceTypes;
|
|
59
|
+
function walkThroughDataTypes(session, nodeVisitor) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
+
const baseDataTypeTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseDataType");
|
|
62
|
+
yield _walkThroughTypes(session, baseDataTypeTypeNodeId, nodeVisitor);
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
exports.walkThroughDataTypes = walkThroughDataTypes;
|
|
66
|
+
function walkThroughInterfaceTypes(session, nodeVisitor) {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
68
|
+
const baseInterfaceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseInterfaceType");
|
|
69
|
+
yield _walkThroughTypes(session, baseInterfaceTypeNodeId, nodeVisitor);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
exports.walkThroughInterfaceTypes = walkThroughInterfaceTypes;
|
|
73
|
+
function walkThroughObjectTypes(session, nodeVisitor) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const baseObjectType = (0, node_opcua_nodeid_1.resolveNodeId)("BaseObjectType");
|
|
76
|
+
yield _walkThroughTypes(session, baseObjectType, nodeVisitor);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
exports.walkThroughObjectTypes = walkThroughObjectTypes;
|
|
80
|
+
function walkThroughVariableTypes(session, nodeVisitor) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const baseObjectType = (0, node_opcua_nodeid_1.resolveNodeId)("BaseVariableType");
|
|
83
|
+
yield _walkThroughTypes(session, baseObjectType, nodeVisitor);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
exports.walkThroughVariableTypes = walkThroughVariableTypes;
|
|
87
87
|
//# sourceMappingURL=walk_through.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-convert-nodeset-to-javascript",
|
|
3
|
-
"version": "2.76.
|
|
3
|
+
"version": "2.76.2",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -convert-nodeset-to-javascript",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,25 +15,25 @@
|
|
|
15
15
|
"@types/wordwrap": "^1.0.1",
|
|
16
16
|
"case-anything": "1.1.5",
|
|
17
17
|
"chalk": "4.1.2",
|
|
18
|
-
"node-opcua-address-space": "2.76.
|
|
19
|
-
"node-opcua-address-space-base": "2.76.
|
|
18
|
+
"node-opcua-address-space": "2.76.2",
|
|
19
|
+
"node-opcua-address-space-base": "2.76.2",
|
|
20
20
|
"node-opcua-assert": "2.76.0",
|
|
21
21
|
"node-opcua-constants": "2.74.0",
|
|
22
|
-
"node-opcua-data-model": "2.76.
|
|
23
|
-
"node-opcua-debug": "2.76.
|
|
24
|
-
"node-opcua-nodeid": "2.76.
|
|
22
|
+
"node-opcua-data-model": "2.76.2",
|
|
23
|
+
"node-opcua-debug": "2.76.2",
|
|
24
|
+
"node-opcua-nodeid": "2.76.2",
|
|
25
25
|
"node-opcua-nodesets": "2.74.0",
|
|
26
|
-
"node-opcua-pseudo-session": "2.76.
|
|
27
|
-
"node-opcua-status-code": "2.76.
|
|
28
|
-
"node-opcua-types": "2.76.
|
|
26
|
+
"node-opcua-pseudo-session": "2.76.2",
|
|
27
|
+
"node-opcua-status-code": "2.76.2",
|
|
28
|
+
"node-opcua-types": "2.76.2",
|
|
29
29
|
"node-opcua-utils": "2.76.0",
|
|
30
|
-
"node-opcua-variant": "2.76.
|
|
30
|
+
"node-opcua-variant": "2.76.2",
|
|
31
31
|
"wordwrap": "^1.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"node-opcua-leak-detector": "2.76.
|
|
35
|
-
"node-opcua-packet-analyzer": "2.76.
|
|
36
|
-
"node-opcua-service-translate-browse-path": "2.76.
|
|
34
|
+
"node-opcua-leak-detector": "2.76.2",
|
|
35
|
+
"node-opcua-packet-analyzer": "2.76.2",
|
|
36
|
+
"node-opcua-service-translate-browse-path": "2.76.2",
|
|
37
37
|
"should": "^13.2.3"
|
|
38
38
|
},
|
|
39
39
|
"author": "Etienne Rossignon",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"internet of things"
|
|
52
52
|
],
|
|
53
53
|
"homepage": "http://node-opcua.github.io/",
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "acb5ecaf1e1c71af3b63e80909d58447f3f298e7"
|
|
55
55
|
}
|
package/tsconfig-generated.json
CHANGED