node-opcua-convert-nodeset-to-javascript 2.113.0 → 2.114.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/_dataType.js +113 -126
- package/dist/_dataType.js.map +1 -1
- package/dist/convert_namespace_to_typescript.js +147 -168
- package/dist/convert_namespace_to_typescript.js.map +1 -1
- package/dist/convert_to_typescript.js +418 -448
- package/dist/convert_to_typescript.js.map +1 -1
- package/dist/main.js +13 -21
- package/dist/main.js.map +1 -1
- package/dist/private/cache.js +30 -46
- package/dist/private/cache.js.map +1 -1
- package/dist/private/get_corresponding_data_type.js +79 -92
- package/dist/private/get_corresponding_data_type.js.map +1 -1
- package/dist/private/utils.js +179 -228
- package/dist/private/utils.js.map +1 -1
- package/dist/update_parent_tsconfig.js +39 -50
- package/dist/update_parent_tsconfig.js.map +1 -1
- package/dist/walk_through.js +46 -67
- package/dist/walk_through.js.map +1 -1
- package/package.json +17 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update_parent_tsconfig.js","sourceRoot":"","sources":["../source/update_parent_tsconfig.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,8CAA8C
|
|
1
|
+
{"version":3,"file":"update_parent_tsconfig.js","sourceRoot":"","sources":["../source/update_parent_tsconfig.ts"],"names":[],"mappings":";AAAA,6FAA6F;AAC7F,8CAA8C;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,2BAAwD;AACxD,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,aAAU,CAAC;AAC3C,2CAA6B;AAC7B,4EAA4E;AAC5E,sCAAsC;AACtC,iEAAiE;AAEjE,6DAAqD;AAE9C,KAAK,UAAU,oBAAoB;IACtC,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,eA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,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,kBAAkB,CAAC,CAAC;QACtD,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC9C,gFAAgF;QAChF,2CAA2C;QAC3C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,IAAI,EAAE,MAAM,CAAC;aACnD,OAAO,CAAC,yBAAyB,EAAE,mGAAmG,CAAC;aACvI,OAAO,CAAC,8BAA8B,EAAE,kBAAkB,CAAC;cAC9D,IAAI,CAAC;QACX,8DAA8D;QAC9D,MAAM,SAAS,CAAC,kBAAkB,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;KACxD;AACL,CAAC;AA3CD,oDA2CC"}
|
package/dist/walk_through.js
CHANGED
|
@@ -1,87 +1,66 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.walkThroughVariableTypes = exports.walkThroughObjectTypes = exports.walkThroughInterfaceTypes = exports.walkThroughDataTypes = exports.walkThroughReferenceTypes = void 0;
|
|
13
4
|
const node_opcua_data_model_1 = require("node-opcua-data-model");
|
|
14
5
|
const node_opcua_nodeid_1 = require("node-opcua-nodeid");
|
|
15
6
|
const node_opcua_types_1 = require("node-opcua-types");
|
|
16
|
-
function _walkThroughTypes(session, nodeId, visitor, level, parent) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
7
|
+
async function _walkThroughTypes(session, nodeId, visitor, level, parent) {
|
|
8
|
+
level = level || 0;
|
|
9
|
+
if (!parent) {
|
|
10
|
+
const dataValues = await session.read([
|
|
11
|
+
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.BrowseName },
|
|
12
|
+
{ nodeId, attributeId: node_opcua_data_model_1.AttributeIds.NodeClass }
|
|
13
|
+
]);
|
|
14
|
+
const browseName = dataValues[0].value.value;
|
|
15
|
+
const nodeClass = dataValues[1].value.value;
|
|
16
|
+
parent = new node_opcua_types_1.ReferenceDescription({
|
|
17
|
+
isForward: true,
|
|
18
|
+
nodeId: nodeId,
|
|
19
|
+
browseName,
|
|
20
|
+
nodeClass,
|
|
21
|
+
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype")
|
|
22
|
+
// typeDefinition,
|
|
41
23
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
24
|
+
}
|
|
25
|
+
const browseResult = await session.browse({
|
|
26
|
+
browseDirection: node_opcua_data_model_1.BrowseDirection.Forward,
|
|
27
|
+
nodeId,
|
|
28
|
+
includeSubtypes: true,
|
|
29
|
+
referenceTypeId: (0, node_opcua_nodeid_1.resolveNodeId)("HasSubtype"),
|
|
30
|
+
resultMask: 0xff
|
|
50
31
|
});
|
|
32
|
+
for (const reference of browseResult.references || []) {
|
|
33
|
+
if (visitor) {
|
|
34
|
+
const r = reference;
|
|
35
|
+
r.parent = parent;
|
|
36
|
+
await visitor.visit(r, level);
|
|
37
|
+
}
|
|
38
|
+
await _walkThroughTypes(session, reference.nodeId, visitor, level + 1, reference);
|
|
39
|
+
}
|
|
51
40
|
}
|
|
52
|
-
function walkThroughReferenceTypes(session, nodeVisitor) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
yield _walkThroughTypes(session, baseReferenceTypeNodeId, nodeVisitor);
|
|
56
|
-
});
|
|
41
|
+
async function walkThroughReferenceTypes(session, nodeVisitor) {
|
|
42
|
+
const baseReferenceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("References");
|
|
43
|
+
await _walkThroughTypes(session, baseReferenceTypeNodeId, nodeVisitor);
|
|
57
44
|
}
|
|
58
45
|
exports.walkThroughReferenceTypes = walkThroughReferenceTypes;
|
|
59
|
-
function walkThroughDataTypes(session, nodeVisitor) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
yield _walkThroughTypes(session, baseDataTypeTypeNodeId, nodeVisitor);
|
|
63
|
-
});
|
|
46
|
+
async function walkThroughDataTypes(session, nodeVisitor) {
|
|
47
|
+
const baseDataTypeTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseDataType");
|
|
48
|
+
await _walkThroughTypes(session, baseDataTypeTypeNodeId, nodeVisitor);
|
|
64
49
|
}
|
|
65
50
|
exports.walkThroughDataTypes = walkThroughDataTypes;
|
|
66
|
-
function walkThroughInterfaceTypes(session, nodeVisitor) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
yield _walkThroughTypes(session, baseInterfaceTypeNodeId, nodeVisitor);
|
|
70
|
-
});
|
|
51
|
+
async function walkThroughInterfaceTypes(session, nodeVisitor) {
|
|
52
|
+
const baseInterfaceTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseInterfaceType");
|
|
53
|
+
await _walkThroughTypes(session, baseInterfaceTypeNodeId, nodeVisitor);
|
|
71
54
|
}
|
|
72
55
|
exports.walkThroughInterfaceTypes = walkThroughInterfaceTypes;
|
|
73
|
-
function walkThroughObjectTypes(session, nodeVisitor) {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
yield _walkThroughTypes(session, baseObjectTypeNodeId, nodeVisitor);
|
|
77
|
-
});
|
|
56
|
+
async function walkThroughObjectTypes(session, nodeVisitor) {
|
|
57
|
+
const baseObjectTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseObjectType");
|
|
58
|
+
await _walkThroughTypes(session, baseObjectTypeNodeId, nodeVisitor);
|
|
78
59
|
}
|
|
79
60
|
exports.walkThroughObjectTypes = walkThroughObjectTypes;
|
|
80
|
-
function walkThroughVariableTypes(session, nodeVisitor) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
yield _walkThroughTypes(session, baseObjectTypeNodeId, nodeVisitor);
|
|
84
|
-
});
|
|
61
|
+
async function walkThroughVariableTypes(session, nodeVisitor) {
|
|
62
|
+
const baseObjectTypeNodeId = (0, node_opcua_nodeid_1.resolveNodeId)("BaseVariableType");
|
|
63
|
+
await _walkThroughTypes(session, baseObjectTypeNodeId, nodeVisitor);
|
|
85
64
|
}
|
|
86
65
|
exports.walkThroughVariableTypes = walkThroughVariableTypes;
|
|
87
66
|
//# sourceMappingURL=walk_through.js.map
|
package/dist/walk_through.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walk_through.js","sourceRoot":"","sources":["../source/walk_through.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"walk_through.js","sourceRoot":"","sources":["../source/walk_through.ts"],"names":[],"mappings":";;;AAAA,iEAAgG;AAChG,yDAA0E;AAE1E,uDAAwD;A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-opcua-convert-nodeset-to-javascript",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.114.0",
|
|
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,26 +15,26 @@
|
|
|
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.
|
|
19
|
-
"node-opcua-address-space-base": "2.
|
|
18
|
+
"node-opcua-address-space": "2.114.0",
|
|
19
|
+
"node-opcua-address-space-base": "2.114.0",
|
|
20
20
|
"node-opcua-assert": "2.105.0",
|
|
21
|
-
"node-opcua-constants": "2.
|
|
22
|
-
"node-opcua-data-model": "2.
|
|
23
|
-
"node-opcua-debug": "2.
|
|
24
|
-
"node-opcua-extension-object": "2.
|
|
25
|
-
"node-opcua-nodeid": "2.
|
|
21
|
+
"node-opcua-constants": "2.114.0",
|
|
22
|
+
"node-opcua-data-model": "2.114.0",
|
|
23
|
+
"node-opcua-debug": "2.114.0",
|
|
24
|
+
"node-opcua-extension-object": "2.114.0",
|
|
25
|
+
"node-opcua-nodeid": "2.114.0",
|
|
26
26
|
"node-opcua-nodesets": "2.110.0",
|
|
27
|
-
"node-opcua-pseudo-session": "2.
|
|
28
|
-
"node-opcua-status-code": "2.
|
|
29
|
-
"node-opcua-types": "2.
|
|
30
|
-
"node-opcua-utils": "2.
|
|
31
|
-
"node-opcua-variant": "2.
|
|
27
|
+
"node-opcua-pseudo-session": "2.114.0",
|
|
28
|
+
"node-opcua-status-code": "2.114.0",
|
|
29
|
+
"node-opcua-types": "2.114.0",
|
|
30
|
+
"node-opcua-utils": "2.114.0",
|
|
31
|
+
"node-opcua-variant": "2.114.0",
|
|
32
32
|
"wordwrap": "^1.0.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"node-opcua-leak-detector": "2.
|
|
36
|
-
"node-opcua-packet-analyzer": "2.
|
|
37
|
-
"node-opcua-service-translate-browse-path": "2.
|
|
35
|
+
"node-opcua-leak-detector": "2.114.0",
|
|
36
|
+
"node-opcua-packet-analyzer": "2.114.0",
|
|
37
|
+
"node-opcua-service-translate-browse-path": "2.114.0",
|
|
38
38
|
"should": "^13.2.3"
|
|
39
39
|
},
|
|
40
40
|
"author": "Etienne Rossignon",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"internet of things"
|
|
53
53
|
],
|
|
54
54
|
"homepage": "http://node-opcua.github.io/",
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "358d284a696c88e383eedac1ab75d950fb28ec35",
|
|
56
56
|
"files": [
|
|
57
57
|
"dist",
|
|
58
58
|
"source"
|