node-opcua-schemas
Advanced tools
Comparing version 2.7.0 to 2.8.0
@@ -0,0 +0,0 @@ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export * from "./parse_binary_xsd"; |
@@ -11,3 +11,3 @@ "use strict"; | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
}; | ||
} | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -14,0 +14,0 @@ __exportStar(require("./parse_binary_xsd"), exports); |
@@ -0,0 +0,0 @@ /** |
@@ -115,2 +115,3 @@ "use strict"; | ||
// _register_namespace_uri(this.text); | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -124,2 +125,3 @@ debugLog("Import NameSpace = ", this.attrs.Namespace, " Location", this.attrs.Location); | ||
this.typescriptDefinition = ""; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -143,2 +145,3 @@ debugLog(chalk.cyan("EnumeratedType Name="), w(this.attrs.Name, 40), "LengthInBits=", this.attrs.LengthInBits); | ||
finish: function () { | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -158,2 +161,3 @@ debugLog(" EnumeratedValue Name=", w(this.attrs.Name, 40), " Value=", this.attrs.Value); | ||
this.parent.typeDictionary.enumeratedTypesRaw[this.attrs.Name] = this.enumeratedType; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -166,2 +170,3 @@ debugLog(" this.typescriptDefinition = ", this.typescriptDefinition); | ||
init: function () { | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -189,2 +194,3 @@ debugLog(chalk.cyan("StructureType Name="), chalk.green(this.attrs.Name), " BaseType=", this.attrs.BaseType); | ||
} | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -220,2 +226,3 @@ debugLog(chalk.yellow(" field Name="), w(this.attrs.Name, 40), chalk.yellow(" typeName="), w(this.attrs.TypeName, 40), this.attrs.LengthField ? chalk.yellow(" lengthField= ") + w(this.attrs.LengthField, 40) : "", this.attrs.SwitchField ? chalk.yellow(" SwitchField= ") + w(this.attrs.SwitchField, 40) : "", this.attrs.SwitchValue !== undefined ? chalk.yellow(" SwitchValue= ") + w(this.attrs.SwitchValue, 40) : ""); | ||
field.switchValue = parseInt(this.attrs.SwitchValue, 10); | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -228,2 +235,3 @@ debugLog("field", field.name, " is part of a union => ", switchField, " value #", field.switchValue); | ||
structuredType.bitFields.findIndex((x) => x.name === switchField) : -2; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -258,2 +266,3 @@ debugLog("field", field.name, " is optional => ", switchField, "bit #", field.switchBit); | ||
const e = new node_opcua_factory_1.EnumerationDefinitionSchema({ | ||
lengthInBits: enumeratedType.lengthInBits || 32, | ||
enumValues: enumeratedType.enumeratedValues, | ||
@@ -264,2 +273,3 @@ name: key | ||
} | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -266,0 +276,0 @@ debugLog("------------------------------- Resolving complex Type"); |
import { DataTypeFactory, StructuredTypeSchema } from "node-opcua-factory"; | ||
import { MapDataTypeAndEncodingIdProvider, TypeDictionary } from "./parse_binary_xsd"; | ||
export declare function getOrCreateStructuredTypeSchema(name: string, typeDictionary: TypeDictionary, dataTypeFactory: DataTypeFactory, idProvider: MapDataTypeAndEncodingIdProvider): StructuredTypeSchema; |
@@ -39,2 +39,17 @@ "use strict"; | ||
structuredType.baseType = structuredType.baseType ? structuredType.baseType : "ExtensionObject"; | ||
const baseSchema = typeDictionary.getStructuredTypesRawByName(structuredType.baseType); | ||
// remove redundant fields | ||
// Note :some file do no thave SourceType property and may be replicated here .. | ||
// but they belongs to the base class and shall be remove/ | ||
// For instance DataTypeSchemaHeader => UABinaryFileDataType | ||
if (baseSchema && baseSchema.fields && baseSchema.name !== "ExtesionObject") { | ||
structuredType.fields = structuredType.fields.filter((field) => { | ||
const name = field.name; | ||
const index = baseSchema.fields.findIndex((f) => f.name === name); | ||
if (index >= 0) { | ||
console.log("Warning : find duplicated field from base structure : name ", name, "baseSchema = ", baseSchema.name, name); | ||
} | ||
return index < 0; | ||
}); | ||
} | ||
for (const field of structuredType.fields) { | ||
@@ -41,0 +56,0 @@ const fieldType = field.fieldType; |
import { DataTypeFactory } from "node-opcua-factory"; | ||
export declare function toTypeScript(dataTypeFactory: DataTypeFactory): string; |
@@ -0,0 +0,0 @@ "use strict"; |
{ | ||
"name": "node-opcua-schemas", | ||
"version": "2.7.0", | ||
"version": "2.8.0", | ||
"description": "pure nodejs OPCUA SDK - module -schemas", | ||
@@ -15,10 +15,10 @@ "main": "dist/source/index.js", | ||
"node-opcua-binary-stream": "^2.6.1", | ||
"node-opcua-data-model": "^2.7.0", | ||
"node-opcua-data-model": "^2.8.0", | ||
"node-opcua-debug": "^2.6.1", | ||
"node-opcua-enum": "^2.6.1", | ||
"node-opcua-extension-object": "^2.7.0", | ||
"node-opcua-factory": "^2.7.0", | ||
"node-opcua-nodeid": "^2.6.1", | ||
"node-opcua-enum": "^2.8.0", | ||
"node-opcua-extension-object": "^2.8.0", | ||
"node-opcua-factory": "^2.8.0", | ||
"node-opcua-nodeid": "^2.8.0", | ||
"node-opcua-utils": "^2.7.0", | ||
"node-opcua-variant": "^2.7.0", | ||
"node-opcua-variant": "^2.8.0", | ||
"node-opcua-xml2json": "^2.7.0", | ||
@@ -28,3 +28,3 @@ "thenify": "^3.3.0" | ||
"devDependencies": { | ||
"node-opcua-packet-analyzer": "^2.7.0" | ||
"node-opcua-packet-analyzer": "^2.8.0" | ||
}, | ||
@@ -46,3 +46,3 @@ "author": "Etienne Rossignon", | ||
"homepage": "http://node-opcua.github.io/", | ||
"gitHead": "868b9f5d0bf0411f30476a0947301dc1d487e462" | ||
"gitHead": "e3b0892d751900c13898ca82be84bbfe66997f0c" | ||
} |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export * from "./parse_binary_xsd"; |
@@ -150,2 +150,3 @@ /** | ||
// _register_namespace_uri(this.text); | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -162,2 +163,3 @@ debugLog("Import NameSpace = ", this.attrs.Namespace, | ||
this.typescriptDefinition = ""; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -184,2 +186,3 @@ debugLog(chalk.cyan("EnumeratedType Name="), | ||
finish: function (this: any) { | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -200,2 +203,3 @@ debugLog(" EnumeratedValue Name=", | ||
this.parent.typeDictionary.enumeratedTypesRaw[this.attrs.Name] = this.enumeratedType; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -208,3 +212,3 @@ debugLog(" this.typescriptDefinition = ", this.typescriptDefinition); | ||
init: function (this: any) { | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -237,2 +241,3 @@ debugLog(chalk.cyan("StructureType Name="), | ||
} | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -279,2 +284,3 @@ debugLog( | ||
field.switchValue = parseInt(this.attrs.SwitchValue, 10); | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -286,2 +292,3 @@ debugLog("field", field.name, " is part of a union => ", switchField, " value #", field.switchValue); | ||
structuredType.bitFields!.findIndex((x) => x.name === switchField) : -2; | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -336,2 +343,3 @@ debugLog("field", field.name, " is optional => ", switchField, "bit #", field.switchBit); | ||
const e = new EnumerationDefinitionSchema({ | ||
lengthInBits: enumeratedType.lengthInBits || 32, | ||
enumValues: enumeratedType.enumeratedValues, | ||
@@ -343,2 +351,3 @@ name: key | ||
// istanbul ignore next | ||
if (doDebug) { | ||
@@ -345,0 +354,0 @@ debugLog("------------------------------- Resolving complex Type"); |
@@ -70,2 +70,18 @@ import { | ||
const baseSchema = typeDictionary.getStructuredTypesRawByName(structuredType.baseType); | ||
// remove redundant fields | ||
// Note :some file do no thave SourceType property and may be replicated here .. | ||
// but they belongs to the base class and shall be remove/ | ||
// For instance DataTypeSchemaHeader => UABinaryFileDataType | ||
if (baseSchema && baseSchema.fields && baseSchema.name !== "ExtesionObject") { | ||
structuredType.fields = structuredType.fields.filter((field)=> { | ||
const name = field.name; | ||
const index = baseSchema.fields.findIndex((f)=> f.name === name); | ||
if(index>=0) { | ||
console.log("Warning : find duplicated field from base structure : name ", name, "baseSchema = ",baseSchema.name, name); | ||
} | ||
return index < 0; | ||
}); | ||
} | ||
for (const field of structuredType.fields) { | ||
@@ -72,0 +88,0 @@ const fieldType = field.fieldType; |
@@ -0,0 +0,0 @@ import { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
154614
2562
Updatednode-opcua-data-model@^2.8.0
Updatednode-opcua-enum@^2.8.0
Updatednode-opcua-factory@^2.8.0
Updatednode-opcua-nodeid@^2.8.0
Updatednode-opcua-variant@^2.8.0