node-opcua-data-model
Advanced tools
Comparing version 2.37.0 to 2.40.0
@@ -14,5 +14,5 @@ /** | ||
NONE = 2048, | ||
None = 2048, | ||
Execute = 4096 | ||
None = 2048 | ||
} | ||
export declare type AccessLevelFlagString = "CurrentRead" | "CurrentWrite" | "HistoryRead" | "HistoryWrite" | "StatusWrite" | "TimestampWrite"; | ||
export declare function convertAccessLevelFlagToByte(accessLevel: AccessLevelFlag): number; | ||
@@ -22,4 +22,5 @@ export declare function makeAccessLevelFlag(str: string | number | null): AccessLevelFlag; | ||
export declare function randomAccessLevel(): AccessLevelFlag; | ||
export declare function _accessLevelFlagToString(accessLevelFlag: number): string[]; | ||
export declare function accessLevelFlagToString(accessLevelFlag: AccessLevelFlag): string; | ||
export declare function decodeAccessLevelFlag(stream: BinaryStream): AccessLevelFlag; | ||
export declare function encodeAccessLevelFlag(value: AccessLevelFlag, stream: OutputBinaryStream): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.encodeAccessLevelFlag = exports.decodeAccessLevelFlag = exports.accessLevelFlagToString = exports.randomAccessLevel = exports.coerceAccessLevelFlag = exports.makeAccessLevelFlag = exports.convertAccessLevelFlagToByte = exports.AccessLevelFlag = void 0; | ||
exports.encodeAccessLevelFlag = exports.decodeAccessLevelFlag = exports.accessLevelFlagToString = exports._accessLevelFlagToString = exports.randomAccessLevel = exports.coerceAccessLevelFlag = exports.makeAccessLevelFlag = exports.convertAccessLevelFlagToByte = exports.AccessLevelFlag = void 0; | ||
const node_opcua_factory_1 = require("node-opcua-factory"); | ||
const _make_flag_1 = require("./_make_flag"); | ||
var AccessLevelFlag; | ||
@@ -14,8 +15,8 @@ (function (AccessLevelFlag) { | ||
AccessLevelFlag[AccessLevelFlag["TimestampWrite"] = 64] = "TimestampWrite"; | ||
// reserved bit 7 | ||
AccessLevelFlag[AccessLevelFlag["NONE"] = 2048] = "NONE"; | ||
AccessLevelFlag[AccessLevelFlag["None"] = 2048] = "None"; | ||
AccessLevelFlag[AccessLevelFlag["Execute"] = 4096] = "Execute"; | ||
})(AccessLevelFlag = exports.AccessLevelFlag || (exports.AccessLevelFlag = {})); | ||
function convertAccessLevelFlagToByte(accessLevel) { | ||
return accessLevel & 0x3f; | ||
return accessLevel & 0x7f; | ||
} | ||
@@ -26,21 +27,3 @@ exports.convertAccessLevelFlagToByte = convertAccessLevelFlagToByte; | ||
function makeAccessLevelFlag(str) { | ||
if (typeof str === "number") { | ||
const value = str; | ||
if (value === 0) { | ||
return AccessLevelFlag.None; | ||
} | ||
return value; | ||
} | ||
let accessFlag; | ||
if (str === "" || str === null) { | ||
accessFlag = AccessLevelFlag.None; | ||
} | ||
else { | ||
const flags = str.split(" | "); | ||
accessFlag = 0; | ||
for (const flag of flags) { | ||
accessFlag |= AccessLevelFlag[flag]; | ||
} | ||
} | ||
return accessFlag; | ||
return _make_flag_1._make_flag(str, AccessLevelFlag.None, AccessLevelFlag); | ||
} | ||
@@ -53,4 +36,3 @@ exports.makeAccessLevelFlag = makeAccessLevelFlag; | ||
exports.randomAccessLevel = randomAccessLevel; | ||
// tslint:disable:no-bitwise | ||
function accessLevelFlagToString(accessLevelFlag) { | ||
function _accessLevelFlagToString(accessLevelFlag) { | ||
const retVal = []; | ||
@@ -78,2 +60,8 @@ if (accessLevelFlag & AccessLevelFlag.CurrentRead) { | ||
} | ||
return retVal; | ||
} | ||
exports._accessLevelFlagToString = _accessLevelFlagToString; | ||
// tslint:disable:no-bitwise | ||
function accessLevelFlagToString(accessLevelFlag) { | ||
const retVal = _accessLevelFlagToString(accessLevelFlag); | ||
if (retVal.length === 0) { | ||
@@ -91,3 +79,3 @@ retVal.push("None"); | ||
function encodeAccessLevelFlag(value, stream) { | ||
stream.writeUInt8(value & 0x8f); | ||
stream.writeUInt8(value & 0xff); | ||
} | ||
@@ -94,0 +82,0 @@ exports.encodeAccessLevelFlag = encodeAccessLevelFlag; |
@@ -5,2 +5,4 @@ /** | ||
export * from "./access_level"; | ||
export * from "./access_level_ex"; | ||
export * from "./access_restrictions"; | ||
export * from "./localized_text"; | ||
@@ -16,1 +18,2 @@ export * from "./qualified_name"; | ||
export * from "./write_mask"; | ||
export * from "./permission_flag"; |
@@ -17,2 +17,4 @@ "use strict"; | ||
__exportStar(require("./access_level"), exports); | ||
__exportStar(require("./access_level_ex"), exports); | ||
__exportStar(require("./access_restrictions"), exports); | ||
__exportStar(require("./localized_text"), exports); | ||
@@ -28,2 +30,3 @@ __exportStar(require("./qualified_name"), exports); | ||
__exportStar(require("./write_mask"), exports); | ||
__exportStar(require("./permission_flag"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -31,3 +31,3 @@ "use strict"; | ||
// for de-serialization | ||
if (options === null) { | ||
if (options === null || options === undefined) { | ||
this.namespaceIndex = 0; | ||
@@ -42,4 +42,4 @@ this.name = null; | ||
} | ||
this.namespaceIndex = (options === null || options === void 0 ? void 0 : options.namespaceIndex) || 0; | ||
this.name = (options === null || options === void 0 ? void 0 : options.name) || null; | ||
this.namespaceIndex = options.namespaceIndex || 0; | ||
this.name = options.name || null; | ||
} | ||
@@ -46,0 +46,0 @@ /** |
{ | ||
"name": "node-opcua-data-model", | ||
"version": "2.37.0", | ||
"version": "2.40.0", | ||
"description": "pure nodejs OPCUA SDK - module -data-model", | ||
@@ -8,3 +8,4 @@ "scripts": { | ||
"test": "mocha", | ||
"clean": "node -e \"require('rimraf').sync('_generated_');require('rimraf').sync('dist');\"" | ||
"clean": "node -e \"require('rimraf').sync('_generated_');require('rimraf').sync('dist');\"", | ||
"coverage": "npx nyc node ../../node_modules/mocha/bin/mocha" | ||
}, | ||
@@ -15,12 +16,12 @@ "main": "./dist/index.js", | ||
"node-opcua-assert": "2.37.0", | ||
"node-opcua-basic-types": "2.37.0", | ||
"node-opcua-binary-stream": "2.37.0", | ||
"node-opcua-enum": "2.37.0", | ||
"node-opcua-factory": "2.37.0", | ||
"node-opcua-nodeid": "2.37.0", | ||
"node-opcua-status-code": "2.37.0", | ||
"node-opcua-utils": "2.37.0" | ||
"node-opcua-basic-types": "2.40.0", | ||
"node-opcua-binary-stream": "2.40.0", | ||
"node-opcua-enum": "2.40.0", | ||
"node-opcua-factory": "2.40.0", | ||
"node-opcua-nodeid": "2.40.0", | ||
"node-opcua-status-code": "2.40.0", | ||
"node-opcua-utils": "2.40.0" | ||
}, | ||
"devDependencies": { | ||
"node-opcua-packet-analyzer": "2.37.0", | ||
"node-opcua-packet-analyzer": "2.40.0", | ||
"should": "^13.2.3", | ||
@@ -44,3 +45,3 @@ "source-map-support": "^0.5.19" | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "271015f5027020dc765b9473501935b548fb855c" | ||
"gitHead": "7315be805cf4ec57a575ca4ef1e1949f6d63ca49" | ||
} |
@@ -8,19 +8,22 @@ // tslint:disable:no-bitwise | ||
import { registerBasicType } from "node-opcua-factory"; | ||
import * as utils from "node-opcua-utils"; | ||
import { _make_flag } from "./_make_flag"; | ||
export enum AccessLevelFlag { | ||
CurrentRead = 0x01, // bit 0 : Indicate if the current value is readable (0 means not readable, 1 means readable). | ||
CurrentWrite = 0x02, // bit 1 : Indicate if the current value is writable (0 means not writable, 1 means writable). | ||
HistoryRead = 0x04, // bit 2 : Indicates if the history of the value is readable (0 means not readable, 1 means readable). | ||
HistoryWrite = 0x08, // bit 3 : Indicates if the history of the value is writable (0 means not writable, 1 means writable). | ||
CurrentRead = 0x01, // bit 0 : Indicate if the current value is readable (0 means not readable, 1 means readable). | ||
CurrentWrite = 0x02, // bit 1 : Indicate if the current value is writable (0 means not writable, 1 means writable). | ||
HistoryRead = 0x04, // bit 2 : Indicates if the history of the value is readable (0 means not readable, 1 means readable). | ||
HistoryWrite = 0x08, // bit 3 : Indicates if the history of the value is writable (0 means not writable, 1 means writable). | ||
SemanticChange = 0x10, // bit 4 : Indicates if the Variable used as Property generates SemanticChangeEvents | ||
StatusWrite = 0x20, // bit 5 : Indicates if the current StatusCode of the value is writable (0 means not writable, 1 means writable). | ||
StatusWrite = 0x20, // bit 5 : Indicates if the current StatusCode of the value is writable (0 means not writable, 1 means writable). | ||
TimestampWrite = 0x40, // bit 6 : Indicates if the current SourceTimestamp of the value is writable (0 means not writable, 1 means writable). | ||
NONE = 0x800, // Deprecated | ||
// reserved bit 7 | ||
NONE = 0x800, // Deprecated | ||
None = 0x800, | ||
Execute = 0x1000 | ||
} | ||
export type AccessLevelFlagString = "CurrentRead" |"CurrentWrite" | "HistoryRead" | "HistoryWrite" | "StatusWrite" | ||
/* | "SemanticChange" */| "TimestampWrite"; | ||
export function convertAccessLevelFlagToByte(accessLevel: AccessLevelFlag): number { | ||
return accessLevel & 0x3f; | ||
return accessLevel & 0x7f; | ||
} | ||
@@ -30,23 +33,3 @@ // @example | ||
export function makeAccessLevelFlag(str: string | number | null): AccessLevelFlag { | ||
if (typeof str === "number") { | ||
const value = str as number; | ||
if (value === 0) { | ||
return AccessLevelFlag.None; | ||
} | ||
return value as AccessLevelFlag; | ||
} | ||
let accessFlag: AccessLevelFlag | null; | ||
if (str === "" || str === null) { | ||
accessFlag = AccessLevelFlag.None; | ||
} else { | ||
const flags = str.split(" | "); | ||
accessFlag = 0; | ||
for (const flag of flags) { | ||
accessFlag |= (AccessLevelFlag as any)[flag]; | ||
} | ||
} | ||
return accessFlag as AccessLevelFlag; | ||
return _make_flag(str,AccessLevelFlag.None, AccessLevelFlag) as AccessLevelFlag; | ||
} | ||
@@ -59,5 +42,3 @@ | ||
} | ||
// tslint:disable:no-bitwise | ||
export function accessLevelFlagToString(accessLevelFlag: AccessLevelFlag): string { | ||
export function _accessLevelFlagToString(accessLevelFlag: number): string[] { | ||
const retVal = []; | ||
@@ -84,3 +65,8 @@ if (accessLevelFlag & AccessLevelFlag.CurrentRead) { | ||
retVal.push("SemanticChange"); | ||
} | ||
} | ||
return retVal; | ||
} | ||
// tslint:disable:no-bitwise | ||
export function accessLevelFlagToString(accessLevelFlag: AccessLevelFlag): string { | ||
const retVal = _accessLevelFlagToString(accessLevelFlag); | ||
if (retVal.length === 0) { | ||
@@ -91,3 +77,2 @@ retVal.push("None"); | ||
} | ||
export function decodeAccessLevelFlag(stream: BinaryStream): AccessLevelFlag { | ||
@@ -97,5 +82,4 @@ const code = stream.readUInt8(); | ||
} | ||
export function encodeAccessLevelFlag(value: AccessLevelFlag, stream: OutputBinaryStream) { | ||
stream.writeUInt8(value & 0x8f); | ||
stream.writeUInt8(value & 0xff); | ||
} | ||
@@ -102,0 +86,0 @@ |
@@ -5,2 +5,4 @@ /** | ||
export * from "./access_level"; | ||
export * from "./access_level_ex"; | ||
export * from "./access_restrictions"; | ||
export * from "./localized_text"; | ||
@@ -16,1 +18,2 @@ export * from "./qualified_name"; | ||
export * from "./write_mask"; | ||
export * from "./permission_flag"; |
@@ -59,3 +59,3 @@ /** | ||
// for de-serialization | ||
if (options === null) { | ||
if (options === null || options === undefined) { | ||
this.namespaceIndex = 0; | ||
@@ -70,4 +70,4 @@ this.name = null; | ||
} | ||
this.namespaceIndex = options?.namespaceIndex || 0; | ||
this.name = options?.name || null; | ||
this.namespaceIndex = options.namespaceIndex || 0; | ||
this.name = options.name || null; | ||
} | ||
@@ -74,0 +74,0 @@ |
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
294534
75
2836
+ Addednode-opcua-basic-types@2.40.0(transitive)
+ Addednode-opcua-binary-stream@2.40.0(transitive)
+ Addednode-opcua-buffer-utils@2.40.0(transitive)
+ Addednode-opcua-date-time@2.40.0(transitive)
+ Addednode-opcua-debug@2.40.0(transitive)
+ Addednode-opcua-enum@2.40.0(transitive)
+ Addednode-opcua-factory@2.40.0(transitive)
+ Addednode-opcua-guid@2.40.0(transitive)
+ Addednode-opcua-nodeid@2.40.0(transitive)
+ Addednode-opcua-status-code@2.40.0(transitive)
+ Addednode-opcua-utils@2.40.0(transitive)
- Removednode-opcua-basic-types@2.37.0(transitive)
- Removednode-opcua-binary-stream@2.37.0(transitive)
- Removednode-opcua-buffer-utils@2.37.0(transitive)
- Removednode-opcua-date-time@2.37.0(transitive)
- Removednode-opcua-debug@2.37.0(transitive)
- Removednode-opcua-enum@2.37.0(transitive)
- Removednode-opcua-factory@2.37.0(transitive)
- Removednode-opcua-guid@2.37.0(transitive)
- Removednode-opcua-nodeid@2.37.0(transitive)
- Removednode-opcua-status-code@2.37.0(transitive)
- Removednode-opcua-utils@2.37.0(transitive)
Updatednode-opcua-enum@2.40.0
Updatednode-opcua-factory@2.40.0
Updatednode-opcua-nodeid@2.40.0
Updatednode-opcua-utils@2.40.0