node-opcua-schemas 2.55.0 → 2.60.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.
@@ -1,101 +1,101 @@
1
- import { ConstructorFuncWithSchema, DataTypeFactory, EnumerationDefinitionSchema, StructuredTypeSchema } from "node-opcua-factory";
2
-
3
- export function toTypeScript(dataTypeFactory: DataTypeFactory): string {
4
- const enumeratedTypes: Map<string, EnumerationDefinitionSchema> = (dataTypeFactory as any)._enumerations;
5
- const structuredTypes: Map<string, ConstructorFuncWithSchema> = (dataTypeFactory as any)._structureTypeConstructorByNameMap;
6
-
7
- const declaration: Map<string, string> = new Map();
8
-
9
- function adjustType(t: string): string {
10
- if (!enumeratedTypes.has(t) && !structuredTypes.has(t)) {
11
- declaration.set(t, t);
12
- }
13
- return t;
14
- }
15
- const l: string[] = [];
16
- // enumeration
17
- for (const e of enumeratedTypes.values()) {
18
- l.push(`export enum ${e.name} {`);
19
- // console.log((e.typedEnum as any).enumItems);
20
- for (const v of Object.entries(e.enumValues as any)) {
21
- const vv = parseInt(v[0], 10);
22
- if (vv >= 0) {
23
- continue;
24
- }
25
- l.push(` ${v[0]} = ${v[1]},`);
26
- }
27
- l.push(`}`);
28
- }
29
- const alreadyDone: Set<string> = new Set();
30
- function dumpType(o: StructuredTypeSchema) {
31
- // base type first
32
- const b = o.baseType;
33
-
34
- const bt = structuredTypes.get(b)?.schema;
35
-
36
- if (b && !alreadyDone.has(o.baseType) && bt) {
37
- dumpType(bt);
38
- }
39
- alreadyDone.add(o.name);
40
- const ex1 = b && bt ? `extends ${b} ` : "";
41
-
42
- if (o.baseType === "Union") {
43
- const p: string[] = [];
44
-
45
- let switchFieldName = "";
46
- // find switchFieldName
47
- for (const field of o.fields) {
48
- if (field.switchValue === undefined) {
49
- // this is the switch value field
50
- switchFieldName = field.name;
51
- break;
52
- }
53
- }
54
- // export all flavors
55
- for (const field of o.fields) {
56
- const name = field.name;
57
- if (field.switchValue === undefined) {
58
- continue;
59
- }
60
- const a = field.isArray ? "[]" : "";
61
- const fieldType = adjustType(field.schema.name);
62
- l.push(`interface ${o.name}${field.switchValue} ${ex1}{`);
63
- l.push(` ${switchFieldName}: ${field.switchValue};`);
64
- l.push(` ${field.name}: ${fieldType}${a};`);
65
- l.push(`}`);
66
- p.push(`${o.name}${field.switchValue}`);
67
- }
68
- const pp = p.join(" | ");
69
- l.push(`type ${o.name} = ${pp};`);
70
- } else {
71
- if (o.fields.length === 0) {
72
- l.push("// tslint:disable-next-line: no-empty-interface");
73
- }
74
-
75
- l.push(`interface ${o.name} ${ex1}{`);
76
- for (const f of o.fields) {
77
- if (f.documentation) {
78
- l.push(` // ${f.documentation}`);
79
- }
80
- const isOpt = f.switchBit !== undefined ? "?" : "";
81
- const fieldType = adjustType(f.schema.name);
82
- if (f.isArray) {
83
- l.push(` ${f.name}${isOpt}: ${fieldType}[];`);
84
- } else {
85
- l.push(` ${f.name}${isOpt}: ${fieldType};`);
86
- }
87
- }
88
- l.push(`}`);
89
- }
90
- }
91
- // objects
92
- for (const o of structuredTypes.values()) {
93
- if (alreadyDone.has(o.schema.name)) {
94
- continue;
95
- }
96
- dumpType(o.schema);
97
- }
98
- const opcuaTypes = [...declaration.keys()].sort().join(",\n ");
99
- l.unshift(`import {\n ${opcuaTypes}\n} from "node-opcua";`);
100
- return l.join("\n");
101
- }
1
+ import { ConstructorFuncWithSchema, DataTypeFactory, EnumerationDefinitionSchema, StructuredTypeSchema } from "node-opcua-factory";
2
+
3
+ export function toTypeScript(dataTypeFactory: DataTypeFactory): string {
4
+ const enumeratedTypes: Map<string, EnumerationDefinitionSchema> = (dataTypeFactory as any)._enumerations;
5
+ const structuredTypes: Map<string, ConstructorFuncWithSchema> = (dataTypeFactory as any)._structureTypeConstructorByNameMap;
6
+
7
+ const declaration: Map<string, string> = new Map();
8
+
9
+ function adjustType(t: string): string {
10
+ if (!enumeratedTypes.has(t) && !structuredTypes.has(t)) {
11
+ declaration.set(t, t);
12
+ }
13
+ return t;
14
+ }
15
+ const l: string[] = [];
16
+ // enumeration
17
+ for (const e of enumeratedTypes.values()) {
18
+ l.push(`export enum ${e.name} {`);
19
+ // console.log((e.typedEnum as any).enumItems);
20
+ for (const v of Object.entries(e.enumValues as any)) {
21
+ const vv = parseInt(v[0], 10);
22
+ if (vv >= 0) {
23
+ continue;
24
+ }
25
+ l.push(` ${v[0]} = ${v[1]},`);
26
+ }
27
+ l.push(`}`);
28
+ }
29
+ const alreadyDone: Set<string> = new Set();
30
+ function dumpType(o: StructuredTypeSchema) {
31
+ // base type first
32
+ const b = o.baseType;
33
+
34
+ const bt = structuredTypes.get(b)?.schema;
35
+
36
+ if (b && !alreadyDone.has(o.baseType) && bt) {
37
+ dumpType(bt);
38
+ }
39
+ alreadyDone.add(o.name);
40
+ const ex1 = b && bt ? `extends ${b} ` : "";
41
+
42
+ if (o.baseType === "Union") {
43
+ const p: string[] = [];
44
+
45
+ let switchFieldName = "";
46
+ // find switchFieldName
47
+ for (const field of o.fields) {
48
+ if (field.switchValue === undefined) {
49
+ // this is the switch value field
50
+ switchFieldName = field.name;
51
+ break;
52
+ }
53
+ }
54
+ // export all flavors
55
+ for (const field of o.fields) {
56
+ const name = field.name;
57
+ if (field.switchValue === undefined) {
58
+ continue;
59
+ }
60
+ const a = field.isArray ? "[]" : "";
61
+ const fieldType = adjustType(field.schema.name);
62
+ l.push(`interface ${o.name}${field.switchValue} ${ex1}{`);
63
+ l.push(` ${switchFieldName}: ${field.switchValue};`);
64
+ l.push(` ${field.name}: ${fieldType}${a};`);
65
+ l.push(`}`);
66
+ p.push(`${o.name}${field.switchValue}`);
67
+ }
68
+ const pp = p.join(" | ");
69
+ l.push(`type ${o.name} = ${pp};`);
70
+ } else {
71
+ if (o.fields.length === 0) {
72
+ l.push("// tslint:disable-next-line: no-empty-interface");
73
+ }
74
+
75
+ l.push(`interface ${o.name} ${ex1}{`);
76
+ for (const f of o.fields) {
77
+ if (f.documentation) {
78
+ l.push(` // ${f.documentation}`);
79
+ }
80
+ const isOpt = f.switchBit !== undefined ? "?" : "";
81
+ const fieldType = adjustType(f.schema.name);
82
+ if (f.isArray) {
83
+ l.push(` ${f.name}${isOpt}: ${fieldType}[];`);
84
+ } else {
85
+ l.push(` ${f.name}${isOpt}: ${fieldType};`);
86
+ }
87
+ }
88
+ l.push(`}`);
89
+ }
90
+ }
91
+ // objects
92
+ for (const o of structuredTypes.values()) {
93
+ if (alreadyDone.has(o.schema.name)) {
94
+ continue;
95
+ }
96
+ dumpType(o.schema);
97
+ }
98
+ const opcuaTypes = [...declaration.keys()].sort().join(",\n ");
99
+ l.unshift(`import {\n ${opcuaTypes}\n} from "node-opcua";`);
100
+ return l.join("\n");
101
+ }
package/source/tools.ts CHANGED
@@ -1,192 +1,190 @@
1
- import {
2
- buildStructuredType,
3
- ConstructorFuncWithSchema,
4
- DataTypeFactory,
5
- FieldCategory,
6
- getBuildInType,
7
- getStructuredTypeSchema,
8
- hasBuiltInType,
9
- hasStructuredType,
10
- StructuredTypeOptions,
11
- StructuredTypeSchema,
12
- } from "node-opcua-factory";
13
- import {
14
- createDynamicObjectConstructor
15
- } from "./dynamic_extension_object";
16
- import {
17
- MapDataTypeAndEncodingIdProvider,
18
- TypeDictionary,
19
- } from "./parse_binary_xsd";
20
- import { ExpandedNodeId } from "node-opcua-nodeid";
21
-
22
- function _removeNamespacePart(str?: string): string | undefined {
23
- if (!str) {
24
- return str;
25
- }
26
- const data = str.split(":");
27
- return data.length > 1 ? data[1] : str;
28
- }
29
-
30
- function _getNamespacePart(str: string): string {
31
- return str.split(":")[0];
32
- }
33
-
34
- function _adjustFieldTypeName(fieldTypeName: string): string {
35
- // special cases
36
- if (fieldTypeName === "String" || fieldTypeName === "CharArray") {
37
- fieldTypeName = "UAString";
38
- }
39
- if (fieldTypeName === "Boolean") {
40
- fieldTypeName = "UABoolean";
41
- }
42
-
43
- return fieldTypeName;
44
- }
45
-
46
- export function getOrCreateStructuredTypeSchema(
47
- name: string,
48
- typeDictionary: TypeDictionary,
49
- dataTypeFactory: DataTypeFactory,
50
- idProvider: MapDataTypeAndEncodingIdProvider
51
- ): StructuredTypeSchema {
52
-
53
- function _getOrCreateStructuredTypeSchema(
54
- _name: string,
55
- ): StructuredTypeSchema {
56
-
57
- if (dataTypeFactory.hasStructuredType(_name)) {
58
- return dataTypeFactory.getStructuredTypeSchema(_name);
59
- }
60
-
61
- // construct it !
62
- const structuredType = typeDictionary.getStructuredTypesRawByName(_name);
63
- if (!structuredType) {
64
- throw new Error("Cannot find structuredType " + _name);
65
- }
66
-
67
- structuredType.baseType = _removeNamespacePart(structuredType.baseType);
68
- structuredType.baseType = structuredType.baseType ? structuredType.baseType : "ExtensionObject";
69
-
70
- const baseSchema = typeDictionary.getStructuredTypesRawByName(structuredType.baseType);
71
-
72
- // remove redundant fields
73
- // Note :some file do no thave SourceType property and may be replicated here ..
74
- // but they belongs to the base class and shall be remove/
75
- // For instance DataTypeSchemaHeader => UABinaryFileDataType
76
- if (baseSchema && baseSchema.fields && baseSchema.name !== "ExtensionObject") {
77
- structuredType.fields = structuredType.fields.filter((field)=> {
78
- const name = field.name;
79
- const index = baseSchema.fields.findIndex((f)=> f.name === name);
80
- if(index>=0) {
81
- // tslint:disable-next-line: no-console
82
- console.log("Warning : find duplicated field from base structure : field name ", name,
83
- "baseSchema = ",baseSchema.name, "schema =", structuredType.name);
84
- }
85
- return index < 0;
86
- });
87
- }
88
- for (const field of structuredType.fields) {
89
- const fieldType = field.fieldType;
90
- if (!field.schema) {
91
-
92
- const prefix = _getNamespacePart(fieldType);
93
- const fieldTypeName = _adjustFieldTypeName(_removeNamespacePart(fieldType)!);
94
-
95
- switch (prefix) {
96
- case "tns":
97
-
98
- field.fieldType = fieldTypeName;
99
- if (dataTypeFactory.hasEnumeration(fieldTypeName)) {
100
- const enumeratedType = dataTypeFactory.getEnumeration(fieldTypeName);
101
- field.category = FieldCategory.enumeration;
102
- field.schema = enumeratedType;
103
- } else {
104
- // must be a structure then ....
105
- field.category = FieldCategory.complex;
106
- const schema1 = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
107
- field.schema = schema1;
108
- // _getOrCreateStructuredTypeSchema(fieldTypeName);
109
- if (!field.schema) {
110
- // tslint:disable-next-line:no-console
111
- console.log("cannot find schema for ", fieldTypeName);
112
- }
113
- }
114
- break;
115
- case "ua":
116
- field.fieldType = fieldTypeName;
117
- if (hasBuiltInType(fieldTypeName)) {
118
- field.category = FieldCategory.basic;
119
- field.schema = getBuildInType(fieldTypeName);
120
- } else if (dataTypeFactory.hasStructuredType(fieldTypeName)) {
121
- field.category = FieldCategory.complex;
122
- field.schema = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
123
-
124
- } else {
125
- field.category = FieldCategory.basic;
126
- // try in this
127
- field.schema = _getOrCreateStructuredTypeSchema(fieldTypeName);
128
- if (!field.schema) {
129
- // tslint:disable-next-line:no-console
130
- console.log("What should I do ??", fieldTypeName, " ", hasStructuredType(fieldTypeName));
131
- } else {
132
- if (hasBuiltInType(fieldTypeName)) {
133
- field.category = FieldCategory.basic;
134
- } else {
135
- field.category = FieldCategory.complex;
136
- }
137
- }
138
- }
139
- break;
140
- case "opc":
141
- if ((fieldTypeName === "UAString" || fieldTypeName === "String") && field.name === "IndexRange") {
142
- field.fieldType = "NumericRange";
143
- // xx console.log(" NumericRange detected here !");
144
- } else {
145
- field.fieldType = fieldTypeName;
146
- }
147
- if (!hasBuiltInType(fieldTypeName)) {
148
- throw new Error("Unknown basic type " + fieldTypeName);
149
- }
150
- field.category = FieldCategory.basic;
151
- break;
152
- default:
153
- if (dataTypeFactory.hasEnumeration(fieldTypeName)) {
154
- field.category = FieldCategory.enumeration;
155
- const enumeratedType = dataTypeFactory.getEnumeration(fieldTypeName);
156
- field.schema = enumeratedType;
157
- } else if (dataTypeFactory.hasStructuredType(fieldTypeName)) {
158
- field.category = FieldCategory.complex;
159
- const schema1 = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
160
- field.schema = schema1;
161
- }
162
- break;
163
- }
164
- }
165
- }
166
-
167
- const schema = buildStructuredType(structuredType as StructuredTypeOptions);
168
- const ids = idProvider.getDataTypeAndEncodingId(schema.name);
169
- if (!ids) {
170
- // this may happen if the type is abstract or if the type referes to a internal ExtnsionObject
171
- // that can only exists inside an other extension object.this Type of extension object cannot
172
- // instantiated as standalone object and do not have encoding nodeIds...
173
- const Constructor = createDynamicObjectConstructor(schema, dataTypeFactory) as ConstructorFuncWithSchema;
174
- return schema;
175
- }
176
- schema.id = ids.dataTypeNodeId;
177
- schema.dataTypeNodeId = ids.dataTypeNodeId;
178
- if (schema.id.namespace === 0 && schema.id.value === 0) {
179
- return schema;
180
- }
181
- schema.encodingDefaultXml = ExpandedNodeId.fromNodeId(ids.xmlEncodingNodeId);
182
- schema.encodingDefaultJson = ExpandedNodeId.fromNodeId(ids.jsonEncodingNodeId);
183
- schema.encodingDefaultBinary = ExpandedNodeId.fromNodeId(ids.binaryEncodingNodeId);
184
-
185
- const Constructor = createDynamicObjectConstructor(schema, dataTypeFactory) as ConstructorFuncWithSchema;
186
- Constructor.encodingDefaultBinary = schema.encodingDefaultBinary;
187
- Constructor.encodingDefaultXml = schema.encodingDefaultXml;
188
-
189
- return schema;
190
- }
191
- return _getOrCreateStructuredTypeSchema(name);
192
- }
1
+ /* eslint-disable max-depth */
2
+ /* eslint-disable max-statements */
3
+ import {
4
+ buildStructuredType,
5
+ ConstructorFuncWithSchema,
6
+ DataTypeFactory,
7
+ FieldCategory,
8
+ getBuildInType,
9
+ getStructuredTypeSchema,
10
+ hasBuiltInType,
11
+ hasStructuredType,
12
+ StructuredTypeOptions,
13
+ StructuredTypeSchema
14
+ } from "node-opcua-factory";
15
+ import { ExpandedNodeId } from "node-opcua-nodeid";
16
+
17
+ import { createDynamicObjectConstructor } from "./dynamic_extension_object";
18
+ import { MapDataTypeAndEncodingIdProvider, TypeDictionary } from "./parse_binary_xsd";
19
+
20
+ function _removeNamespacePart(str?: string): string | undefined {
21
+ if (!str) {
22
+ return str;
23
+ }
24
+ const data = str.split(":");
25
+ return data.length > 1 ? data[1] : str;
26
+ }
27
+
28
+ function _getNamespacePart(str: string): string {
29
+ return str.split(":")[0];
30
+ }
31
+
32
+ function _adjustFieldTypeName(fieldTypeName: string): string {
33
+ // special cases
34
+ if (fieldTypeName === "String" || fieldTypeName === "CharArray") {
35
+ fieldTypeName = "UAString";
36
+ }
37
+ if (fieldTypeName === "Boolean") {
38
+ fieldTypeName = "UABoolean";
39
+ }
40
+
41
+ return fieldTypeName;
42
+ }
43
+
44
+ export function getOrCreateStructuredTypeSchema(
45
+ name: string,
46
+ typeDictionary: TypeDictionary,
47
+ dataTypeFactory: DataTypeFactory,
48
+ idProvider: MapDataTypeAndEncodingIdProvider
49
+ ): StructuredTypeSchema {
50
+ // eslint-disable-next-line complexity
51
+ function _getOrCreateStructuredTypeSchema(_name: string): StructuredTypeSchema {
52
+ if (dataTypeFactory.hasStructuredType(_name)) {
53
+ return dataTypeFactory.getStructuredTypeSchema(_name);
54
+ }
55
+
56
+ // construct it !
57
+ const structuredType = typeDictionary.getStructuredTypesRawByName(_name);
58
+ if (!structuredType) {
59
+ throw new Error("Cannot find structuredType " + _name);
60
+ }
61
+
62
+ structuredType.baseType = _removeNamespacePart(structuredType.baseType);
63
+ structuredType.baseType = structuredType.baseType ? structuredType.baseType : "ExtensionObject";
64
+
65
+ const baseSchema = typeDictionary.getStructuredTypesRawByName(structuredType.baseType);
66
+
67
+ // remove redundant fields
68
+ // Note :some file do no thave SourceType property and may be replicated here ..
69
+ // but they belongs to the base class and shall be remove/
70
+ // For instance DataTypeSchemaHeader => UABinaryFileDataType
71
+ if (baseSchema && baseSchema.fields && baseSchema.name !== "ExtensionObject") {
72
+ structuredType.fields = structuredType.fields.filter((field) => {
73
+ const name = field.name;
74
+ const index = baseSchema.fields.findIndex((f) => f.name === name);
75
+ if (index >= 0) {
76
+ // tslint:disable-next-line: no-console
77
+ console.log(
78
+ "Warning : find duplicated field from base structure : field name ",
79
+ name,
80
+ "baseSchema = ",
81
+ baseSchema.name,
82
+ "schema =",
83
+ structuredType.name
84
+ );
85
+ }
86
+ return index < 0;
87
+ });
88
+ }
89
+ for (const field of structuredType.fields) {
90
+ const fieldType = field.fieldType;
91
+ if (!field.schema) {
92
+ const prefix = _getNamespacePart(fieldType);
93
+ const fieldTypeName = _adjustFieldTypeName(_removeNamespacePart(fieldType)!);
94
+
95
+ switch (prefix) {
96
+ case "tns":
97
+ field.fieldType = fieldTypeName;
98
+ if (dataTypeFactory.hasEnumeration(fieldTypeName)) {
99
+ const enumeratedType = dataTypeFactory.getEnumeration(fieldTypeName);
100
+ field.category = FieldCategory.enumeration;
101
+ field.schema = enumeratedType;
102
+ } else {
103
+ // must be a structure then ....
104
+ field.category = FieldCategory.complex;
105
+ const schema1 = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
106
+ field.schema = schema1;
107
+ // _getOrCreateStructuredTypeSchema(fieldTypeName);
108
+ if (!field.schema) {
109
+ // tslint:disable-next-line:no-console
110
+ console.log("cannot find schema for ", fieldTypeName);
111
+ }
112
+ }
113
+ break;
114
+ case "ua":
115
+ field.fieldType = fieldTypeName;
116
+ if (hasBuiltInType(fieldTypeName)) {
117
+ field.category = FieldCategory.basic;
118
+ field.schema = getBuildInType(fieldTypeName);
119
+ } else if (dataTypeFactory.hasStructuredType(fieldTypeName)) {
120
+ field.category = FieldCategory.complex;
121
+ field.schema = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
122
+ } else {
123
+ field.category = FieldCategory.basic;
124
+ // try in this
125
+ field.schema = _getOrCreateStructuredTypeSchema(fieldTypeName);
126
+ if (!field.schema) {
127
+ // tslint:disable-next-line:no-console
128
+ console.log("What should I do ??", fieldTypeName, " ", hasStructuredType(fieldTypeName));
129
+ } else {
130
+ if (hasBuiltInType(fieldTypeName)) {
131
+ field.category = FieldCategory.basic;
132
+ } else {
133
+ field.category = FieldCategory.complex;
134
+ }
135
+ }
136
+ }
137
+ break;
138
+ case "opc":
139
+ if ((fieldTypeName === "UAString" || fieldTypeName === "String") && field.name === "IndexRange") {
140
+ field.fieldType = "NumericRange";
141
+ // xx console.log(" NumericRange detected here !");
142
+ } else {
143
+ field.fieldType = fieldTypeName;
144
+ }
145
+ if (!hasBuiltInType(fieldTypeName)) {
146
+ throw new Error("Unknown basic type " + fieldTypeName);
147
+ }
148
+ field.category = FieldCategory.basic;
149
+ break;
150
+ default:
151
+ if (dataTypeFactory.hasEnumeration(fieldTypeName)) {
152
+ field.category = FieldCategory.enumeration;
153
+ const enumeratedType = dataTypeFactory.getEnumeration(fieldTypeName);
154
+ field.schema = enumeratedType;
155
+ } else if (dataTypeFactory.hasStructuredType(fieldTypeName)) {
156
+ field.category = FieldCategory.complex;
157
+ const schema1 = dataTypeFactory.getStructuredTypeSchema(fieldTypeName);
158
+ field.schema = schema1;
159
+ }
160
+ break;
161
+ }
162
+ }
163
+ }
164
+
165
+ const schema = buildStructuredType(structuredType as StructuredTypeOptions);
166
+ const ids = idProvider.getDataTypeAndEncodingId(schema.name);
167
+ if (!ids) {
168
+ // this may happen if the type is abstract or if the type referes to a internal ExtnsionObject
169
+ // that can only exists inside an other extension object.this Type of extension object cannot
170
+ // instantiated as standalone object and do not have encoding nodeIds...
171
+ const Constructor = createDynamicObjectConstructor(schema, dataTypeFactory) as ConstructorFuncWithSchema;
172
+ return schema;
173
+ }
174
+ schema.id = ids.dataTypeNodeId;
175
+ schema.dataTypeNodeId = ids.dataTypeNodeId;
176
+ if (schema.id.namespace === 0 && schema.id.value === 0) {
177
+ return schema;
178
+ }
179
+ schema.encodingDefaultXml = ExpandedNodeId.fromNodeId(ids.xmlEncodingNodeId);
180
+ schema.encodingDefaultJson = ExpandedNodeId.fromNodeId(ids.jsonEncodingNodeId);
181
+ schema.encodingDefaultBinary = ExpandedNodeId.fromNodeId(ids.binaryEncodingNodeId);
182
+
183
+ const Constructor = createDynamicObjectConstructor(schema, dataTypeFactory) as ConstructorFuncWithSchema;
184
+ Constructor.encodingDefaultBinary = schema.encodingDefaultBinary;
185
+ Constructor.encodingDefaultXml = schema.encodingDefaultXml;
186
+
187
+ return schema;
188
+ }
189
+ return _getOrCreateStructuredTypeSchema(name);
190
+ }