node-opcua-nodeid
Advanced tools
Comparing version 2.5.9 to 2.6.0-alpha.0
/// <reference types="node" /> | ||
import { Guid } from "node-opcua-guid"; | ||
import { NodeId, NodeIdType } from "./nodeid"; | ||
/** | ||
* An ExpandedNodeId extends the NodeId structure. | ||
* | ||
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be | ||
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it | ||
* is specified then the NamespaceIndex inside the NodeId shall be ignored. | ||
* | ||
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9 | ||
* and then encoding NamespaceUri as a String. | ||
* | ||
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the | ||
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of | ||
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding | ||
* format byte for the NodeId. | ||
* | ||
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in | ||
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in | ||
* the stream for consistency, | ||
* | ||
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the | ||
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the | ||
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero. | ||
* | ||
* @class ExpandedNodeId | ||
* @extends NodeId | ||
* | ||
* | ||
* | ||
* @param identifierType - the nodeID type | ||
* @param value - the node id value. The type of Value depends on identifierType. | ||
* @param namespace - the index of the related namespace (optional , default value = 0 ) | ||
* @param namespaceUri - NamespaceUri | ||
* @param serverIndex - the server Index | ||
* @constructor | ||
*/ | ||
export declare class ExpandedNodeId extends NodeId { | ||
@@ -45,21 +10,6 @@ static nullExpandedNodeId: ExpandedNodeId; | ||
constructor(identifierType: NodeIdType, value: number | string | Guid | Buffer, namespace: number, namespaceUri?: null | string, serverIndex?: number); | ||
/** | ||
* @method toString | ||
* @return {string} | ||
*/ | ||
toString(): string; | ||
/** | ||
* convert nodeId to a JSON string. same as {@link NodeId#toString } | ||
* @method toJSON | ||
* @return {String} | ||
*/ | ||
toJSON(): any; | ||
} | ||
export declare function coerceExpandedNodeId(value: any): ExpandedNodeId; | ||
/** | ||
* @method makeExpandedNodeId | ||
* @param value | ||
* @param [namespace=0] the namespace | ||
* @return {ExpandedNodeId} | ||
*/ | ||
export declare function makeExpandedNodeId(value: any, namespace?: number): ExpandedNodeId; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-nodeid | ||
*/ | ||
exports.makeExpandedNodeId = exports.coerceExpandedNodeId = exports.ExpandedNodeId = void 0; | ||
const _ = require("underscore"); | ||
const nodeid_1 = require("./nodeid"); | ||
/** | ||
* An ExpandedNodeId extends the NodeId structure. | ||
* | ||
* An ExpandedNodeId extends the NodeId structure by allowing the NamespaceUri to be | ||
* explicitly specified instead of using the NamespaceIndex. The NamespaceUri is optional. If it | ||
* is specified then the NamespaceIndex inside the NodeId shall be ignored. | ||
* | ||
* The ExpandedNodeId is encoded by first encoding a NodeId as described in Clause 5 .2.2.9 | ||
* and then encoding NamespaceUri as a String. | ||
* | ||
* An instance of an ExpandedNodeId may still use the NamespaceIndex instead of the | ||
* NamespaceUri. In this case, the NamespaceUri is not encoded in the stream. The presence of | ||
* the NamespaceUri in the stream is indicated by setting the NamespaceUri flag in the encoding | ||
* format byte for the NodeId. | ||
* | ||
* If the NamespaceUri is present then the encoder shall encode the NamespaceIndex as 0 in | ||
* the stream when the NodeId portion is encoded. The unused NamespaceIndex is included in | ||
* the stream for consistency, | ||
* | ||
* An ExpandedNodeId may also have a ServerIndex which is encoded as a UInt32 after the | ||
* NamespaceUri. The ServerIndex flag in the NodeId encoding byte indicates whether the | ||
* ServerIndex is present in the stream. The ServerIndex is omitted if it is equal to zero. | ||
* | ||
* @class ExpandedNodeId | ||
* @extends NodeId | ||
* | ||
* | ||
* | ||
* @param identifierType - the nodeID type | ||
* @param value - the node id value. The type of Value depends on identifierType. | ||
* @param namespace - the index of the related namespace (optional , default value = 0 ) | ||
* @param namespaceUri - NamespaceUri | ||
* @param serverIndex - the server Index | ||
* @constructor | ||
*/ | ||
class ExpandedNodeId extends nodeid_1.NodeId { | ||
constructor(identifierType, value, namespace, namespaceUri, serverIndex) { | ||
super(identifierType, value, namespace); | ||
this.namespaceUri = namespaceUri || null; | ||
this.serverIndex = serverIndex || 0; | ||
} | ||
static fromNodeId(nodeId, namespaceUri, serverIndex) { | ||
return new ExpandedNodeId(nodeId.identifierType, nodeId.value, nodeId.namespace, namespaceUri, serverIndex); | ||
} | ||
/** | ||
* @method toString | ||
* @return {string} | ||
*/ | ||
toString() { | ||
let str = nodeid_1.NodeId.prototype.toString.call(this); | ||
if (this.namespaceUri) { | ||
str += ";namespaceUri:" + this.namespaceUri; | ||
let ExpandedNodeId = (() => { | ||
class ExpandedNodeId extends nodeid_1.NodeId { | ||
constructor(identifierType, value, namespace, namespaceUri, serverIndex) { | ||
super(identifierType, value, namespace); | ||
this.namespaceUri = namespaceUri || null; | ||
this.serverIndex = serverIndex || 0; | ||
} | ||
if (this.serverIndex) { | ||
str += ";serverIndex:" + this.serverIndex; | ||
static fromNodeId(nodeId, namespaceUri, serverIndex) { | ||
return new ExpandedNodeId(nodeId.identifierType, nodeId.value, nodeId.namespace, namespaceUri, serverIndex); | ||
} | ||
return str; | ||
toString() { | ||
let str = nodeid_1.NodeId.prototype.toString.call(this); | ||
if (this.namespaceUri) { | ||
str += ";namespaceUri:" + this.namespaceUri; | ||
} | ||
if (this.serverIndex) { | ||
str += ";serverIndex:" + this.serverIndex; | ||
} | ||
return str; | ||
} | ||
toJSON() { | ||
return this.toString(); | ||
} | ||
} | ||
/** | ||
* convert nodeId to a JSON string. same as {@link NodeId#toString } | ||
* @method toJSON | ||
* @return {String} | ||
*/ | ||
toJSON() { | ||
return this.toString(); | ||
} | ||
} | ||
ExpandedNodeId.nullExpandedNodeId = new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0); | ||
return ExpandedNodeId; | ||
})(); | ||
exports.ExpandedNodeId = ExpandedNodeId; | ||
ExpandedNodeId.nullExpandedNodeId = new ExpandedNodeId(nodeid_1.NodeIdType.NUMERIC, 0, 0); | ||
function coerceExpandedNodeId(value) { | ||
const n = nodeid_1.coerceNodeId(value); | ||
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, /*namespaceUri*/ null, /*serverIndex*/ 0); | ||
return new ExpandedNodeId(n.identifierType, n.value, n.namespace, null, 0); | ||
} | ||
exports.coerceExpandedNodeId = coerceExpandedNodeId; | ||
/** | ||
* @method makeExpandedNodeId | ||
* @param value | ||
* @param [namespace=0] the namespace | ||
* @return {ExpandedNodeId} | ||
*/ | ||
function makeExpandedNodeId(value, namespace) { | ||
@@ -96,3 +47,2 @@ if (value === undefined && namespace === undefined) { | ||
if (value instanceof ExpandedNodeId) { | ||
// construct from a ExpandedNodeId => copy | ||
n = value; | ||
@@ -102,3 +52,2 @@ return new ExpandedNodeId(n.identifierType, n.value, n.namespace, n.namespaceUri, n.serverIndex); | ||
if (value instanceof nodeid_1.NodeId) { | ||
// construct from a nodeId | ||
n = value; | ||
@@ -105,0 +54,0 @@ return new ExpandedNodeId(n.identifierType, n.value, n.namespace, namespaceUri, serverIndex); |
@@ -1,5 +0,2 @@ | ||
/** | ||
* @module node-opcua-nodeid | ||
*/ | ||
export * from "./nodeid"; | ||
export * from "./expanded_nodeid"; |
"use strict"; | ||
function __export(m) { | ||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-nodeid | ||
*/ | ||
__export(require("./nodeid")); | ||
__export(require("./expanded_nodeid")); | ||
__exportStar(require("./nodeid"), exports); | ||
__exportStar(require("./expanded_nodeid"), exports); | ||
//# sourceMappingURL=index.js.map |
/// <reference types="node" /> | ||
import { Guid } from "node-opcua-guid"; | ||
/** | ||
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value. | ||
*/ | ||
export declare enum NodeIdType { | ||
/** | ||
* @static | ||
* @property NUMERIC | ||
* @default 0x1 | ||
*/ | ||
NUMERIC = 1, | ||
/** | ||
* @static | ||
* @property STRING | ||
* @default 0x2 | ||
*/ | ||
STRING = 2, | ||
/** | ||
* @static | ||
* @property GUID | ||
* @default 0x3 | ||
*/ | ||
GUID = 3, | ||
/** | ||
* @static | ||
* @property BYTESTRING | ||
* @default 0x4 | ||
*/ | ||
BYTESTRING = 4 | ||
} | ||
/** | ||
* Construct a node ID | ||
* | ||
* @class NodeId | ||
* @example | ||
* | ||
* ``` javascript | ||
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1); | ||
* ``` | ||
* @constructor | ||
*/ | ||
export declare class NodeId { | ||
@@ -51,72 +17,14 @@ static NodeIdType: typeof NodeIdType; | ||
namespace: number; | ||
/** | ||
* @param identifierType - the nodeID type | ||
* @param value - the node id value. The type of Value depends on identifierType. | ||
* @param namespace - the index of the related namespace (optional , default value = 0 ) | ||
*/ | ||
constructor(identifierType: NodeIdType, value: any, namespace?: number); | ||
/** | ||
* get the string representation of the nodeID. | ||
* | ||
* @method toString | ||
* @example | ||
* | ||
* ``` javascript | ||
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1); | ||
* console.log(nodeid.toString()); | ||
* ``` | ||
* | ||
* ``` | ||
* >"ns=1;i=123" | ||
* ``` | ||
* | ||
* @param [options.addressSpace] {AddressSpace} | ||
* @return {String} | ||
*/ | ||
toString(options?: { | ||
addressSpace?: any; | ||
}): string; | ||
/** | ||
* convert nodeId to a JSON string. same as {@link NodeId#toString } | ||
*/ | ||
toJSON(): string; | ||
displayText(): string; | ||
/** | ||
* returns true if the NodeId is null or empty | ||
*/ | ||
isEmpty(): boolean; | ||
} | ||
export declare type NodeIdLike = string | NodeId | number; | ||
/** | ||
* Convert a value into a nodeId: | ||
* @class opcua | ||
* @method coerceNodeId | ||
* @static | ||
* | ||
* @description: | ||
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC}) | ||
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING}) | ||
* - if nodeId is a {@link NodeId} : coerceNodeId returns value | ||
* @param value | ||
* @param namespace {number} | ||
*/ | ||
export declare function coerceNodeId(value: any, namespace?: number): NodeId; | ||
/** | ||
* construct a node Id from a value and a namespace. | ||
* @class opcua | ||
* @method makeNodeId | ||
* @static | ||
* @param {String|Buffer} value | ||
* @param [namespace]=0 {Number} the node id namespace | ||
* @return {NodeId} | ||
*/ | ||
export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId; | ||
/** | ||
* @class opcua | ||
* @method resolveNodeId | ||
* @static | ||
* @param nodeIdOrString | ||
* @return the nodeId | ||
*/ | ||
export declare function resolveNodeId(nodeIdOrString: NodeIdLike): NodeId; | ||
export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module node-opcua-nodeid | ||
*/ | ||
// tslint:disable:no-conditional-assignment | ||
exports.sameNodeId = exports.resolveNodeId = exports.makeNodeId = exports.coerceNodeId = exports.NodeId = exports.NodeIdType = void 0; | ||
const chalk = require("chalk"); | ||
@@ -12,149 +9,85 @@ const node_opcua_assert_1 = require("node-opcua-assert"); | ||
const _ = require("underscore"); | ||
/** | ||
* `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value. | ||
*/ | ||
var NodeIdType; | ||
(function (NodeIdType) { | ||
/** | ||
* @static | ||
* @property NUMERIC | ||
* @default 0x1 | ||
*/ | ||
NodeIdType[NodeIdType["NUMERIC"] = 1] = "NUMERIC"; | ||
/** | ||
* @static | ||
* @property STRING | ||
* @default 0x2 | ||
*/ | ||
NodeIdType[NodeIdType["STRING"] = 2] = "STRING"; | ||
/** | ||
* @static | ||
* @property GUID | ||
* @default 0x3 | ||
*/ | ||
NodeIdType[NodeIdType["GUID"] = 3] = "GUID"; | ||
/** | ||
* @static | ||
* @property BYTESTRING | ||
* @default 0x4 | ||
*/ | ||
NodeIdType[NodeIdType["BYTESTRING"] = 4] = "BYTESTRING"; | ||
})(NodeIdType = exports.NodeIdType || (exports.NodeIdType = {})); | ||
/** | ||
* Construct a node ID | ||
* | ||
* @class NodeId | ||
* @example | ||
* | ||
* ``` javascript | ||
* const nodeId = new NodeId(NodeIdType.NUMERIC,123,1); | ||
* ``` | ||
* @constructor | ||
*/ | ||
class NodeId { | ||
/** | ||
* @param identifierType - the nodeID type | ||
* @param value - the node id value. The type of Value depends on identifierType. | ||
* @param namespace - the index of the related namespace (optional , default value = 0 ) | ||
*/ | ||
constructor(identifierType, value, namespace) { | ||
this.identifierType = identifierType; | ||
this.value = value; | ||
this.namespace = namespace || 0; | ||
// namespace shall be a UInt16 | ||
node_opcua_assert_1.assert(this.namespace >= 0 && this.namespace <= 0xFFFF); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.NUMERIC || (this.value >= 0 && this.value <= 0xFFFFFFFF)); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.GUID || node_opcua_guid_1.isValidGuid(this.value)); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.STRING || typeof this.value === "string"); | ||
} | ||
/** | ||
* get the string representation of the nodeID. | ||
* | ||
* @method toString | ||
* @example | ||
* | ||
* ``` javascript | ||
* const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1); | ||
* console.log(nodeid.toString()); | ||
* ``` | ||
* | ||
* ``` | ||
* >"ns=1;i=123" | ||
* ``` | ||
* | ||
* @param [options.addressSpace] {AddressSpace} | ||
* @return {String} | ||
*/ | ||
toString(options) { | ||
const addressSpace = options ? options.addressSpace : null; | ||
let str; | ||
switch (this.identifierType) { | ||
case NodeIdType.NUMERIC: | ||
str = "ns=" + this.namespace + ";i=" + this.value; | ||
break; | ||
case NodeIdType.STRING: | ||
str = "ns=" + this.namespace + ";s=" + this.value; | ||
break; | ||
case NodeIdType.GUID: | ||
str = "ns=" + this.namespace + ";g=" + this.value; | ||
break; | ||
default: | ||
node_opcua_assert_1.assert(this.identifierType === NodeIdType.BYTESTRING, "invalid identifierType in NodeId : " + this.identifierType); | ||
if (this.value) { | ||
str = "ns=" + this.namespace + ";b=" + this.value.toString("hex"); | ||
let NodeId = (() => { | ||
class NodeId { | ||
constructor(identifierType, value, namespace) { | ||
this.identifierType = identifierType; | ||
this.value = value; | ||
this.namespace = namespace || 0; | ||
node_opcua_assert_1.assert(this.namespace >= 0 && this.namespace <= 0xFFFF); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.NUMERIC || (this.value >= 0 && this.value <= 0xFFFFFFFF)); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.GUID || node_opcua_guid_1.isValidGuid(this.value)); | ||
node_opcua_assert_1.assert(this.identifierType !== NodeIdType.STRING || typeof this.value === "string"); | ||
} | ||
toString(options) { | ||
const addressSpace = options ? options.addressSpace : null; | ||
let str; | ||
switch (this.identifierType) { | ||
case NodeIdType.NUMERIC: | ||
str = "ns=" + this.namespace + ";i=" + this.value; | ||
break; | ||
case NodeIdType.STRING: | ||
str = "ns=" + this.namespace + ";s=" + this.value; | ||
break; | ||
case NodeIdType.GUID: | ||
str = "ns=" + this.namespace + ";g=" + this.value; | ||
break; | ||
default: | ||
node_opcua_assert_1.assert(this.identifierType === NodeIdType.BYTESTRING, "invalid identifierType in NodeId : " + this.identifierType); | ||
if (this.value) { | ||
str = "ns=" + this.namespace + ";b=" + this.value.toString("hex"); | ||
} | ||
else { | ||
str = "ns=" + this.namespace + ";b=<null>"; | ||
} | ||
break; | ||
} | ||
if (addressSpace) { | ||
if (this.namespace === 0 && (this.identifierType === NodeIdType.NUMERIC)) { | ||
const name = reverse_map(this.value.toString()) || "<undefined>"; | ||
str += " " + chalk.green.bold(name); | ||
} | ||
else { | ||
str = "ns=" + this.namespace + ";b=<null>"; | ||
else if (addressSpace.findNode) { | ||
const n = addressSpace.findNode(this); | ||
str += " " + (n ? n.browseName.toString() : " (????)"); | ||
} | ||
break; | ||
} | ||
return str; | ||
} | ||
if (addressSpace) { | ||
if (this.namespace === 0 && (this.identifierType === NodeIdType.NUMERIC)) { | ||
// find standard browse name | ||
const name = reverse_map(this.value.toString()) || "<undefined>"; | ||
str += " " + chalk.green.bold(name); | ||
toJSON() { | ||
return this.toString(); | ||
} | ||
displayText() { | ||
if (this.namespace === 0 && this.identifierType === NodeIdType.NUMERIC) { | ||
const name = reverse_map(this.value.toString()); | ||
if (name) { | ||
return name + " (" + this.toString() + ")"; | ||
} | ||
} | ||
else if (addressSpace.findNode) { | ||
// let use the provided address space to figure out the browseNode of this node. | ||
// to make the message a little bit more useful. | ||
const n = addressSpace.findNode(this); | ||
str += " " + (n ? n.browseName.toString() : " (????)"); | ||
} | ||
return this.toString(); | ||
} | ||
return str; | ||
} | ||
/** | ||
* convert nodeId to a JSON string. same as {@link NodeId#toString } | ||
*/ | ||
toJSON() { | ||
return this.toString(); | ||
} | ||
displayText() { | ||
if (this.namespace === 0 && this.identifierType === NodeIdType.NUMERIC) { | ||
const name = reverse_map(this.value.toString()); | ||
if (name) { | ||
return name + " (" + this.toString() + ")"; | ||
isEmpty() { | ||
switch (this.identifierType) { | ||
case NodeIdType.NUMERIC: | ||
return this.value === 0; | ||
case NodeIdType.STRING: | ||
return !this.value || this.value.length === 0; | ||
case NodeIdType.GUID: | ||
return !this.value || this.value === node_opcua_guid_1.emptyGuid; | ||
default: | ||
node_opcua_assert_1.assert(this.identifierType === NodeIdType.BYTESTRING, "invalid identifierType in NodeId : " + this.identifierType); | ||
return !this.value || this.value.length === 0; | ||
} | ||
} | ||
return this.toString(); | ||
} | ||
/** | ||
* returns true if the NodeId is null or empty | ||
*/ | ||
isEmpty() { | ||
switch (this.identifierType) { | ||
case NodeIdType.NUMERIC: | ||
return this.value === 0; | ||
case NodeIdType.STRING: | ||
return !this.value || this.value.length === 0; | ||
case NodeIdType.GUID: | ||
return !this.value || this.value === node_opcua_guid_1.emptyGuid; | ||
default: | ||
node_opcua_assert_1.assert(this.identifierType === NodeIdType.BYTESTRING, "invalid identifierType in NodeId : " + this.identifierType); | ||
return !this.value || this.value.length === 0; | ||
} | ||
} | ||
} | ||
NodeId.NodeIdType = NodeIdType; | ||
return NodeId; | ||
})(); | ||
exports.NodeId = NodeId; | ||
NodeId.NodeIdType = NodeIdType; | ||
NodeId.nullNodeId = new NodeId(NodeIdType.NUMERIC, 0); | ||
@@ -165,15 +98,2 @@ const regexNamespaceI = /ns=([0-9]+);i=([0-9]+)/; | ||
const regexNamespaceG = /ns=([0-9]+);g=(.*)/; | ||
/** | ||
* Convert a value into a nodeId: | ||
* @class opcua | ||
* @method coerceNodeId | ||
* @static | ||
* | ||
* @description: | ||
* - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC}) | ||
* - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING}) | ||
* - if nodeId is a {@link NodeId} : coerceNodeId returns value | ||
* @param value | ||
* @param namespace {number} | ||
*/ | ||
function coerceNodeId(value, namespace) { | ||
@@ -238,3 +158,2 @@ let matches; | ||
else if (value instanceof Object) { | ||
// it could be a Enum or a NodeId Like object | ||
const tmp = value; | ||
@@ -249,11 +168,2 @@ value = tmp.value; | ||
exports.coerceNodeId = coerceNodeId; | ||
/** | ||
* construct a node Id from a value and a namespace. | ||
* @class opcua | ||
* @method makeNodeId | ||
* @static | ||
* @param {String|Buffer} value | ||
* @param [namespace]=0 {Number} the node id namespace | ||
* @return {NodeId} | ||
*/ | ||
function makeNodeId(value, namespace) { | ||
@@ -267,5 +177,2 @@ value = value || 0; | ||
} | ||
// 1 2 3 | ||
// 012345678901234567890123456789012345 | ||
// "72962B91-FA75-4AE6-8D28-B404DC7DAF63" | ||
if (node_opcua_guid_1.isValidGuid(value)) { | ||
@@ -276,3 +183,2 @@ identifierType = NodeIdType.GUID; | ||
identifierType = NodeIdType.STRING; | ||
// detect accidental string of form "ns=x;x"; | ||
node_opcua_assert_1.assert(value.indexOf("ns=") === -1, " makeNodeId(string) ? did you mean using coerceNodeId instead? "); | ||
@@ -289,3 +195,2 @@ } | ||
exports.makeNodeId = makeNodeId; | ||
// reverse maps | ||
let _nodeIdToNameIndex = {}; | ||
@@ -317,9 +222,2 @@ let _nameToNodeIdIndex = {}; | ||
} | ||
/** | ||
* @class opcua | ||
* @method resolveNodeId | ||
* @static | ||
* @param nodeIdOrString | ||
* @return the nodeId | ||
*/ | ||
function resolveNodeId(nodeIdOrString) { | ||
@@ -326,0 +224,0 @@ let nodeId; |
@@ -5,3 +5,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "2.5.9", | ||
"version": "2.6.0-alpha.0", | ||
"description": "pure nodejs OPCUA SDK - module -nodeid", | ||
@@ -17,3 +17,3 @@ "scripts": { | ||
"node-opcua-constants": "^2.5.9", | ||
"node-opcua-enum": "^2.5.9", | ||
"node-opcua-enum": "^2.6.0-alpha.0", | ||
"node-opcua-guid": "^2.5.9", | ||
@@ -23,5 +23,5 @@ "underscore": "^1.10.2" | ||
"devDependencies": { | ||
"node-opcua-benchmarker": "^2.5.9", | ||
"node-opcua-benchmarker": "^2.6.0-alpha.0", | ||
"should": "^13.2.3", | ||
"source-map-support": "^0.5.17" | ||
"source-map-support": "^0.5.19" | ||
}, | ||
@@ -43,3 +43,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "3cadd387a1ddb6158b80280e9b61d4432d5be996" | ||
"gitHead": "b4e0776f042c4a1e5c801f38a249f6da46b5057d" | ||
} |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45221
826
1