node-opcua-factory 2.72.1 → 2.74.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/LICENSE +3 -1
- package/dist/base_ua_object.d.ts +53 -0
- package/dist/base_ua_object.js +536 -0
- package/dist/base_ua_object.js.map +1 -0
- package/dist/basic_type.d.ts +40 -0
- package/dist/basic_type.js +119 -0
- package/dist/basic_type.js.map +1 -0
- package/dist/builtin_types.d.ts +46 -0
- package/dist/builtin_types.js +284 -0
- package/dist/builtin_types.js.map +1 -0
- package/dist/builtin_types_special.d.ts +5 -0
- package/dist/builtin_types_special.js +46 -0
- package/dist/builtin_types_special.js.map +1 -0
- package/dist/datatype_factory.d.ts +8 -11
- package/dist/datatype_factory.js +25 -42
- package/dist/datatype_factory.js.map +1 -1
- package/dist/encode_decode.d.ts +9 -0
- package/dist/encode_decode.js +40 -0
- package/dist/encode_decode.js.map +1 -0
- package/dist/enumerations.d.ts +32 -0
- package/dist/enumerations.js +78 -0
- package/dist/enumerations.js.map +1 -0
- package/dist/get_built_in_type.d.ts +0 -0
- package/dist/get_built_in_type.js +2 -0
- package/dist/get_built_in_type.js.map +1 -0
- package/dist/get_standard_data_type_factory.d.ts +12 -0
- package/dist/get_standard_data_type_factory.js +35 -0
- package/dist/get_standard_data_type_factory.js.map +1 -0
- package/dist/get_structured_type_schema.d.ts +4 -0
- package/dist/get_structured_type_schema.js +13 -0
- package/dist/get_structured_type_schema.js.map +1 -0
- package/dist/id_generator.d.ts +3 -0
- package/dist/id_generator.js +22 -0
- package/dist/id_generator.js.map +1 -0
- package/dist/index.d.ts +13 -10
- package/dist/index.js +13 -10
- package/dist/index.js.map +1 -1
- package/dist/nodeid_type.d.ts +13 -0
- package/dist/nodeid_type.js +19 -0
- package/dist/nodeid_type.js.map +1 -0
- package/dist/parameters.d.ts +3 -0
- package/dist/parameters.js +7 -0
- package/dist/parameters.js.map +1 -0
- package/dist/register_class_definition.d.ts +3 -0
- package/dist/register_class_definition.js +9 -0
- package/dist/register_class_definition.js.map +1 -0
- package/dist/schema_helpers.d.ts +24 -0
- package/dist/schema_helpers.js +100 -0
- package/dist/schema_helpers.js.map +1 -0
- package/dist/structured_type_schema.d.ts +44 -0
- package/dist/structured_type_schema.js +279 -0
- package/dist/structured_type_schema.js.map +1 -0
- package/dist/types.d.ts +86 -45
- package/dist/types.js +1 -43
- package/dist/types.js.map +1 -1
- package/package.json +13 -12
- package/source/{factories_baseobject.ts → base_ua_object.ts} +48 -44
- package/source/{factories_basic_type.ts → basic_type.ts} +7 -28
- package/source/{factories_builtin_types.ts → builtin_types.ts} +111 -89
- package/source/{factories_builtin_types_special.ts → builtin_types_special.ts} +2 -2
- package/source/datatype_factory.ts +44 -47
- package/source/encode_decode.ts +37 -0
- package/source/{factories_enumerations.ts → enumerations.ts} +6 -4
- package/source/get_built_in_type.ts +0 -0
- package/source/{factories_factories.ts → get_standard_data_type_factory.ts} +7 -25
- package/source/get_structured_type_schema.ts +10 -0
- package/source/{factories_id_generator.ts → id_generator.ts} +0 -0
- package/source/index.ts +14 -11
- package/source/nodeid_type.ts +17 -0
- package/source/parameters.ts +3 -0
- package/source/register_class_definition.ts +11 -0
- package/source/{factories_schema_helpers.ts → schema_helpers.ts} +15 -37
- package/source/{factories_structuredTypeSchema.ts → structured_type_schema.ts} +37 -36
- package/source/types.ts +104 -79
- package/source/constructor_type.ts +0 -18
package/dist/types.js
CHANGED
|
@@ -1,52 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
/**
|
|
5
|
-
* @module node-opcua-factory
|
|
6
|
-
*/
|
|
7
|
-
const node_opcua_assert_1 = require("node-opcua-assert");
|
|
3
|
+
exports.FieldCategory = void 0;
|
|
8
4
|
var FieldCategory;
|
|
9
5
|
(function (FieldCategory) {
|
|
10
6
|
FieldCategory["enumeration"] = "enumeration";
|
|
11
7
|
FieldCategory["complex"] = "complex";
|
|
12
8
|
FieldCategory["basic"] = "basic";
|
|
13
9
|
})(FieldCategory = exports.FieldCategory || (exports.FieldCategory = {}));
|
|
14
|
-
/**
|
|
15
|
-
* @class TypeSchemaBase
|
|
16
|
-
* @param options {Object}
|
|
17
|
-
* @constructor
|
|
18
|
-
* create a new type Schema
|
|
19
|
-
*/
|
|
20
|
-
class TypeSchemaBase {
|
|
21
|
-
constructor(options) {
|
|
22
|
-
(0, node_opcua_assert_1.assert)(options.category !== null);
|
|
23
|
-
this.encode = options.encode || undefined;
|
|
24
|
-
this.decode = options.decode || undefined;
|
|
25
|
-
this.coerce = options.coerce;
|
|
26
|
-
this.category = options.category || FieldCategory.basic;
|
|
27
|
-
this.name = options.name;
|
|
28
|
-
for (const prop in options) {
|
|
29
|
-
if (Object.prototype.hasOwnProperty.call(options, prop)) {
|
|
30
|
-
this[prop] = options[prop];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* @method computer_default_value
|
|
36
|
-
* @param defaultValue {*} the default value
|
|
37
|
-
* @return {*}
|
|
38
|
-
*/
|
|
39
|
-
computer_default_value(defaultValue) {
|
|
40
|
-
if (defaultValue === undefined) {
|
|
41
|
-
defaultValue = this.defaultValue;
|
|
42
|
-
}
|
|
43
|
-
if (typeof defaultValue === "function") {
|
|
44
|
-
// be careful not to cache this value , it must be call each time to make sure
|
|
45
|
-
// we do not end up with the same value/instance twice.
|
|
46
|
-
defaultValue = defaultValue();
|
|
47
|
-
}
|
|
48
|
-
return defaultValue;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
exports.TypeSchemaBase = TypeSchemaBase;
|
|
52
10
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../source/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../source/types.ts"],"names":[],"mappings":";;;AAOA,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,4CAA2B,CAAA;IAC3B,oCAAmB,CAAA;IACnB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "node-opcua-factory",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.74.0",
|
|
4
4
|
"description": "pure nodejs OPCUA SDK - module -factory",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,19 +9,20 @@
|
|
|
9
9
|
"lint": "eslint source",
|
|
10
10
|
"format": "prettier --write source",
|
|
11
11
|
"clean": "npx rimraf dist *.tsbuildinfo",
|
|
12
|
-
"test": "
|
|
12
|
+
"test": "mocha"
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"chalk": "4.1.2",
|
|
16
|
-
"node-opcua-assert": "2.
|
|
17
|
-
"node-opcua-basic-types": "2.
|
|
18
|
-
"node-opcua-binary-stream": "2.
|
|
19
|
-
"node-opcua-
|
|
20
|
-
"node-opcua-
|
|
21
|
-
"node-opcua-
|
|
22
|
-
"node-opcua-
|
|
23
|
-
"node-opcua-
|
|
24
|
-
"node-opcua-
|
|
16
|
+
"node-opcua-assert": "2.74.0",
|
|
17
|
+
"node-opcua-basic-types": "2.74.0",
|
|
18
|
+
"node-opcua-binary-stream": "2.74.0",
|
|
19
|
+
"node-opcua-constants": "2.74.0",
|
|
20
|
+
"node-opcua-debug": "2.74.0",
|
|
21
|
+
"node-opcua-enum": "2.74.0",
|
|
22
|
+
"node-opcua-guid": "2.74.0",
|
|
23
|
+
"node-opcua-nodeid": "2.74.0",
|
|
24
|
+
"node-opcua-status-code": "2.74.0",
|
|
25
|
+
"node-opcua-utils": "2.74.0"
|
|
25
26
|
},
|
|
26
27
|
"author": "Etienne Rossignon",
|
|
27
28
|
"license": "MIT",
|
|
@@ -38,5 +39,5 @@
|
|
|
38
39
|
"internet of things"
|
|
39
40
|
],
|
|
40
41
|
"homepage": "http://node-opcua.github.io/",
|
|
41
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "003ee041795f3b737afaaef5721045ee31ea9f77"
|
|
42
43
|
}
|
|
@@ -8,16 +8,28 @@ import * as chalk from "chalk";
|
|
|
8
8
|
import { assert } from "node-opcua-assert";
|
|
9
9
|
import { AttributeIds } from "node-opcua-basic-types";
|
|
10
10
|
import { BinaryStream, BinaryStreamSizeCalculator, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
11
|
-
import { hexDump } from "node-opcua-debug";
|
|
11
|
+
import { hexDump, make_errorLog } from "node-opcua-debug";
|
|
12
12
|
import { NodeId } from "node-opcua-nodeid";
|
|
13
13
|
import * as utils from "node-opcua-utils";
|
|
14
14
|
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
15
|
+
import { getBuiltInEnumeration, hasBuiltInEnumeration } from "./enumerations";
|
|
16
|
+
import { DataTypeFactory, _findFieldSchema } from "./datatype_factory";
|
|
17
|
+
import { getStructureTypeConstructor } from "./get_standard_data_type_factory";
|
|
18
|
+
import { get_base_schema } from "./structured_type_schema";
|
|
19
|
+
import {
|
|
20
|
+
EnumerationDefinition,
|
|
21
|
+
FieldCategory,
|
|
22
|
+
StructuredTypeField,
|
|
23
|
+
BuiltInTypeDefinition,
|
|
24
|
+
FieldType,
|
|
25
|
+
CommonInterface,
|
|
26
|
+
Func1,
|
|
27
|
+
IStructuredTypeSchema,
|
|
28
|
+
IBaseUAObject,
|
|
29
|
+
DecodeDebugOptions
|
|
30
|
+
} from "./types";
|
|
31
|
+
|
|
32
|
+
const errorLog = make_errorLog(__filename);
|
|
21
33
|
|
|
22
34
|
function r(str: string, length = 30) {
|
|
23
35
|
return (str + " ").substring(0, length);
|
|
@@ -60,12 +72,10 @@ function _decode_member_(value: any, field: StructuredTypeField, stream: BinaryS
|
|
|
60
72
|
return value;
|
|
61
73
|
}
|
|
62
74
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
function applyOnAllSchemaFields(self: BaseUAObject, schema: StructuredTypeSchema, data: ExploreParams, functor: Func1, args: any) {
|
|
75
|
+
function _applyOnAllSchemaFields<T>(self: BaseUAObject, schema: IStructuredTypeSchema, data: T, functor: Func1<T>, args?: any) {
|
|
66
76
|
const baseSchema = get_base_schema(schema);
|
|
67
77
|
if (baseSchema) {
|
|
68
|
-
|
|
78
|
+
_applyOnAllSchemaFields(self, baseSchema, data, functor, args);
|
|
69
79
|
}
|
|
70
80
|
|
|
71
81
|
for (const field of schema.fields) {
|
|
@@ -131,7 +141,6 @@ function _exploreObject(self: BaseUAObject, field: StructuredTypeField, data: Ex
|
|
|
131
141
|
if (!self) {
|
|
132
142
|
return;
|
|
133
143
|
}
|
|
134
|
-
assert(self);
|
|
135
144
|
|
|
136
145
|
const fieldType = field.fieldType;
|
|
137
146
|
|
|
@@ -153,9 +162,10 @@ function _exploreObject(self: BaseUAObject, field: StructuredTypeField, data: Ex
|
|
|
153
162
|
if (field.switchValue !== undefined) {
|
|
154
163
|
opt = " !" + field.switchValue + " ";
|
|
155
164
|
}
|
|
156
|
-
|
|
165
|
+
const allowSubTypeSymbol = field.allowSubType ? "~" : " ";
|
|
166
|
+
const arraySymbol = field.isArray ? "[]" : " ";
|
|
157
167
|
const fieldNameF = chalk.yellow(r(padding + fieldName, 30));
|
|
158
|
-
const fieldTypeF = chalk.cyan(
|
|
168
|
+
const fieldTypeF = chalk.cyan(`/* ${allowSubTypeSymbol}${r(fieldType + opt, 38)}${arraySymbol} */`);
|
|
159
169
|
|
|
160
170
|
// detected when optional field is not specified in value
|
|
161
171
|
if (field.switchBit !== undefined && value === undefined) {
|
|
@@ -297,19 +307,12 @@ function _exploreObject(self: BaseUAObject, field: StructuredTypeField, data: Ex
|
|
|
297
307
|
_dump_simple_value(self, field, data, value, fieldType);
|
|
298
308
|
} else {
|
|
299
309
|
const typeDictionary = (self.schema as any).$$factory as DataTypeFactory;
|
|
310
|
+
|
|
300
311
|
// istanbul ignore next
|
|
301
312
|
if (!typeDictionary) {
|
|
302
|
-
|
|
303
|
-
console.log(" No typeDictionary for ", self.schema);
|
|
313
|
+
errorLog("Internal Error: No typeDictionary for ", self.schema);
|
|
304
314
|
return;
|
|
305
315
|
}
|
|
306
|
-
field.fieldTypeConstructor = field.fieldTypeConstructor || typeDictionary.getStructureTypeConstructor(fieldType);
|
|
307
|
-
const fieldTypeConstructor = field.fieldTypeConstructor;
|
|
308
|
-
|
|
309
|
-
const _newFieldSchema =
|
|
310
|
-
(field.schema as StructuredTypeSchema) ||
|
|
311
|
-
fieldTypeConstructor.prototype.schema ||
|
|
312
|
-
(fieldTypeConstructor as any).schema;
|
|
313
316
|
|
|
314
317
|
if (field.isArray) {
|
|
315
318
|
if (value === null) {
|
|
@@ -322,13 +325,16 @@ function _exploreObject(self: BaseUAObject, field: StructuredTypeField, data: Ex
|
|
|
322
325
|
|
|
323
326
|
for (let i = 0; i < m; i++) {
|
|
324
327
|
const element = value[i];
|
|
325
|
-
|
|
328
|
+
|
|
329
|
+
const _newFieldSchema = _findFieldSchema(typeDictionary, field, element);
|
|
330
|
+
|
|
331
|
+
data.lines.push(padding + ` { ` + chalk.cyan(`/* ${i} - ${_newFieldSchema?.name}*/`));
|
|
326
332
|
|
|
327
333
|
const data1 = {
|
|
328
334
|
lines: [] as string[],
|
|
329
335
|
padding: padding + " "
|
|
330
336
|
};
|
|
331
|
-
|
|
337
|
+
_applyOnAllSchemaFields(element, _newFieldSchema, data1, _exploreObject, args);
|
|
332
338
|
|
|
333
339
|
data.lines = data.lines.concat(data1.lines);
|
|
334
340
|
|
|
@@ -340,9 +346,10 @@ function _exploreObject(self: BaseUAObject, field: StructuredTypeField, data: Ex
|
|
|
340
346
|
data.lines.push(padding + "]");
|
|
341
347
|
}
|
|
342
348
|
} else {
|
|
349
|
+
const _newFieldSchema = _findFieldSchema(typeDictionary, field, value);
|
|
343
350
|
data.lines.push(fieldNameF + " " + fieldTypeF + ": {");
|
|
344
351
|
const data1 = { padding: padding + " ", lines: [] as string[] };
|
|
345
|
-
|
|
352
|
+
_applyOnAllSchemaFields(value, _newFieldSchema, data1, _exploreObject, args);
|
|
346
353
|
data.lines = data.lines.concat(data1.lines);
|
|
347
354
|
|
|
348
355
|
data.lines.push(padding + "}");
|
|
@@ -383,7 +390,7 @@ function json_ify(t: BuiltInTypeDefinition, value: any, fieldType: FieldType) {
|
|
|
383
390
|
}
|
|
384
391
|
}
|
|
385
392
|
|
|
386
|
-
function _JSONify(self: BaseUAObject, schema:
|
|
393
|
+
function _JSONify(self: BaseUAObject, schema: IStructuredTypeSchema, pojo: any) {
|
|
387
394
|
/* jshint validthis: true */
|
|
388
395
|
for (const field of schema.fields) {
|
|
389
396
|
const fieldValue = (self as any)[field.name];
|
|
@@ -391,8 +398,8 @@ function _JSONify(self: BaseUAObject, schema: StructuredTypeSchema, pojo: any) {
|
|
|
391
398
|
continue;
|
|
392
399
|
}
|
|
393
400
|
|
|
394
|
-
if (
|
|
395
|
-
const enumeration =
|
|
401
|
+
if (hasBuiltInEnumeration(field.fieldType)) {
|
|
402
|
+
const enumeration = getBuiltInEnumeration(field.fieldType);
|
|
396
403
|
assert(enumeration !== null);
|
|
397
404
|
if (field.isArray) {
|
|
398
405
|
pojo[field.name] = fieldValue.map((value: any) => enumeration.enumValues[value.toString()]);
|
|
@@ -401,7 +408,7 @@ function _JSONify(self: BaseUAObject, schema: StructuredTypeSchema, pojo: any) {
|
|
|
401
408
|
}
|
|
402
409
|
continue;
|
|
403
410
|
}
|
|
404
|
-
const t =
|
|
411
|
+
const t = field.schema as BuiltInTypeDefinition; // getBuiltInType(field.fieldType);
|
|
405
412
|
|
|
406
413
|
if (field.isArray) {
|
|
407
414
|
pojo[field.name] = fieldValue.map((value: any) => json_ify(t, value, field));
|
|
@@ -411,15 +418,8 @@ function _JSONify(self: BaseUAObject, schema: StructuredTypeSchema, pojo: any) {
|
|
|
411
418
|
}
|
|
412
419
|
}
|
|
413
420
|
|
|
414
|
-
export interface
|
|
415
|
-
|
|
416
|
-
name: string;
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
/* tslint:disable:no-empty*/
|
|
420
|
-
|
|
421
|
-
export interface BaseUAObject {
|
|
422
|
-
schema: StructuredTypeSchema;
|
|
421
|
+
export interface BaseUAObject extends IBaseUAObject {
|
|
422
|
+
schema: IStructuredTypeSchema;
|
|
423
423
|
}
|
|
424
424
|
|
|
425
425
|
/**
|
|
@@ -458,7 +458,7 @@ export class BaseUAObject {
|
|
|
458
458
|
*/
|
|
459
459
|
public binaryStoreSize(): number {
|
|
460
460
|
const stream = new BinaryStreamSizeCalculator();
|
|
461
|
-
this.encode(stream
|
|
461
|
+
this.encode(stream);
|
|
462
462
|
return stream.length;
|
|
463
463
|
}
|
|
464
464
|
|
|
@@ -548,12 +548,16 @@ export class BaseUAObject {
|
|
|
548
548
|
|
|
549
549
|
data.lines.push("{" + chalk.cyan(" /*" + (this.schema ? this.schema.name : "") + "*/"));
|
|
550
550
|
if (this.schema) {
|
|
551
|
-
|
|
551
|
+
this.applyOnAllFields(_exploreObject, data);
|
|
552
552
|
}
|
|
553
553
|
data.lines.push("};");
|
|
554
554
|
return data.lines.join("\n");
|
|
555
555
|
}
|
|
556
556
|
|
|
557
|
+
public applyOnAllFields<T>(func: Func1<T>, data: T): void {
|
|
558
|
+
_applyOnAllSchemaFields(this, this.schema, data, func, null);
|
|
559
|
+
}
|
|
560
|
+
|
|
557
561
|
public toJSON(): any {
|
|
558
562
|
assert(this.schema);
|
|
559
563
|
if (this.schema.toJSON) {
|
|
@@ -579,7 +583,7 @@ export class BaseUAObject {
|
|
|
579
583
|
continue;
|
|
580
584
|
}
|
|
581
585
|
if (field.isArray) {
|
|
582
|
-
options[field.name] = self[field.name];
|
|
586
|
+
options[field.name] = [...self[field.name]];
|
|
583
587
|
} else {
|
|
584
588
|
options[field.name] = self[field.name];
|
|
585
589
|
}
|
|
@@ -594,9 +598,9 @@ export class BaseUAObject {
|
|
|
594
598
|
|
|
595
599
|
function _visitSchemaChain(
|
|
596
600
|
self: BaseUAObject,
|
|
597
|
-
schema:
|
|
601
|
+
schema: IStructuredTypeSchema,
|
|
598
602
|
pojo: any,
|
|
599
|
-
func: (self: BaseUAObject, schema:
|
|
603
|
+
func: (self: BaseUAObject, schema: IStructuredTypeSchema, pojo: any) => void,
|
|
600
604
|
extraData: any
|
|
601
605
|
) {
|
|
602
606
|
assert(typeof func === "function");
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
import { assert } from "node-opcua-assert";
|
|
5
5
|
import { decodeLocaleId, encodeLocaleId, validateLocaleId } from "node-opcua-basic-types";
|
|
6
6
|
import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
|
|
7
|
+
import { make_errorLog } from "node-opcua-debug";
|
|
8
|
+
import { getBuiltInType, hasBuiltInType, registerType } from "./builtin_types";
|
|
7
9
|
|
|
8
|
-
|
|
9
|
-
import { BasicTypeDefinition, BasicTypeDefinitionOptions } from "./types";
|
|
10
|
-
|
|
10
|
+
const errorLog = make_errorLog("Factory");
|
|
11
11
|
export interface BasicTypeOptions {
|
|
12
12
|
name: string;
|
|
13
13
|
subType: string;
|
|
@@ -51,14 +51,13 @@ export function registerBasicType(schema: BasicTypeOptions): void {
|
|
|
51
51
|
|
|
52
52
|
/* istanbul ignore next */
|
|
53
53
|
if (exists) {
|
|
54
|
-
|
|
55
|
-
console.log("registerBasicType:", schema);
|
|
54
|
+
errorLog("registerBasicType:", schema);
|
|
56
55
|
throw new Error(`Basic Type ${schema.name} already registered`);
|
|
57
56
|
}
|
|
58
57
|
|
|
59
58
|
const name = schema.name;
|
|
60
59
|
|
|
61
|
-
const t
|
|
60
|
+
const t = getBuiltInType(schema.subType);
|
|
62
61
|
|
|
63
62
|
/* istanbul ignore next */
|
|
64
63
|
if (!t) {
|
|
@@ -86,8 +85,8 @@ export function registerBasicType(schema: BasicTypeOptions): void {
|
|
|
86
85
|
subType: schema.subType,
|
|
87
86
|
|
|
88
87
|
coerce: coerceFunc,
|
|
89
|
-
decode: decodeFunc
|
|
90
|
-
encode: encodeFunc
|
|
88
|
+
decode: decodeFunc!,
|
|
89
|
+
encode: encodeFunc!,
|
|
91
90
|
|
|
92
91
|
random,
|
|
93
92
|
|
|
@@ -105,15 +104,7 @@ export function registerBasicType(schema: BasicTypeOptions): void {
|
|
|
105
104
|
registerBasicType({ name: "Counter", subType: "UInt32" });
|
|
106
105
|
// OPC Unified Architecture, part 3.0 $8.13 page 65
|
|
107
106
|
registerBasicType({ name: "Duration", subType: "Double" });
|
|
108
|
-
registerBasicType({ name: "UAString", subType: "String" });
|
|
109
|
-
registerBasicType({ name: "UABoolean", subType: "Boolean" });
|
|
110
107
|
registerBasicType({ name: "UtcTime", subType: "DateTime" });
|
|
111
|
-
// already ? registerBasicType({name: "Int8", subType: "SByte"});
|
|
112
|
-
// already ? registerBasicType({name: "UInt8", subType: "Byte"});
|
|
113
|
-
registerBasicType({ name: "Char", subType: "Byte" });
|
|
114
|
-
// xx registerBasicType({name:"XmlElement" ,subType:"String" });
|
|
115
|
-
// xx registerBasicType({ name: "Time", subType: "String" });
|
|
116
|
-
// string in the form "en-US" or "de-DE" or "fr" etc...
|
|
117
108
|
|
|
118
109
|
registerBasicType({
|
|
119
110
|
name: "LocaleId",
|
|
@@ -128,8 +119,6 @@ registerBasicType({
|
|
|
128
119
|
|
|
129
120
|
registerBasicType({ name: "ContinuationPoint", subType: "ByteString" });
|
|
130
121
|
registerBasicType({ name: "Image", subType: "ByteString" });
|
|
131
|
-
registerBasicType({ name: "NodeIdType", subType: "NodeId" });
|
|
132
|
-
|
|
133
122
|
registerBasicType({ name: "ImageBMP", subType: "Image" });
|
|
134
123
|
registerBasicType({ name: "ImageGIF", subType: "Image" });
|
|
135
124
|
registerBasicType({ name: "ImageJPG", subType: "Image" });
|
|
@@ -156,13 +145,3 @@ registerBasicType({ name: "Index", subType: "UInt32" });
|
|
|
156
145
|
registerBasicType({ name: "VersionTime", subType: "UInt32" });
|
|
157
146
|
registerBasicType({ name: "ApplicationInstanceCertificate", subType: "ByteString" });
|
|
158
147
|
registerBasicType({ name: "AttributeWriteMask", subType: "UInt32" });
|
|
159
|
-
registerBasicType({ name: "Date", subType: "DateTime" });
|
|
160
|
-
|
|
161
|
-
// registerBasicType({ name: "Counter", subType: "UInt32" });
|
|
162
|
-
// registerBasicType({ name: "IntegerId", subType: "UInt32" });
|
|
163
|
-
// registerBasicType({ name: "UtcTime", subType: "DateTime" });
|
|
164
|
-
// registerBasicType({ name: "Duration", subType: "Double" });
|
|
165
|
-
// registerBasicType({ name: "LocaleId", subType: "String" });
|
|
166
|
-
// registerBasicType({ name: "NumericRange", subType: "String" });
|
|
167
|
-
// registerBasicType({ name: "Time", subType: "String" });
|
|
168
|
-
// registerBasicType({ name: "SessionAuthenticationToken", subType: "NodeId" });
|