node-opcua-data-model 2.98.0 → 2.99.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/BrowseDirection.d.ts +18 -0
- package/dist/BrowseDirection.js +37 -0
- package/dist/BrowseDirection.js.map +1 -0
- package/dist/_make_flag.d.ts +1 -0
- package/dist/_make_flag.js +26 -0
- package/dist/_make_flag.js.map +1 -0
- package/dist/access_level.d.ts +24 -0
- package/dist/access_level.js +86 -0
- package/dist/access_level.js.map +1 -0
- package/dist/access_level_ex.d.ts +34 -0
- package/dist/access_level_ex.js +83 -0
- package/dist/access_level_ex.js.map +1 -0
- package/dist/access_restrictions.d.ts +9 -0
- package/dist/access_restrictions.js +37 -0
- package/dist/access_restrictions.js.map +1 -0
- package/dist/attributeIds.d.ts +1 -0
- package/dist/attributeIds.js +8 -0
- package/dist/attributeIds.js.map +1 -0
- package/dist/data_encoding.d.ts +6 -0
- package/dist/data_encoding.js +22 -0
- package/dist/data_encoding.js.map +1 -0
- package/dist/diagnostic_info.d.ts +69 -0
- package/dist/diagnostic_info.js +329 -0
- package/dist/diagnostic_info.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +34 -0
- package/dist/index.js.map +1 -0
- package/dist/localized_text.d.ts +24 -0
- package/dist/localized_text.js +152 -0
- package/dist/localized_text.js.map +1 -0
- package/dist/node_class_mask.d.ts +14 -0
- package/dist/node_class_mask.js +45 -0
- package/dist/node_class_mask.js.map +1 -0
- package/dist/nodeclass.d.ts +16 -0
- package/dist/nodeclass.js +26 -0
- package/dist/nodeclass.js.map +1 -0
- package/dist/permission_flag.d.ts +112 -0
- package/dist/permission_flag.js +163 -0
- package/dist/permission_flag.js.map +1 -0
- package/dist/qualified_name.d.ts +45 -0
- package/dist/qualified_name.js +137 -0
- package/dist/qualified_name.js.map +1 -0
- package/dist/result_mask.d.ts +18 -0
- package/dist/result_mask.js +31 -0
- package/dist/result_mask.js.map +1 -0
- package/dist/time_zone.d.ts +3 -0
- package/dist/time_zone.js +19 -0
- package/dist/time_zone.js.map +1 -0
- package/dist/write_mask.d.ts +31 -0
- package/dist/write_mask.js +41 -0
- package/dist/write_mask.js.map +1 -0
- package/package.json +15 -11
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeDiagnosticInfo = exports.encodeDiagnosticInfo = exports.DiagnosticInfo_EncodingByte = exports.filterDiagnosticServiceLevel = exports.filterDiagnosticOperationLevel = exports.filterDiagnosticInfoLevel = exports.RESPONSE_DIAGNOSTICS_MASK_ALL = exports.DiagnosticInfo_OperationLevelMask = exports.DiagnosticInfo_ServiceLevelMask = exports.DiagnosticInfo = exports.schemaDiagnosticInfo = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* @module node-opcua-data-model
|
|
6
|
+
*/
|
|
7
|
+
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
8
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
9
|
+
const node_opcua_status_code_1 = require("node-opcua-status-code");
|
|
10
|
+
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
11
|
+
const node_opcua_factory_2 = require("node-opcua-factory");
|
|
12
|
+
// --------------------------------------------------------------------------------------------
|
|
13
|
+
exports.schemaDiagnosticInfo = (0, node_opcua_factory_1.buildStructuredType)({
|
|
14
|
+
name: "DiagnosticInfo",
|
|
15
|
+
baseType: "BaseUAObject",
|
|
16
|
+
fields: [
|
|
17
|
+
{
|
|
18
|
+
name: "namespaceUri",
|
|
19
|
+
fieldType: "Int32",
|
|
20
|
+
defaultValue: -1,
|
|
21
|
+
documentation: "The symbolicId is defined within the context of a namespace."
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "symbolicId",
|
|
25
|
+
fieldType: "Int32",
|
|
26
|
+
defaultValue: -1,
|
|
27
|
+
documentation: "The symbolicId shall be used to identify a vendor-specific error or condition"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: "locale",
|
|
31
|
+
fieldType: "Int32",
|
|
32
|
+
defaultValue: -1,
|
|
33
|
+
documentation: "The locale part of the vendor-specific localized text describing the symbolic id."
|
|
34
|
+
},
|
|
35
|
+
{ name: "localizedText", fieldType: "Int32", defaultValue: -1 },
|
|
36
|
+
{
|
|
37
|
+
name: "additionalInfo",
|
|
38
|
+
fieldType: "String",
|
|
39
|
+
defaultValue: null,
|
|
40
|
+
documentation: "Vendor-specific diagnostic information."
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "innerStatusCode",
|
|
44
|
+
fieldType: "StatusCode",
|
|
45
|
+
defaultValue: node_opcua_status_code_1.StatusCodes.Good,
|
|
46
|
+
documentation: "The StatusCode from the inner operation."
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: "innerDiagnosticInfo",
|
|
50
|
+
fieldType: "DiagnosticInfo",
|
|
51
|
+
category: node_opcua_factory_1.FieldCategory.basic,
|
|
52
|
+
defaultValue: null,
|
|
53
|
+
documentation: "The diagnostic info associated with the inner StatusCode."
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
class DiagnosticInfo extends node_opcua_factory_1.BaseUAObject {
|
|
58
|
+
/**
|
|
59
|
+
*
|
|
60
|
+
* @class DiagnosticInfo
|
|
61
|
+
* @constructor
|
|
62
|
+
* @extends BaseUAObject
|
|
63
|
+
* @param options {Object}
|
|
64
|
+
*/
|
|
65
|
+
constructor(options = {}) {
|
|
66
|
+
super();
|
|
67
|
+
const schema = exports.schemaDiagnosticInfo;
|
|
68
|
+
/* istanbul ignore next */
|
|
69
|
+
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
70
|
+
(0, node_opcua_factory_2.check_options_correctness_against_schema)(this, schema, options);
|
|
71
|
+
}
|
|
72
|
+
this.symbolicId = (0, node_opcua_factory_2.initialize_field)(schema.fields[0], options.symbolicId);
|
|
73
|
+
this.namespaceURI = (0, node_opcua_factory_2.initialize_field)(schema.fields[1], options.namespaceURI);
|
|
74
|
+
this.locale = (0, node_opcua_factory_2.initialize_field)(schema.fields[2], options.locale);
|
|
75
|
+
this.localizedText = (0, node_opcua_factory_2.initialize_field)(schema.fields[3], options.localizedText);
|
|
76
|
+
this.additionalInfo = (0, node_opcua_factory_2.initialize_field)(schema.fields[4], options.additionalInfo);
|
|
77
|
+
this.innerStatusCode = (0, node_opcua_factory_2.initialize_field)(schema.fields[5], options.innerStatusCode);
|
|
78
|
+
this.innerDiagnosticInfo = (0, node_opcua_factory_2.initialize_field)(schema.fields[6], options.innerDiagnosticInfo);
|
|
79
|
+
}
|
|
80
|
+
encode(stream) {
|
|
81
|
+
encode_DiagnosticInfo(this, stream);
|
|
82
|
+
}
|
|
83
|
+
decode(stream) {
|
|
84
|
+
decode_DiagnosticInfo(this, stream);
|
|
85
|
+
}
|
|
86
|
+
decodeDebug(stream, options) {
|
|
87
|
+
decodeDebug_DiagnosticInfo(this, stream, options);
|
|
88
|
+
}
|
|
89
|
+
static filterForResponse(diagnostic, requestedDiagnostics, diagnosticInfoMask) {
|
|
90
|
+
const options = {
|
|
91
|
+
symbolicId: (requestedDiagnostics & diagnosticInfoMask.SymbolicId) ? diagnostic.symbolicId : undefined,
|
|
92
|
+
localizedText: (requestedDiagnostics & diagnosticInfoMask.LocalizedText) ? diagnostic.localizedText : undefined,
|
|
93
|
+
additionalInfo: (requestedDiagnostics & diagnosticInfoMask.AdditionalInfo) ? diagnostic.additionalInfo : undefined,
|
|
94
|
+
innerStatusCode: (requestedDiagnostics & diagnosticInfoMask.InnerStatusCode) ? diagnostic.innerStatusCode : undefined,
|
|
95
|
+
innerDiagnosticInfo: (requestedDiagnostics & diagnosticInfoMask.InnerDiagnostics) ? diagnostic.innerDiagnosticInfo : (diagnostic.innerDiagnosticInfo ? DiagnosticInfo.filterForResponse(diagnostic.innerDiagnosticInfo, requestedDiagnostics, diagnosticInfoMask) : undefined),
|
|
96
|
+
};
|
|
97
|
+
return new DiagnosticInfo(options);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
DiagnosticInfo.schema = exports.schemaDiagnosticInfo;
|
|
101
|
+
DiagnosticInfo.possibleFields = [
|
|
102
|
+
"symbolicId",
|
|
103
|
+
"namespaceURI",
|
|
104
|
+
"locale",
|
|
105
|
+
"localizedText",
|
|
106
|
+
"additionalInfo",
|
|
107
|
+
"innerStatusCode",
|
|
108
|
+
"innerDiagnosticInfo"
|
|
109
|
+
];
|
|
110
|
+
exports.DiagnosticInfo = DiagnosticInfo;
|
|
111
|
+
DiagnosticInfo.prototype.schema = DiagnosticInfo.schema;
|
|
112
|
+
DiagnosticInfo.schema.fields[6].schema = DiagnosticInfo.schema;
|
|
113
|
+
var DiagnosticInfo_ServiceLevelMask;
|
|
114
|
+
(function (DiagnosticInfo_ServiceLevelMask) {
|
|
115
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["None"] = 0] = "None";
|
|
116
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["SymbolicId"] = 1] = "SymbolicId";
|
|
117
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["LocalizedText"] = 2] = "LocalizedText";
|
|
118
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["AdditionalInfo"] = 4] = "AdditionalInfo";
|
|
119
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["InnerStatusCode"] = 8] = "InnerStatusCode";
|
|
120
|
+
DiagnosticInfo_ServiceLevelMask[DiagnosticInfo_ServiceLevelMask["InnerDiagnostics"] = 16] = "InnerDiagnostics";
|
|
121
|
+
})(DiagnosticInfo_ServiceLevelMask = exports.DiagnosticInfo_ServiceLevelMask || (exports.DiagnosticInfo_ServiceLevelMask = {}));
|
|
122
|
+
var DiagnosticInfo_OperationLevelMask;
|
|
123
|
+
(function (DiagnosticInfo_OperationLevelMask) {
|
|
124
|
+
DiagnosticInfo_OperationLevelMask[DiagnosticInfo_OperationLevelMask["SymbolicId"] = 32] = "SymbolicId";
|
|
125
|
+
DiagnosticInfo_OperationLevelMask[DiagnosticInfo_OperationLevelMask["LocalizedText"] = 64] = "LocalizedText";
|
|
126
|
+
DiagnosticInfo_OperationLevelMask[DiagnosticInfo_OperationLevelMask["AdditionalInfo"] = 128] = "AdditionalInfo";
|
|
127
|
+
DiagnosticInfo_OperationLevelMask[DiagnosticInfo_OperationLevelMask["InnerStatusCode"] = 256] = "InnerStatusCode";
|
|
128
|
+
DiagnosticInfo_OperationLevelMask[DiagnosticInfo_OperationLevelMask["InnerDiagnostics"] = 512] = "InnerDiagnostics";
|
|
129
|
+
})(DiagnosticInfo_OperationLevelMask = exports.DiagnosticInfo_OperationLevelMask || (exports.DiagnosticInfo_OperationLevelMask = {}));
|
|
130
|
+
exports.RESPONSE_DIAGNOSTICS_MASK_ALL = 0x3FF;
|
|
131
|
+
function filterDiagnosticInfoLevel(returnDiagnostics, diagnostic, diagnosticInfoMask) {
|
|
132
|
+
if (!diagnostic) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
return DiagnosticInfo.filterForResponse(diagnostic, returnDiagnostics, diagnosticInfoMask);
|
|
136
|
+
}
|
|
137
|
+
exports.filterDiagnosticInfoLevel = filterDiagnosticInfoLevel;
|
|
138
|
+
function filterDiagnosticOperationLevel(returnDiagnostics, diagnostic) {
|
|
139
|
+
return filterDiagnosticInfoLevel(returnDiagnostics, diagnostic, DiagnosticInfo_OperationLevelMask);
|
|
140
|
+
}
|
|
141
|
+
exports.filterDiagnosticOperationLevel = filterDiagnosticOperationLevel;
|
|
142
|
+
function filterDiagnosticServiceLevel(returnDiagnostics, diagnostic) {
|
|
143
|
+
return filterDiagnosticInfoLevel(returnDiagnostics, diagnostic, DiagnosticInfo_ServiceLevelMask);
|
|
144
|
+
}
|
|
145
|
+
exports.filterDiagnosticServiceLevel = filterDiagnosticServiceLevel;
|
|
146
|
+
var DiagnosticInfo_EncodingByte;
|
|
147
|
+
(function (DiagnosticInfo_EncodingByte) {
|
|
148
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["SymbolicId"] = 1] = "SymbolicId";
|
|
149
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["NamespaceURI"] = 2] = "NamespaceURI";
|
|
150
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["LocalizedText"] = 4] = "LocalizedText";
|
|
151
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["Locale"] = 8] = "Locale";
|
|
152
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["AdditionalInfo"] = 16] = "AdditionalInfo";
|
|
153
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["InnerStatusCode"] = 32] = "InnerStatusCode";
|
|
154
|
+
DiagnosticInfo_EncodingByte[DiagnosticInfo_EncodingByte["InnerDiagnosticInfo"] = 64] = "InnerDiagnosticInfo";
|
|
155
|
+
})(DiagnosticInfo_EncodingByte = exports.DiagnosticInfo_EncodingByte || (exports.DiagnosticInfo_EncodingByte = {}));
|
|
156
|
+
// tslint:disable:no-bitwise
|
|
157
|
+
function getDiagnosticInfoEncodingByte(diagnosticInfo) {
|
|
158
|
+
(0, node_opcua_assert_1.assert)(diagnosticInfo);
|
|
159
|
+
let encodingMask = 0;
|
|
160
|
+
if (diagnosticInfo.symbolicId >= 0) {
|
|
161
|
+
encodingMask |= DiagnosticInfo_EncodingByte.SymbolicId;
|
|
162
|
+
}
|
|
163
|
+
if (diagnosticInfo.namespaceURI >= 0) {
|
|
164
|
+
encodingMask |= DiagnosticInfo_EncodingByte.NamespaceURI;
|
|
165
|
+
}
|
|
166
|
+
if (diagnosticInfo.localizedText >= 0) {
|
|
167
|
+
encodingMask |= DiagnosticInfo_EncodingByte.LocalizedText;
|
|
168
|
+
}
|
|
169
|
+
if (diagnosticInfo.locale >= 0) {
|
|
170
|
+
encodingMask |= DiagnosticInfo_EncodingByte.Locale;
|
|
171
|
+
}
|
|
172
|
+
if (diagnosticInfo.additionalInfo) {
|
|
173
|
+
encodingMask |= DiagnosticInfo_EncodingByte.AdditionalInfo;
|
|
174
|
+
}
|
|
175
|
+
if (diagnosticInfo.innerStatusCode && diagnosticInfo.innerStatusCode !== node_opcua_status_code_1.StatusCodes.Good) {
|
|
176
|
+
encodingMask |= DiagnosticInfo_EncodingByte.InnerStatusCode;
|
|
177
|
+
}
|
|
178
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
179
|
+
encodingMask |= DiagnosticInfo_EncodingByte.InnerDiagnosticInfo;
|
|
180
|
+
}
|
|
181
|
+
return encodingMask;
|
|
182
|
+
}
|
|
183
|
+
function encode_DiagnosticInfo(diagnosticInfo, stream) {
|
|
184
|
+
const encodingMask = getDiagnosticInfoEncodingByte(diagnosticInfo);
|
|
185
|
+
// write encoding byte
|
|
186
|
+
(0, node_opcua_basic_types_1.encodeByte)(encodingMask, stream);
|
|
187
|
+
// write symbolic id
|
|
188
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
189
|
+
(0, node_opcua_basic_types_1.encodeInt32)(diagnosticInfo.symbolicId, stream);
|
|
190
|
+
}
|
|
191
|
+
// write namespace uri
|
|
192
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
193
|
+
(0, node_opcua_basic_types_1.encodeInt32)(diagnosticInfo.namespaceURI, stream);
|
|
194
|
+
}
|
|
195
|
+
// write locale
|
|
196
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
197
|
+
(0, node_opcua_basic_types_1.encodeInt32)(diagnosticInfo.locale, stream);
|
|
198
|
+
}
|
|
199
|
+
// write localized text
|
|
200
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
201
|
+
(0, node_opcua_basic_types_1.encodeInt32)(diagnosticInfo.localizedText, stream);
|
|
202
|
+
}
|
|
203
|
+
// write additional info
|
|
204
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
205
|
+
(0, node_opcua_basic_types_1.encodeString)(diagnosticInfo.additionalInfo, stream);
|
|
206
|
+
}
|
|
207
|
+
// write inner status code
|
|
208
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
209
|
+
(0, node_opcua_basic_types_1.encodeStatusCode)(diagnosticInfo.innerStatusCode, stream);
|
|
210
|
+
}
|
|
211
|
+
// write innerDiagnosticInfo
|
|
212
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
213
|
+
(0, node_opcua_assert_1.assert)(diagnosticInfo.innerDiagnosticInfo !== null, "missing innerDiagnosticInfo");
|
|
214
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
215
|
+
encode_DiagnosticInfo(diagnosticInfo.innerDiagnosticInfo, stream);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
function decodeDebug_DiagnosticInfo(diagnosticInfo, stream, options) {
|
|
220
|
+
const tracer = options.tracer;
|
|
221
|
+
tracer.trace("start", options.name + "(" + "DiagnosticInfo" + ")", stream.length, stream.length);
|
|
222
|
+
let cursorBefore = stream.length;
|
|
223
|
+
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
224
|
+
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
|
|
225
|
+
tracer.encoding_byte(encodingMask, DiagnosticInfo_EncodingByte, cursorBefore, stream.length);
|
|
226
|
+
cursorBefore = stream.length;
|
|
227
|
+
// read symbolic id
|
|
228
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
229
|
+
diagnosticInfo.symbolicId = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
230
|
+
tracer.trace("member", "symbolicId", diagnosticInfo.symbolicId, cursorBefore, stream.length, "Int32");
|
|
231
|
+
cursorBefore = stream.length;
|
|
232
|
+
}
|
|
233
|
+
// read namespace uri
|
|
234
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
235
|
+
diagnosticInfo.namespaceURI = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
236
|
+
tracer.trace("member", "symbolicId", diagnosticInfo.namespaceURI, cursorBefore, stream.length, "Int32");
|
|
237
|
+
cursorBefore = stream.length;
|
|
238
|
+
}
|
|
239
|
+
// read locale
|
|
240
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
241
|
+
diagnosticInfo.locale = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
242
|
+
tracer.trace("member", "locale", diagnosticInfo.locale, cursorBefore, stream.length, "Int32");
|
|
243
|
+
cursorBefore = stream.length;
|
|
244
|
+
}
|
|
245
|
+
// read localized text
|
|
246
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
247
|
+
diagnosticInfo.localizedText = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
248
|
+
tracer.trace("member", "localizedText", diagnosticInfo.localizedText, cursorBefore, stream.length, "Int32");
|
|
249
|
+
cursorBefore = stream.length;
|
|
250
|
+
}
|
|
251
|
+
// read additional info
|
|
252
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
253
|
+
diagnosticInfo.additionalInfo = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
254
|
+
tracer.trace("member", "additionalInfo", diagnosticInfo.additionalInfo, cursorBefore, stream.length, "String");
|
|
255
|
+
cursorBefore = stream.length;
|
|
256
|
+
}
|
|
257
|
+
// read inner status code
|
|
258
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
259
|
+
diagnosticInfo.innerStatusCode = (0, node_opcua_basic_types_1.decodeStatusCode)(stream);
|
|
260
|
+
tracer.trace("member", "innerStatusCode", diagnosticInfo.innerStatusCode, cursorBefore, stream.length, "StatusCode");
|
|
261
|
+
cursorBefore = stream.length;
|
|
262
|
+
}
|
|
263
|
+
// read inner status code
|
|
264
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
265
|
+
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
|
|
266
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
267
|
+
diagnosticInfo.innerDiagnosticInfo.decodeDebug(stream, options);
|
|
268
|
+
}
|
|
269
|
+
tracer.trace("member", "innerDiagnosticInfo", diagnosticInfo.innerDiagnosticInfo, cursorBefore, stream.length, "DiagnosticInfo");
|
|
270
|
+
}
|
|
271
|
+
tracer.trace("end", options.name, stream.length, stream.length);
|
|
272
|
+
}
|
|
273
|
+
function decode_DiagnosticInfo(diagnosticInfo, stream) {
|
|
274
|
+
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
275
|
+
// read symbolic id
|
|
276
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.SymbolicId) {
|
|
277
|
+
diagnosticInfo.symbolicId = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
278
|
+
}
|
|
279
|
+
// read namespace uri
|
|
280
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.NamespaceURI) {
|
|
281
|
+
diagnosticInfo.namespaceURI = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
282
|
+
}
|
|
283
|
+
// read locale
|
|
284
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.Locale) {
|
|
285
|
+
diagnosticInfo.locale = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
286
|
+
}
|
|
287
|
+
// read localized text
|
|
288
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.LocalizedText) {
|
|
289
|
+
diagnosticInfo.localizedText = (0, node_opcua_basic_types_1.decodeInt32)(stream);
|
|
290
|
+
}
|
|
291
|
+
// read additional info
|
|
292
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.AdditionalInfo) {
|
|
293
|
+
diagnosticInfo.additionalInfo = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
294
|
+
}
|
|
295
|
+
// read inner status code
|
|
296
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerStatusCode) {
|
|
297
|
+
diagnosticInfo.innerStatusCode = (0, node_opcua_basic_types_1.decodeStatusCode)(stream);
|
|
298
|
+
}
|
|
299
|
+
// read inner status code
|
|
300
|
+
if (encodingMask & DiagnosticInfo_EncodingByte.InnerDiagnosticInfo) {
|
|
301
|
+
diagnosticInfo.innerDiagnosticInfo = new DiagnosticInfo({});
|
|
302
|
+
if (diagnosticInfo.innerDiagnosticInfo) {
|
|
303
|
+
diagnosticInfo.innerDiagnosticInfo.decode(stream);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
const emptyDiagnosticInfo = new DiagnosticInfo({});
|
|
308
|
+
function encodeDiagnosticInfo(value, stream) {
|
|
309
|
+
if (value === null) {
|
|
310
|
+
emptyDiagnosticInfo.encode(stream);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
value.encode(stream);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
exports.encodeDiagnosticInfo = encodeDiagnosticInfo;
|
|
317
|
+
function decodeDiagnosticInfo(stream, _value) {
|
|
318
|
+
const value = _value || new DiagnosticInfo();
|
|
319
|
+
value.decode(stream);
|
|
320
|
+
return value;
|
|
321
|
+
}
|
|
322
|
+
exports.decodeDiagnosticInfo = decodeDiagnosticInfo;
|
|
323
|
+
// Note:
|
|
324
|
+
// the SymbolicId, NamespaceURI, LocalizedText and Locale fields are indexes in a string table which is returned
|
|
325
|
+
// in the response header. Only the index of the corresponding string in the string table is encoded. An index
|
|
326
|
+
// of −1 indicates that there is no value for the string.
|
|
327
|
+
//
|
|
328
|
+
(0, node_opcua_factory_1.registerSpecialVariantEncoder)(DiagnosticInfo);
|
|
329
|
+
//# sourceMappingURL=diagnostic_info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostic_info.js","sourceRoot":"","sources":["../source/diagnostic_info.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,yDAA2C;AAE3C,2DAQ4B;AAC5B,mEAAiE;AAEjE,mEAWgC;AAChC,2DAAgG;AAEhG,+FAA+F;AAClF,QAAA,oBAAoB,GAA0B,IAAA,wCAAmB,EAAC;IAC3E,IAAI,EAAE,gBAAgB;IAEtB,QAAQ,EAAE,cAAc;IAExB,MAAM,EAAE;QACJ;YACI,IAAI,EAAE,cAAc;YAEpB,SAAS,EAAE,OAAO;YAElB,YAAY,EAAE,CAAC,CAAC;YAChB,aAAa,EAAE,8DAA8D;SAChF;QACD;YACI,IAAI,EAAE,YAAY;YAElB,SAAS,EAAE,OAAO;YAElB,YAAY,EAAE,CAAC,CAAC;YAChB,aAAa,EAAE,+EAA+E;SACjG;QACD;YACI,IAAI,EAAE,QAAQ;YAEd,SAAS,EAAE,OAAO;YAElB,YAAY,EAAE,CAAC,CAAC;YAChB,aAAa,EAAE,mFAAmF;SACrG;QACD,EAAE,IAAI,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC,EAAE;QAC/D;YACI,IAAI,EAAE,gBAAgB;YAEtB,SAAS,EAAE,QAAQ;YAEnB,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,yCAAyC;SAC3D;QACD;YACI,IAAI,EAAE,iBAAiB;YAEvB,SAAS,EAAE,YAAY;YAEvB,YAAY,EAAE,oCAAW,CAAC,IAAI;YAC9B,aAAa,EAAE,0CAA0C;SAC5D;QACD;YACI,IAAI,EAAE,qBAAqB;YAE3B,SAAS,EAAE,gBAAgB;YAC3B,QAAQ,EAAE,kCAAa,CAAC,KAAK;YAC7B,YAAY,EAAE,IAAI;YAClB,aAAa,EAAE,2DAA2D;SAC7E;KACJ;CACJ,CAAC,CAAC;AAEH,MAAa,c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+
* @module node-opcua-data-model
|
|
3
|
+
*/
|
|
4
|
+
export * from "./access_level";
|
|
5
|
+
export * from "./access_level_ex";
|
|
6
|
+
export * from "./access_restrictions";
|
|
7
|
+
export * from "./localized_text";
|
|
8
|
+
export * from "./qualified_name";
|
|
9
|
+
export * from "./diagnostic_info";
|
|
10
|
+
export * from "./nodeclass";
|
|
11
|
+
export * from "./attributeIds";
|
|
12
|
+
export * from "./node_class_mask";
|
|
13
|
+
export * from "./result_mask";
|
|
14
|
+
export * from "./BrowseDirection";
|
|
15
|
+
export * from "./data_encoding";
|
|
16
|
+
export * from "./write_mask";
|
|
17
|
+
export * from "./permission_flag";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* @module node-opcua-data-model
|
|
19
|
+
*/
|
|
20
|
+
__exportStar(require("./access_level"), exports);
|
|
21
|
+
__exportStar(require("./access_level_ex"), exports);
|
|
22
|
+
__exportStar(require("./access_restrictions"), exports);
|
|
23
|
+
__exportStar(require("./localized_text"), exports);
|
|
24
|
+
__exportStar(require("./qualified_name"), exports);
|
|
25
|
+
__exportStar(require("./diagnostic_info"), exports);
|
|
26
|
+
__exportStar(require("./nodeclass"), exports);
|
|
27
|
+
__exportStar(require("./attributeIds"), exports);
|
|
28
|
+
__exportStar(require("./node_class_mask"), exports);
|
|
29
|
+
__exportStar(require("./result_mask"), exports);
|
|
30
|
+
__exportStar(require("./BrowseDirection"), exports);
|
|
31
|
+
__exportStar(require("./data_encoding"), exports);
|
|
32
|
+
__exportStar(require("./write_mask"), exports);
|
|
33
|
+
__exportStar(require("./permission_flag"), exports);
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA;;GAEG;AACH,iDAA+B;AAC/B,oDAAkC;AAClC,wDAAsC;AACtC,mDAAiC;AACjC,mDAAiC;AACjC,oDAAkC;AAClC,8CAA4B;AAC5B,iDAA+B;AAC/B,oDAAkC;AAClC,gDAA8B;AAC9B,oDAAkC;AAClC,kDAAgC;AAChC,+CAA6B;AAC7B,oDAAkC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LocaleId, UAString } from "node-opcua-basic-types";
|
|
2
|
+
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
3
|
+
import { BaseUAObject, DecodeDebugOptions, IStructuredTypeSchema } from "node-opcua-factory";
|
|
4
|
+
export declare function coerceLocalizedText(value?: null | string | LocalizedTextOptions): LocalizedText | null;
|
|
5
|
+
export interface LocalizedTextOptions {
|
|
6
|
+
locale?: LocaleId;
|
|
7
|
+
text?: UAString;
|
|
8
|
+
}
|
|
9
|
+
export declare class LocalizedText extends BaseUAObject {
|
|
10
|
+
static get schema(): IStructuredTypeSchema;
|
|
11
|
+
get schema(): IStructuredTypeSchema;
|
|
12
|
+
static possibleFields: string[];
|
|
13
|
+
static coerce(value?: null | string | LocalizedTextOptions): LocalizedText | null;
|
|
14
|
+
locale: LocaleId;
|
|
15
|
+
text: UAString;
|
|
16
|
+
constructor(options?: LocalizedTextOptions | string | null);
|
|
17
|
+
toString(): string;
|
|
18
|
+
encode(stream: OutputBinaryStream): void;
|
|
19
|
+
decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
|
|
20
|
+
decode(stream: BinaryStream): void;
|
|
21
|
+
}
|
|
22
|
+
export type LocalizedTextLike = LocalizedTextOptions | string;
|
|
23
|
+
export declare function encodeLocalizedText(value: LocalizedText, stream: OutputBinaryStream): void;
|
|
24
|
+
export declare function decodeLocalizedText(stream: BinaryStream, value?: LocalizedText): LocalizedText;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.decodeLocalizedText = exports.encodeLocalizedText = exports.LocalizedText = exports.coerceLocalizedText = void 0;
|
|
4
|
+
const node_opcua_basic_types_1 = require("node-opcua-basic-types");
|
|
5
|
+
const node_opcua_factory_1 = require("node-opcua-factory");
|
|
6
|
+
function coerceLocalizedText(value) {
|
|
7
|
+
if (value === undefined || value === null) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (value instanceof LocalizedText) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
return new LocalizedText(value);
|
|
14
|
+
}
|
|
15
|
+
exports.coerceLocalizedText = coerceLocalizedText;
|
|
16
|
+
// --------------------------------------------------------------------------------------------
|
|
17
|
+
// see Part 3 - $8.5 page 63
|
|
18
|
+
const schemaLocalizedText = (0, node_opcua_factory_1.buildStructuredType)({
|
|
19
|
+
name: "LocalizedText",
|
|
20
|
+
baseType: "BaseUAObject",
|
|
21
|
+
fields: [
|
|
22
|
+
{
|
|
23
|
+
name: "locale",
|
|
24
|
+
fieldType: "LocaleId",
|
|
25
|
+
defaultValue: null
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "text",
|
|
29
|
+
fieldType: "String",
|
|
30
|
+
defaultValue: null
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
});
|
|
34
|
+
schemaLocalizedText.coerce = coerceLocalizedText;
|
|
35
|
+
class LocalizedText extends node_opcua_factory_1.BaseUAObject {
|
|
36
|
+
static get schema() {
|
|
37
|
+
return schemaLocalizedText;
|
|
38
|
+
}
|
|
39
|
+
get schema() {
|
|
40
|
+
return schemaLocalizedText;
|
|
41
|
+
}
|
|
42
|
+
static coerce(value) {
|
|
43
|
+
return coerceLocalizedText(value);
|
|
44
|
+
}
|
|
45
|
+
constructor(options) {
|
|
46
|
+
super();
|
|
47
|
+
if (options === null) {
|
|
48
|
+
this.locale = null;
|
|
49
|
+
this.text = null;
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (typeof options === "string") {
|
|
53
|
+
this.locale = null;
|
|
54
|
+
this.text = options;
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
/* istanbul ignore next */
|
|
58
|
+
if (node_opcua_factory_1.parameters.debugSchemaHelper) {
|
|
59
|
+
const schema = schemaLocalizedText;
|
|
60
|
+
(0, node_opcua_factory_1.check_options_correctness_against_schema)(this, schema, options);
|
|
61
|
+
}
|
|
62
|
+
this.locale = (options === null || options === void 0 ? void 0 : options.locale) || null;
|
|
63
|
+
this.text = (options === null || options === void 0 ? void 0 : options.text) || null;
|
|
64
|
+
}
|
|
65
|
+
toString() {
|
|
66
|
+
return "locale=" + this.locale + " text=" + this.text;
|
|
67
|
+
}
|
|
68
|
+
// OPCUA Part 6 $ 5.2.2.14 : localizedText have a special encoding
|
|
69
|
+
encode(stream) {
|
|
70
|
+
// tslint:disable:no-bitwise
|
|
71
|
+
const encodingMask = getLocalizeText_EncodingByte(this);
|
|
72
|
+
(0, node_opcua_basic_types_1.encodeByte)(encodingMask, stream);
|
|
73
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
74
|
+
(0, node_opcua_basic_types_1.encodeString)(this.locale, stream);
|
|
75
|
+
}
|
|
76
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
77
|
+
(0, node_opcua_basic_types_1.encodeString)(this.text, stream);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
decodeDebug(stream, options) {
|
|
81
|
+
let cursorBefore;
|
|
82
|
+
const tracer = options.tracer;
|
|
83
|
+
tracer.trace("start", options.name + "(" + "LocalizedText" + ")", stream.length, stream.length);
|
|
84
|
+
cursorBefore = stream.length;
|
|
85
|
+
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
86
|
+
tracer.trace("member", "encodingByte", "0x" + encodingMask.toString(16), cursorBefore, stream.length, "Mask");
|
|
87
|
+
cursorBefore = stream.length;
|
|
88
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
89
|
+
this.locale = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
90
|
+
tracer.trace("member", "locale", this.locale, cursorBefore, stream.length, "locale");
|
|
91
|
+
cursorBefore = stream.length;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.locale = null;
|
|
95
|
+
}
|
|
96
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
97
|
+
this.text = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
98
|
+
tracer.trace("member", "text", this.text, cursorBefore, stream.length, "text");
|
|
99
|
+
// cursor_before = stream.length;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
this.text = null;
|
|
103
|
+
}
|
|
104
|
+
tracer.trace("end", options.name, stream.length, stream.length);
|
|
105
|
+
}
|
|
106
|
+
decode(stream) {
|
|
107
|
+
const encodingMask = (0, node_opcua_basic_types_1.decodeByte)(stream);
|
|
108
|
+
if ((encodingMask & 0x01) === 0x01) {
|
|
109
|
+
this.locale = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
this.locale = null;
|
|
113
|
+
}
|
|
114
|
+
if ((encodingMask & 0x02) === 0x02) {
|
|
115
|
+
this.text = (0, node_opcua_basic_types_1.decodeString)(stream);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
this.text = null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
LocalizedText.possibleFields = ["locale", "text"];
|
|
123
|
+
exports.LocalizedText = LocalizedText;
|
|
124
|
+
// not an extension object registerClassDefinition("LocalizedText", LocalizedText);
|
|
125
|
+
(0, node_opcua_factory_1.registerSpecialVariantEncoder)(LocalizedText);
|
|
126
|
+
function getLocalizeText_EncodingByte(localizedText) {
|
|
127
|
+
let encodingMask = 0;
|
|
128
|
+
if (localizedText.locale) {
|
|
129
|
+
encodingMask |= 0x01;
|
|
130
|
+
}
|
|
131
|
+
if (localizedText.text) {
|
|
132
|
+
encodingMask |= 0x02;
|
|
133
|
+
}
|
|
134
|
+
return encodingMask;
|
|
135
|
+
}
|
|
136
|
+
const emptyLocalizedText = new LocalizedText({});
|
|
137
|
+
function encodeLocalizedText(value, stream) {
|
|
138
|
+
if (value) {
|
|
139
|
+
value.encode(stream);
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
emptyLocalizedText.encode(stream);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
exports.encodeLocalizedText = encodeLocalizedText;
|
|
146
|
+
function decodeLocalizedText(stream, value) {
|
|
147
|
+
value = value || new LocalizedText(null);
|
|
148
|
+
value.decode(stream);
|
|
149
|
+
return value;
|
|
150
|
+
}
|
|
151
|
+
exports.decodeLocalizedText = decodeLocalizedText;
|
|
152
|
+
//# sourceMappingURL=localized_text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localized_text.js","sourceRoot":"","sources":["../source/localized_text.ts"],"names":[],"mappings":";;;AAIA,mEAAgH;AAEhH,2DAS4B;AAE5B,SAAgB,mBAAmB,CAAC,KAA4C;IAC5E,IAAI,KAAK,KAAK,SAAS,IAAI,KA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NodeClassMask {
|
|
5
|
+
Object = 1,
|
|
6
|
+
Variable = 2,
|
|
7
|
+
Method = 4,
|
|
8
|
+
ObjectType = 8,
|
|
9
|
+
VariableType = 16,
|
|
10
|
+
ReferenceType = 32,
|
|
11
|
+
DataType = 64,
|
|
12
|
+
View = 128
|
|
13
|
+
}
|
|
14
|
+
export declare function makeNodeClassMask(str: string): NodeClassMask;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @module node-opcua-data-model
|
|
4
|
+
*/
|
|
5
|
+
// tslint:disable:no-bitwise
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.makeNodeClassMask = exports.NodeClassMask = void 0;
|
|
8
|
+
// Specifies the NodeClasses of the TargetNodes. Only TargetNodes with the
|
|
9
|
+
// selected NodeClasses are returned. The NodeClasses are assigned the
|
|
10
|
+
// following bits:
|
|
11
|
+
// If set to zero, then all NodeClasses are returned.
|
|
12
|
+
// @example
|
|
13
|
+
// var mask = NodeClassMask.get("Object | ObjectType");
|
|
14
|
+
// mask.value.should.eql(1 + (1<<3));
|
|
15
|
+
var NodeClassMask;
|
|
16
|
+
(function (NodeClassMask) {
|
|
17
|
+
NodeClassMask[NodeClassMask["Object"] = 1] = "Object";
|
|
18
|
+
NodeClassMask[NodeClassMask["Variable"] = 2] = "Variable";
|
|
19
|
+
NodeClassMask[NodeClassMask["Method"] = 4] = "Method";
|
|
20
|
+
NodeClassMask[NodeClassMask["ObjectType"] = 8] = "ObjectType";
|
|
21
|
+
NodeClassMask[NodeClassMask["VariableType"] = 16] = "VariableType";
|
|
22
|
+
NodeClassMask[NodeClassMask["ReferenceType"] = 32] = "ReferenceType";
|
|
23
|
+
NodeClassMask[NodeClassMask["DataType"] = 64] = "DataType";
|
|
24
|
+
NodeClassMask[NodeClassMask["View"] = 128] = "View";
|
|
25
|
+
})(NodeClassMask = exports.NodeClassMask || (exports.NodeClassMask = {}));
|
|
26
|
+
function makeFlagFromString(type, str) {
|
|
27
|
+
const flags = str.split(" | ");
|
|
28
|
+
let result = 0;
|
|
29
|
+
for (const flag of flags) {
|
|
30
|
+
result |= type[flag];
|
|
31
|
+
}
|
|
32
|
+
return result;
|
|
33
|
+
}
|
|
34
|
+
// @example
|
|
35
|
+
// makeNodeClassMask("Method | Object").should.eql(5);
|
|
36
|
+
function makeNodeClassMask(str) {
|
|
37
|
+
const classMask = makeFlagFromString(NodeClassMask, str);
|
|
38
|
+
/* istanbul ignore next */
|
|
39
|
+
if (!classMask) {
|
|
40
|
+
throw new Error(" cannot find class mask for " + str);
|
|
41
|
+
}
|
|
42
|
+
return classMask;
|
|
43
|
+
}
|
|
44
|
+
exports.makeNodeClassMask = makeNodeClassMask;
|
|
45
|
+
//# sourceMappingURL=node_class_mask.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node_class_mask.js","sourceRoot":"","sources":["../source/node_class_mask.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,4BAA4B;;;AAE5B,0EAA0E;AAC1E,sEAAsE;AACtE,kBAAkB;AAClB,qDAAqD;AACrD,WAAW;AACX,2DAA2D;AAC3D,wCAAwC;AAExC,IAAY,aASX;AATD,WAAY,aAAa;IACrB,qDAAe,CAAA;IACf,yDAAiB,CAAA;IACjB,qDAAe,CAAA;IACf,6DAAmB,CAAA;IACnB,kEAAqB,CAAA;IACrB,oEAAsB,CAAA;IACtB,0DAAiB,CAAA;IACjB,mDAAa,CAAA;AACjB,CAAC,EATW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QASxB;AAMD,SAAS,kBAAkB,CAAO,IAAU,EAAE,GAAW;IACrD,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,MAAM,GAAQ,CAAC,CAAC;IACpB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE;QACtB,MAAM,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;KACxB;IACD,OAAO,MAAc,CAAC;AAC1B,CAAC;AAED,WAAW;AACX,2DAA2D;AAC3D,SAAgB,iBAAiB,CAAC,GAAW;IACzC,MAAM,SAAS,GAAG,kBAAkB,CAAgB,aAAoB,EAAE,GAAG,CAAC,CAAC;IAC/E,0BAA0B;IAC1B,IAAI,CAAC,SAAS,EAAE;QACZ,MAAM,IAAI,KAAK,CAAC,8BAA8B,GAAG,GAAG,CAAC,CAAC;KACzD;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAPD,8CAOC"}
|