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.
Files changed (75) hide show
  1. package/LICENSE +3 -1
  2. package/dist/base_ua_object.d.ts +53 -0
  3. package/dist/base_ua_object.js +536 -0
  4. package/dist/base_ua_object.js.map +1 -0
  5. package/dist/basic_type.d.ts +40 -0
  6. package/dist/basic_type.js +119 -0
  7. package/dist/basic_type.js.map +1 -0
  8. package/dist/builtin_types.d.ts +46 -0
  9. package/dist/builtin_types.js +284 -0
  10. package/dist/builtin_types.js.map +1 -0
  11. package/dist/builtin_types_special.d.ts +5 -0
  12. package/dist/builtin_types_special.js +46 -0
  13. package/dist/builtin_types_special.js.map +1 -0
  14. package/dist/datatype_factory.d.ts +8 -11
  15. package/dist/datatype_factory.js +25 -42
  16. package/dist/datatype_factory.js.map +1 -1
  17. package/dist/encode_decode.d.ts +9 -0
  18. package/dist/encode_decode.js +40 -0
  19. package/dist/encode_decode.js.map +1 -0
  20. package/dist/enumerations.d.ts +32 -0
  21. package/dist/enumerations.js +78 -0
  22. package/dist/enumerations.js.map +1 -0
  23. package/dist/get_built_in_type.d.ts +0 -0
  24. package/dist/get_built_in_type.js +2 -0
  25. package/dist/get_built_in_type.js.map +1 -0
  26. package/dist/get_standard_data_type_factory.d.ts +12 -0
  27. package/dist/get_standard_data_type_factory.js +35 -0
  28. package/dist/get_standard_data_type_factory.js.map +1 -0
  29. package/dist/get_structured_type_schema.d.ts +4 -0
  30. package/dist/get_structured_type_schema.js +13 -0
  31. package/dist/get_structured_type_schema.js.map +1 -0
  32. package/dist/id_generator.d.ts +3 -0
  33. package/dist/id_generator.js +22 -0
  34. package/dist/id_generator.js.map +1 -0
  35. package/dist/index.d.ts +13 -10
  36. package/dist/index.js +13 -10
  37. package/dist/index.js.map +1 -1
  38. package/dist/nodeid_type.d.ts +13 -0
  39. package/dist/nodeid_type.js +19 -0
  40. package/dist/nodeid_type.js.map +1 -0
  41. package/dist/parameters.d.ts +3 -0
  42. package/dist/parameters.js +7 -0
  43. package/dist/parameters.js.map +1 -0
  44. package/dist/register_class_definition.d.ts +3 -0
  45. package/dist/register_class_definition.js +9 -0
  46. package/dist/register_class_definition.js.map +1 -0
  47. package/dist/schema_helpers.d.ts +24 -0
  48. package/dist/schema_helpers.js +100 -0
  49. package/dist/schema_helpers.js.map +1 -0
  50. package/dist/structured_type_schema.d.ts +44 -0
  51. package/dist/structured_type_schema.js +279 -0
  52. package/dist/structured_type_schema.js.map +1 -0
  53. package/dist/types.d.ts +86 -45
  54. package/dist/types.js +1 -43
  55. package/dist/types.js.map +1 -1
  56. package/package.json +13 -12
  57. package/source/{factories_baseobject.ts → base_ua_object.ts} +48 -44
  58. package/source/{factories_basic_type.ts → basic_type.ts} +7 -28
  59. package/source/{factories_builtin_types.ts → builtin_types.ts} +111 -89
  60. package/source/{factories_builtin_types_special.ts → builtin_types_special.ts} +2 -2
  61. package/source/datatype_factory.ts +44 -47
  62. package/source/encode_decode.ts +37 -0
  63. package/source/{factories_enumerations.ts → enumerations.ts} +6 -4
  64. package/source/get_built_in_type.ts +0 -0
  65. package/source/{factories_factories.ts → get_standard_data_type_factory.ts} +7 -25
  66. package/source/get_structured_type_schema.ts +10 -0
  67. package/source/{factories_id_generator.ts → id_generator.ts} +0 -0
  68. package/source/index.ts +14 -11
  69. package/source/nodeid_type.ts +17 -0
  70. package/source/parameters.ts +3 -0
  71. package/source/register_class_definition.ts +11 -0
  72. package/source/{factories_schema_helpers.ts → schema_helpers.ts} +15 -37
  73. package/source/{factories_structuredTypeSchema.ts → structured_type_schema.ts} +37 -36
  74. package/source/types.ts +104 -79
  75. 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.TypeSchemaBase = exports.FieldCategory = void 0;
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":";;;AAAA;;GAEG;AACH,yDAA2C;AA4B3C,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,4CAA2B,CAAA;IAC3B,oCAAmB,CAAA;IACnB,gCAAe,CAAA;AACnB,CAAC,EAJW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAIxB;AA4FD;;;;;GAKG;AACH,MAAa,cAAc;IASvB,YAAY,OAAqC;QAC7C,IAAA,0BAAM,EAAC,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,SAAS,CAAC;QAC1C,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,aAAa,CAAC,KAAK,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QAEzB,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YACxB,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE;gBACpD,IAAY,CAAC,IAAI,CAAC,GAAI,OAAe,CAAC,IAAI,CAAC,CAAC;aAChD;SACJ;IACL,CAAC;IAED;;;;OAIG;IACI,sBAAsB,CAAC,YAAqB;QAC/C,IAAI,YAAY,KAAK,SAAS,EAAE;YAC5B,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC;SACpC;QACD,IAAI,OAAO,YAAY,KAAK,UAAU,EAAE;YACpC,8EAA8E;YAC9E,uDAAuD;YACvD,YAAY,GAAG,YAAY,EAAE,CAAC;SACjC;QACD,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ;AAxCD,wCAwCC"}
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.72.1",
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": "echo no test"
12
+ "test": "mocha"
13
13
  },
14
14
  "dependencies": {
15
15
  "chalk": "4.1.2",
16
- "node-opcua-assert": "2.66.0",
17
- "node-opcua-basic-types": "2.72.1",
18
- "node-opcua-binary-stream": "2.71.0",
19
- "node-opcua-debug": "2.71.0",
20
- "node-opcua-enum": "2.71.0",
21
- "node-opcua-guid": "2.66.0",
22
- "node-opcua-nodeid": "2.71.0",
23
- "node-opcua-status-code": "2.71.0",
24
- "node-opcua-utils": "2.71.0"
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": "ba98dd91a9eada9815268c66c98ca5391bc884e7"
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 { getBuildInType } from "./factories_builtin_types";
16
- import { getEnumeration, hasEnumeration } from "./factories_enumerations";
17
- import { DataTypeFactory } from "./datatype_factory";
18
- import { getStructureTypeConstructor } from "./factories_factories";
19
- import { get_base_schema, StructuredTypeSchema } from "./factories_structuredTypeSchema";
20
- import { EnumerationDefinition, FieldCategory, StructuredTypeField, BuiltInTypeDefinition, FieldType } from "./types";
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
- type Func1 = (a: any, field: StructuredTypeField, data: ExploreParams, args: any) => void;
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
- applyOnAllSchemaFields(self, baseSchema, data, functor, args);
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("/* " + r(fieldType + opt, 17) + (field.isArray ? "[]" : " ") + " */");
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
- // tslint:disable-next-line: no-console
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
- data.lines.push(padding + chalk.cyan(" { " + ("/*" + i + "*/")));
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
- applyOnAllSchemaFields(element, _newFieldSchema, data1, _exploreObject, args);
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
- applyOnAllSchemaFields(value, _newFieldSchema, data1, _exploreObject, args);
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: StructuredTypeSchema, pojo: any) {
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 (hasEnumeration(field.fieldType)) {
395
- const enumeration = getEnumeration(field.fieldType);
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 = getBuildInType(field.fieldType);
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 DecodeDebugOptions {
415
- tracer: any;
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 as OutputBinaryStream);
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
- applyOnAllSchemaFields(this, this.schema, data, _exploreObject, arguments);
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: StructuredTypeSchema,
601
+ schema: IStructuredTypeSchema,
598
602
  pojo: any,
599
- func: (self: BaseUAObject, schema: StructuredTypeSchema, pojo: any) => void,
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
- import { findSimpleType, hasBuiltInType, registerType } from "./factories_builtin_types";
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
- // tslint:disable-next-line: no-console
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: BasicTypeDefinition = findSimpleType(schema.subType);
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" });