@itwin/ecschema-metadata 5.1.0-dev.59 → 5.1.0-dev.61

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 (133) hide show
  1. package/lib/cjs/Deserialization/Helper.d.ts +30 -11
  2. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  3. package/lib/cjs/Deserialization/Helper.js +124 -96
  4. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  5. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  6. package/lib/cjs/Deserialization/XmlParser.js +14 -5
  7. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  8. package/lib/cjs/IncrementalLoading/ClassParsers.d.ts +60 -0
  9. package/lib/cjs/IncrementalLoading/ClassParsers.d.ts.map +1 -0
  10. package/lib/cjs/IncrementalLoading/ClassParsers.js +111 -0
  11. package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -0
  12. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
  13. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
  14. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +387 -0
  15. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
  16. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
  17. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
  18. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +609 -0
  19. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -0
  20. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
  21. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
  22. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +219 -0
  23. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
  24. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
  25. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
  26. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +77 -0
  27. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
  28. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +60 -0
  29. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
  30. package/lib/cjs/IncrementalLoading/PerformanceLogger.js +82 -0
  31. package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +1 -0
  32. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
  33. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
  34. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +122 -0
  35. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -0
  36. package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
  37. package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
  38. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +308 -0
  39. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -0
  40. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +42 -0
  41. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -0
  42. package/lib/cjs/IncrementalLoading/SchemaParser.js +109 -0
  43. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -0
  44. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
  45. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
  46. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +365 -0
  47. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -0
  48. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  49. package/lib/cjs/Metadata/Class.js +2 -0
  50. package/lib/cjs/Metadata/Class.js.map +1 -1
  51. package/lib/cjs/Metadata/Schema.d.ts +10 -0
  52. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  53. package/lib/cjs/Metadata/Schema.js +13 -0
  54. package/lib/cjs/Metadata/Schema.js.map +1 -1
  55. package/lib/cjs/Metadata/SchemaItem.d.ts +10 -0
  56. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  57. package/lib/cjs/Metadata/SchemaItem.js +13 -0
  58. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  59. package/lib/cjs/ecschema-metadata.d.ts +2 -0
  60. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  61. package/lib/cjs/ecschema-metadata.js +2 -0
  62. package/lib/cjs/ecschema-metadata.js.map +1 -1
  63. package/lib/cjs/utils/SchemaLoadingController.d.ts +37 -0
  64. package/lib/cjs/utils/SchemaLoadingController.d.ts.map +1 -0
  65. package/lib/cjs/utils/SchemaLoadingController.js +65 -0
  66. package/lib/cjs/utils/SchemaLoadingController.js.map +1 -0
  67. package/lib/esm/Deserialization/Helper.d.ts +30 -11
  68. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  69. package/lib/esm/Deserialization/Helper.js +124 -96
  70. package/lib/esm/Deserialization/Helper.js.map +1 -1
  71. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  72. package/lib/esm/Deserialization/XmlParser.js +14 -5
  73. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  74. package/lib/esm/IncrementalLoading/ClassParsers.d.ts +60 -0
  75. package/lib/esm/IncrementalLoading/ClassParsers.d.ts.map +1 -0
  76. package/lib/esm/IncrementalLoading/ClassParsers.js +104 -0
  77. package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -0
  78. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
  79. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
  80. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +383 -0
  81. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
  82. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
  83. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
  84. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +606 -0
  85. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -0
  86. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
  87. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
  88. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +215 -0
  89. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
  90. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
  91. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
  92. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +73 -0
  93. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
  94. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +60 -0
  95. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
  96. package/lib/esm/IncrementalLoading/PerformanceLogger.js +78 -0
  97. package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +1 -0
  98. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
  99. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
  100. package/lib/esm/IncrementalLoading/SchemaItemParsers.js +117 -0
  101. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -0
  102. package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
  103. package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
  104. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +305 -0
  105. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -0
  106. package/lib/esm/IncrementalLoading/SchemaParser.d.ts +42 -0
  107. package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -0
  108. package/lib/esm/IncrementalLoading/SchemaParser.js +104 -0
  109. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -0
  110. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
  111. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
  112. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +359 -0
  113. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -0
  114. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  115. package/lib/esm/Metadata/Class.js +2 -0
  116. package/lib/esm/Metadata/Class.js.map +1 -1
  117. package/lib/esm/Metadata/Schema.d.ts +10 -0
  118. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  119. package/lib/esm/Metadata/Schema.js +13 -0
  120. package/lib/esm/Metadata/Schema.js.map +1 -1
  121. package/lib/esm/Metadata/SchemaItem.d.ts +10 -0
  122. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  123. package/lib/esm/Metadata/SchemaItem.js +13 -0
  124. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  125. package/lib/esm/ecschema-metadata.d.ts +2 -0
  126. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  127. package/lib/esm/ecschema-metadata.js +2 -0
  128. package/lib/esm/ecschema-metadata.js.map +1 -1
  129. package/lib/esm/utils/SchemaLoadingController.d.ts +37 -0
  130. package/lib/esm/utils/SchemaLoadingController.d.ts.map +1 -0
  131. package/lib/esm/utils/SchemaLoadingController.js +61 -0
  132. package/lib/esm/utils/SchemaLoadingController.js.map +1 -0
  133. package/package.json +9 -8
@@ -1 +1 @@
1
- {"version":3,"file":"XmlParser.js","sourceRoot":"","sources":["../../../src/Deserialization/XmlParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,sDAA6C;AAC7C,4CAAsI;AACtI,4CAA6D;AAI7D,yDAAsD;A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C,iBAA2B;QAC/D,MAAM,GAAG,GAAa,EAAE,CAAC;QACzB,KAAK,MAAM,gBAAgB,IAAI,iBAAiB,EAAE,CAAC;YACjD,6IAA6I;YAC7I,sEAAsE;YACtE,MAAM,uBAAuB,GAAG,gBAAgB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAClE,IAAI,qBAAqB,GAAW,EAAE,CAAC;YACvC,qBAAqB,GAAG,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;YAC9E,IAAI,uBAAuB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,uBAAuB,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,CAAC;oBACxD,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,CAAC;wBACzC,SAAS;oBACX,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBACjE,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACxG,MAAM,WAAW,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;oBACvE,qBAAqB,IAAI,IAAI,cAAc,GAAG,WAAW,GAAG,CAAC;gBAC/D,CAAC;YACH,CAAC;YAED,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA7tCD,8BA6tCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { ECClass, StructClass } from \"../Metadata/Class\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { Enumeration } from \"../Metadata/Enumeration\";\nimport { PrimitiveProperty, Property, StructArrayProperty } from \"../Metadata/Property\";\nimport { ECName } from \"../ECName\";\nimport { AbstractParser, CAProviderTuple } from \"./AbstractParser\";\nimport {\n ClassProps, ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, EnumeratorProps, InvertedUnitProps,\n KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\n PrimitivePropertyProps, PropertyCategoryProps, PropertyProps, RelationshipClassProps, RelationshipConstraintProps, SchemaItemFormatProps, SchemaItemProps,\n SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\n} from \"./JsonProps\";\nimport { ECSpecVersion, SchemaReadHelper } from \"./Helper\";\n\nconst NON_ITEM_SCHEMA_ELEMENTS = [\"ECSchemaReference\", \"ECCustomAttributes\"];\nconst ECXML_URI = \"http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\";\n\ntype PrimitiveArray = PrimitiveValue[];\ntype PrimitiveValue = string | number | boolean | Date;\n\n/** @internal */\nexport class XmlParser extends AbstractParser<Element> {\n private _rawSchema: Document;\n private _schemaName?: string;\n private _schemaReferenceNames: Map<string, string>;\n private _schemaAlias: string;\n private _schemaVersion?: string;\n private _xmlNamespace?: string;\n private _currentItemFullName?: string;\n private _schemaItems: Map<string, [string, Element]>;\n private _mapIsPopulated: boolean;\n\n constructor(rawSchema: Readonly<Document>) {\n super();\n\n this._rawSchema = rawSchema;\n const schemaInfo = rawSchema.documentElement;\n\n const schemaName = schemaInfo.getAttribute(\"schemaName\");\n if (schemaName)\n this._schemaName = schemaName;\n\n this._schemaAlias = \"\";\n const schemaAlias = schemaInfo.getAttribute(\"alias\");\n if (schemaAlias)\n this._schemaAlias = schemaAlias;\n\n this._schemaReferenceNames = new Map<string, string>();\n\n const schemaVersion = schemaInfo.getAttribute(\"version\");\n if (schemaVersion)\n this._schemaVersion = schemaVersion;\n\n const xmlNamespace = schemaInfo.getAttribute(\"xmlns\");\n if (xmlNamespace) {\n this._xmlNamespace = xmlNamespace;\n this._ecSpecVersion = XmlParser.parseXmlNamespace(this._xmlNamespace);\n }\n\n this._schemaItems = new Map<string, [string, Element]>();\n this._mapIsPopulated = false;\n }\n\n public get getECSpecVersion(): ECSpecVersion | undefined { return this._ecSpecVersion; }\n\n public parseSchema(): SchemaProps {\n const schemaMetadata = this._rawSchema.documentElement;\n if (\"ECSchema\" !== schemaMetadata.nodeName)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, \"An ECSchema is missing the required metadata.\");\n\n const schemaDefDuplicates = this.getElementChildrenByTagName(schemaMetadata, \"ECSchema\");\n if (schemaDefDuplicates.length > 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, \"An ECSchema has more than one ECSchema definition. Only one is allowed.\");\n\n if (this._schemaName === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);\n\n if (this._schemaVersion === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);\n\n if (this._xmlNamespace === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);\n\n if (this._ecSpecVersion === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);\n\n const alias = this.getRequiredAttribute(schemaMetadata, \"alias\",\n `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);\n const description = this.getOptionalAttribute(schemaMetadata, \"description\");\n const displayLabel = this.getOptionalAttribute(schemaMetadata, \"displayLabel\");\n\n const schemaProps = {\n name: this._schemaName,\n $schema: this._xmlNamespace,\n version: this._schemaVersion,\n alias,\n label: displayLabel,\n description,\n ecSpecMajorVersion: this._ecSpecVersion.readVersion,\n ecSpecMinorVersion: this._ecSpecVersion.writeVersion,\n };\n\n return schemaProps;\n }\n\n public *getReferences(): Iterable<SchemaReferenceProps> {\n const schemaReferences = this.getElementChildrenByTagName(this._rawSchema.documentElement, \"ECSchemaReference\");\n for (const ref of schemaReferences) {\n yield this.getSchemaReference(ref);\n }\n }\n\n public *getItems(): Iterable<[string, string, Element]> {\n if (!this._mapIsPopulated) {\n const schemaItems = this.getSchemaChildren();\n for (const item of schemaItems) {\n let rawItemType = item.nodeName;\n if (NON_ITEM_SCHEMA_ELEMENTS.includes(rawItemType))\n continue;\n\n // Differentiate a Mixin from an EntityClass\n const customAttributesResult = this.getElementChildrenByTagName(item, \"ECCustomAttributes\");\n if (customAttributesResult.length > 0) {\n const customAttributes = customAttributesResult[0];\n const isMixinResult = this.getElementChildrenByTagName(customAttributes, \"IsMixin\");\n if (isMixinResult.length > 0)\n rawItemType = \"Mixin\";\n }\n\n const itemType = this.getSchemaItemType(rawItemType);\n if (itemType === undefined) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n continue;\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);\n }\n\n const itemName = this.getRequiredAttribute(item, \"typeName\", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n this._schemaItems.set(itemName, [itemType, item]);\n yield [itemName, itemType, item];\n }\n this._mapIsPopulated = true;\n } else {\n for (const [itemName, [itemType, item]] of this._schemaItems) {\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n yield [itemName, itemType, item];\n }\n }\n }\n\n public findItem(itemName: string): [string, string, Element] | undefined {\n if (!this._mapIsPopulated) {\n for (const item of this.getItems()) {\n if (item[0] === itemName) {\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return item;\n }\n }\n } else {\n const values = this._schemaItems.get(itemName);\n if (undefined !== values) {\n const [itemType, item] = values;\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return [itemName, itemType, item];\n }\n }\n\n return undefined;\n }\n\n public parseEntityClass(xmlElement: Element): EntityClassProps {\n const classProps = this.getClassProps(xmlElement);\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n let mixinElements: Element[];\n const mixins = new Array<string>();\n\n // if it has just one BaseClass we assume it is a 'true' base class not a mixin\n if (baseClasses.length > 1) {\n mixinElements = baseClasses.slice(1);\n for (const mixin of mixinElements) {\n if (mixin.textContent) {\n const typeName = this.getQualifiedTypeName(mixin.textContent);\n mixins.push(typeName);\n }\n }\n }\n\n const entityClassProps = {\n ...classProps,\n mixins,\n };\n\n return entityClassProps;\n }\n\n public parseMixin(xmlElement: Element): MixinProps {\n const classProps = this.getClassProps(xmlElement);\n\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n\n // Mixins can only have one base class\n if (baseClasses.length > 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);\n\n const customAttributesResult = this.getElementChildrenByTagName(xmlElement, \"ECCustomAttributes\");\n\n if (customAttributesResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);\n\n const customAttributes = customAttributesResult[0];\n const isMixinResult = this.getElementChildrenByTagName(customAttributes, \"IsMixin\");\n if (isMixinResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);\n\n const mixinAttributes = isMixinResult[0];\n const appliesToResult = this.getElementChildrenByTagName(mixinAttributes, \"AppliesToEntityClass\");\n\n if (appliesToResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);\n\n const appliesToElement = appliesToResult[0];\n let appliesTo = appliesToElement.textContent;\n if (appliesTo === null || appliesTo.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);\n\n appliesTo = this.getQualifiedTypeName(appliesTo);\n\n const mixinProps = {\n ...classProps,\n appliesTo,\n };\n\n return mixinProps;\n }\n\n public parseStructClass(xmlElement: Element): StructClassProps {\n return this.getClassProps(xmlElement);\n }\n\n public parseCustomAttributeClass(xmlElement: Element): CustomAttributeClassProps {\n const classProps = this.getClassProps(xmlElement);\n const appliesTo = this.getRequiredAttribute(xmlElement, \"appliesTo\",\n `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n\n const customAttributeClassProps = {\n ...classProps,\n appliesTo,\n };\n\n return customAttributeClassProps;\n }\n\n public parseRelationshipClass(xmlElement: Element): RelationshipClassProps {\n const classProps = this.getClassProps(xmlElement);\n const strength = this.getRequiredAttribute(xmlElement, \"strength\",\n `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);\n let strengthDirection = this.getOptionalAttribute(xmlElement, \"strengthDirection\");\n if (!strengthDirection)\n strengthDirection = strengthDirectionToString(StrengthDirection.Forward);\n\n const sourceResult = this.getElementChildrenByTagName(xmlElement, \"Source\");\n if (sourceResult.length !== 1) {\n if (sourceResult.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);\n }\n const source = this.getRelationshipConstraintProps(sourceResult[0], true);\n\n const targetResult = this.getElementChildrenByTagName(xmlElement, \"Target\");\n if (targetResult.length !== 1) {\n if (targetResult.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);\n }\n const target = this.getRelationshipConstraintProps(targetResult[0], false);\n\n return {\n ...classProps,\n strength,\n strengthDirection,\n source,\n target,\n };\n }\n\n public parseEnumeration(xmlElement: Element): EnumerationProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const enumType = this.getRequiredAttribute(xmlElement, \"backingTypeName\",\n `The Enumeration ${this._currentItemFullName} is missing the required 'backingTypeName' attribute.`);\n\n // TODO: This shouldn't be verified here. It's for the deserialize method to handle. The only reason it's currently done here so that the xml\n // value can be put in the correct type, number or string.\n let tempBackingType: PrimitiveType;\n if (/int/i.test(enumType)) {\n tempBackingType = PrimitiveType.Integer;\n } else if (/string/i.test(enumType)) {\n tempBackingType = PrimitiveType.String;\n } else {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n tempBackingType = PrimitiveType.String;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either \"int\" or \"string\".`);\n }\n\n let isStrictString: string | undefined = this.getOptionalAttribute(xmlElement, \"isStrict\");\n if (isStrictString === undefined)\n isStrictString = \"true\";\n\n const isStrict = this.parseBoolean(isStrictString,\n `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should either be \"true\" or \"false\".`);\n\n const enumeratorElements = this.getElementChildrenByTagName(xmlElement, \"ECEnumerator\");\n const enumerators = new Array<EnumeratorProps>();\n\n for (const element of enumeratorElements) {\n const name = this.getRequiredAttribute(element, \"name\",\n `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);\n\n const valueString = this.getRequiredAttribute(element, \"value\",\n `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);\n let value: string | number = valueString;\n\n if (PrimitiveType.Integer === tempBackingType) {\n const numericValue = parseInt(valueString, 10);\n if (isNaN(numericValue))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type \"int\" has an enumerator with a non-integer value.`);\n value = numericValue;\n }\n\n const label = this.getOptionalAttribute(element, \"displayLabel\");\n const description = this.getOptionalAttribute(element, \"description\");\n\n enumerators.push({\n name,\n value,\n label,\n description,\n });\n }\n\n return {\n ...itemProps,\n type: enumType,\n isStrict,\n enumerators,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n public parseKindOfQuantity(xmlElement: Element): KindOfQuantityProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const relativeErrorString = this.getRequiredAttribute(xmlElement, \"relativeError\",\n `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);\n const relativeError = parseFloat(relativeErrorString);\n if (isNaN(relativeError))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);\n\n const presentationUnitsString = this.getOptionalAttribute(xmlElement, \"presentationUnits\");\n let presentationUnits: string[] | undefined;\n if (presentationUnitsString)\n presentationUnits = this.getQualifiedPresentationUnits(presentationUnitsString.split(\";\"));\n\n let persistenceUnit = this.getRequiredAttribute(xmlElement, \"persistenceUnit\",\n `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);\n persistenceUnit = this.getQualifiedTypeName(persistenceUnit);\n\n return {\n ...itemProps,\n relativeError,\n presentationUnits,\n persistenceUnit,\n };\n }\n\n public parsePropertyCategory(xmlElement: Element): PropertyCategoryProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const priorityString = this.getRequiredAttribute(xmlElement, \"priority\",\n `The PropertyCategory ${this._currentItemFullName} is missing the required 'priority' attribute.`);\n const priority = parseInt(priorityString, 10);\n if (isNaN(priority))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);\n\n return {\n ...itemProps,\n priority,\n };\n }\n\n public parseUnit(xmlElement: Element): SchemaItemUnitProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let phenomenon = this.getRequiredAttribute(xmlElement, \"phenomenon\",\n `The Unit ${this._currentItemFullName} is missing the required 'phenomenon' attribute.`);\n let unitSystem = this.getRequiredAttribute(xmlElement, \"unitSystem\",\n `The Unit ${this._currentItemFullName} is missing the required 'unitSystem' attribute.`);\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Unit ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n const numerator = this.getOptionalFloatAttribute(xmlElement, \"numerator\",\n `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be a numeric value.`);\n const denominator = this.getOptionalFloatAttribute(xmlElement, \"denominator\",\n `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be a numeric value.`);\n const offset = this.getOptionalFloatAttribute(xmlElement, \"offset\",\n `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be a numeric value.`);\n\n phenomenon = this.getQualifiedTypeName(phenomenon);\n unitSystem = this.getQualifiedTypeName(unitSystem);\n\n return {\n ...itemProps,\n phenomenon,\n unitSystem,\n definition,\n numerator,\n denominator,\n offset,\n };\n }\n\n public parseInvertedUnit(xmlElement: Element): InvertedUnitProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let invertsUnit = this.getRequiredAttribute(xmlElement, \"invertsUnit\",\n `The InvertedUnit ${this._currentItemFullName} is missing the required 'invertsUnit' attribute.`);\n let unitSystem = this.getRequiredAttribute(xmlElement, \"unitSystem\",\n `The InvertedUnit ${this._currentItemFullName} is missing the required 'unitSystem' attribute.`);\n\n invertsUnit = this.getQualifiedTypeName(invertsUnit);\n unitSystem = this.getQualifiedTypeName(unitSystem);\n\n return {\n ...itemProps,\n invertsUnit,\n unitSystem,\n };\n }\n\n public parseConstant(xmlElement: Element): ConstantProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let phenomenon = this.getRequiredAttribute(xmlElement, \"phenomenon\",\n `The Constant ${this._currentItemFullName} is missing the required 'phenomenon' attribute.`);\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Constant ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n const numerator = this.getOptionalFloatAttribute(xmlElement, \"numerator\",\n `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be a numeric value.`);\n const denominator = this.getOptionalFloatAttribute(xmlElement, \"denominator\",\n `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be a numeric value.`);\n\n phenomenon = this.getQualifiedTypeName(phenomenon);\n\n return {\n ...itemProps,\n phenomenon,\n definition,\n numerator,\n denominator,\n };\n }\n\n public parsePhenomenon(xmlElement: Element): PhenomenonProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Phenomenon ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n\n return {\n ...itemProps,\n definition,\n };\n }\n\n public parseFormat(xmlElement: Element): SchemaItemFormatProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const formatType = this.getRequiredAttribute(xmlElement, \"type\",\n `The Format ${this._currentItemFullName} is missing the required 'type' attribute.`);\n const precision = this.getOptionalIntAttribute(xmlElement, \"precision\",\n `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be a numeric value.`);\n const roundFactor = this.getOptionalFloatAttribute(xmlElement, \"roundFactor\",\n `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be a numeric value.`);\n const minWidth = this.getOptionalIntAttribute(xmlElement, \"minWidth\",\n `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be a numeric value.`);\n const showSignOption = this.getOptionalAttribute(xmlElement, \"showSignOption\");\n\n const formatTraitsString = this.getRequiredAttribute(xmlElement, \"formatTraits\",\n `The Format ${this._currentItemFullName} is missing the required 'formatTraits' attribute.`);\n const formatTraits = formatTraitsString.split(\"|\");\n\n const decimalSeparator = this.getOptionalAttribute(xmlElement, \"decimalSeparator\");\n const thousandSeparator = this.getOptionalAttribute(xmlElement, \"thousandSeparator\");\n const uomSeparator = this.getOptionalAttribute(xmlElement, \"uomSeparator\");\n const scientificType = this.getOptionalAttribute(xmlElement, \"scientificType\");\n\n const stationOffsetSize = this.getOptionalIntAttribute(xmlElement, \"stationOffsetSize\",\n `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be a numeric value.`);\n\n const stationSeparator = this.getOptionalAttribute(xmlElement, \"stationSeparator\");\n\n let composite: object | undefined;\n const compositeResult = this.getElementChildrenByTagName(xmlElement, \"Composite\");\n if (compositeResult.length > 0) {\n const compositeElement = compositeResult[0];\n\n const spacer = this.getOptionalAttribute(compositeElement, \"spacer\");\n\n const includeZeroString = this.getOptionalAttribute(compositeElement, \"includeZero\");\n let includeZero: boolean | undefined;\n if (includeZeroString) {\n includeZero = this.parseBoolean(includeZeroString,\n `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be either \"true\" or \"false\".`);\n }\n\n const units = new Array<{ name: string, label?: string }>();\n const unitsResult = this.getElementChildrenByTagName(compositeElement, \"Unit\");\n if (unitsResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);\n\n for (const unit of unitsResult) {\n let name = unit.textContent;\n if (null === name || 0 === name.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);\n\n const label = this.getOptionalAttribute(unit, \"label\");\n name = this.getQualifiedTypeName(name);\n units.push({ name, label });\n }\n\n composite = {\n spacer,\n includeZero,\n units,\n };\n }\n\n return {\n ...itemProps,\n type: formatType,\n precision,\n roundFactor,\n minWidth,\n showSignOption,\n formatTraits,\n decimalSeparator,\n thousandSeparator,\n uomSeparator,\n scientificType,\n stationOffsetSize,\n stationSeparator,\n composite,\n } as SchemaItemFormatProps;\n }\n\n public parseUnitSystem(xmlElement: Element): UnitSystemProps {\n return this.getClassProps(xmlElement);\n }\n\n public *getProperties(xmlElement: Element, itemName: string): Iterable<[string, string, Element]> {\n const propertyTagRegex = /EC((Struct(Array)?)|Array|Navigation)?Property/;\n const children = this.getElementChildrenByTagName(xmlElement, propertyTagRegex);\n\n for (const child of children) {\n const childType = child.nodeName;\n const propertyName = this.getRequiredAttribute(child, \"propertyName\",\n `An ECProperty in ${itemName} is missing the required 'propertyName' attribute.`);\n\n const propertyType = this.getPropertyType(childType);\n // This may not be needed, just a failsafe if the regex is faulty\n if (propertyType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);\n\n yield [propertyName, propertyType, child];\n }\n }\n\n public parsePrimitiveProperty(xmlElement: Element): PrimitivePropertyProps {\n const propertyProps = this.getPrimitiveOrEnumPropertyBaseProps(xmlElement);\n const typeName = this.getPropertyTypeName(xmlElement);\n const primitivePropertyProps = { ...propertyProps, typeName };\n return primitivePropertyProps;\n }\n\n public parseStructProperty(xmlElement: Element): StructPropertyProps {\n const propertyProps = this.getPropertyProps(xmlElement);\n const typeName = this.getPropertyTypeName(xmlElement);\n const structPropertyProps = { ...propertyProps, typeName };\n return structPropertyProps;\n }\n\n public parsePrimitiveArrayProperty(xmlElement: Element): PrimitiveArrayPropertyProps {\n const typeName = this.getPropertyTypeName(xmlElement);\n const propertyProps = this.getPrimitiveOrEnumPropertyBaseProps(xmlElement);\n const minAndMaxOccurs = this.getPropertyMinAndMaxOccurs(xmlElement);\n\n return {\n ...propertyProps,\n ...minAndMaxOccurs,\n typeName,\n };\n }\n\n public parseStructArrayProperty(xmlElement: Element): StructArrayPropertyProps {\n const propertyProps = this.getPropertyProps(xmlElement);\n const typeName = this.getPropertyTypeName(xmlElement);\n const minAndMaxOccurs = this.getPropertyMinAndMaxOccurs(xmlElement);\n return {\n ...propertyProps,\n ...minAndMaxOccurs,\n typeName,\n };\n }\n\n public parseNavigationProperty(xmlElement: Element): NavigationPropertyProps {\n const propName = this.getPropertyName(xmlElement);\n const propertyProps = this.getPropertyProps(xmlElement);\n let relationshipName = this.getRequiredAttribute(xmlElement, \"relationshipName\",\n `The ECNavigationProperty ${this._currentItemFullName}.${propName} is missing the required 'relationshipName' property.`);\n const direction = this.getRequiredAttribute(xmlElement, \"direction\",\n `The ECNavigationProperty ${this._currentItemFullName}.${propName} is missing the required 'direction' property.`);\n\n relationshipName = this.getQualifiedTypeName(relationshipName);\n\n return {\n ...propertyProps,\n relationshipName,\n direction,\n };\n }\n\n public getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(this._rawSchema.documentElement, \"Schema\", this._schemaName);\n }\n\n public getClassCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(xmlElement, \"ECClass\", this._currentItemFullName);\n }\n\n public getPropertyCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple> {\n const propName = this.getPropertyName(xmlElement);\n return this.getCustomAttributeProviders(xmlElement, \"ECProperty\", `${this._currentItemFullName}.${propName}`);\n }\n\n public getRelationshipConstraintCustomAttributeProviders(xmlElement: Element): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */] {\n const sourceResult = this.getElementChildrenByTagName(xmlElement, \"Source\");\n if (sourceResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);\n const sourceElement = sourceResult[0];\n const sourceCustomAttributes = this.getCustomAttributeProviders(sourceElement, \"Source Constraint of\", this._currentItemFullName);\n\n const targetResult = this.getElementChildrenByTagName(xmlElement, \"Target\");\n if (targetResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);\n const targetElement = targetResult[0];\n const targetCustomAttributes = this.getCustomAttributeProviders(targetElement, \"Source Constraint of\", this._currentItemFullName);\n\n return [sourceCustomAttributes, targetCustomAttributes];\n }\n\n private getElementChildren(xmlElement: Element): Element[] {\n // NodeListOf<T> does not define [Symbol.iterator]\n const children = Array.from(xmlElement.childNodes).filter((child) => {\n // (node.nodeType === 1) implies instanceof Element\n // https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children#Polyfill\n return child.nodeType === 1;\n });\n return children as Element[];\n }\n\n private getElementChildrenByTagName(xmlElement: Element, tagName: string | RegExp): Element[] {\n const children = this.getElementChildren(xmlElement);\n if (\"*\" === tagName)\n return children;\n\n let result: Element[];\n if (typeof tagName === \"string\") {\n result = children.filter((child) => {\n return tagName.toLowerCase() === child.nodeName.toLowerCase();\n });\n } else {\n result = children.filter((child) => {\n return tagName.test(child.nodeName);\n });\n }\n\n return result;\n }\n\n private getOptionalAttribute(xmlElement: Element, attributeName: string): string | undefined {\n if (!xmlElement.hasAttribute(attributeName))\n return undefined;\n const result = xmlElement.getAttribute(attributeName);\n\n // The typings for the return value of getAttribute do not match that of xmldom\n // xmldom returns an empty string instead of null\n // However Typescript will still treat result as a union type without this check\n // Hence this is needed for tsc to compile\n if (result === null)\n return undefined;\n return result;\n }\n\n private getOptionalFloatAttribute(xmlElement: Element, attributeName: string, parseErrorMsg: string): number | undefined {\n const resultString = this.getOptionalAttribute(xmlElement, attributeName);\n let result: number | undefined;\n if (resultString) {\n result = parseFloat(resultString);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n return result;\n }\n\n private getOptionalIntAttribute(xmlElement: Element, attributeName: string, parseErrorMsg: string): number | undefined {\n const resultString = this.getOptionalAttribute(xmlElement, attributeName);\n let result: number | undefined;\n if (resultString) {\n result = parseInt(resultString, 10);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n return result;\n }\n\n private parseBoolean(text: string, parseErrorMsg: string): boolean {\n const textString = text.toLowerCase();\n if (\"true\" === textString)\n return true;\n else if (\"false\" === textString)\n return false;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n\n private getRequiredAttribute(xmlElement: Element, attributeName: string, errorMsg: string): string {\n if (!xmlElement.hasAttribute(attributeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);\n const result = xmlElement.getAttribute(attributeName);\n if (result === null)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);\n return result;\n }\n\n private getSchemaReference(xmlElement: Element): SchemaReferenceProps {\n const alias = this.getRequiredAttribute(xmlElement, \"alias\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'alias' attribute.`);\n const name = this.getRequiredAttribute(xmlElement, \"name\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'name' attribute.`);\n const version = this.getRequiredAttribute(xmlElement, \"version\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'version' attribute.`);\n\n if (!this._schemaReferenceNames.has(alias.toLowerCase()))\n this._schemaReferenceNames.set(alias.toLowerCase(), name);\n\n return {\n name,\n version,\n };\n }\n\n private getSchemaItemType(rawType: string): string | undefined {\n switch (rawType.toLowerCase()) {\n case \"ecentityclass\": return \"EntityClass\";\n case \"mixin\": return \"Mixin\";\n case \"ecstructclass\": return \"StructClass\";\n case \"eccustomattributeclass\": return \"CustomAttributeClass\";\n case \"ecrelationshipclass\": return \"RelationshipClass\";\n case \"ecenumeration\": return \"Enumeration\";\n case \"kindofquantity\": return \"KindOfQuantity\";\n case \"propertycategory\": return \"PropertyCategory\";\n case \"unit\": return \"Unit\";\n case \"invertedunit\": return \"InvertedUnit\";\n case \"constant\": return \"Constant\";\n case \"phenomenon\": return \"Phenomenon\";\n case \"unitsystem\": return \"UnitSystem\";\n case \"format\": return \"Format\";\n }\n return undefined;\n }\n\n private getSchemaChildren(): Element[] {\n const schemaMetadata = this._rawSchema.documentElement;\n return this.getElementChildren(schemaMetadata);\n }\n\n private getSchemaItemProps(xmlElement: Element): SchemaItemProps {\n const displayLabel = this.getOptionalAttribute(xmlElement, \"displayLabel\");\n const description = this.getOptionalAttribute(xmlElement, \"description\");\n\n return {\n description,\n label: displayLabel,\n };\n }\n\n private getClassProps(xmlElement: Element): ClassProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n const modifier = this.getOptionalAttribute(xmlElement, \"modifier\");\n\n let baseClass: string | null | undefined = null;\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n if (baseClasses.length > 0) {\n // We are assuming here that the first BaseClass is the 'real' one - the rest are mixins\n // This is not a finalized approach as this could lead to unsupported schemas\n baseClass = baseClasses[0].textContent;\n }\n\n baseClass = baseClass ? this.getQualifiedTypeName(baseClass) : undefined;\n\n return {\n ...itemProps,\n modifier,\n baseClass,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n private getRelationshipConstraintProps(xmlElement: Element, isSource: boolean): RelationshipConstraintProps {\n const constraintName = `${(isSource) ? \"Source\" : \"Target\"} Constraint of ${this._currentItemFullName}`;\n\n const multiplicity = this.getRequiredAttribute(xmlElement, \"multiplicity\",\n `The ${constraintName} is missing the required 'multiplicity' attribute.`);\n const roleLabel = this.getRequiredAttribute(xmlElement, \"roleLabel\",\n `The ${constraintName} is missing the required 'roleLabel' attribute.`);\n\n const polymorphicString = this.getRequiredAttribute(xmlElement, \"polymorphic\",\n `The ${constraintName} is missing the required 'polymorphic' attribute.`);\n const polymorphic = this.parseBoolean(polymorphicString,\n `The ${constraintName} has an invalid 'polymorphic' attribute. It should either be \"true\" or \"false\".`);\n\n let abstractConstraint = this.getOptionalAttribute(xmlElement, \"abstractConstraint\");\n if (undefined !== abstractConstraint)\n abstractConstraint = this.getQualifiedTypeName(abstractConstraint);\n\n const constraintClasses = new Array<string>();\n const constraintClassesResult = this.getElementChildrenByTagName(xmlElement, \"Class\");\n if (constraintClassesResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);\n\n for (const constraintClass of constraintClassesResult) {\n let constraintClassId = constraintClass.getAttribute(\"class\");\n if (null === constraintClassId || 0 === constraintClassId.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);\n\n constraintClassId = this.getQualifiedTypeName(constraintClassId);\n constraintClasses.push(constraintClassId);\n }\n\n return {\n multiplicity,\n roleLabel,\n polymorphic,\n abstractConstraint,\n constraintClasses,\n };\n }\n\n private getPropertyType(propType: string): string | undefined {\n switch (propType) {\n case \"ECNavigationProperty\": return \"navigationproperty\";\n case \"ECStructProperty\": return \"structproperty\";\n case \"ECArrayProperty\": return \"primitivearrayproperty\";\n case \"ECStructArrayProperty\": return \"structarrayproperty\";\n case \"ECProperty\": return \"primitiveproperty\";\n default: return undefined;\n }\n }\n\n private getPropertyName(xmlElement: Element): string {\n return this.getRequiredAttribute(xmlElement, \"propertyName\",\n `An ECProperty in ${this._currentItemFullName} is missing the required 'propertyName' attribute.`);\n }\n\n private getPropertyProps(xmlElement: Element): PropertyProps {\n const propName = this.getPropertyName(xmlElement);\n\n const propType = this.getPropertyType(xmlElement.nodeName);\n if (propType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);\n\n const label = this.getOptionalAttribute(xmlElement, \"displayLabel\");\n const description = this.getOptionalAttribute(xmlElement, \"description\");\n\n const readOnlyString = this.getOptionalAttribute(xmlElement, \"readOnly\");\n let isReadOnly: boolean | undefined;\n if (readOnlyString) {\n isReadOnly = this.parseBoolean(readOnlyString,\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'readOnly' attribute. It should be either \"true\" or \"false\".`);\n }\n\n let category = this.getOptionalAttribute(xmlElement, \"category\");\n\n const priority = this.getOptionalIntAttribute(xmlElement, \"priority\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be a numeric value.`);\n\n const inheritedString = this.getOptionalAttribute(xmlElement, \"inherited\");\n let inherited: boolean | undefined;\n if (inheritedString) {\n inherited = this.parseBoolean(inheritedString,\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be either \"true\" or \"false\".`);\n }\n\n let kindOfQuantity = this.getOptionalAttribute(xmlElement, \"kindOfQuantity\");\n\n if (kindOfQuantity)\n kindOfQuantity = this.getQualifiedTypeName(kindOfQuantity);\n if (category)\n category = this.getQualifiedTypeName(category);\n\n return {\n name: propName,\n type: propType,\n description,\n label,\n isReadOnly,\n category,\n priority,\n inherited,\n kindOfQuantity,\n };\n }\n\n private getPropertyTypeName(xmlElement: Element): string {\n const propName = this.getPropertyName(xmlElement);\n const rawTypeName = this.getRequiredAttribute(xmlElement, \"typeName\",\n `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);\n\n // If not a primitive type, we must prepend the schema name.\n const primitiveType = parsePrimitiveType(rawTypeName);\n if (primitiveType)\n return rawTypeName;\n\n return this.getQualifiedTypeName(rawTypeName);\n }\n\n private getPrimitiveOrEnumPropertyBaseProps(xmlElement: Element): PrimitiveOrEnumPropertyBaseProps {\n const propertyProps = this.getPropertyProps(xmlElement);\n const propName = propertyProps.name;\n const extendedTypeName = this.getOptionalAttribute(xmlElement, \"extendedTypeName\");\n const minLength = this.getOptionalIntAttribute(xmlElement, \"minimumLength\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minimumLength' attribute. It should be a numeric value.`);\n const maxLength = this.getOptionalIntAttribute(xmlElement, \"maximumLength\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maximumLength' attribute. It should be a numeric value.`);\n const minValue = this.getOptionalIntAttribute(xmlElement, \"minimumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minimumValue' attribute. It should be a numeric value.`);\n const maxValue = this.getOptionalIntAttribute(xmlElement, \"maximumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maximumValue' attribute. It should be a numeric value.`);\n\n return {\n ...propertyProps,\n extendedTypeName,\n minLength,\n maxLength,\n minValue,\n maxValue,\n };\n }\n\n private getPropertyMinAndMaxOccurs(xmlElement: Element): { minOccurs: number | undefined, maxOccurs: number | undefined } {\n const propName = this.getPropertyName(xmlElement);\n const minOccurs = this.getOptionalIntAttribute(xmlElement, \"minOccurs\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be a numeric value.`);\n\n const maxOccursStr = this.getOptionalAttribute(xmlElement, \"maxOccurs\");\n let maxOccurs: number | undefined;\n if (\"unbounded\" === maxOccursStr)\n maxOccurs = 2147483647; // TODO: This should be using the INT32_MAX variable.\n else if (undefined !== maxOccursStr) {\n maxOccurs = parseInt(maxOccursStr, 10);\n if (isNaN(maxOccurs))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);\n }\n\n return { minOccurs, maxOccurs };\n }\n\n private *getCustomAttributeProviders(xmlElement: Element, type: string, _name?: string): Iterable<CAProviderTuple> {\n const customAttributesResult = this.getElementChildrenByTagName(xmlElement, \"ECCustomAttributes\");\n if (customAttributesResult.length < 1)\n return;\n\n const attributes = this.getElementChildren(customAttributesResult[0]);\n for (const attribute of attributes) {\n if (\"ECClass\" === type && \"IsMixin\" === attribute.tagName)\n continue;\n\n yield this.getCustomAttributeProvider(attribute);\n }\n }\n\n private getCustomAttributeProvider(xmlCustomAttribute: Element): CAProviderTuple {\n assert(this._ecSpecVersion !== undefined);\n\n let ns = xmlCustomAttribute.getAttribute(\"xmlns\");\n if (!ns) {\n assert(this._schemaName !== undefined);\n assert(this._schemaVersion !== undefined);\n ns = `${this._schemaName}.${this._schemaVersion}`;\n }\n\n if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);\n\n const schemaNameParts = ns.split(\".\");\n const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;\n const properties = this.getElementChildren(xmlCustomAttribute);\n\n const provider = (caClass: CustomAttributeClass) => {\n return this.addCAPropertyValues(caClass, properties);\n };\n\n return [className, provider];\n }\n\n private addCAPropertyValues(caClass: CustomAttributeClass, propertyElements: Element[]): CustomAttribute {\n const instance = { className: caClass.fullName } as CustomAttribute;\n for (const propertyElement of propertyElements) {\n const value = this.readPropertyValue(propertyElement, caClass);\n if (value !== undefined)\n instance[propertyElement.tagName] = value;\n }\n\n return instance;\n }\n\n private readPropertyValue(propElement: Element, parentClass: ECClass): any {\n const propertyClass = parentClass.getPropertySync(propElement.tagName);\n if (!propertyClass)\n return;\n\n if (propertyClass.isArray())\n return this.readArrayPropertyValue(propElement, propertyClass);\n\n let enumeration: Enumeration | undefined;\n if (propertyClass.isPrimitive()) {\n if (propertyClass.isEnumeration() && propertyClass.enumeration) {\n enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName, Enumeration);\n if (!enumeration)\n throw new ECSchemaError(ECSchemaStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);\n }\n const primitiveType = enumeration && enumeration.type ? enumeration.type : (propertyClass).primitiveType;\n return this.readPrimitivePropertyValue(propElement, primitiveType);\n }\n\n if (propertyClass.isStruct())\n return this.readStructPropertyValue(propElement, propertyClass.structClass);\n\n return undefined;\n }\n\n private readArrayPropertyValue(propElement: Element, propertyClass: Property): PrimitiveArray | undefined {\n if (propertyClass.isPrimitive())\n return this.readPrimitiveArrayValues(propElement, (propertyClass as PrimitiveProperty).primitiveType);\n\n if (propertyClass.isStruct())\n return this.readStructArrayValues(propElement, propertyClass as StructArrayProperty);\n\n return undefined;\n }\n\n private readPrimitiveArrayValues(propElement: Element, primitiveType: PrimitiveType): PrimitiveArray {\n const typeName = primitiveTypeToString(primitiveType);\n const children = this.getElementChildrenByTagName(propElement, typeName);\n const values: PrimitiveArray = [];\n for (const child of children) {\n const value = this.readPrimitivePropertyValue(child, primitiveType);\n values.push(value);\n }\n\n return values;\n }\n\n private readStructArrayValues(propElement: Element, propertyClass: StructArrayProperty): any {\n const children = this.getElementChildren(propElement);\n const values: any = [];\n for (const child of children) {\n const value = this.readStructPropertyValue(child, propertyClass.structClass);\n values.push(value);\n }\n\n return values;\n }\n\n private readStructPropertyValue(propElement: Element, structClass: StructClass): any {\n const structObj: any = {};\n const children = this.getElementChildren(propElement);\n for (const child of children) {\n const value = this.readPropertyValue(child, structClass);\n if (value !== undefined)\n structObj[child.tagName] = value;\n }\n return structObj;\n }\n\n private readPrimitivePropertyValue(propElement: Element, primitiveType: PrimitiveType): PrimitiveValue {\n if (undefined === propElement.textContent || null === propElement.textContent)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);\n\n if (propElement.textContent === \"\" && primitiveType !== PrimitiveType.String)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);\n\n // TODO: Mapping all primitive types to string, number and boolean\n // for now. Need to review with IModelJs.\n switch (primitiveType) {\n case PrimitiveType.String:\n case PrimitiveType.Binary: /** TODO - Currently treated as strings */\n case PrimitiveType.IGeometry: /** TODO - Currently treated as strings */\n return propElement.textContent;\n case PrimitiveType.DateTime:\n return this.getDatePropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Point2d:\n return this.getPoint2DPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Point3d:\n return this.getPoint3DPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Boolean:\n return this.getBooleanPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Integer:\n case PrimitiveType.Long:\n return this.getIntegerPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Double:\n return this.getDoublePropertyValue(propElement.textContent, propElement.tagName);\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);\n }\n }\n\n private getBooleanPropertyValue(propValue: string, propName: string): boolean {\n if (propValue.toLowerCase() === \"true\" ||\n Number.parseInt(propValue, 10) > 0) {\n return true;\n } else if (propValue.toLowerCase() === \"false\" ||\n Number.parseInt(propValue, 10) === 0) {\n return false;\n }\n\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);\n }\n\n private getIntegerPropertyValue(propValue: string, propName: string): number {\n const result = Number.parseFloat(propValue);\n if (isNaN(result) || result % 1 !== 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);\n\n return result;\n }\n\n private getDatePropertyValue(propValue: string, propName: string): Date {\n const result = Number.parseInt(propValue, 10);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);\n\n return new Date(result);\n }\n\n private getDoublePropertyValue(propValue: string, propName: string): number {\n const result = Number.parseFloat(propValue);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);\n\n return result;\n }\n\n private getPoint2DPropertyValue(propValue: string, propName: string): any {\n const result = propValue.split(\",\");\n if (result.length !== 2) {\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);\n }\n\n const x = Number.parseFloat(result[0]);\n const y = Number.parseFloat(result[1]);\n\n if (isNaN(x) || isNaN(y))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);\n\n return { x, y };\n }\n\n private getPoint3DPropertyValue(propValue: string, propName: string): any {\n const result = propValue.split(\",\");\n if (result.length !== 3) {\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);\n }\n\n const x = Number.parseFloat(result[0]);\n const y = Number.parseFloat(result[1]);\n const z = Number.parseFloat(result[2]);\n\n if (isNaN(x) || isNaN(y) || isNaN(z))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);\n\n return { x, y, z };\n }\n\n private isSchemaFullNameValidForVersion(schemaFullName: string, ecSpecVersion: ECSpecVersion) {\n const schemaNameParts = schemaFullName.split(\".\");\n\n if ((ecSpecVersion.readVersion >= 3 && ecSpecVersion.writeVersion >= 2) || ecSpecVersion.readVersion > 3) {\n if (schemaNameParts.length < 4)\n return false;\n } else {\n if (schemaNameParts.length < 3)\n return false;\n }\n return true;\n }\n\n public static parseXmlNamespace(xmlNamespace: string): ECSpecVersion | undefined {\n const regEx = new RegExp(`^${ECXML_URI}\\\\.([0-9]+)\\\\.([0-9]+)$`);\n const match = xmlNamespace.match(regEx);\n if (!match)\n return;\n\n const readVersion = parseInt(match[1], 10);\n const writeVersion = parseInt(match[2], 10);\n return { readVersion, writeVersion };\n }\n\n private getQualifiedTypeName(rawTypeName: string): string {\n const nameParts = rawTypeName.split(\":\");\n if (nameParts.length !== 2)\n return `${this._schemaName}.${rawTypeName}`;\n\n if (nameParts[0].toLowerCase() === this._schemaAlias.toLowerCase())\n return `${this._schemaName}.${nameParts[1]}`;\n if (this._schemaReferenceNames.has(nameParts[0].toLowerCase()))\n return `${this._schemaReferenceNames.get(nameParts[0].toLowerCase())}.${nameParts[1]}`;\n\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);\n }\n\n /** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,\n * meaning all of the references in the format string need to be changed.\n */\n private getQualifiedPresentationUnits(presentationUnits: string[]): string[] {\n const res: string[] = [];\n for (const presentationUnit of presentationUnits) {\n // we split the presentation unit by square parantheses [ ], f:DefaultReal(6)[u:FT|feet] will be splitted into f:DefaultReal(6) and u:FT|feet\n // we format the first one and the next one will be put into [ ] again\n const presentationUnitFormats = presentationUnit.split(/[\\[\\]]/g);\n let qualifiedPresentation: string = \"\";\n qualifiedPresentation = this.getQualifiedTypeName(presentationUnitFormats[0]);\n if (presentationUnitFormats.length > 1) {\n for (let i = 1; i < presentationUnitFormats.length; ++i) {\n if (presentationUnitFormats[i].length === 0)\n continue;\n const verticalSlashIdx = presentationUnitFormats[i].indexOf(\"|\");\n const overrideFormat = this.getQualifiedTypeName(presentationUnitFormats[i].slice(0, verticalSlashIdx));\n const formatLabel = presentationUnitFormats[i].slice(verticalSlashIdx);\n qualifiedPresentation += `[${overrideFormat}${formatLabel}]`;\n }\n }\n\n res.push(qualifiedPresentation);\n }\n\n return res;\n }\n}\n"]}
1
+ {"version":3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C;wBACzC,SAAS;oBACX,MAAM,gBAAgB,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;oBACjE,MAAM,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACxG,MAAM,WAAW,GAAG,uBAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;oBACvE,qBAAqB,IAAI,IAAI,cAAc,GAAG,WAAW,GAAG,CAAC;gBAC/D,CAAC;YACH,CAAC;YAED,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;QAClC,CAAC;QAED,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAxuCD,8BAwuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { ECClass, StructClass } from \"../Metadata/Class\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { Enumeration } from \"../Metadata/Enumeration\";\nimport { PrimitiveProperty, Property, StructArrayProperty } from \"../Metadata/Property\";\nimport { ECName } from \"../ECName\";\nimport { AbstractParser, CAProviderTuple } from \"./AbstractParser\";\nimport {\n ClassProps, ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, EnumeratorProps, InvertedUnitProps,\n KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\n PrimitivePropertyProps, PropertyCategoryProps, PropertyProps, RelationshipClassProps, RelationshipConstraintProps, SchemaItemFormatProps, SchemaItemProps,\n SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\n} from \"./JsonProps\";\nimport { ECSpecVersion, SchemaReadHelper } from \"./Helper\";\n\nconst NON_ITEM_SCHEMA_ELEMENTS = [\"ECSchemaReference\", \"ECCustomAttributes\"];\nconst ECXML_URI = \"http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\";\n\ntype PrimitiveArray = PrimitiveValue[];\ntype PrimitiveValue = string | number | boolean | Date;\n\n/** @internal */\nexport class XmlParser extends AbstractParser<Element> {\n private _rawSchema: Document;\n private _schemaName?: string;\n private _schemaReferenceNames: Map<string, string>;\n private _schemaAlias: string;\n private _schemaVersion?: string;\n private _xmlNamespace?: string;\n private _currentItemFullName?: string;\n private _schemaItems: Map<string, [string, Element]>;\n private _mapIsPopulated: boolean;\n\n constructor(rawSchema: Readonly<Document>) {\n super();\n\n this._rawSchema = rawSchema;\n const schemaInfo = rawSchema.documentElement;\n\n const schemaName = schemaInfo.getAttribute(\"schemaName\");\n if (schemaName)\n this._schemaName = schemaName;\n\n this._schemaAlias = \"\";\n const schemaAlias = schemaInfo.getAttribute(\"alias\");\n if (schemaAlias)\n this._schemaAlias = schemaAlias;\n\n this._schemaReferenceNames = new Map<string, string>();\n\n const schemaVersion = schemaInfo.getAttribute(\"version\");\n if (schemaVersion)\n this._schemaVersion = schemaVersion;\n\n const xmlNamespace = schemaInfo.getAttribute(\"xmlns\");\n if (xmlNamespace) {\n this._xmlNamespace = xmlNamespace;\n this._ecSpecVersion = XmlParser.parseXmlNamespace(this._xmlNamespace);\n }\n\n this._schemaItems = new Map<string, [string, Element]>();\n this._mapIsPopulated = false;\n }\n\n public get getECSpecVersion(): ECSpecVersion | undefined { return this._ecSpecVersion; }\n\n public parseSchema(): SchemaProps {\n const schemaMetadata = this._rawSchema.documentElement;\n if (\"ECSchema\" !== schemaMetadata.nodeName)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, \"An ECSchema is missing the required metadata.\");\n\n const schemaDefDuplicates = this.getElementChildrenByTagName(schemaMetadata, \"ECSchema\");\n if (schemaDefDuplicates.length > 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, \"An ECSchema has more than one ECSchema definition. Only one is allowed.\");\n\n if (this._schemaName === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `An ECSchema is missing a required 'schemaName' attribute`);\n\n if (this._schemaVersion === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'version' attribute`);\n\n if (this._xmlNamespace === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} is missing a required 'xmlns' attribute`);\n\n if (this._ecSpecVersion === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECSchema ${this._schemaName} has an invalid 'xmlns' attribute`);\n\n const alias = this.getRequiredAttribute(schemaMetadata, \"alias\",\n `The ECSchema ${this._schemaName} is missing a required 'alias' attribute`);\n const description = this.getOptionalAttribute(schemaMetadata, \"description\");\n const displayLabel = this.getOptionalAttribute(schemaMetadata, \"displayLabel\");\n\n const schemaProps = {\n name: this._schemaName,\n $schema: this._xmlNamespace,\n version: this._schemaVersion,\n alias,\n label: displayLabel,\n description,\n ecSpecMajorVersion: this._ecSpecVersion.readVersion,\n ecSpecMinorVersion: this._ecSpecVersion.writeVersion,\n };\n\n return schemaProps;\n }\n\n public *getReferences(): Iterable<SchemaReferenceProps> {\n const schemaReferences = this.getElementChildrenByTagName(this._rawSchema.documentElement, \"ECSchemaReference\");\n for (const ref of schemaReferences) {\n yield this.getSchemaReference(ref);\n }\n }\n\n public *getItems(): Iterable<[string, string, Element]> {\n if (!this._mapIsPopulated) {\n const schemaItems = this.getSchemaChildren();\n for (const item of schemaItems) {\n let rawItemType = item.nodeName;\n if (NON_ITEM_SCHEMA_ELEMENTS.includes(rawItemType))\n continue;\n\n // Differentiate a Mixin from an EntityClass\n const customAttributesResult = this.getElementChildrenByTagName(item, \"ECCustomAttributes\");\n if (customAttributesResult.length > 0) {\n const customAttributes = customAttributesResult[0];\n const isMixinResult = this.getElementChildrenByTagName(customAttributes, \"IsMixin\");\n if (isMixinResult.length > 0)\n rawItemType = \"Mixin\";\n }\n\n const itemType = this.getSchemaItemType(rawItemType);\n if (itemType === undefined) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n continue;\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `A SchemaItem in ${this._schemaName} has an invalid type. '${rawItemType}' is not a valid SchemaItem type.`);\n }\n\n const itemName = this.getRequiredAttribute(item, \"typeName\", `A SchemaItem in ${this._schemaName} is missing the required 'typeName' attribute.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'typeName' attribute. '${itemName}' is not a valid ECName.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n this._schemaItems.set(itemName, [itemType, item]);\n yield [itemName, itemType, item];\n }\n this._mapIsPopulated = true;\n } else {\n for (const [itemName, [itemType, item]] of this._schemaItems) {\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n yield [itemName, itemType, item];\n }\n }\n }\n\n public findItem(itemName: string): [string, string, Element] | undefined {\n if (!this._mapIsPopulated) {\n for (const item of this.getItems()) {\n if (item[0] === itemName) {\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return item;\n }\n }\n } else {\n const values = this._schemaItems.get(itemName);\n if (undefined !== values) {\n const [itemType, item] = values;\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return [itemName, itemType, item];\n }\n }\n\n return undefined;\n }\n\n public parseEntityClass(xmlElement: Element): EntityClassProps {\n const classProps = this.getClassProps(xmlElement);\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n let mixinElements: Element[];\n const mixins = new Array<string>();\n\n // if it has just one BaseClass we assume it is a 'true' base class not a mixin\n if (baseClasses.length > 1) {\n mixinElements = baseClasses.slice(1);\n for (const mixin of mixinElements) {\n if (mixin.textContent) {\n const typeName = this.getQualifiedTypeName(mixin.textContent);\n mixins.push(typeName);\n }\n }\n }\n\n const entityClassProps = {\n ...classProps,\n mixins,\n };\n\n return entityClassProps;\n }\n\n public parseMixin(xmlElement: Element): MixinProps {\n const classProps = this.getClassProps(xmlElement);\n\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n\n // Mixins can only have one base class\n if (baseClasses.length > 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} has more than one base class which is not allowed.`);\n\n const customAttributesResult = this.getElementChildrenByTagName(xmlElement, \"ECCustomAttributes\");\n\n if (customAttributesResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);\n\n const customAttributes = customAttributesResult[0];\n const isMixinResult = this.getElementChildrenByTagName(customAttributes, \"IsMixin\");\n if (isMixinResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'IsMixin' tag.`);\n\n const mixinAttributes = isMixinResult[0];\n const appliesToResult = this.getElementChildrenByTagName(mixinAttributes, \"AppliesToEntityClass\");\n\n if (appliesToResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);\n\n const appliesToElement = appliesToResult[0];\n let appliesTo = appliesToElement.textContent;\n if (appliesTo === null || appliesTo.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Mixin ${this._currentItemFullName} is missing the required 'AppliesToEntityClass' tag.`);\n\n appliesTo = this.getQualifiedTypeName(appliesTo);\n\n const mixinProps = {\n ...classProps,\n appliesTo,\n };\n\n return mixinProps;\n }\n\n public parseStructClass(xmlElement: Element): StructClassProps {\n return this.getClassProps(xmlElement);\n }\n\n public parseCustomAttributeClass(xmlElement: Element): CustomAttributeClassProps {\n const classProps = this.getClassProps(xmlElement);\n const appliesTo = this.getRequiredAttribute(xmlElement, \"appliesTo\",\n `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n\n const customAttributeClassProps = {\n ...classProps,\n appliesTo,\n };\n\n return customAttributeClassProps;\n }\n\n public parseRelationshipClass(xmlElement: Element): RelationshipClassProps {\n const classProps = this.getClassProps(xmlElement);\n const strength = this.getRequiredAttribute(xmlElement, \"strength\",\n `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);\n let strengthDirection = this.getOptionalAttribute(xmlElement, \"strengthDirection\");\n if (!strengthDirection)\n strengthDirection = strengthDirectionToString(StrengthDirection.Forward);\n\n const sourceResult = this.getElementChildrenByTagName(xmlElement, \"Source\");\n if (sourceResult.length !== 1) {\n if (sourceResult.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Source constraint tag. Only one is allowed.`);\n }\n const source = this.getRelationshipConstraintProps(sourceResult[0], true);\n\n const targetResult = this.getElementChildrenByTagName(xmlElement, \"Target\");\n if (targetResult.length !== 1) {\n if (targetResult.length === 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} has more than one Target constraint tag. Only one is allowed.`);\n }\n const target = this.getRelationshipConstraintProps(targetResult[0], false);\n\n return {\n ...classProps,\n strength,\n strengthDirection,\n source,\n target,\n };\n }\n\n public parseEnumeration(xmlElement: Element): EnumerationProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const enumType = this.getRequiredAttribute(xmlElement, \"backingTypeName\",\n `The Enumeration ${this._currentItemFullName} is missing the required 'backingTypeName' attribute.`);\n\n // TODO: This shouldn't be verified here. It's for the deserialize method to handle. The only reason it's currently done here so that the xml\n // value can be put in the correct type, number or string.\n let tempBackingType: PrimitiveType;\n if (/int/i.test(enumType)) {\n tempBackingType = PrimitiveType.Integer;\n } else if (/string/i.test(enumType)) {\n tempBackingType = PrimitiveType.String;\n } else {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n tempBackingType = PrimitiveType.String;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'backingTypeName' attribute. It should be either \"int\" or \"string\".`);\n }\n\n let isStrictString: string | undefined = this.getOptionalAttribute(xmlElement, \"isStrict\");\n if (isStrictString === undefined)\n isStrictString = \"true\";\n\n const isStrict = this.parseBoolean(isStrictString,\n `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should either be \"true\" or \"false\".`);\n\n const enumeratorElements = this.getElementChildrenByTagName(xmlElement, \"ECEnumerator\");\n const enumerators = new Array<EnumeratorProps>();\n\n for (const element of enumeratorElements) {\n const name = this.getRequiredAttribute(element, \"name\",\n `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);\n\n const valueString = this.getRequiredAttribute(element, \"value\",\n `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);\n let value: string | number = valueString;\n\n if (PrimitiveType.Integer === tempBackingType) {\n const numericValue = parseInt(valueString, 10);\n if (isNaN(numericValue))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Enumeration ${this._currentItemFullName} of type \"int\" has an enumerator with a non-integer value.`);\n value = numericValue;\n }\n\n const label = this.getOptionalAttribute(element, \"displayLabel\");\n const description = this.getOptionalAttribute(element, \"description\");\n\n enumerators.push({\n name,\n value,\n label,\n description,\n });\n }\n\n return {\n ...itemProps,\n type: enumType,\n isStrict,\n enumerators,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n public parseKindOfQuantity(xmlElement: Element): KindOfQuantityProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const relativeErrorString = this.getRequiredAttribute(xmlElement, \"relativeError\",\n `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);\n const relativeError = parseFloat(relativeErrorString);\n if (isNaN(relativeError))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be a numeric value.`);\n\n const presentationUnitsString = this.getOptionalAttribute(xmlElement, \"presentationUnits\");\n let presentationUnits: string[] | undefined;\n if (presentationUnitsString)\n presentationUnits = this.getQualifiedPresentationUnits(presentationUnitsString.split(\";\"));\n\n let persistenceUnit = this.getRequiredAttribute(xmlElement, \"persistenceUnit\",\n `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);\n persistenceUnit = this.getQualifiedTypeName(persistenceUnit);\n\n return {\n ...itemProps,\n relativeError,\n presentationUnits,\n persistenceUnit,\n };\n }\n\n public parsePropertyCategory(xmlElement: Element): PropertyCategoryProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const priorityString = this.getRequiredAttribute(xmlElement, \"priority\",\n `The PropertyCategory ${this._currentItemFullName} is missing the required 'priority' attribute.`);\n const priority = parseInt(priorityString, 10);\n if (isNaN(priority))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be a numeric value.`);\n\n return {\n ...itemProps,\n priority,\n };\n }\n\n public parseUnit(xmlElement: Element): SchemaItemUnitProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let phenomenon = this.getRequiredAttribute(xmlElement, \"phenomenon\",\n `The Unit ${this._currentItemFullName} is missing the required 'phenomenon' attribute.`);\n let unitSystem = this.getRequiredAttribute(xmlElement, \"unitSystem\",\n `The Unit ${this._currentItemFullName} is missing the required 'unitSystem' attribute.`);\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Unit ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n const numerator = this.getOptionalFloatAttribute(xmlElement, \"numerator\",\n `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be a numeric value.`);\n const denominator = this.getOptionalFloatAttribute(xmlElement, \"denominator\",\n `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be a numeric value.`);\n const offset = this.getOptionalFloatAttribute(xmlElement, \"offset\",\n `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be a numeric value.`);\n\n phenomenon = this.getQualifiedTypeName(phenomenon);\n unitSystem = this.getQualifiedTypeName(unitSystem);\n\n return {\n ...itemProps,\n phenomenon,\n unitSystem,\n definition,\n numerator,\n denominator,\n offset,\n };\n }\n\n public parseInvertedUnit(xmlElement: Element): InvertedUnitProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let invertsUnit = this.getRequiredAttribute(xmlElement, \"invertsUnit\",\n `The InvertedUnit ${this._currentItemFullName} is missing the required 'invertsUnit' attribute.`);\n let unitSystem = this.getRequiredAttribute(xmlElement, \"unitSystem\",\n `The InvertedUnit ${this._currentItemFullName} is missing the required 'unitSystem' attribute.`);\n\n invertsUnit = this.getQualifiedTypeName(invertsUnit);\n unitSystem = this.getQualifiedTypeName(unitSystem);\n\n return {\n ...itemProps,\n invertsUnit,\n unitSystem,\n };\n }\n\n public parseConstant(xmlElement: Element): ConstantProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n let phenomenon = this.getRequiredAttribute(xmlElement, \"phenomenon\",\n `The Constant ${this._currentItemFullName} is missing the required 'phenomenon' attribute.`);\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Constant ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n const numerator = this.getOptionalFloatAttribute(xmlElement, \"numerator\",\n `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be a numeric value.`);\n const denominator = this.getOptionalFloatAttribute(xmlElement, \"denominator\",\n `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be a numeric value.`);\n\n phenomenon = this.getQualifiedTypeName(phenomenon);\n\n return {\n ...itemProps,\n phenomenon,\n definition,\n numerator,\n denominator,\n };\n }\n\n public parsePhenomenon(xmlElement: Element): PhenomenonProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const definition = this.getRequiredAttribute(xmlElement, \"definition\",\n `The Phenomenon ${this._currentItemFullName} is missing the required 'definition' attribute.`);\n\n return {\n ...itemProps,\n definition,\n };\n }\n\n public parseFormat(xmlElement: Element): SchemaItemFormatProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n\n const formatType = this.getRequiredAttribute(xmlElement, \"type\",\n `The Format ${this._currentItemFullName} is missing the required 'type' attribute.`);\n const precision = this.getOptionalIntAttribute(xmlElement, \"precision\",\n `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be a numeric value.`);\n const roundFactor = this.getOptionalFloatAttribute(xmlElement, \"roundFactor\",\n `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be a numeric value.`);\n const minWidth = this.getOptionalIntAttribute(xmlElement, \"minWidth\",\n `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be a numeric value.`);\n const showSignOption = this.getOptionalAttribute(xmlElement, \"showSignOption\");\n\n const formatTraitsString = this.getRequiredAttribute(xmlElement, \"formatTraits\",\n `The Format ${this._currentItemFullName} is missing the required 'formatTraits' attribute.`);\n const formatTraits = formatTraitsString.split(\"|\");\n\n const decimalSeparator = this.getOptionalAttribute(xmlElement, \"decimalSeparator\");\n const thousandSeparator = this.getOptionalAttribute(xmlElement, \"thousandSeparator\");\n const uomSeparator = this.getOptionalAttribute(xmlElement, \"uomSeparator\");\n const scientificType = this.getOptionalAttribute(xmlElement, \"scientificType\");\n\n const stationOffsetSize = this.getOptionalIntAttribute(xmlElement, \"stationOffsetSize\",\n `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be a numeric value.`);\n\n const stationSeparator = this.getOptionalAttribute(xmlElement, \"stationSeparator\");\n\n let composite: object | undefined;\n const compositeResult = this.getElementChildrenByTagName(xmlElement, \"Composite\");\n if (compositeResult.length > 0) {\n const compositeElement = compositeResult[0];\n\n const spacer = this.getOptionalAttribute(compositeElement, \"spacer\");\n\n const includeZeroString = this.getOptionalAttribute(compositeElement, \"includeZero\");\n let includeZero: boolean | undefined;\n if (includeZeroString) {\n includeZero = this.parseBoolean(includeZeroString,\n `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be either \"true\" or \"false\".`);\n }\n\n const units = new Array<{ name: string, label?: string }>();\n const unitsResult = this.getElementChildrenByTagName(compositeElement, \"Unit\");\n if (unitsResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has an invalid 'Composite' element. It should have 1-4 Unit elements.`);\n\n for (const unit of unitsResult) {\n let name = unit.textContent;\n if (null === name || 0 === name.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has a Composite with an invalid Unit. One of the Units is missing the required 'name' attribute.`);\n\n const label = this.getOptionalAttribute(unit, \"label\");\n name = this.getQualifiedTypeName(name);\n units.push({ name, label });\n }\n\n composite = {\n spacer,\n includeZero,\n units,\n };\n }\n\n return {\n ...itemProps,\n type: formatType,\n precision,\n roundFactor,\n minWidth,\n showSignOption,\n formatTraits,\n decimalSeparator,\n thousandSeparator,\n uomSeparator,\n scientificType,\n stationOffsetSize,\n stationSeparator,\n composite,\n } as SchemaItemFormatProps;\n }\n\n public parseUnitSystem(xmlElement: Element): UnitSystemProps {\n return this.getClassProps(xmlElement);\n }\n\n public *getProperties(xmlElement: Element, itemName: string): Iterable<[string, string, Element]> {\n const propertyTagRegex = /EC((Struct(Array)?)|Array|Navigation)?Property/;\n const children = this.getElementChildrenByTagName(xmlElement, propertyTagRegex);\n\n for (const child of children) {\n const childType = child.nodeName;\n const propertyName = this.getRequiredAttribute(child, \"propertyName\",\n `An ECProperty in ${itemName} is missing the required 'propertyName' attribute.`);\n\n const propertyType = this.getPropertyType(childType);\n // This may not be needed, just a failsafe if the regex is faulty\n if (propertyType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${itemName}.${propertyName} has an invalid type. ${childType} is not a valid ECProperty type.`);\n\n yield [propertyName, propertyType, child];\n }\n }\n\n public parsePrimitiveProperty(xmlElement: Element): PrimitivePropertyProps {\n const typeName = this.getPropertyTypeName(xmlElement);\n const propertyProps = this.getPrimitiveOrEnumPropertyBaseProps(xmlElement, typeName);\n const primitivePropertyProps = { ...propertyProps, typeName };\n return primitivePropertyProps;\n }\n\n public parseStructProperty(xmlElement: Element): StructPropertyProps {\n const propertyProps = this.getPropertyProps(xmlElement);\n const typeName = this.getPropertyTypeName(xmlElement);\n const structPropertyProps = { ...propertyProps, typeName };\n return structPropertyProps;\n }\n\n public parsePrimitiveArrayProperty(xmlElement: Element): PrimitiveArrayPropertyProps {\n const typeName = this.getPropertyTypeName(xmlElement);\n const propertyProps = this.getPrimitiveOrEnumPropertyBaseProps(xmlElement, typeName);\n const minAndMaxOccurs = this.getPropertyMinAndMaxOccurs(xmlElement);\n\n return {\n ...propertyProps,\n ...minAndMaxOccurs,\n typeName,\n };\n }\n\n public parseStructArrayProperty(xmlElement: Element): StructArrayPropertyProps {\n const propertyProps = this.getPropertyProps(xmlElement);\n const typeName = this.getPropertyTypeName(xmlElement);\n const minAndMaxOccurs = this.getPropertyMinAndMaxOccurs(xmlElement);\n return {\n ...propertyProps,\n ...minAndMaxOccurs,\n typeName,\n };\n }\n\n public parseNavigationProperty(xmlElement: Element): NavigationPropertyProps {\n const propName = this.getPropertyName(xmlElement);\n const propertyProps = this.getPropertyProps(xmlElement);\n let relationshipName = this.getRequiredAttribute(xmlElement, \"relationshipName\",\n `The ECNavigationProperty ${this._currentItemFullName}.${propName} is missing the required 'relationshipName' property.`);\n const direction = this.getRequiredAttribute(xmlElement, \"direction\",\n `The ECNavigationProperty ${this._currentItemFullName}.${propName} is missing the required 'direction' property.`);\n\n relationshipName = this.getQualifiedTypeName(relationshipName);\n\n return {\n ...propertyProps,\n relationshipName,\n direction,\n };\n }\n\n public getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(this._rawSchema.documentElement, \"Schema\", this._schemaName);\n }\n\n public getClassCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(xmlElement, \"ECClass\", this._currentItemFullName);\n }\n\n public getPropertyCustomAttributeProviders(xmlElement: Element): Iterable<CAProviderTuple> {\n const propName = this.getPropertyName(xmlElement);\n return this.getCustomAttributeProviders(xmlElement, \"ECProperty\", `${this._currentItemFullName}.${propName}`);\n }\n\n public getRelationshipConstraintCustomAttributeProviders(xmlElement: Element): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */] {\n const sourceResult = this.getElementChildrenByTagName(xmlElement, \"Source\");\n if (sourceResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Source constraint tag.`);\n const sourceElement = sourceResult[0];\n const sourceCustomAttributes = this.getCustomAttributeProviders(sourceElement, \"Source Constraint of\", this._currentItemFullName);\n\n const targetResult = this.getElementChildrenByTagName(xmlElement, \"Target\");\n if (targetResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The RelationshipClass ${this._currentItemFullName} is missing the required Target constraint tag.`);\n const targetElement = targetResult[0];\n const targetCustomAttributes = this.getCustomAttributeProviders(targetElement, \"Source Constraint of\", this._currentItemFullName);\n\n return [sourceCustomAttributes, targetCustomAttributes];\n }\n\n private getElementChildren(xmlElement: Element): Element[] {\n // NodeListOf<T> does not define [Symbol.iterator]\n const children = Array.from(xmlElement.childNodes).filter((child) => {\n // (node.nodeType === 1) implies instanceof Element\n // https://developer.mozilla.org/en-US/docs/Web/API/ParentNode/children#Polyfill\n return child.nodeType === 1;\n });\n return children as Element[];\n }\n\n private getElementChildrenByTagName(xmlElement: Element, tagName: string | RegExp): Element[] {\n const children = this.getElementChildren(xmlElement);\n if (\"*\" === tagName)\n return children;\n\n let result: Element[];\n if (typeof tagName === \"string\") {\n result = children.filter((child) => {\n return tagName.toLowerCase() === child.nodeName.toLowerCase();\n });\n } else {\n result = children.filter((child) => {\n return tagName.test(child.nodeName);\n });\n }\n\n return result;\n }\n\n private getOptionalAttribute(xmlElement: Element, attributeName: string): string | undefined {\n if (!xmlElement.hasAttribute(attributeName))\n return undefined;\n const result = xmlElement.getAttribute(attributeName);\n\n // The typings for the return value of getAttribute do not match that of xmldom\n // xmldom returns an empty string instead of null\n // However Typescript will still treat result as a union type without this check\n // Hence this is needed for tsc to compile\n if (result === null)\n return undefined;\n return result;\n }\n\n private getOptionalFloatAttribute(xmlElement: Element, attributeName: string, parseErrorMsg: string): number | undefined {\n const resultString = this.getOptionalAttribute(xmlElement, attributeName);\n let result: number | undefined;\n if (resultString) {\n result = parseFloat(resultString);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n return result;\n }\n\n private getOptionalIntAttribute(xmlElement: Element, attributeName: string, parseErrorMsg: string): number | undefined {\n const resultString = this.getOptionalAttribute(xmlElement, attributeName);\n let result: number | undefined;\n if (resultString) {\n result = parseInt(resultString, 10);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n return result;\n }\n\n private parseBoolean(text: string, parseErrorMsg: string): boolean {\n const textString = text.toLowerCase();\n if (\"true\" === textString)\n return true;\n else if (\"false\" === textString)\n return false;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, parseErrorMsg);\n }\n\n private getRequiredAttribute(xmlElement: Element, attributeName: string, errorMsg: string): string {\n if (!xmlElement.hasAttribute(attributeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);\n const result = xmlElement.getAttribute(attributeName);\n if (result === null)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, errorMsg);\n return result;\n }\n\n private getSchemaReference(xmlElement: Element): SchemaReferenceProps {\n const alias = this.getRequiredAttribute(xmlElement, \"alias\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'alias' attribute.`);\n const name = this.getRequiredAttribute(xmlElement, \"name\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'name' attribute.`);\n const version = this.getRequiredAttribute(xmlElement, \"version\",\n `The schema ${this._schemaName} has an invalid ECSchemaReference attribute. One of the references is missing the required 'version' attribute.`);\n\n if (!this._schemaReferenceNames.has(alias.toLowerCase()))\n this._schemaReferenceNames.set(alias.toLowerCase(), name);\n\n return {\n name,\n version,\n };\n }\n\n private getSchemaItemType(rawType: string): string | undefined {\n switch (rawType.toLowerCase()) {\n case \"ecentityclass\": return \"EntityClass\";\n case \"mixin\": return \"Mixin\";\n case \"ecstructclass\": return \"StructClass\";\n case \"eccustomattributeclass\": return \"CustomAttributeClass\";\n case \"ecrelationshipclass\": return \"RelationshipClass\";\n case \"ecenumeration\": return \"Enumeration\";\n case \"kindofquantity\": return \"KindOfQuantity\";\n case \"propertycategory\": return \"PropertyCategory\";\n case \"unit\": return \"Unit\";\n case \"invertedunit\": return \"InvertedUnit\";\n case \"constant\": return \"Constant\";\n case \"phenomenon\": return \"Phenomenon\";\n case \"unitsystem\": return \"UnitSystem\";\n case \"format\": return \"Format\";\n }\n return undefined;\n }\n\n private getSchemaChildren(): Element[] {\n const schemaMetadata = this._rawSchema.documentElement;\n return this.getElementChildren(schemaMetadata);\n }\n\n private getSchemaItemProps(xmlElement: Element): SchemaItemProps {\n const displayLabel = this.getOptionalAttribute(xmlElement, \"displayLabel\");\n const description = this.getOptionalAttribute(xmlElement, \"description\");\n\n return {\n description,\n label: displayLabel,\n };\n }\n\n private getClassProps(xmlElement: Element): ClassProps {\n const itemProps = this.getSchemaItemProps(xmlElement);\n const modifier = this.getOptionalAttribute(xmlElement, \"modifier\");\n\n let baseClass: string | null | undefined = null;\n const baseClasses = this.getElementChildrenByTagName(xmlElement, \"BaseClass\");\n if (baseClasses.length > 0) {\n // We are assuming here that the first BaseClass is the 'real' one - the rest are mixins\n // This is not a finalized approach as this could lead to unsupported schemas\n baseClass = baseClasses[0].textContent;\n }\n\n baseClass = baseClass ? this.getQualifiedTypeName(baseClass) : undefined;\n\n return {\n ...itemProps,\n modifier,\n baseClass,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n private getRelationshipConstraintProps(xmlElement: Element, isSource: boolean): RelationshipConstraintProps {\n const constraintName = `${(isSource) ? \"Source\" : \"Target\"} Constraint of ${this._currentItemFullName}`;\n\n const multiplicity = this.getRequiredAttribute(xmlElement, \"multiplicity\",\n `The ${constraintName} is missing the required 'multiplicity' attribute.`);\n const roleLabel = this.getRequiredAttribute(xmlElement, \"roleLabel\",\n `The ${constraintName} is missing the required 'roleLabel' attribute.`);\n\n const polymorphicString = this.getRequiredAttribute(xmlElement, \"polymorphic\",\n `The ${constraintName} is missing the required 'polymorphic' attribute.`);\n const polymorphic = this.parseBoolean(polymorphicString,\n `The ${constraintName} has an invalid 'polymorphic' attribute. It should either be \"true\" or \"false\".`);\n\n let abstractConstraint = this.getOptionalAttribute(xmlElement, \"abstractConstraint\");\n if (undefined !== abstractConstraint)\n abstractConstraint = this.getQualifiedTypeName(abstractConstraint);\n\n const constraintClasses = new Array<string>();\n const constraintClassesResult = this.getElementChildrenByTagName(xmlElement, \"Class\");\n if (constraintClassesResult.length < 1)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} is missing the required Class tags.`);\n\n for (const constraintClass of constraintClassesResult) {\n let constraintClassId = constraintClass.getAttribute(\"class\");\n if (null === constraintClassId || 0 === constraintClassId.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ${constraintName} has a Class that is missing the required 'class' attribute.`);\n\n constraintClassId = this.getQualifiedTypeName(constraintClassId);\n constraintClasses.push(constraintClassId);\n }\n\n return {\n multiplicity,\n roleLabel,\n polymorphic,\n abstractConstraint,\n constraintClasses,\n };\n }\n\n private getPropertyType(propType: string): string | undefined {\n switch (propType) {\n case \"ECNavigationProperty\": return \"navigationproperty\";\n case \"ECStructProperty\": return \"structproperty\";\n case \"ECArrayProperty\": return \"primitivearrayproperty\";\n case \"ECStructArrayProperty\": return \"structarrayproperty\";\n case \"ECProperty\": return \"primitiveproperty\";\n default: return undefined;\n }\n }\n\n private getPropertyName(xmlElement: Element): string {\n return this.getRequiredAttribute(xmlElement, \"propertyName\",\n `An ECProperty in ${this._currentItemFullName} is missing the required 'propertyName' attribute.`);\n }\n\n private getPropertyProps(xmlElement: Element): PropertyProps {\n const propName = this.getPropertyName(xmlElement);\n\n const propType = this.getPropertyType(xmlElement.nodeName);\n if (propType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid type. ${propType} is not a valid ECProperty type.`);\n\n const label = this.getOptionalAttribute(xmlElement, \"displayLabel\");\n const description = this.getOptionalAttribute(xmlElement, \"description\");\n\n const readOnlyString = this.getOptionalAttribute(xmlElement, \"readOnly\");\n let isReadOnly: boolean | undefined;\n if (readOnlyString) {\n isReadOnly = this.parseBoolean(readOnlyString,\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'readOnly' attribute. It should be either \"true\" or \"false\".`);\n }\n\n let category = this.getOptionalAttribute(xmlElement, \"category\");\n\n const priority = this.getOptionalIntAttribute(xmlElement, \"priority\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be a numeric value.`);\n\n const inheritedString = this.getOptionalAttribute(xmlElement, \"inherited\");\n let inherited: boolean | undefined;\n if (inheritedString) {\n inherited = this.parseBoolean(inheritedString,\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be either \"true\" or \"false\".`);\n }\n\n let kindOfQuantity = this.getOptionalAttribute(xmlElement, \"kindOfQuantity\");\n\n if (kindOfQuantity)\n kindOfQuantity = this.getQualifiedTypeName(kindOfQuantity);\n if (category)\n category = this.getQualifiedTypeName(category);\n\n return {\n name: propName,\n type: propType,\n description,\n label,\n isReadOnly,\n category,\n priority,\n inherited,\n kindOfQuantity,\n };\n }\n\n private getPropertyTypeName(xmlElement: Element): string {\n const propName = this.getPropertyName(xmlElement);\n const rawTypeName = this.getRequiredAttribute(xmlElement, \"typeName\",\n `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);\n\n // If not a primitive type, we must prepend the schema name.\n const primitiveType = parsePrimitiveType(rawTypeName);\n if (primitiveType)\n return rawTypeName;\n\n return this.getQualifiedTypeName(rawTypeName);\n }\n\n private getPrimitiveOrEnumPropertyBaseProps(xmlElement: Element, typeName: string): PrimitiveOrEnumPropertyBaseProps {\n const primitiveType = parsePrimitiveType(typeName);\n const propertyProps = this.getPropertyProps(xmlElement);\n const propName = propertyProps.name;\n const extendedTypeName = this.getOptionalAttribute(xmlElement, \"extendedTypeName\");\n const minLength = this.getOptionalIntAttribute(xmlElement, \"minimumLength\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minimumLength' attribute. It should be a numeric value.`);\n const maxLength = this.getOptionalIntAttribute(xmlElement, \"maximumLength\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maximumLength' attribute. It should be a numeric value.`);\n\n let minValue: number | undefined;\n let maxValue: number | undefined;\n if (primitiveType === PrimitiveType.Double || primitiveType === PrimitiveType.Long) {\n minValue = this.getOptionalFloatAttribute(xmlElement, \"minimumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minimumValue' attribute. It should be a numeric value.`);\n maxValue = this.getOptionalFloatAttribute(xmlElement, \"maximumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maximumValue' attribute. It should be a numeric value.`);\n } else {\n minValue = this.getOptionalIntAttribute(xmlElement, \"minimumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minimumValue' attribute. It should be a numeric value.`);\n maxValue = this.getOptionalIntAttribute(xmlElement, \"maximumValue\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maximumValue' attribute. It should be a numeric value.`);\n }\n\n return {\n ...propertyProps,\n extendedTypeName,\n minLength,\n maxLength,\n minValue,\n maxValue,\n };\n }\n\n private getPropertyMinAndMaxOccurs(xmlElement: Element): { minOccurs: number | undefined, maxOccurs: number | undefined } {\n const propName = this.getPropertyName(xmlElement);\n const minOccurs = this.getOptionalIntAttribute(xmlElement, \"minOccurs\",\n `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be a numeric value.`);\n\n const maxOccursStr = this.getOptionalAttribute(xmlElement, \"maxOccurs\");\n let maxOccurs: number | undefined;\n if (\"unbounded\" === maxOccursStr)\n maxOccurs = 2147483647; // TODO: This should be using the INT32_MAX variable.\n else if (undefined !== maxOccursStr) {\n maxOccurs = parseInt(maxOccursStr, 10);\n if (isNaN(maxOccurs))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be a numeric value.`);\n }\n\n return { minOccurs, maxOccurs };\n }\n\n private *getCustomAttributeProviders(xmlElement: Element, type: string, _name?: string): Iterable<CAProviderTuple> {\n const customAttributesResult = this.getElementChildrenByTagName(xmlElement, \"ECCustomAttributes\");\n if (customAttributesResult.length < 1)\n return;\n\n const attributes = this.getElementChildren(customAttributesResult[0]);\n for (const attribute of attributes) {\n if (\"ECClass\" === type && \"IsMixin\" === attribute.tagName)\n continue;\n\n yield this.getCustomAttributeProvider(attribute);\n }\n }\n\n private getCustomAttributeProvider(xmlCustomAttribute: Element): CAProviderTuple {\n assert(this._ecSpecVersion !== undefined);\n\n let ns = xmlCustomAttribute.getAttribute(\"xmlns\");\n if (!ns) {\n assert(this._schemaName !== undefined);\n assert(this._schemaVersion !== undefined);\n ns = `${this._schemaName}.${this._schemaVersion}`;\n }\n\n if (null === ns || !this.isSchemaFullNameValidForVersion(ns, this._ecSpecVersion))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Custom attribute namespaces must contain a valid 3.2 full schema name in the form <schemaName>.RR.ww.mm.`);\n\n const schemaNameParts = ns.split(\".\");\n const className = `${schemaNameParts[0]}.${xmlCustomAttribute.tagName}`;\n const properties = this.getElementChildren(xmlCustomAttribute);\n\n const provider = (caClass: CustomAttributeClass) => {\n return this.addCAPropertyValues(caClass, properties);\n };\n\n return [className, provider];\n }\n\n private addCAPropertyValues(caClass: CustomAttributeClass, propertyElements: Element[]): CustomAttribute {\n const instance = { className: caClass.fullName } as CustomAttribute;\n for (const propertyElement of propertyElements) {\n const value = this.readPropertyValue(propertyElement, caClass);\n if (value !== undefined)\n instance[propertyElement.tagName] = value;\n }\n\n return instance;\n }\n\n private readPropertyValue(propElement: Element, parentClass: ECClass): any {\n const propertyClass = parentClass.getPropertySync(propElement.tagName);\n if (!propertyClass)\n return;\n\n if (propertyClass.isArray())\n return this.readArrayPropertyValue(propElement, propertyClass);\n\n let enumeration: Enumeration | undefined;\n if (propertyClass.isPrimitive()) {\n if (propertyClass.isEnumeration() && propertyClass.enumeration) {\n enumeration = propertyClass.schema.lookupItemSync(propertyClass.enumeration.fullName, Enumeration);\n if (!enumeration)\n throw new ECSchemaError(ECSchemaStatus.ClassNotFound, `The Enumeration class '${propertyClass.enumeration.fullName}' could not be found.`);\n }\n const primitiveType = enumeration && enumeration.type ? enumeration.type : (propertyClass).primitiveType;\n return this.readPrimitivePropertyValue(propElement, primitiveType);\n }\n\n if (propertyClass.isStruct())\n return this.readStructPropertyValue(propElement, propertyClass.structClass);\n\n return undefined;\n }\n\n private readArrayPropertyValue(propElement: Element, propertyClass: Property): PrimitiveArray | undefined {\n if (propertyClass.isPrimitive())\n return this.readPrimitiveArrayValues(propElement, (propertyClass as PrimitiveProperty).primitiveType);\n\n if (propertyClass.isStruct())\n return this.readStructArrayValues(propElement, propertyClass as StructArrayProperty);\n\n return undefined;\n }\n\n private readPrimitiveArrayValues(propElement: Element, primitiveType: PrimitiveType): PrimitiveArray {\n const typeName = primitiveTypeToString(primitiveType);\n const children = this.getElementChildrenByTagName(propElement, typeName);\n const values: PrimitiveArray = [];\n for (const child of children) {\n const value = this.readPrimitivePropertyValue(child, primitiveType);\n values.push(value);\n }\n\n return values;\n }\n\n private readStructArrayValues(propElement: Element, propertyClass: StructArrayProperty): any {\n const children = this.getElementChildren(propElement);\n const values: any = [];\n for (const child of children) {\n const value = this.readStructPropertyValue(child, propertyClass.structClass);\n values.push(value);\n }\n\n return values;\n }\n\n private readStructPropertyValue(propElement: Element, structClass: StructClass): any {\n const structObj: any = {};\n const children = this.getElementChildren(propElement);\n for (const child of children) {\n const value = this.readPropertyValue(child, structClass);\n if (value !== undefined)\n structObj[child.tagName] = value;\n }\n return structObj;\n }\n\n private readPrimitivePropertyValue(propElement: Element, primitiveType: PrimitiveType): PrimitiveValue {\n if (undefined === propElement.textContent || null === propElement.textContent)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);\n\n if (propElement.textContent === \"\" && primitiveType !== PrimitiveType.String)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid property value.`);\n\n // TODO: Mapping all primitive types to string, number and boolean\n // for now. Need to review with IModelJs.\n switch (primitiveType) {\n case PrimitiveType.String:\n case PrimitiveType.Binary: /** TODO - Currently treated as strings */\n case PrimitiveType.IGeometry: /** TODO - Currently treated as strings */\n return propElement.textContent;\n case PrimitiveType.DateTime:\n return this.getDatePropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Point2d:\n return this.getPoint2DPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Point3d:\n return this.getPoint3DPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Boolean:\n return this.getBooleanPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Integer:\n case PrimitiveType.Long:\n return this.getIntegerPropertyValue(propElement.textContent, propElement.tagName);\n case PrimitiveType.Double:\n return this.getDoublePropertyValue(propElement.textContent, propElement.tagName);\n default:\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Primitive property '${propElement.tagName}' has an invalid primitive type.`);\n }\n }\n\n private getBooleanPropertyValue(propValue: string, propName: string): boolean {\n if (propValue.toLowerCase() === \"true\" ||\n Number.parseInt(propValue, 10) > 0) {\n return true;\n } else if (propValue.toLowerCase() === \"false\" ||\n Number.parseInt(propValue, 10) === 0) {\n return false;\n }\n\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An boolean value was expected.`);\n }\n\n private getIntegerPropertyValue(propValue: string, propName: string): number {\n const result = Number.parseFloat(propValue);\n if (isNaN(result) || result % 1 !== 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. An integer value was expected.`);\n\n return result;\n }\n\n private getDatePropertyValue(propValue: string, propName: string): Date {\n const result = Number.parseInt(propValue, 10);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A date in milliseconds was expected.`);\n\n return new Date(result);\n }\n\n private getDoublePropertyValue(propValue: string, propName: string): number {\n const result = Number.parseFloat(propValue);\n if (isNaN(result))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A double value was expected.`);\n\n return result;\n }\n\n private getPoint2DPropertyValue(propValue: string, propName: string): any {\n const result = propValue.split(\",\");\n if (result.length !== 2) {\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);\n }\n\n const x = Number.parseFloat(result[0]);\n const y = Number.parseFloat(result[1]);\n\n if (isNaN(x) || isNaN(y))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 2D value was expected.`);\n\n return { x, y };\n }\n\n private getPoint3DPropertyValue(propValue: string, propName: string): any {\n const result = propValue.split(\",\");\n if (result.length !== 3) {\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);\n }\n\n const x = Number.parseFloat(result[0]);\n const y = Number.parseFloat(result[1]);\n const z = Number.parseFloat(result[2]);\n\n if (isNaN(x) || isNaN(y) || isNaN(z))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `Property '${propName}' has an invalid property value. A Point 3D value was expected.`);\n\n return { x, y, z };\n }\n\n private isSchemaFullNameValidForVersion(schemaFullName: string, ecSpecVersion: ECSpecVersion) {\n const schemaNameParts = schemaFullName.split(\".\");\n\n if ((ecSpecVersion.readVersion >= 3 && ecSpecVersion.writeVersion >= 2) || ecSpecVersion.readVersion > 3) {\n if (schemaNameParts.length < 4)\n return false;\n } else {\n if (schemaNameParts.length < 3)\n return false;\n }\n return true;\n }\n\n public static parseXmlNamespace(xmlNamespace: string): ECSpecVersion | undefined {\n const regEx = new RegExp(`^${ECXML_URI}\\\\.([0-9]+)\\\\.([0-9]+)$`);\n const match = xmlNamespace.match(regEx);\n if (!match)\n return;\n\n const readVersion = parseInt(match[1], 10);\n const writeVersion = parseInt(match[2], 10);\n return { readVersion, writeVersion };\n }\n\n private getQualifiedTypeName(rawTypeName: string): string {\n const nameParts = rawTypeName.split(\":\");\n if (nameParts.length !== 2)\n return `${this._schemaName}.${rawTypeName}`;\n\n if (nameParts[0].toLowerCase() === this._schemaAlias.toLowerCase())\n return `${this._schemaName}.${nameParts[1]}`;\n if (this._schemaReferenceNames.has(nameParts[0].toLowerCase()))\n return `${this._schemaReferenceNames.get(nameParts[0].toLowerCase())}.${nameParts[1]}`;\n\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaXML, `No valid schema found for alias ${nameParts[0]}`);\n }\n\n /** The rest of the API uses the full name format of `{SchemaName}.{SchemaItemName}`,\n * meaning all of the references in the format string need to be changed.\n */\n private getQualifiedPresentationUnits(presentationUnits: string[]): string[] {\n const res: string[] = [];\n for (const presentationUnit of presentationUnits) {\n // we split the presentation unit by square parantheses [ ], f:DefaultReal(6)[u:FT|feet] will be splitted into f:DefaultReal(6) and u:FT|feet\n // we format the first one and the next one will be put into [ ] again\n const presentationUnitFormats = presentationUnit.split(/[\\[\\]]/g);\n let qualifiedPresentation: string = \"\";\n qualifiedPresentation = this.getQualifiedTypeName(presentationUnitFormats[0]);\n if (presentationUnitFormats.length > 1) {\n for (let i = 1; i < presentationUnitFormats.length; ++i) {\n if (presentationUnitFormats[i].length === 0)\n continue;\n const verticalSlashIdx = presentationUnitFormats[i].indexOf(\"|\");\n const overrideFormat = this.getQualifiedTypeName(presentationUnitFormats[i].slice(0, verticalSlashIdx));\n const formatLabel = presentationUnitFormats[i].slice(verticalSlashIdx);\n qualifiedPresentation += `[${overrideFormat}${formatLabel}]`;\n }\n }\n\n res.push(qualifiedPresentation);\n }\n\n return res;\n }\n}\n"]}
@@ -0,0 +1,60 @@
1
+ import { ClassProps, CustomAttributeClassProps, MixinProps, RelationshipClassProps } from "../Deserialization/JsonProps";
2
+ import { SchemaItemParser } from "./SchemaItemParsers";
3
+ /**
4
+ * Parses ClassProps JSON returned from an ECSql query and returns the correct ClassProps JSON.
5
+ * This is necessary as a small amount information (ie. CustomAttribute data) returned from the
6
+ * iModelDb is in a different format than is required for a ClassProps JSON object.
7
+ * @internal
8
+ */
9
+ export declare class ClassParser extends SchemaItemParser {
10
+ /**
11
+ * Parses the given ClassProps JSON returned from an ECSql query.
12
+ * @param data The ClassProps JSON as returned from an iModelDb.
13
+ * @returns The corrected ClassProps Json.
14
+ */
15
+ parse(data: ClassProps): Promise<ClassProps>;
16
+ private parseProperties;
17
+ }
18
+ /**
19
+ * Parses the given MixinProps JSON returned from an ECSql query.
20
+ * @param data The MixinProps JSON as returned from an iModelDb.
21
+ * @returns The corrected MixinProps Json.
22
+ * @internal
23
+ */
24
+ export declare class MixinParser extends ClassParser {
25
+ /**
26
+ * Parses the given MixinProps JSON returned from an ECSql query.
27
+ * @param data The MixinProps JSON as returned from an iModelDb.
28
+ * @returns The corrected MixinProps Json.
29
+ */
30
+ parse(data: MixinProps): Promise<MixinProps>;
31
+ }
32
+ /**
33
+ * Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
34
+ * @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
35
+ * @returns The corrected CustomAttributeClassProps Json.
36
+ * @internal
37
+ */
38
+ export declare class CustomAttributeClassParser extends ClassParser {
39
+ /**
40
+ * Parses the given CustomAttributeClassProps JSON returned from an ECSql query.
41
+ * @param data The CustomAttributeClassProps JSON as returned from an iModelDb.
42
+ * @returns The corrected CustomAttributeClassProps Json.
43
+ */
44
+ parse(data: CustomAttributeClassProps): Promise<CustomAttributeClassProps>;
45
+ }
46
+ /**
47
+ * Parses the given RelationshipClassProps JSON returned from an ECSql query.
48
+ * @param data The RelationshipClassProps JSON as returned from an iModelDb.
49
+ * @returns The corrected RelationshipClassProps Json.
50
+ * @internal
51
+ */
52
+ export declare class RelationshipClassParser extends ClassParser {
53
+ /**
54
+ * Parses the given RelationshipClassProps JSON returned from an ECSql query.
55
+ * @param data The RelationshipClassProps JSON as returned from an iModelDb.
56
+ * @returns The corrected RelationshipClassProps Json.
57
+ */
58
+ parse(data: RelationshipClassProps): Promise<RelationshipClassProps>;
59
+ }
60
+ //# sourceMappingURL=ClassParsers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClassParsers.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/ClassParsers.ts"],"names":[],"mappings":"AAKA,OAAO,EAAoB,UAAU,EAAE,yBAAyB,EAAE,UAAU,EAAE,sBAAsB,EAA+B,MAAM,8BAA8B,CAAC;AAExK,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAWvD;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,gBAAgB;IAC/C;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAYlE,OAAO,CAAC,eAAe;CAOxB;AAMD;;;;;GAKG;AACH,qBAAa,WAAY,SAAQ,WAAW;IAC1C;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;CAOnE;AAMD;;;;;GAKG;AACH,qBAAa,0BAA2B,SAAQ,WAAW;IACzD;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,yBAAyB,CAAC;CAKjG;AAMD;;;;;GAKG;AACH,qBAAa,uBAAwB,SAAQ,WAAW;IACtD;;;;OAIG;IACmB,KAAK,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,sBAAsB,CAAC;CAmB3F"}