node-opcua-service-translate-browse-path
Advanced tools
Comparing version 2.0.0-alpha.8 to 2.0.0-alpha.9
@@ -0,1 +1,4 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
export { RelativePathElement, RelativePath, BrowsePath, TranslateBrowsePathsToNodeIdsRequest, BrowsePathTarget, BrowsePathResult, TranslateBrowsePathsToNodeIdsResponse } from "node-opcua-types"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
var node_opcua_types_1 = require("node-opcua-types"); | ||
@@ -4,0 +7,0 @@ exports.RelativePathElement = node_opcua_types_1.RelativePathElement; |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
export * from "./imports"; | ||
@@ -2,0 +5,0 @@ export * from "./make_browse_path"; |
@@ -6,2 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
__export(require("./imports")); | ||
@@ -8,0 +11,0 @@ __export(require("./make_browse_path")); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const node_opcua_nodeid_1 = require("node-opcua-nodeid"); | ||
const node_opcua_types_1 = require("node-opcua-types"); | ||
const make_relative_path_1 = require("./make_relative_path"); | ||
const node_opcua_nodeid_1 = require("node-opcua-nodeid"); | ||
function _get_nodeId(node) { | ||
@@ -7,0 +7,0 @@ if (node.nodeId) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
const node_opcua_assert_1 = require("node-opcua-assert"); | ||
const node_opcua_data_model_1 = require("node-opcua-data-model"); | ||
const node_opcua_nodeid_1 = require("node-opcua-nodeid"); | ||
const node_opcua_data_model_1 = require("node-opcua-data-model"); | ||
const node_opcua_types_1 = require("node-opcua-types"); | ||
@@ -25,3 +28,2 @@ /*= | ||
“<1:ConnectedTo>1:Boiler/” | ||
@@ -88,3 +90,3 @@ Follows any forward Reference with a BrowseName = ‘1:ConnectedTo’ and finds targets | ||
} | ||
const namespaceIndex = mm[11] ? parseInt(mm[11]) : 0; | ||
const namespaceIndex = mm[11] ? parseInt(mm[11], 10) : 0; | ||
const name = unescape(mm[12]); | ||
@@ -116,3 +118,5 @@ return new node_opcua_data_model_1.QualifiedName({ namespaceIndex, name }); | ||
// console.log(mm); | ||
let referenceTypeId, includeSubtypes, isInverse; | ||
let referenceTypeId; | ||
let includeSubtypes; | ||
let isInverse; | ||
// | ||
@@ -140,3 +144,3 @@ // ------------ extract reference type | ||
// name match 7 | ||
const ns = matches[6] ? parseInt(matches[6]) : 0; | ||
const ns = matches[6] ? parseInt(matches[6], 10) : 0; | ||
const name = matches[7]; | ||
@@ -143,0 +147,0 @@ if (!matches[6]) { |
@@ -1,9 +0,3 @@ | ||
/** | ||
* @module opcua.miscellaneous | ||
* @class ToolBrowsePath | ||
* | ||
* @static | ||
*/ | ||
import { NodeId } from "node-opcua-nodeid"; | ||
import { BrowsePath } from "./imports"; | ||
import { NodeId } from "node-opcua-nodeid"; | ||
export { stringToQualifiedName } from "node-opcua-data-model"; | ||
@@ -10,0 +4,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module opcua.miscellaneous | ||
* @module node-opcua-service-translate-browse-path | ||
* @class ToolBrowsePath | ||
* | ||
* @static | ||
*/ | ||
const node_opcua_constants_1 = require("node-opcua-constants"); | ||
const node_opcua_nodeid_1 = require("node-opcua-nodeid"); | ||
const imports_1 = require("./imports"); | ||
const node_opcua_nodeid_1 = require("node-opcua-nodeid"); | ||
const node_opcua_constants_1 = require("node-opcua-constants"); | ||
const hierarchicalReferencesId = node_opcua_nodeid_1.makeNodeId(node_opcua_constants_1.ReferenceTypeIds.HierarchicalReferences); | ||
@@ -25,5 +24,5 @@ var node_opcua_data_model_1 = require("node-opcua-data-model"); | ||
return { | ||
referenceTypeId: hierarchicalReferencesId, | ||
isInverse: false, | ||
includeSubtypes: true, | ||
referenceTypeId: hierarchicalReferencesId, | ||
targetName | ||
@@ -33,4 +32,4 @@ }; | ||
const browsePath = new imports_1.BrowsePath({ | ||
relativePath: { elements }, | ||
startingNode: startingNode.nodeId, | ||
relativePath: { elements } | ||
}); | ||
@@ -37,0 +36,0 @@ return browsePath; |
{ | ||
"name": "node-opcua-service-translate-browse-path", | ||
"version": "2.0.0-alpha.8", | ||
"version": "2.0.0-alpha.9", | ||
"description": "pure nodejs OPCUA SDK - module -service-translate-browse-path", | ||
@@ -13,17 +13,17 @@ "scripts": { | ||
"dependencies": { | ||
"node-opcua-assert": "^2.0.0-alpha.8", | ||
"node-opcua-basic-types": "^2.0.0-alpha.8", | ||
"node-opcua-binary-stream": "^2.0.0-alpha.8", | ||
"node-opcua-constants": "^2.0.0-alpha.8", | ||
"node-opcua-data-model": "^2.0.0-alpha.8", | ||
"node-opcua-factory": "^2.0.0-alpha.8", | ||
"node-opcua-nodeid": "^2.0.0-alpha.8", | ||
"node-opcua-service-secure-channel": "^2.0.0-alpha.8", | ||
"node-opcua-types": "^2.0.0-alpha.8", | ||
"node-opcua-assert": "^2.0.0-alpha.9", | ||
"node-opcua-basic-types": "^2.0.0-alpha.9", | ||
"node-opcua-binary-stream": "^2.0.0-alpha.9", | ||
"node-opcua-constants": "^2.0.0-alpha.9", | ||
"node-opcua-data-model": "^2.0.0-alpha.9", | ||
"node-opcua-factory": "^2.0.0-alpha.9", | ||
"node-opcua-nodeid": "^2.0.0-alpha.9", | ||
"node-opcua-service-secure-channel": "^2.0.0-alpha.9", | ||
"node-opcua-types": "^2.0.0-alpha.9", | ||
"underscore": "^1.9.1" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-generator": "^2.0.0-alpha.8", | ||
"node-opcua-generator": "^2.0.0-alpha.9", | ||
"should": "13.2.3", | ||
"sinon": "^7.1.1" | ||
"sinon": "^7.2.2" | ||
}, | ||
@@ -45,3 +45,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "7bbf38d5a3cd29cb6aed6ca38078f4d89d3f956a" | ||
"gitHead": "cd7120d1840593757f0f3c9e53be4e85883dc0e6" | ||
} |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
export { | ||
@@ -2,0 +5,0 @@ RelativePathElement, |
@@ -1,2 +0,4 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
export * from "./imports"; | ||
@@ -3,0 +5,0 @@ export * from "./make_browse_path"; |
@@ -0,5 +1,8 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
import { assert } from "node-opcua-assert"; | ||
import { NodeId, resolveNodeId } from "node-opcua-nodeid"; | ||
import { BrowsePath } from "node-opcua-types"; | ||
import { makeRelativePath } from "./make_relative_path"; | ||
import { resolveNodeId, NodeId } from "node-opcua-nodeid"; | ||
@@ -15,4 +18,5 @@ function _get_nodeId(node: any): NodeId { | ||
startingNode: _get_nodeId(rootNode), | ||
relativePath: makeRelativePath(relativePathBNF) | ||
}); | ||
} |
@@ -0,4 +1,7 @@ | ||
/** | ||
* @module node-opcua-service-translate-browse-path | ||
*/ | ||
import { assert } from "node-opcua-assert"; | ||
import { resolveNodeId, NodeId } from "node-opcua-nodeid"; | ||
import { QualifiedName } from "node-opcua-data-model"; | ||
import { NodeId, resolveNodeId } from "node-opcua-nodeid"; | ||
import { RelativePath } from "node-opcua-types"; | ||
@@ -11,3 +14,2 @@ /*= | ||
/* | ||
@@ -26,3 +28,2 @@ | ||
“<1:ConnectedTo>1:Boiler/” | ||
@@ -67,3 +68,2 @@ Follows any forward Reference with a BrowseName = ‘1:ConnectedTo’ and finds targets | ||
// The following BNF describes the syntax of the RelativePath text format. | ||
@@ -97,3 +97,3 @@ // <relative-path> ::= <reference-type> <browse-name> [relative-path] | ||
} | ||
const namespaceIndex = mm[11] ? parseInt(mm[11]) : 0; | ||
const namespaceIndex = mm[11] ? parseInt(mm[11], 10) : 0; | ||
const name = unescape(mm[12]); | ||
@@ -129,3 +129,5 @@ return new QualifiedName({namespaceIndex, name}); | ||
let referenceTypeId: NodeId, includeSubtypes: boolean, isInverse: boolean; | ||
let referenceTypeId: NodeId; | ||
let includeSubtypes: boolean; | ||
let isInverse: boolean; | ||
@@ -156,3 +158,3 @@ // | ||
// name match 7 | ||
const ns = matches[6] ? parseInt(matches[6]) : 0; | ||
const ns = matches[6] ? parseInt(matches[6], 10) : 0; | ||
const name = matches[7]; | ||
@@ -159,0 +161,0 @@ if (!matches[6]) { |
/** | ||
* @module opcua.miscellaneous | ||
* @module node-opcua-service-translate-browse-path | ||
* @class ToolBrowsePath | ||
* | ||
* @static | ||
*/ | ||
import { ReferenceTypeIds } from "node-opcua-constants"; | ||
import { makeNodeId, NodeId } from "node-opcua-nodeid"; | ||
import { BrowsePath } from "./imports"; | ||
import { makeNodeId, NodeId } from "node-opcua-nodeid"; | ||
import { ReferenceTypeIds } from "node-opcua-constants"; | ||
@@ -20,3 +19,6 @@ const hierarchicalReferencesId = makeNodeId(ReferenceTypeIds.HierarchicalReferences); | ||
*/ | ||
export function constructBrowsePathFromQualifiedName(startingNode: { nodeId: NodeId }, targetNames: null | string[]): BrowsePath { | ||
export function constructBrowsePathFromQualifiedName( | ||
startingNode: { nodeId: NodeId }, | ||
targetNames: null | string[] | ||
): BrowsePath { | ||
@@ -27,5 +29,7 @@ targetNames = targetNames || []; | ||
return { | ||
referenceTypeId: hierarchicalReferencesId, | ||
isInverse: false, | ||
includeSubtypes: true, | ||
referenceTypeId: hierarchicalReferencesId, | ||
targetName | ||
@@ -36,6 +40,6 @@ }; | ||
const browsePath = new BrowsePath({ | ||
relativePath: { elements }, | ||
startingNode: startingNode.nodeId, // ROOT | ||
relativePath: {elements} | ||
}); | ||
return browsePath; | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29361
23
503