node-opcua-factory 2.75.0 → 2.76.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 (66) hide show
  1. package/dist/base_ua_object.d.ts +53 -53
  2. package/dist/base_ua_object.js +535 -535
  3. package/dist/basic_type.d.ts +40 -40
  4. package/dist/basic_type.js +118 -118
  5. package/dist/builtin_types.d.ts +46 -46
  6. package/dist/builtin_types.js +283 -283
  7. package/dist/builtin_types_special.d.ts +5 -5
  8. package/dist/builtin_types_special.js +45 -45
  9. package/dist/datatype_factory.d.ts +36 -36
  10. package/dist/datatype_factory.js +307 -307
  11. package/dist/encode_decode.d.ts +9 -9
  12. package/dist/encode_decode.js +39 -39
  13. package/dist/enumerations.d.ts +32 -32
  14. package/dist/enumerations.js +77 -77
  15. package/dist/get_built_in_type.js +1 -1
  16. package/dist/get_standard_data_type_factory.d.ts +12 -12
  17. package/dist/get_standard_data_type_factory.js +34 -34
  18. package/dist/get_structured_type_schema.d.ts +4 -4
  19. package/dist/get_structured_type_schema.js +12 -12
  20. package/dist/id_generator.d.ts +3 -3
  21. package/dist/id_generator.js +21 -21
  22. package/dist/index.d.ts +18 -18
  23. package/dist/index.js +34 -34
  24. package/dist/nodeid_type.d.ts +13 -13
  25. package/dist/nodeid_type.js +18 -18
  26. package/dist/parameters.d.ts +3 -3
  27. package/dist/parameters.js +6 -6
  28. package/dist/register_class_definition.d.ts +3 -3
  29. package/dist/register_class_definition.js +8 -8
  30. package/dist/schema_helpers.d.ts +24 -24
  31. package/dist/schema_helpers.js +99 -99
  32. package/dist/structured_type_schema.d.ts +44 -44
  33. package/dist/structured_type_schema.js +278 -278
  34. package/dist/types.d.ts +151 -151
  35. package/dist/types.js +9 -9
  36. package/package.json +14 -11
  37. package/dist/constructor_type.d.ts +0 -15
  38. package/dist/constructor_type.js +0 -3
  39. package/dist/constructor_type.js.map +0 -1
  40. package/dist/factories_baseobject.d.ts +0 -56
  41. package/dist/factories_baseobject.js +0 -535
  42. package/dist/factories_baseobject.js.map +0 -1
  43. package/dist/factories_basic_type.d.ts +0 -40
  44. package/dist/factories_basic_type.js +0 -136
  45. package/dist/factories_basic_type.js.map +0 -1
  46. package/dist/factories_builtin_types.d.ts +0 -32
  47. package/dist/factories_builtin_types.js +0 -262
  48. package/dist/factories_builtin_types.js.map +0 -1
  49. package/dist/factories_builtin_types_special.d.ts +0 -5
  50. package/dist/factories_builtin_types_special.js +0 -46
  51. package/dist/factories_builtin_types_special.js.map +0 -1
  52. package/dist/factories_enumerations.d.ts +0 -31
  53. package/dist/factories_enumerations.js +0 -78
  54. package/dist/factories_enumerations.js.map +0 -1
  55. package/dist/factories_factories.d.ts +0 -17
  56. package/dist/factories_factories.js +0 -54
  57. package/dist/factories_factories.js.map +0 -1
  58. package/dist/factories_id_generator.d.ts +0 -3
  59. package/dist/factories_id_generator.js +0 -22
  60. package/dist/factories_id_generator.js.map +0 -1
  61. package/dist/factories_schema_helpers.d.ts +0 -27
  62. package/dist/factories_schema_helpers.js +0 -122
  63. package/dist/factories_schema_helpers.js.map +0 -1
  64. package/dist/factories_structuredTypeSchema.d.ts +0 -45
  65. package/dist/factories_structuredTypeSchema.js +0 -277
  66. package/dist/factories_structuredTypeSchema.js.map +0 -1
package/dist/types.d.ts CHANGED
@@ -1,151 +1,151 @@
1
- /**
2
- * @module node-opcua-factory
3
- */
4
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
5
- import { Enum } from "node-opcua-enum";
6
- import { ExpandedNodeId, NodeId } from "node-opcua-nodeid";
7
- export declare enum FieldCategory {
8
- enumeration = "enumeration",
9
- complex = "complex",
10
- basic = "basic"
11
- }
12
- export interface CommonInterface {
13
- name: string;
14
- defaultValue?: any;
15
- encode?: (value: any, stream: OutputBinaryStream) => void;
16
- decode?: (stream: BinaryStream) => any;
17
- coerce?: (value: any) => any;
18
- toJSON?: (value: any) => any;
19
- category: FieldCategory;
20
- random?: () => any;
21
- validate?: (value: any) => void;
22
- computer_default_value(defaultValue: any): any;
23
- subType: string;
24
- isAbstract: boolean;
25
- isSubTypeOf(type: CommonInterface): boolean;
26
- }
27
- export interface FieldInterfaceOptions {
28
- name: string;
29
- defaultValue?: any | DefaultValueFunc;
30
- fieldType: string;
31
- isArray?: boolean;
32
- documentation?: string;
33
- category?: FieldCategory;
34
- schema?: CommonInterface;
35
- switchBit?: number;
36
- switchValue?: number;
37
- allowSubType?: boolean;
38
- dataType?: NodeId;
39
- basicDataType?: number;
40
- }
41
- export declare type Func1<T> = (value: any, field: StructuredTypeField, data: T, args?: any) => void;
42
- export interface DecodeDebugOptions {
43
- tracer: any;
44
- name: string;
45
- }
46
- export interface IBaseUAObject {
47
- schema: IStructuredTypeSchema;
48
- encode(stream: OutputBinaryStream): void;
49
- decode(stream: BinaryStream): void;
50
- binaryStoreSize(): number;
51
- toString(...args: any[]): string;
52
- isValid(): boolean;
53
- explore(): string;
54
- applyOnAllFields<T>(func: Func1<T>, data: T): void;
55
- toJSON(): any;
56
- decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
57
- clone(): IBaseUAObject;
58
- }
59
- declare type BaseUAObjectConstructable = new (options?: any) => IBaseUAObject;
60
- export declare type ConstructorFunc = BaseUAObjectConstructable;
61
- export interface ConstructorFuncWithSchema extends ConstructorFunc {
62
- schema: IStructuredTypeSchema;
63
- possibleFields: string[];
64
- encodingDefaultBinary: ExpandedNodeId;
65
- encodingDefaultXml: ExpandedNodeId;
66
- encodingDefaultJson?: ExpandedNodeId;
67
- }
68
- export interface StructuredTypeField {
69
- name: string;
70
- originalName: string;
71
- fieldType: string;
72
- isArray?: boolean;
73
- documentation?: string;
74
- category: FieldCategory;
75
- defaultValue?: any | DefaultValueFunc;
76
- schema: CommonInterface;
77
- switchBit?: number;
78
- switchValue?: number;
79
- allowSubType?: boolean;
80
- dataType?: NodeId;
81
- basicDataType?: number;
82
- fieldTypeConstructor?: ConstructorFunc;
83
- subType?: string;
84
- validate?: (value: any) => boolean;
85
- decode?: (stream: BinaryStream) => any;
86
- }
87
- export interface FieldEnumeration extends StructuredTypeField {
88
- }
89
- export interface FieldComplex extends StructuredTypeField {
90
- }
91
- export interface FieldBasic extends StructuredTypeField {
92
- }
93
- export declare type FieldType = FieldEnumeration | FieldComplex | FieldBasic;
94
- export declare type DefaultValueFunc = () => any;
95
- export interface StructuredTypeOptions {
96
- name: string;
97
- id?: number | NodeId;
98
- fields: FieldInterfaceOptions[];
99
- documentation?: string;
100
- baseType: string;
101
- _resolved?: boolean;
102
- bitFields?: any[];
103
- base?: StructuredTypeOptions;
104
- }
105
- export interface TypeSchemaConstructorOptions {
106
- name: string;
107
- subType?: string;
108
- isAbstract?: boolean;
109
- category?: FieldCategory;
110
- defaultValue?: any;
111
- encode?: (value: any, stream: OutputBinaryStream) => void;
112
- decode?: (stream: BinaryStream) => any;
113
- coerce?: (value: any) => any;
114
- }
115
- export interface BasicTypeDefinitionOptionsB extends TypeSchemaConstructorOptions {
116
- toJSON?: (value: any) => any;
117
- random?: () => any;
118
- validate?: (value: any) => void;
119
- }
120
- export interface BasicTypeDefinitionOptionsBase extends BasicTypeDefinitionOptionsB {
121
- }
122
- export interface BasicTypeDefinitionOptions extends BasicTypeDefinitionOptionsB {
123
- subType: string;
124
- }
125
- export interface BasicTypeDefinition extends CommonInterface {
126
- subType: string;
127
- }
128
- export interface BuiltInTypeDefinition extends BasicTypeDefinition {
129
- }
130
- export interface EnumerationDefinition extends CommonInterface {
131
- typedEnum: Enum;
132
- documentation?: string;
133
- }
134
- export declare type TypeDefinition = BuiltInTypeDefinition | EnumerationDefinition | BasicTypeDefinition | CommonInterface;
135
- export interface IStructuredTypeSchema extends CommonInterface {
136
- fields: FieldType[];
137
- id: NodeId;
138
- dataTypeNodeId: NodeId;
139
- baseType: string;
140
- _possibleFields: string[];
141
- _baseSchema: IStructuredTypeSchema | null;
142
- documentation?: string;
143
- isValid?: (options: any) => boolean;
144
- decodeDebug?: (stream: BinaryStream, options: any) => any;
145
- constructHook?: (options: any) => any;
146
- encodingDefaultBinary?: ExpandedNodeId;
147
- encodingDefaultXml?: ExpandedNodeId;
148
- encodingDefaultJson?: ExpandedNodeId;
149
- bitFields?: any[];
150
- }
151
- export {};
1
+ /**
2
+ * @module node-opcua-factory
3
+ */
4
+ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
5
+ import { Enum } from "node-opcua-enum";
6
+ import { ExpandedNodeId, NodeId } from "node-opcua-nodeid";
7
+ export declare enum FieldCategory {
8
+ enumeration = "enumeration",
9
+ complex = "complex",
10
+ basic = "basic"
11
+ }
12
+ export interface CommonInterface {
13
+ name: string;
14
+ defaultValue?: any;
15
+ encode?: (value: any, stream: OutputBinaryStream) => void;
16
+ decode?: (stream: BinaryStream) => any;
17
+ coerce?: (value: any) => any;
18
+ toJSON?: (value: any) => any;
19
+ category: FieldCategory;
20
+ random?: () => any;
21
+ validate?: (value: any) => void;
22
+ computer_default_value(defaultValue: any): any;
23
+ subType: string;
24
+ isAbstract: boolean;
25
+ isSubTypeOf(type: CommonInterface): boolean;
26
+ }
27
+ export interface FieldInterfaceOptions {
28
+ name: string;
29
+ defaultValue?: any | DefaultValueFunc;
30
+ fieldType: string;
31
+ isArray?: boolean;
32
+ documentation?: string;
33
+ category?: FieldCategory;
34
+ schema?: CommonInterface;
35
+ switchBit?: number;
36
+ switchValue?: number;
37
+ allowSubType?: boolean;
38
+ dataType?: NodeId;
39
+ basicDataType?: number;
40
+ }
41
+ export declare type Func1<T> = (value: any, field: StructuredTypeField, data: T, args?: any) => void;
42
+ export interface DecodeDebugOptions {
43
+ tracer: any;
44
+ name: string;
45
+ }
46
+ export interface IBaseUAObject {
47
+ schema: IStructuredTypeSchema;
48
+ encode(stream: OutputBinaryStream): void;
49
+ decode(stream: BinaryStream): void;
50
+ binaryStoreSize(): number;
51
+ toString(...args: any[]): string;
52
+ isValid(): boolean;
53
+ explore(): string;
54
+ applyOnAllFields<T>(func: Func1<T>, data: T): void;
55
+ toJSON(): any;
56
+ decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
57
+ clone(): IBaseUAObject;
58
+ }
59
+ declare type BaseUAObjectConstructable = new (options?: any) => IBaseUAObject;
60
+ export declare type ConstructorFunc = BaseUAObjectConstructable;
61
+ export interface ConstructorFuncWithSchema extends ConstructorFunc {
62
+ schema: IStructuredTypeSchema;
63
+ possibleFields: string[];
64
+ encodingDefaultBinary: ExpandedNodeId;
65
+ encodingDefaultXml: ExpandedNodeId;
66
+ encodingDefaultJson?: ExpandedNodeId;
67
+ }
68
+ export interface StructuredTypeField {
69
+ name: string;
70
+ originalName: string;
71
+ fieldType: string;
72
+ isArray?: boolean;
73
+ documentation?: string;
74
+ category: FieldCategory;
75
+ defaultValue?: any | DefaultValueFunc;
76
+ schema: CommonInterface;
77
+ switchBit?: number;
78
+ switchValue?: number;
79
+ allowSubType?: boolean;
80
+ dataType?: NodeId;
81
+ basicDataType?: number;
82
+ fieldTypeConstructor?: ConstructorFunc;
83
+ subType?: string;
84
+ validate?: (value: any) => boolean;
85
+ decode?: (stream: BinaryStream) => any;
86
+ }
87
+ export interface FieldEnumeration extends StructuredTypeField {
88
+ }
89
+ export interface FieldComplex extends StructuredTypeField {
90
+ }
91
+ export interface FieldBasic extends StructuredTypeField {
92
+ }
93
+ export declare type FieldType = FieldEnumeration | FieldComplex | FieldBasic;
94
+ export declare type DefaultValueFunc = () => any;
95
+ export interface StructuredTypeOptions {
96
+ name: string;
97
+ id?: number | NodeId;
98
+ fields: FieldInterfaceOptions[];
99
+ documentation?: string;
100
+ baseType: string;
101
+ _resolved?: boolean;
102
+ bitFields?: any[];
103
+ base?: StructuredTypeOptions;
104
+ }
105
+ export interface TypeSchemaConstructorOptions {
106
+ name: string;
107
+ subType?: string;
108
+ isAbstract?: boolean;
109
+ category?: FieldCategory;
110
+ defaultValue?: any;
111
+ encode?: (value: any, stream: OutputBinaryStream) => void;
112
+ decode?: (stream: BinaryStream) => any;
113
+ coerce?: (value: any) => any;
114
+ }
115
+ export interface BasicTypeDefinitionOptionsB extends TypeSchemaConstructorOptions {
116
+ toJSON?: (value: any) => any;
117
+ random?: () => any;
118
+ validate?: (value: any) => void;
119
+ }
120
+ export interface BasicTypeDefinitionOptionsBase extends BasicTypeDefinitionOptionsB {
121
+ }
122
+ export interface BasicTypeDefinitionOptions extends BasicTypeDefinitionOptionsB {
123
+ subType: string;
124
+ }
125
+ export interface BasicTypeDefinition extends CommonInterface {
126
+ subType: string;
127
+ }
128
+ export interface BuiltInTypeDefinition extends BasicTypeDefinition {
129
+ }
130
+ export interface EnumerationDefinition extends CommonInterface {
131
+ typedEnum: Enum;
132
+ documentation?: string;
133
+ }
134
+ export declare type TypeDefinition = BuiltInTypeDefinition | EnumerationDefinition | BasicTypeDefinition | CommonInterface;
135
+ export interface IStructuredTypeSchema extends CommonInterface {
136
+ fields: FieldType[];
137
+ id: NodeId;
138
+ dataTypeNodeId: NodeId;
139
+ baseType: string;
140
+ _possibleFields: string[];
141
+ _baseSchema: IStructuredTypeSchema | null;
142
+ documentation?: string;
143
+ isValid?: (options: any) => boolean;
144
+ decodeDebug?: (stream: BinaryStream, options: any) => any;
145
+ constructHook?: (options: any) => any;
146
+ encodingDefaultBinary?: ExpandedNodeId;
147
+ encodingDefaultXml?: ExpandedNodeId;
148
+ encodingDefaultJson?: ExpandedNodeId;
149
+ bitFields?: any[];
150
+ }
151
+ export {};
package/dist/types.js CHANGED
@@ -1,10 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FieldCategory = void 0;
4
- var FieldCategory;
5
- (function (FieldCategory) {
6
- FieldCategory["enumeration"] = "enumeration";
7
- FieldCategory["complex"] = "complex";
8
- FieldCategory["basic"] = "basic";
9
- })(FieldCategory = exports.FieldCategory || (exports.FieldCategory = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldCategory = void 0;
4
+ var FieldCategory;
5
+ (function (FieldCategory) {
6
+ FieldCategory["enumeration"] = "enumeration";
7
+ FieldCategory["complex"] = "complex";
8
+ FieldCategory["basic"] = "basic";
9
+ })(FieldCategory = exports.FieldCategory || (exports.FieldCategory = {}));
10
10
  //# sourceMappingURL=types.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-factory",
3
- "version": "2.75.0",
3
+ "version": "2.76.0",
4
4
  "description": "pure nodejs OPCUA SDK - module -factory",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -11,18 +11,21 @@
11
11
  "clean": "npx rimraf dist *.tsbuildinfo",
12
12
  "test": "mocha"
13
13
  },
14
+ "devDependencies": {
15
+ "should": "^13.2.3"
16
+ },
14
17
  "dependencies": {
15
18
  "chalk": "4.1.2",
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-assert": "2.76.0",
20
+ "node-opcua-basic-types": "2.76.0",
21
+ "node-opcua-binary-stream": "2.76.0",
19
22
  "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"
23
+ "node-opcua-debug": "2.76.0",
24
+ "node-opcua-enum": "2.76.0",
25
+ "node-opcua-guid": "2.76.0",
26
+ "node-opcua-nodeid": "2.76.0",
27
+ "node-opcua-status-code": "2.76.0",
28
+ "node-opcua-utils": "2.76.0"
26
29
  },
27
30
  "author": "Etienne Rossignon",
28
31
  "license": "MIT",
@@ -39,5 +42,5 @@
39
42
  "internet of things"
40
43
  ],
41
44
  "homepage": "http://node-opcua.github.io/",
42
- "gitHead": "5ccb835ca480c2a8a591ae61b5949a9d8bad4017"
45
+ "gitHead": "75d9b8cf894c8fbadf77d2c4a48a730d055465e7"
43
46
  }
@@ -1,15 +0,0 @@
1
- /**
2
- * @module node-opcua-factory
3
- */
4
- import { ExpandedNodeId } from "node-opcua-nodeid";
5
- import { BaseUAObject } from "./factories_baseobject";
6
- import { StructuredTypeSchema } from "./factories_structuredTypeSchema";
7
- declare type BaseUAObjectConstructable = new (options?: any) => BaseUAObject;
8
- export declare type ConstructorFunc = BaseUAObjectConstructable;
9
- export interface ConstructorFuncWithSchema extends ConstructorFunc {
10
- schema: StructuredTypeSchema;
11
- possibleFields: string[];
12
- encodingDefaultBinary: ExpandedNodeId;
13
- encodingDefaultXml: ExpandedNodeId;
14
- }
15
- export {};
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=constructor_type.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constructor_type.js","sourceRoot":"","sources":["../source/constructor_type.ts"],"names":[],"mappings":""}
@@ -1,56 +0,0 @@
1
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
2
- import { StructuredTypeSchema } from "./factories_structuredTypeSchema";
3
- export interface DecodeDebugOptions {
4
- tracer: any;
5
- name: string;
6
- }
7
- export interface BaseUAObject {
8
- schema: StructuredTypeSchema;
9
- }
10
- /**
11
- * @class BaseUAObject
12
- * @constructor
13
- */
14
- export declare class BaseUAObject {
15
- constructor();
16
- /**
17
- * Encode the object to the binary stream.
18
- * @class BaseUAObject
19
- * @method encode
20
- * @param stream {BinaryStream}
21
- */
22
- encode(stream: OutputBinaryStream): void;
23
- /**
24
- * Decode the object from the binary stream.
25
- * @class BaseUAObject
26
- * @method decode
27
- * @param stream {BinaryStream}
28
- */
29
- decode(stream: BinaryStream): void;
30
- /**
31
- * Calculate the required size to store this object in a binary stream.
32
- * @method binaryStoreSize
33
- * @return number
34
- */
35
- binaryStoreSize(): number;
36
- /**
37
- * @method toString
38
- * @return {String}
39
- */
40
- toString(...args: any[]): string;
41
- /**
42
- *
43
- * verify that all object attributes values are valid according to schema
44
- * @method isValid
45
- * @return boolean
46
- */
47
- isValid(): boolean;
48
- /**
49
- * @method decodeDebug
50
- *
51
- */
52
- decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
53
- explore(): string;
54
- toJSON(): any;
55
- clone(): any;
56
- }