@itwin/ecschema-metadata 5.9.0-dev.15 → 5.9.0-dev.16
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.
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPartVisitor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Aa;oBAC7B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAkB,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,0BAAc,CAAC,UAAU;gBAC5B,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB;oBACnC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAwB,CAAC,CAAC;gBAC9D,MAAM;QACV,CAAC;IACH,CAAC;CACF;AA3MD,8DA2MC","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 { SchemaItemType } from \"./ECObjects\";\nimport { AnyClass, AnyECType } from \"./Interfaces\";\nimport { ECClass, StructClass } from \"./Metadata/Class\";\nimport { Constant } from \"./Metadata/Constant\";\nimport { CustomAttributeContainerProps } from \"./Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nimport { EntityClass } from \"./Metadata/EntityClass\";\nimport { Enumeration } from \"./Metadata/Enumeration\";\nimport { Format } from \"./Metadata/Format\";\nimport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nimport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nimport { Mixin } from \"./Metadata/Mixin\";\nimport { Phenomenon } from \"./Metadata/Phenomenon\";\nimport { AnyProperty, Property } from \"./Metadata/Property\";\nimport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nimport { RelationshipClass, RelationshipConstraint } from \"./Metadata/RelationshipClass\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\nimport { Unit } from \"./Metadata/Unit\";\nimport { UnitSystem } from \"./Metadata/UnitSystem\";\n\n/**\n * Interface to allow schema traversal/deserialization workflows to visit\n * each part, item, class, etc. that exists in a given schema.\n * @public @preview\n */\nexport interface ISchemaPartVisitor {\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n /* async */ visitEmptySchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n visitEmptySchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n /* async */ visitFullSchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n visitFullSchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n /* async */ visitSchemaItem?: (schemaItem: SchemaItem) => Promise<void>;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n visitSchemaItemSync?: (schemaItem: SchemaItem) => void;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n /* async */ visitClass?: (ecClass: AnyClass) => Promise<void>;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n visitClassSync?: (ecClass: AnyClass) => void;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n /* async */ visitProperty?: (property: AnyProperty) => Promise<void>;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n visitPropertySync?: (property: AnyProperty) => void;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n /* async */ visitEntityClass?: (entityClass: EntityClass) => Promise<void>;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n visitEntityClassSync?: (entityClass: EntityClass) => void;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n /* async */ visitStructClass?: (structClass: StructClass) => Promise<void>;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n visitStructClassSync?: (structClass: StructClass) => void;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n /* async */ visitMixin?: (mixin: Mixin) => Promise<void>;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n visitMixinSync?: (mixin: Mixin) => void;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n /* async */ visitRelationshipClass?: (relationshipClass: RelationshipClass) => Promise<void>;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n visitRelationshipClassSync?: (relationshipClass: RelationshipClass) => void;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n /* async */ visitRelationshipConstraint?: (relationshipConstraint: RelationshipConstraint) => Promise<void>;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n visitRelationshipConstraintSync?: (relationshipConstraint: RelationshipConstraint) => void;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n /* async */ visitCustomAttributeClass?: (customAttributeClass: CustomAttributeClass) => Promise<void>;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n visitCustomAttributeClassSync?: (customAttributeClass: CustomAttributeClass) => void;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n /* async */ visitCustomAttributeContainer?: (customAttributeContainer: CustomAttributeContainerProps) => Promise<void>;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n visitCustomAttributeContainerSync?: (customAttributeContainer: CustomAttributeContainerProps) => void;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n /* async */ visitEnumeration?: (enumeration: Enumeration) => Promise<void>;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n visitEnumerationSync?: (enumeration: Enumeration) => void;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n /* async */ visitKindOfQuantity?: (koq: KindOfQuantity) => Promise<void>;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n visitKindOfQuantitySync?: (koq: KindOfQuantity) => void;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n /* async */ visitPropertyCategory?: (category: PropertyCategory) => Promise<void>;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n visitPropertyCategorySync?: (category: PropertyCategory) => void;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n /* async */ visitFormat?: (format: Format) => Promise<void>;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n visitFormatSync?: (format: Format) => void;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n /* async */ visitUnit?: (unit: Unit) => Promise<void>;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n visitUnitSync?: (unit: Unit) => void;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n /* async */ visitInvertedUnit?: (invertedUnit: InvertedUnit) => Promise<void>;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n visitInvertedUnitSync?: (invertedUnit: InvertedUnit) => void;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n /* async */ visitUnitSystem?: (unitSystem: UnitSystem) => Promise<void>;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n visitUnitSystemSync?: (unitSystem: UnitSystem) => void;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n /* async */ visitPhenomenon?: (phenomena: Phenomenon) => Promise<void>;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n visitPhenomenonSync?: (phenomena: Phenomenon) => void;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n /* async */ visitConstant?: (constant: Constant) => Promise<void>;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n visitConstantSync?: (constant: Constant) => void;\n}\n\nfunction isCustomAttributeContainer(object: any): object is CustomAttributeContainerProps {\n return \"customAttributes\" in object;\n}\n\n/**\n * A helper class to call methods on the provided [[ISchemaPartVisitor]].\n * @public @preview\n */\nexport class SchemaPartVisitorDelegate {\n private _visitor: ISchemaPartVisitor;\n\n constructor(visitor: ISchemaPartVisitor) {\n this._visitor = visitor;\n }\n\n /**\n * Calls (async) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public async visitSchema(schema: Schema, fullSchema: boolean = true): Promise<void> {\n if (!fullSchema && this._visitor.visitEmptySchema)\n await this._visitor.visitEmptySchema(schema);\n\n if (fullSchema && this._visitor.visitFullSchema)\n await this._visitor.visitFullSchema(schema);\n }\n\n /**\n * Calls (synchronously) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public visitSchemaSync(schema: Schema, fullSchema: boolean = true): void {\n if (!fullSchema && this._visitor.visitEmptySchemaSync)\n this._visitor.visitEmptySchemaSync(schema);\n\n if (fullSchema && this._visitor.visitFullSchemaSync)\n this._visitor.visitFullSchemaSync(schema);\n }\n\n /**\n * Calls (async) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public async visitSchemaPart(schemaPart: AnyECType): Promise<void> {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n await this.visitSchemaItem(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitProperty) {\n await this._visitor.visitProperty(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraint) {\n await this._visitor.visitRelationshipConstraint(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainer) {\n await this._visitor.visitCustomAttributeContainer(schemaPart);\n }\n }\n\n /**\n * Calls (synchronously) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public visitSchemaPartSync(schemaPart: AnyECType): void {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n this.visitSchemaItemSync(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitPropertySync) {\n this._visitor.visitPropertySync(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraintSync) {\n this._visitor.visitRelationshipConstraintSync(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainerSync)\n this._visitor.visitCustomAttributeContainerSync(schemaPart);\n }\n\n private async visitSchemaItem(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItem)\n await this._visitor.visitSchemaItem(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClass)\n await this._visitor.visitClass(schemaItem as AnyClass);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstant)\n await this._visitor.visitConstant(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClass)\n await this._visitor.visitCustomAttributeClass(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClass)\n await this._visitor.visitEntityClass(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumeration)\n await this._visitor.visitEnumeration(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormat)\n await this._visitor.visitFormat(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnit)\n await this._visitor.visitInvertedUnit(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantity)\n await this._visitor.visitKindOfQuantity(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixin)\n await this._visitor.visitMixin(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenon)\n await this._visitor.visitPhenomenon(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategory)\n await this._visitor.visitPropertyCategory(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClass)\n await this._visitor.visitRelationshipClass(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClass)\n await this._visitor.visitStructClass(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnit)\n await this._visitor.visitUnit(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystem)\n await this._visitor.visitUnitSystem(schemaItem as UnitSystem);\n break;\n }\n }\n\n private visitSchemaItemSync(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItemSync)\n this._visitor.visitSchemaItemSync(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClassSync)\n this._visitor.visitClassSync(schemaItem as AnyClass);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstantSync)\n this._visitor.visitConstantSync(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClassSync)\n this._visitor.visitCustomAttributeClassSync(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClassSync)\n this._visitor.visitEntityClassSync(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumerationSync)\n this._visitor.visitEnumerationSync(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormatSync)\n this._visitor.visitFormatSync(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnitSync)\n this._visitor.visitInvertedUnitSync(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantitySync)\n this._visitor.visitKindOfQuantitySync(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixinSync)\n this._visitor.visitMixinSync(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenonSync)\n this._visitor.visitPhenomenonSync(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategorySync)\n this._visitor.visitPropertyCategorySync(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClassSync)\n this._visitor.visitRelationshipClassSync(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClassSync)\n this._visitor.visitStructClassSync(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnitSync)\n this._visitor.visitUnitSync(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystemSync)\n this._visitor.visitUnitSystemSync(schemaItem as UnitSystem);\n break;\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C,IAAI;gBACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa;oBAC7B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAkB,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,0BAAc,CAAC,UAAU;gBAC5B,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB;oBACnC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM;QACV,CAAC;IACH,CAAC;CACF;AA3MD,8DA2MC","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 { SchemaItemType } from \"./ECObjects\";\nimport { AnyClass, AnyECType } from \"./Interfaces\";\nimport { ECClass, StructClass } from \"./Metadata/Class\";\nimport { Constant } from \"./Metadata/Constant\";\nimport { CustomAttributeContainerProps } from \"./Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nimport { EntityClass } from \"./Metadata/EntityClass\";\nimport { Enumeration } from \"./Metadata/Enumeration\";\nimport { Format } from \"./Metadata/Format\";\nimport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nimport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nimport { Mixin } from \"./Metadata/Mixin\";\nimport { Phenomenon } from \"./Metadata/Phenomenon\";\nimport { AnyProperty, Property } from \"./Metadata/Property\";\nimport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nimport { RelationshipClass, RelationshipConstraint } from \"./Metadata/RelationshipClass\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\nimport { Unit } from \"./Metadata/Unit\";\nimport { UnitSystem } from \"./Metadata/UnitSystem\";\n\n/**\n * Interface to allow schema traversal/deserialization workflows to visit\n * each part, item, class, etc. that exists in a given schema.\n * @public @preview\n */\nexport interface ISchemaPartVisitor {\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n /* async */ visitEmptySchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n visitEmptySchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n /* async */ visitFullSchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n visitFullSchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n /* async */ visitSchemaItem?: (schemaItem: SchemaItem) => Promise<void>;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n visitSchemaItemSync?: (schemaItem: SchemaItem) => void;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n /* async */ visitClass?: (ecClass: AnyClass) => Promise<void>;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n visitClassSync?: (ecClass: AnyClass) => void;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n /* async */ visitProperty?: (property: AnyProperty) => Promise<void>;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n visitPropertySync?: (property: AnyProperty) => void;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n /* async */ visitEntityClass?: (entityClass: EntityClass) => Promise<void>;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n visitEntityClassSync?: (entityClass: EntityClass) => void;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n /* async */ visitStructClass?: (structClass: StructClass) => Promise<void>;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n visitStructClassSync?: (structClass: StructClass) => void;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n /* async */ visitMixin?: (mixin: Mixin) => Promise<void>;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n visitMixinSync?: (mixin: Mixin) => void;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n /* async */ visitRelationshipClass?: (relationshipClass: RelationshipClass) => Promise<void>;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n visitRelationshipClassSync?: (relationshipClass: RelationshipClass) => void;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n /* async */ visitRelationshipConstraint?: (relationshipConstraint: RelationshipConstraint) => Promise<void>;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n visitRelationshipConstraintSync?: (relationshipConstraint: RelationshipConstraint) => void;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n /* async */ visitCustomAttributeClass?: (customAttributeClass: CustomAttributeClass) => Promise<void>;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n visitCustomAttributeClassSync?: (customAttributeClass: CustomAttributeClass) => void;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n /* async */ visitCustomAttributeContainer?: (customAttributeContainer: CustomAttributeContainerProps) => Promise<void>;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n visitCustomAttributeContainerSync?: (customAttributeContainer: CustomAttributeContainerProps) => void;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n /* async */ visitEnumeration?: (enumeration: Enumeration) => Promise<void>;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n visitEnumerationSync?: (enumeration: Enumeration) => void;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n /* async */ visitKindOfQuantity?: (koq: KindOfQuantity) => Promise<void>;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n visitKindOfQuantitySync?: (koq: KindOfQuantity) => void;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n /* async */ visitPropertyCategory?: (category: PropertyCategory) => Promise<void>;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n visitPropertyCategorySync?: (category: PropertyCategory) => void;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n /* async */ visitFormat?: (format: Format) => Promise<void>;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n visitFormatSync?: (format: Format) => void;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n /* async */ visitUnit?: (unit: Unit) => Promise<void>;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n visitUnitSync?: (unit: Unit) => void;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n /* async */ visitInvertedUnit?: (invertedUnit: InvertedUnit) => Promise<void>;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n visitInvertedUnitSync?: (invertedUnit: InvertedUnit) => void;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n /* async */ visitUnitSystem?: (unitSystem: UnitSystem) => Promise<void>;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n visitUnitSystemSync?: (unitSystem: UnitSystem) => void;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n /* async */ visitPhenomenon?: (phenomena: Phenomenon) => Promise<void>;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n visitPhenomenonSync?: (phenomena: Phenomenon) => void;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n /* async */ visitConstant?: (constant: Constant) => Promise<void>;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n visitConstantSync?: (constant: Constant) => void;\n}\n\nfunction isCustomAttributeContainer(object: any): object is CustomAttributeContainerProps {\n return \"customAttributes\" in object;\n}\n\n/**\n * A helper class to call methods on the provided [[ISchemaPartVisitor]].\n * @public @preview\n */\nexport class SchemaPartVisitorDelegate {\n private _visitor: ISchemaPartVisitor;\n\n constructor(visitor: ISchemaPartVisitor) {\n this._visitor = visitor;\n }\n\n /**\n * Calls (async) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public async visitSchema(schema: Schema, fullSchema: boolean = true): Promise<void> {\n if (!fullSchema && this._visitor.visitEmptySchema)\n await this._visitor.visitEmptySchema(schema);\n\n if (fullSchema && this._visitor.visitFullSchema)\n await this._visitor.visitFullSchema(schema);\n }\n\n /**\n * Calls (synchronously) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public visitSchemaSync(schema: Schema, fullSchema: boolean = true): void {\n if (!fullSchema && this._visitor.visitEmptySchemaSync)\n this._visitor.visitEmptySchemaSync(schema);\n\n if (fullSchema && this._visitor.visitFullSchemaSync)\n this._visitor.visitFullSchemaSync(schema);\n }\n\n /**\n * Calls (async) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public async visitSchemaPart(schemaPart: AnyECType): Promise<void> {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n await this.visitSchemaItem(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitProperty) {\n await this._visitor.visitProperty(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraint) {\n await this._visitor.visitRelationshipConstraint(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainer) {\n await this._visitor.visitCustomAttributeContainer(schemaPart);\n }\n }\n\n /**\n * Calls (synchronously) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public visitSchemaPartSync(schemaPart: AnyECType): void {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n this.visitSchemaItemSync(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitPropertySync) {\n this._visitor.visitPropertySync(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraintSync) {\n this._visitor.visitRelationshipConstraintSync(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainerSync)\n this._visitor.visitCustomAttributeContainerSync(schemaPart);\n }\n\n private async visitSchemaItem(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItem)\n await this._visitor.visitSchemaItem(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClass)\n await this._visitor.visitClass(schemaItem);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstant)\n await this._visitor.visitConstant(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClass)\n await this._visitor.visitCustomAttributeClass(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClass)\n await this._visitor.visitEntityClass(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumeration)\n await this._visitor.visitEnumeration(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormat)\n await this._visitor.visitFormat(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnit)\n await this._visitor.visitInvertedUnit(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantity)\n await this._visitor.visitKindOfQuantity(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixin)\n await this._visitor.visitMixin(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenon)\n await this._visitor.visitPhenomenon(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategory)\n await this._visitor.visitPropertyCategory(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClass)\n await this._visitor.visitRelationshipClass(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClass)\n await this._visitor.visitStructClass(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnit)\n await this._visitor.visitUnit(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystem)\n await this._visitor.visitUnitSystem(schemaItem);\n break;\n }\n }\n\n private visitSchemaItemSync(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItemSync)\n this._visitor.visitSchemaItemSync(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClassSync)\n this._visitor.visitClassSync(schemaItem);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstantSync)\n this._visitor.visitConstantSync(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClassSync)\n this._visitor.visitCustomAttributeClassSync(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClassSync)\n this._visitor.visitEntityClassSync(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumerationSync)\n this._visitor.visitEnumerationSync(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormatSync)\n this._visitor.visitFormatSync(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnitSync)\n this._visitor.visitInvertedUnitSync(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantitySync)\n this._visitor.visitKindOfQuantitySync(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixinSync)\n this._visitor.visitMixinSync(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenonSync)\n this._visitor.visitPhenomenonSync(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategorySync)\n this._visitor.visitPropertyCategorySync(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClassSync)\n this._visitor.visitRelationshipClassSync(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClassSync)\n this._visitor.visitStructClassSync(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnitSync)\n this._visitor.visitUnitSync(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystemSync)\n this._visitor.visitUnitSystemS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aAAa,EAAE,wBAAwB,IAAI,kEAAkE,CAAC,CAAC;gBACxJ,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,QAAQ;oBAC1C,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,wBAAwB,IAAI,wFAAwF,CAAC,CAAC;gBAE9K,MAAM,QAAQ,GAAG,CAAC,QAA8B,EAAE,EAAE;oBAClD,OAAO,QAA2B,CAAC;gBACrC,CAAC,CAAC;gBAEF,MAAM,OAAO,GAAoB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBAChE,MAAM,OAAO,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC;CACF","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 { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { ECName } from \"../ECName\";\nimport { AbstractParser, CAProviderTuple } from \"./AbstractParser\";\nimport {\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps, PrimitivePropertyProps,\n PropertyCategoryProps, PropertyProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps,\n StructPropertyProps, UnitSystemProps,\n} from \"./JsonProps\";\nimport { ECSpecVersion, SchemaReadHelper } from \"./Helper\";\n\ninterface UnknownObject { readonly [name: string]: unknown }\nfunction isObject(x: unknown): x is UnknownObject {\n return typeof (x) === \"object\";\n}\n\nconst SCHEMAURL_JSON = \"https://dev\\\\.bentley\\\\.com/json_schemas/ec\";\n\n/** @internal */\nexport class JsonParser extends AbstractParser<UnknownObject> {\n private _rawSchema: UnknownObject;\n private _schemaName?: string;\n private _currentItemFullName?: string;\n\n constructor(rawSchema: Readonly<unknown>) {\n super();\n\n if (!isObject(rawSchema))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Invalid JSON object.`);\n\n this._rawSchema = rawSchema;\n this._schemaName = rawSchema.name as string | undefined;\n this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema as string);\n }\n\n public get getECSpecVersion(): ECSpecVersion | undefined { return this._ecSpecVersion; }\n\n public static parseJSUri(uri: string): ECSpecVersion | undefined {\n if (uri === undefined)\n return undefined;\n\n const match = uri.match(`^${SCHEMAURL_JSON}/([0-9]+)/ecschema$`);\n if (!match)\n return;\n\n const readVersion = parseInt(match[1][0], 10);\n const writeVersion = parseInt(match[1][1], 10);\n return { readVersion, writeVersion };\n }\n\n /**\n * Type checks Schema and returns SchemaProps interface\n * @param this._rawSchema\n * @returns SchemaProps\n */\n public parseSchema(): SchemaProps {\n if (undefined === this._rawSchema.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);\n if (typeof (this._rawSchema.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined === this._rawSchema.$schema)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);\n if (typeof (this._rawSchema.$schema) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);\n\n if (undefined === this._rawSchema.version)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);\n if (typeof (this._rawSchema.version) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);\n\n if (undefined !== this._rawSchema.alias) {\n if (typeof (this._rawSchema.alias) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== this._rawSchema.label) {\n if (typeof (this._rawSchema.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== this._rawSchema.description) {\n if (typeof (this._rawSchema.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);\n }\n\n const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);\n\n return {\n ...this._rawSchema,\n ecSpecMajorVersion: ecVersions?.readVersion,\n ecSpecMinorVersion: ecVersions?.writeVersion,\n } as SchemaProps;\n }\n\n public *getReferences(): Iterable<SchemaReferenceProps> {\n if (undefined !== this._rawSchema.references) {\n if (!Array.isArray(this._rawSchema.references))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${String(this._rawSchema.name)} has an invalid 'references' attribute. It should be of type 'object[]'.`);\n\n for (const ref of this._rawSchema.references) {\n yield this.checkSchemaReference(ref);\n }\n }\n }\n\n private checkSchemaReference(jsonObj: Readonly<unknown>): SchemaReferenceProps {\n if (!isObject(jsonObj))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);\n if (undefined === jsonObj.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);\n if (typeof (jsonObj.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'name' attribute. It should be of type 'string'.`);\n if (undefined === jsonObj.version)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);\n if (typeof (jsonObj.version) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'version' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as SchemaReferenceProps;\n }\n\n public *getItems(): Iterable<[string, string, UnknownObject]> {\n const items = this._rawSchema.items;\n if (undefined !== items) {\n if (!isObject(items) || Array.isArray(items))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\n\n // eslint-disable-next-line guard-for-in\n for (const itemName in items) {\n const item = items[itemName];\n if (!isObject(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\n\n if (undefined === item.schemaItemType)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\n if (typeof (item.schemaItemType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n yield [itemName, item.schemaItemType, item];\n }\n }\n }\n\n public findItem(itemName: string): [string, string, UnknownObject] | undefined {\n const items = this._rawSchema.items;\n if (undefined !== items) {\n if (!isObject(items) || Array.isArray(items))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\n\n const item = items[itemName];\n if (undefined !== item) {\n if (!isObject(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\n\n if (undefined === item.schemaItemType)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\n if (typeof (item.schemaItemType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return [itemName, item.schemaItemType, item];\n }\n }\n\n return undefined;\n }\n\n /**\n * Type checks all Schema Item attributes.\n * @param jsonObj The JSON object to check if it represents a Schema Item.\n */\n private checkSchemaItemProps(jsonObj: UnknownObject): void {\n if (undefined !== jsonObj.description) {\n if (typeof (jsonObj.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== jsonObj.label) {\n if (typeof (jsonObj.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n }\n\n public *getProperties(jsonObj: UnknownObject, itemName: string): Iterable<[string, string, UnknownObject]> {\n const properties = jsonObj.properties;\n if (undefined !== properties) {\n if (!Array.isArray(properties))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);\n\n for (const property of properties as unknown[]) {\n if (!isObject(property))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);\n\n if (undefined === property.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);\n if (typeof (property.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined === property.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);\n if (typeof (property.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);\n if (!this.isValidPropertyType(property.type)) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n return;\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);\n }\n\n yield [property.name, property.type, property];\n }\n }\n }\n\n /**\n * Type checks Class and returns ClassProps interface\n * @param jsonObj The JSON object to check if it represents a Class.\n */\n private checkClassProps(jsonObj: UnknownObject): void {\n this.checkSchemaItemProps(jsonObj);\n\n if (undefined !== jsonObj.modifier) {\n if (typeof (jsonObj.modifier) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== jsonObj.baseClass) {\n if (typeof (jsonObj.baseClass) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);\n }\n if (undefined !== jsonObj.customAttributes) {\n if (!Array.isArray(jsonObj.customAttributes)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n }\n }\n }\n\n /**\n * Type checks entity class and returns EntityClassProps interface\n * @param jsonObj\n * @returns EntityClassProps\n */\n public parseEntityClass(jsonObj: UnknownObject): EntityClassProps {\n this.checkClassProps(jsonObj);\n\n if (undefined !== jsonObj.mixins) {\n if (!Array.isArray(jsonObj.mixins))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\n for (const mixinName of jsonObj.mixins) {\n if (typeof (mixinName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\n }\n }\n\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as EntityClassProps;\n }\n\n /**\n * Type checks mixin and returns MixinProps interface\n * @param jsonObj\n * @returns MixinProps\n */\n public parseMixin(jsonObj: UnknownObject): MixinProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n if (typeof (jsonObj.appliesTo) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as MixinProps;\n }\n\n /**\n * Type checks custom attribute class and returns CustomAttributeClassProps interface\n * @param jsonObj\n * @returns CustomAttributeClassProps\n */\n public parseCustomAttributeClass(jsonObj: UnknownObject): CustomAttributeClassProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n if (typeof (jsonObj.appliesTo) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as CustomAttributeClassProps;\n }\n\n public parseStructClass(jsonObj: UnknownObject): StructClassProps {\n this.checkClassProps(jsonObj);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as StructClassProps;\n }\n\n public parseUnitSystem(jsonObj: UnknownObject): UnitSystemProps {\n this.checkSchemaItemProps(jsonObj);\n return jsonObj as UnitSystemProps;\n }\n\n /**\n * Type checks Relationship Class and returns RelationshipClassProps interface\n * @param jsonObj\n * @returns RelationshipClassProps\n */\n public parseRelationshipClass(jsonObj: UnknownObject): RelationshipClassProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.strength)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);\n if (typeof (jsonObj.strength) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.strengthDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);\n if (typeof (jsonObj.strengthDirection) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.source)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);\n if (!isObject(jsonObj.source))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);\n this.checkRelationshipConstraintProps(jsonObj.source, true);\n\n if (undefined === jsonObj.target)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);\n if (!isObject(jsonObj.target))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);\n this.checkRelationshipConstraintProps(jsonObj.target, false);\n\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as RelationshipClassProps;\n }\n\n /**\n * Type checks Relationship Constraint and returns RelationshipConstraintProps interface.\n * @param jsonObj\n * @param isSource For sake of error message, is this relationship constraint a source or target\n * @returns RelationshipConstraintProps\n */\n private checkRelationshipConstraintProps(jsonObj: UnknownObject, isSource: boolean): void {\n const constraintName = `${(isSource) ? \"Source\" : \"Target\"} Constraint of ${this._currentItemFullName}`; // most specific name to call RelationshipConstraint\n\n if (undefined === jsonObj.multiplicity)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);\n if (typeof (jsonObj.multiplicity) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.roleLabel)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);\n if (typeof (jsonObj.roleLabel) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.polymorphic)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);\n if (typeof (jsonObj.polymorphic) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.abstractConstraint && typeof (jsonObj.abstractConstraint) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.constraintClasses)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);\n if (!Array.isArray(jsonObj.constraintClasses))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\n\n for (const constraintClassName of jsonObj.constraintClasses) {\n if (typeof (constraintClassName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\n }\n\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n }\n\n /**\n * Type checks Enumeration and returns EnumerationProps interface\n * @param jsonObj\n * @returns EnumerationProps\n */\n public parseEnumeration(jsonObj: UnknownObject): EnumerationProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);\n if (typeof (jsonObj.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\n\n const isValidEnumerationType = (type: string): boolean => {\n type = type.toLowerCase();\n return (type === \"int\") ||\n (type === \"integer\") ||\n (type === \"string\");\n };\n if (!isValidEnumerationType(jsonObj.type)) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n (jsonObj as any).type = \"string\";\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either \"int\" or \"string\".`);\n }\n\n if (undefined !== jsonObj.isStrict) { // TODO: make required\n if (typeof (jsonObj.isStrict) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);\n }\n\n if (undefined === jsonObj.enumerators)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);\n if (!Array.isArray(jsonObj.enumerators))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\n\n for (const enumerator of jsonObj.enumerators) {\n if (!isObject(enumerator))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\n\n if (undefined === enumerator.value)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);\n\n // TODO: Should this really be handled here?\n const expectedType = jsonObj.type;\n const receivedType = (typeof (enumerator.value) === \"number\") ? \"int\" : typeof (enumerator.value);\n if (!expectedType.includes(receivedType)) // is receivedType a substring of expectedType? - easiest way to check \"int\" === \"int\" | \"integer\" && \"string\" === \"string\"\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be \"${expectedType}\", not \"${receivedType}\".`);\n\n if (undefined === enumerator.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);\n if (typeof (enumerator.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined !== enumerator.label) {\n if (typeof (enumerator.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== enumerator.description) {\n if (typeof (enumerator.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);\n }\n }\n\n return (jsonObj as unknown) as EnumerationProps;\n }\n\n /**\n * Type checks KindOfQuantity and returns KindOfQuantityProps interface\n * @param jsonObj\n * @returns KindOfQuantityProps\n */\n public parseKindOfQuantity(jsonObj: UnknownObject): KindOfQuantityProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.relativeError)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);\n if (typeof (jsonObj.relativeError) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.presentationUnits) {\n if (!Array.isArray(jsonObj.presentationUnits) && typeof (jsonObj.presentationUnits) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);\n }\n\n if (undefined === jsonObj.persistenceUnit)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);\n if (typeof (jsonObj.persistenceUnit) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as KindOfQuantityProps;\n }\n\n /**\n * Type checks Property Category and returns PropertyCategoryProps interface\n * @param jsonObj\n * @returns PropertyCategoryProps\n */\n public parsePropertyCategory(jsonObj: UnknownObject): PropertyCategoryProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined !== jsonObj.priority) { // TODO: make required\n if (typeof (jsonObj.priority) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);\n }\n\n return (jsonObj as unknown) as PropertyCategoryProps;\n }\n\n /**\n * Type checks unit and returns UnitProps interface\n * @param jsonObj\n * @returns UnitProps\n */\n public parseUnit(jsonObj: UnknownObject): SchemaItemUnitProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.phenomenon)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\n if (typeof (jsonObj.phenomenon) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.unitSystem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\n if (typeof (jsonObj.unitSystem) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.numerator) {\n if (typeof (jsonObj.numerator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.denominator) {\n if (typeof (jsonObj.denominator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.offset) {\n if (typeof (jsonObj.offset) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);\n }\n return (jsonObj as unknown) as SchemaItemUnitProps;\n }\n\n /**\n * Type checks inverted unit and returns InvertedUnitProps interface\n * @param jsonObj\n * @returns InvertedUnitProps\n */\n public parseInvertedUnit(jsonObj: UnknownObject): InvertedUnitProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.invertsUnit)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);\n if (typeof (jsonObj.invertsUnit) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.unitSystem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\n if (typeof (jsonObj.unitSystem) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as InvertedUnitProps;\n }\n\n /**\n * Type checks constant and returns ConstantProps interface\n * @param jsonObj\n * @returns ConstantProps\n */\n public parseConstant(jsonObj: UnknownObject): ConstantProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.phenomenon)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\n if (typeof (jsonObj.phenomenon) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.numerator) {\n if (typeof (jsonObj.numerator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.denominator) {\n if (typeof (jsonObj.denominator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\n }\n\n return (jsonObj as unknown) as ConstantProps;\n }\n\n /**\n * Type checks phenomenon and returns PhenomenonProps interface\n * @param jsonObj\n * @returns PhenomenonProps\n */\n public parsePhenomenon(jsonObj: UnknownObject): PhenomenonProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as PhenomenonProps;\n }\n\n /**\n * Type checks format and returns SchemaItemFormatProps interface\n * @param jsonObj\n * @returns SchemaItemFormatProps\n */\n public parseFormat(jsonObj: UnknownObject): SchemaItemFormatProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);\n if (typeof (jsonObj.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.precision && typeof (jsonObj.precision) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.roundFactor && typeof (jsonObj.roundFactor) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.minWidth && typeof (jsonObj.minWidth) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.showSignOption && typeof (jsonObj.showSignOption) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.formatTraits) {\n if (!Array.isArray(jsonObj.formatTraits) && typeof (jsonObj.formatTraits) !== \"string\") // must be either an array of strings or a string\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);\n }\n\n if (undefined !== jsonObj.decimalSeparator && typeof (jsonObj.decimalSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.thousandSeparator && typeof (jsonObj.thousandSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.uomSeparator && typeof (jsonObj.uomSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioType && typeof (jsonObj.ratioType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioType' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioSeparator && typeof (jsonObj.ratioSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioFormatType && typeof (jsonObj.ratioFormatType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioFormatType' attribute. It should be of type 'string'.`);\n\n // Validate EC version if ratio properties exist - they require EC version 3.3+\n if (jsonObj.ratioType !== undefined || jsonObj.ratioSeparator !== undefined || jsonObj.ratioFormatType !== undefined) {\n if (this._ecSpecVersion === undefined || this._ecSpecVersion.readVersion < 3 || (this._ecSpecVersion.readVersion === 3 && this._ecSpecVersion.writeVersion < 3)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has ratio properties that require EC version 3.3 or newer.`);\n }\n }\n\n if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.composite) { // optional\n if (!isObject(jsonObj.composite))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);\n if (undefined !== jsonObj.composite.includeZero && typeof (jsonObj.composite.includeZero) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.composite.spacer && typeof (jsonObj.composite.spacer) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);\n\n // if composite is defined\n if (undefined === jsonObj.composite.units)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);\n if (!Array.isArray(jsonObj.composite.units))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\n\n for (let i = 0; i < jsonObj.composite.units.length; i++) {\n if (!isObject(jsonObj.composite.units[i]))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\n\n if (undefined === jsonObj.composite.units[i].name) // required\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} is missing the required 'name' attribute.`);\n if (typeof (jsonObj.composite.units[i].name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.composite.units[i].label && typeof (jsonObj.composite.units[i].label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n }\n return (jsonObj as unknown) as SchemaItemFormatProps;\n }\n\n private isValidPropertyType(type: string): boolean {\n type = type.toLowerCase();\n return (type === \"primitiveproperty\") ||\n (type === \"structproperty\") ||\n (type === \"primitivearrayproperty\") ||\n (type === \"structarrayproperty\") ||\n (type === \"navigationproperty\");\n }\n\n /**\n * Type checks property and returns PropertyProps interface\n * @param jsonObj\n * @returns PropertyProps\n */\n private checkPropertyProps(jsonObj: UnknownObject): PropertyProps {\n const propName = String(jsonObj.name);\n\n if (undefined !== jsonObj.label && typeof (jsonObj.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.description && typeof (jsonObj.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.priority && typeof (jsonObj.priority) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.isReadOnly && typeof (jsonObj.isReadOnly) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.category && typeof (jsonObj.category) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.kindOfQuantity && typeof (jsonObj.kindOfQuantity) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.inherited && typeof (jsonObj.inherited) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n return (jsonObj as unknown) as PropertyProps;\n }\n\n private checkPropertyTypename(jsonObj: UnknownObject): void {\n const propName = String(jsonObj.name);\n if (undefined === jsonObj.typeName)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);\n if (typeof (jsonObj.typeName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);\n }\n\n private checkPropertyMinAndMaxOccurs(jsonObj: UnknownObject): void {\n const propName = String(jsonObj.name);\n if (undefined !== jsonObj.minOccurs && typeof (jsonObj.minOccurs) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);\n if (undefined !== jsonObj.maxOccurs && typeof (jsonObj.maxOccurs) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);\n }\n\n /**\n * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface\n * @param jsonObj\n * @returns PrimitiveOrEnumPropertyBaseProps\n */\n private checkPrimitiveOrEnumPropertyBaseProps(jsonObj: UnknownObject): PrimitiveOrEnumPropertyBaseProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n const propName = String(jsonObj.name);\n\n if (undefined !== jsonObj.minLength && typeof (jsonObj.minLength) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.maxLength && typeof (jsonObj.maxLength) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.minValue && typeof (jsonObj.minValue) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.maxValue && typeof (jsonObj.maxValue) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.extendedTypeName && typeof (jsonObj.extendedTypeName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as PrimitiveOrEnumPropertyBaseProps;\n }\n\n /**\n * Type checks PrimitiveProperty and returns PrimitivePropertyProps interface\n * @param jsonObj\n * @returns PrimitivePropertyProps\n */\n public parsePrimitiveProperty(jsonObj: UnknownObject): PrimitivePropertyProps {\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\n return (jsonObj as unknown) as PrimitivePropertyProps;\n }\n\n /**\n * Type checks StructProperty and returns StructPropertyProps interface\n * @param jsonObj\n * @returns StructPropertyProps\n */\n public parseStructProperty(jsonObj: UnknownObject): StructPropertyProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n return (jsonObj as unknown) as StructPropertyProps;\n }\n\n /**\n * Type checks PrimitiveArrayProperty and returns PrimitiveArrayPropertyProps interface\n * @param jsonObj\n * @returns PrimitiveArrayPropertyProps\n */\n public parsePrimitiveArrayProperty(jsonObj: UnknownObject): PrimitiveArrayPropertyProps {\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\n this.checkPropertyMinAndMaxOccurs(jsonObj);\n return (jsonObj as unknown) as PrimitiveArrayPropertyProps;\n }\n\n /**\n * Type checks StructArrayProperty and returns StructArrayPropertyProps interface\n * @param jsonObj\n * @returns StructArrayPropertyProps\n */\n public parseStructArrayProperty(jsonObj: UnknownObject): StructArrayPropertyProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n this.checkPropertyMinAndMaxOccurs(jsonObj);\n return (jsonObj as unknown) as StructArrayPropertyProps;\n }\n\n /**\n * Type checks NavigationProperty and returns NavigationPropertyProps interface\n * @param jsonObj\n * @returns NavigationPropertyProps\n */\n public parseNavigationProperty(jsonObj: UnknownObject): NavigationPropertyProps {\n this.checkPropertyProps(jsonObj);\n const fullname = `${this._currentItemFullName}.${String(jsonObj.name)}`;\n\n if (undefined === jsonObj.relationshipName)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);\n if (typeof (jsonObj.relationshipName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);\n\n if (undefined === jsonObj.direction)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);\n if (typeof (jsonObj.direction) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as NavigationPropertyProps;\n }\n\n public getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(this._rawSchema, \"Schema\", this._schemaName);\n }\n\n public getClassCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(jsonObj, \"ECClass\", this._currentItemFullName);\n }\n\n public getPropertyCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(jsonObj, \"ECProperty\", `${this._currentItemFullName}.${String(jsonObj.name)}`);\n }\n\n public getRelationshipConstraintCustomAttributeProviders(jsonObj: UnknownObject): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */] {\n const sourceCustomAttributes = this.getCustomAttributeProviders(jsonObj.source as UnknownObject, \"Source Constraint of\", this._currentItemFullName);\n const targetCustomAttributes = this.getCustomAttributeProviders(jsonObj.target as UnknownObject, \"Target Constraint of\", this._currentItemFullName);\n return [sourceCustomAttributes, targetCustomAttributes];\n }\n\n private *getCustomAttributeProviders(jsonObj: UnknownObject, type: string, name?: string): Iterable<CAProviderTuple> {\n if (undefined !== jsonObj.customAttributes) {\n if (!Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\n\n for (const instance of jsonObj.customAttributes) {\n if (!isObject(instance) || Array.isArray(instance))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\n if (undefined === instance.className)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);\n if (typeof (instance.className) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);\n\n const provider = (_caClass: CustomAttributeClass) => {\n return instance as CustomAttribute;\n };\n\n const caTuple: CAProviderTuple = [instance.className, provider];\n yield caTuple;\n }\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"JsonParser.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonParser.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,cAAc,EAAmB,MAAM,kBAAkB,CAAC;AAOnE,OAAO,EAAiB,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG3D,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,MAAM,cAAc,GAAG,6CAA6C,CAAC;AAErE,gBAAgB;AAChB,MAAM,OAAO,UAAW,SAAQ,cAA6B;IACnD,UAAU,CAAgB;IAC1B,WAAW,CAAU;IACrB,oBAAoB,CAAU;IAEtC,YAAY,SAA4B;QACtC,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC;YACtB,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,sBAAsB,CAAC,CAAC;QAEhF,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IA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AAE,OAAO,IAAI,IAAI,IAAI,gFAAgF,CAAC,CAAC;YAE7J,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,gBAAgB,EAAE,CAAC;gBAChD,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC;oBAChD,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,OAAO,IAAI,IAAI,IAAI,gFAAgF,CAAC,CAAC;gBAC7J,IAAI,SAAS,KAAK,QAAQ,CAAC,SAAS;oBAClC,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,wBAAwB,IAAI,kEAAkE,CAAC,CAAC;gBACxJ,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,QAAQ;oBAC1C,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,wBAAwB,IAAI,wFAAwF,CAAC,CAAC;gBAE9K,MAAM,QAAQ,GAAG,CAAC,QAA8B,EAAE,EAAE;oBAClD,OAAO,QAA2B,CAAC;gBACrC,CAAC,CAAC;gBAEF,MAAM,OAAO,GAAoB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;gBAChE,MAAM,OAAO,CAAC;YAChB,CAAC;QACH,CAAC;IACH,CAAC;CACF","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 { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { ECName } from \"../ECName\";\nimport { AbstractParser, CAProviderTuple } from \"./AbstractParser\";\nimport {\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps, PrimitivePropertyProps,\n PropertyCategoryProps, PropertyProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps,\n StructPropertyProps, UnitSystemProps,\n} from \"./JsonProps\";\nimport { ECSpecVersion, SchemaReadHelper } from \"./Helper\";\n\ninterface UnknownObject { readonly [name: string]: unknown }\nfunction isObject(x: unknown): x is UnknownObject {\n return typeof (x) === \"object\";\n}\n\nconst SCHEMAURL_JSON = \"https://dev\\\\.bentley\\\\.com/json_schemas/ec\";\n\n/** @internal */\nexport class JsonParser extends AbstractParser<UnknownObject> {\n private _rawSchema: UnknownObject;\n private _schemaName?: string;\n private _currentItemFullName?: string;\n\n constructor(rawSchema: Readonly<unknown>) {\n super();\n\n if (!isObject(rawSchema))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Invalid JSON object.`);\n\n this._rawSchema = rawSchema;\n this._schemaName = rawSchema.name as string | undefined;\n this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema as string);\n }\n\n public get getECSpecVersion(): ECSpecVersion | undefined { return this._ecSpecVersion; }\n\n public static parseJSUri(uri: string): ECSpecVersion | undefined {\n if (uri === undefined)\n return undefined;\n\n const match = uri.match(`^${SCHEMAURL_JSON}/([0-9]+)/ecschema$`);\n if (!match)\n return;\n\n const readVersion = parseInt(match[1][0], 10);\n const writeVersion = parseInt(match[1][1], 10);\n return { readVersion, writeVersion };\n }\n\n /**\n * Type checks Schema and returns SchemaProps interface\n * @param this._rawSchema\n * @returns SchemaProps\n */\n public parseSchema(): SchemaProps {\n if (undefined === this._rawSchema.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);\n if (typeof (this._rawSchema.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined === this._rawSchema.$schema)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);\n if (typeof (this._rawSchema.$schema) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);\n\n if (undefined === this._rawSchema.version)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);\n if (typeof (this._rawSchema.version) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);\n\n if (undefined !== this._rawSchema.alias) {\n if (typeof (this._rawSchema.alias) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== this._rawSchema.label) {\n if (typeof (this._rawSchema.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== this._rawSchema.description) {\n if (typeof (this._rawSchema.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);\n }\n\n const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);\n\n return {\n ...this._rawSchema,\n ecSpecMajorVersion: ecVersions?.readVersion,\n ecSpecMinorVersion: ecVersions?.writeVersion,\n } as SchemaProps;\n }\n\n public *getReferences(): Iterable<SchemaReferenceProps> {\n if (undefined !== this._rawSchema.references) {\n if (!Array.isArray(this._rawSchema.references))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${String(this._rawSchema.name)} has an invalid 'references' attribute. It should be of type 'object[]'.`);\n\n for (const ref of this._rawSchema.references) {\n yield this.checkSchemaReference(ref);\n }\n }\n }\n\n private checkSchemaReference(jsonObj: Readonly<unknown>): SchemaReferenceProps {\n if (!isObject(jsonObj))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);\n if (undefined === jsonObj.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'name' attribute.`);\n if (typeof (jsonObj.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'name' attribute. It should be of type 'string'.`);\n if (undefined === jsonObj.version)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references is missing the required 'version' attribute.`);\n if (typeof (jsonObj.version) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. One of the references has an invalid 'version' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as SchemaReferenceProps;\n }\n\n public *getItems(): Iterable<[string, string, UnknownObject]> {\n const items = this._rawSchema.items;\n if (undefined !== items) {\n if (!isObject(items) || Array.isArray(items))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\n\n // eslint-disable-next-line guard-for-in\n for (const itemName in items) {\n const item = items[itemName];\n if (!isObject(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\n\n if (undefined === item.schemaItemType)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\n if (typeof (item.schemaItemType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n yield [itemName, item.schemaItemType, item];\n }\n }\n }\n\n public findItem(itemName: string): [string, string, UnknownObject] | undefined {\n const items = this._rawSchema.items;\n if (undefined !== items) {\n if (!isObject(items) || Array.isArray(items))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\n\n const item = items[itemName];\n if (undefined !== item) {\n if (!isObject(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\n\n if (!ECName.validate(itemName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\n\n if (undefined === item.schemaItemType)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\n if (typeof (item.schemaItemType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\n\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\n return [itemName, item.schemaItemType, item];\n }\n }\n\n return undefined;\n }\n\n /**\n * Type checks all Schema Item attributes.\n * @param jsonObj The JSON object to check if it represents a Schema Item.\n */\n private checkSchemaItemProps(jsonObj: UnknownObject): void {\n if (undefined !== jsonObj.description) {\n if (typeof (jsonObj.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== jsonObj.label) {\n if (typeof (jsonObj.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n }\n\n public *getProperties(jsonObj: UnknownObject, itemName: string): Iterable<[string, string, UnknownObject]> {\n const properties = jsonObj.properties;\n if (undefined !== properties) {\n if (!Array.isArray(properties))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);\n\n for (const property of properties as unknown[]) {\n if (!isObject(property))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);\n\n if (undefined === property.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);\n if (typeof (property.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined === property.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);\n if (typeof (property.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);\n if (!this.isValidPropertyType(property.type)) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n return;\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);\n }\n\n yield [property.name, property.type, property];\n }\n }\n }\n\n /**\n * Type checks Class and returns ClassProps interface\n * @param jsonObj The JSON object to check if it represents a Class.\n */\n private checkClassProps(jsonObj: UnknownObject): void {\n this.checkSchemaItemProps(jsonObj);\n\n if (undefined !== jsonObj.modifier) {\n if (typeof (jsonObj.modifier) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== jsonObj.baseClass) {\n if (typeof (jsonObj.baseClass) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);\n }\n if (undefined !== jsonObj.customAttributes) {\n if (!Array.isArray(jsonObj.customAttributes)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n }\n }\n }\n\n /**\n * Type checks entity class and returns EntityClassProps interface\n * @param jsonObj\n * @returns EntityClassProps\n */\n public parseEntityClass(jsonObj: UnknownObject): EntityClassProps {\n this.checkClassProps(jsonObj);\n\n if (undefined !== jsonObj.mixins) {\n if (!Array.isArray(jsonObj.mixins))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\n for (const mixinName of jsonObj.mixins) {\n if (typeof (mixinName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\n }\n }\n\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n /**\n * Type checks mixin and returns MixinProps interface\n * @param jsonObj\n * @returns MixinProps\n */\n public parseMixin(jsonObj: UnknownObject): MixinProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n if (typeof (jsonObj.appliesTo) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as MixinProps;\n }\n\n /**\n * Type checks custom attribute class and returns CustomAttributeClassProps interface\n * @param jsonObj\n * @returns CustomAttributeClassProps\n */\n public parseCustomAttributeClass(jsonObj: UnknownObject): CustomAttributeClassProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\n if (typeof (jsonObj.appliesTo) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as CustomAttributeClassProps;\n }\n\n public parseStructClass(jsonObj: UnknownObject): StructClassProps {\n this.checkClassProps(jsonObj);\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n };\n }\n\n public parseUnitSystem(jsonObj: UnknownObject): UnitSystemProps {\n this.checkSchemaItemProps(jsonObj);\n return jsonObj;\n }\n\n /**\n * Type checks Relationship Class and returns RelationshipClassProps interface\n * @param jsonObj\n * @returns RelationshipClassProps\n */\n public parseRelationshipClass(jsonObj: UnknownObject): RelationshipClassProps {\n this.checkClassProps(jsonObj);\n if (undefined === jsonObj.strength)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);\n if (typeof (jsonObj.strength) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.strengthDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);\n if (typeof (jsonObj.strengthDirection) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.source)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);\n if (!isObject(jsonObj.source))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);\n this.checkRelationshipConstraintProps(jsonObj.source, true);\n\n if (undefined === jsonObj.target)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);\n if (!isObject(jsonObj.target))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);\n this.checkRelationshipConstraintProps(jsonObj.target, false);\n\n return {\n ...jsonObj,\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\n } as unknown as RelationshipClassProps;\n }\n\n /**\n * Type checks Relationship Constraint and returns RelationshipConstraintProps interface.\n * @param jsonObj\n * @param isSource For sake of error message, is this relationship constraint a source or target\n * @returns RelationshipConstraintProps\n */\n private checkRelationshipConstraintProps(jsonObj: UnknownObject, isSource: boolean): void {\n const constraintName = `${(isSource) ? \"Source\" : \"Target\"} Constraint of ${this._currentItemFullName}`; // most specific name to call RelationshipConstraint\n\n if (undefined === jsonObj.multiplicity)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);\n if (typeof (jsonObj.multiplicity) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.roleLabel)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);\n if (typeof (jsonObj.roleLabel) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.polymorphic)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);\n if (typeof (jsonObj.polymorphic) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.abstractConstraint && typeof (jsonObj.abstractConstraint) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.constraintClasses)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);\n if (!Array.isArray(jsonObj.constraintClasses))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\n\n for (const constraintClassName of jsonObj.constraintClasses) {\n if (typeof (constraintClassName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\n }\n\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n }\n\n /**\n * Type checks Enumeration and returns EnumerationProps interface\n * @param jsonObj\n * @returns EnumerationProps\n */\n public parseEnumeration(jsonObj: UnknownObject): EnumerationProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);\n if (typeof (jsonObj.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\n\n const isValidEnumerationType = (type: string): boolean => {\n type = type.toLowerCase();\n return (type === \"int\") ||\n (type === \"integer\") ||\n (type === \"string\");\n };\n if (!isValidEnumerationType(jsonObj.type)) {\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\n (jsonObj as any).type = \"string\";\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either \"int\" or \"string\".`);\n }\n\n if (undefined !== jsonObj.isStrict) { // TODO: make required\n if (typeof (jsonObj.isStrict) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);\n }\n\n if (undefined === jsonObj.enumerators)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);\n if (!Array.isArray(jsonObj.enumerators))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\n\n for (const enumerator of jsonObj.enumerators) {\n if (!isObject(enumerator))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\n\n if (undefined === enumerator.value)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);\n\n // TODO: Should this really be handled here?\n const expectedType = jsonObj.type;\n const receivedType = (typeof (enumerator.value) === \"number\") ? \"int\" : typeof (enumerator.value);\n if (!expectedType.includes(receivedType)) // is receivedType a substring of expectedType? - easiest way to check \"int\" === \"int\" | \"integer\" && \"string\" === \"string\"\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be \"${expectedType}\", not \"${receivedType}\".`);\n\n if (undefined === enumerator.name)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);\n if (typeof (enumerator.name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined !== enumerator.label) {\n if (typeof (enumerator.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);\n }\n\n if (undefined !== enumerator.description) {\n if (typeof (enumerator.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);\n }\n }\n\n return (jsonObj as unknown) as EnumerationProps;\n }\n\n /**\n * Type checks KindOfQuantity and returns KindOfQuantityProps interface\n * @param jsonObj\n * @returns KindOfQuantityProps\n */\n public parseKindOfQuantity(jsonObj: UnknownObject): KindOfQuantityProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.relativeError)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);\n if (typeof (jsonObj.relativeError) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.presentationUnits) {\n if (!Array.isArray(jsonObj.presentationUnits) && typeof (jsonObj.presentationUnits) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);\n }\n\n if (undefined === jsonObj.persistenceUnit)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);\n if (typeof (jsonObj.persistenceUnit) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as KindOfQuantityProps;\n }\n\n /**\n * Type checks Property Category and returns PropertyCategoryProps interface\n * @param jsonObj\n * @returns PropertyCategoryProps\n */\n public parsePropertyCategory(jsonObj: UnknownObject): PropertyCategoryProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined !== jsonObj.priority) { // TODO: make required\n if (typeof (jsonObj.priority) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);\n }\n\n return (jsonObj as unknown) as PropertyCategoryProps;\n }\n\n /**\n * Type checks unit and returns UnitProps interface\n * @param jsonObj\n * @returns UnitProps\n */\n public parseUnit(jsonObj: UnknownObject): SchemaItemUnitProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.phenomenon)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\n if (typeof (jsonObj.phenomenon) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.unitSystem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\n if (typeof (jsonObj.unitSystem) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.numerator) {\n if (typeof (jsonObj.numerator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.denominator) {\n if (typeof (jsonObj.denominator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.offset) {\n if (typeof (jsonObj.offset) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);\n }\n return (jsonObj as unknown) as SchemaItemUnitProps;\n }\n\n /**\n * Type checks inverted unit and returns InvertedUnitProps interface\n * @param jsonObj\n * @returns InvertedUnitProps\n */\n public parseInvertedUnit(jsonObj: UnknownObject): InvertedUnitProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.invertsUnit)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);\n if (typeof (jsonObj.invertsUnit) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.unitSystem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\n if (typeof (jsonObj.unitSystem) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as InvertedUnitProps;\n }\n\n /**\n * Type checks constant and returns ConstantProps interface\n * @param jsonObj\n * @returns ConstantProps\n */\n public parseConstant(jsonObj: UnknownObject): ConstantProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.phenomenon)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\n if (typeof (jsonObj.phenomenon) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\n\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.numerator) {\n if (typeof (jsonObj.numerator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\n }\n\n if (undefined !== jsonObj.denominator) {\n if (typeof (jsonObj.denominator) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\n }\n\n return (jsonObj as unknown) as ConstantProps;\n }\n\n /**\n * Type checks phenomenon and returns PhenomenonProps interface\n * @param jsonObj\n * @returns PhenomenonProps\n */\n public parsePhenomenon(jsonObj: UnknownObject): PhenomenonProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.definition)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);\n if (typeof (jsonObj.definition) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as PhenomenonProps;\n }\n\n /**\n * Type checks format and returns SchemaItemFormatProps interface\n * @param jsonObj\n * @returns SchemaItemFormatProps\n */\n public parseFormat(jsonObj: UnknownObject): SchemaItemFormatProps {\n this.checkSchemaItemProps(jsonObj);\n if (undefined === jsonObj.type)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);\n if (typeof (jsonObj.type) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.precision && typeof (jsonObj.precision) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.roundFactor && typeof (jsonObj.roundFactor) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.minWidth && typeof (jsonObj.minWidth) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.showSignOption && typeof (jsonObj.showSignOption) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.formatTraits) {\n if (!Array.isArray(jsonObj.formatTraits) && typeof (jsonObj.formatTraits) !== \"string\") // must be either an array of strings or a string\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);\n }\n\n if (undefined !== jsonObj.decimalSeparator && typeof (jsonObj.decimalSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.thousandSeparator && typeof (jsonObj.thousandSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.uomSeparator && typeof (jsonObj.uomSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioType && typeof (jsonObj.ratioType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioType' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioSeparator && typeof (jsonObj.ratioSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.ratioFormatType && typeof (jsonObj.ratioFormatType) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioFormatType' attribute. It should be of type 'string'.`);\n\n // Validate EC version if ratio properties exist - they require EC version 3.3+\n if (jsonObj.ratioType !== undefined || jsonObj.ratioSeparator !== undefined || jsonObj.ratioFormatType !== undefined) {\n if (this._ecSpecVersion === undefined || this._ecSpecVersion.readVersion < 3 || (this._ecSpecVersion.readVersion === 3 && this._ecSpecVersion.writeVersion < 3)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has ratio properties that require EC version 3.3 or newer.`);\n }\n }\n\n if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.composite) { // optional\n if (!isObject(jsonObj.composite))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);\n if (undefined !== jsonObj.composite.includeZero && typeof (jsonObj.composite.includeZero) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.composite.spacer && typeof (jsonObj.composite.spacer) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);\n\n // if composite is defined\n if (undefined === jsonObj.composite.units)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);\n if (!Array.isArray(jsonObj.composite.units))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\n\n for (let i = 0; i < jsonObj.composite.units.length; i++) {\n if (!isObject(jsonObj.composite.units[i]))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\n\n if (undefined === jsonObj.composite.units[i].name) // required\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} is missing the required 'name' attribute.`);\n if (typeof (jsonObj.composite.units[i].name) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'name' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.composite.units[i].label && typeof (jsonObj.composite.units[i].label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. The object at position ${i} has an invalid 'label' attribute. It should be of type 'string'.`);\n }\n }\n return (jsonObj as unknown) as SchemaItemFormatProps;\n }\n\n private isValidPropertyType(type: string): boolean {\n type = type.toLowerCase();\n return (type === \"primitiveproperty\") ||\n (type === \"structproperty\") ||\n (type === \"primitivearrayproperty\") ||\n (type === \"structarrayproperty\") ||\n (type === \"navigationproperty\");\n }\n\n /**\n * Type checks property and returns PropertyProps interface\n * @param jsonObj\n * @returns PropertyProps\n */\n private checkPropertyProps(jsonObj: UnknownObject): PropertyProps {\n const propName = String(jsonObj.name);\n\n if (undefined !== jsonObj.label && typeof (jsonObj.label) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.description && typeof (jsonObj.description) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.priority && typeof (jsonObj.priority) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.isReadOnly && typeof (jsonObj.isReadOnly) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.category && typeof (jsonObj.category) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.kindOfQuantity && typeof (jsonObj.kindOfQuantity) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);\n\n if (undefined !== jsonObj.inherited && typeof (jsonObj.inherited) !== \"boolean\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);\n\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\n return (jsonObj as unknown) as PropertyProps;\n }\n\n private checkPropertyTypename(jsonObj: UnknownObject): void {\n const propName = String(jsonObj.name);\n if (undefined === jsonObj.typeName)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);\n if (typeof (jsonObj.typeName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);\n }\n\n private checkPropertyMinAndMaxOccurs(jsonObj: UnknownObject): void {\n const propName = String(jsonObj.name);\n if (undefined !== jsonObj.minOccurs && typeof (jsonObj.minOccurs) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);\n if (undefined !== jsonObj.maxOccurs && typeof (jsonObj.maxOccurs) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);\n }\n\n /**\n * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface\n * @param jsonObj\n * @returns PrimitiveOrEnumPropertyBaseProps\n */\n private checkPrimitiveOrEnumPropertyBaseProps(jsonObj: UnknownObject): PrimitiveOrEnumPropertyBaseProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n const propName = String(jsonObj.name);\n\n if (undefined !== jsonObj.minLength && typeof (jsonObj.minLength) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.maxLength && typeof (jsonObj.maxLength) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.minValue && typeof (jsonObj.minValue) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.maxValue && typeof (jsonObj.maxValue) !== \"number\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);\n\n if (undefined !== jsonObj.extendedTypeName && typeof (jsonObj.extendedTypeName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);\n return (jsonObj as unknown) as PrimitiveOrEnumPropertyBaseProps;\n }\n\n /**\n * Type checks PrimitiveProperty and returns PrimitivePropertyProps interface\n * @param jsonObj\n * @returns PrimitivePropertyProps\n */\n public parsePrimitiveProperty(jsonObj: UnknownObject): PrimitivePropertyProps {\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\n return (jsonObj as unknown) as PrimitivePropertyProps;\n }\n\n /**\n * Type checks StructProperty and returns StructPropertyProps interface\n * @param jsonObj\n * @returns StructPropertyProps\n */\n public parseStructProperty(jsonObj: UnknownObject): StructPropertyProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n return (jsonObj as unknown) as StructPropertyProps;\n }\n\n /**\n * Type checks PrimitiveArrayProperty and returns PrimitiveArrayPropertyProps interface\n * @param jsonObj\n * @returns PrimitiveArrayPropertyProps\n */\n public parsePrimitiveArrayProperty(jsonObj: UnknownObject): PrimitiveArrayPropertyProps {\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\n this.checkPropertyMinAndMaxOccurs(jsonObj);\n return (jsonObj as unknown) as PrimitiveArrayPropertyProps;\n }\n\n /**\n * Type checks StructArrayProperty and returns StructArrayPropertyProps interface\n * @param jsonObj\n * @returns StructArrayPropertyProps\n */\n public parseStructArrayProperty(jsonObj: UnknownObject): StructArrayPropertyProps {\n this.checkPropertyProps(jsonObj);\n this.checkPropertyTypename(jsonObj);\n this.checkPropertyMinAndMaxOccurs(jsonObj);\n return (jsonObj as unknown) as StructArrayPropertyProps;\n }\n\n /**\n * Type checks NavigationProperty and returns NavigationPropertyProps interface\n * @param jsonObj\n * @returns NavigationPropertyProps\n */\n public parseNavigationProperty(jsonObj: UnknownObject): NavigationPropertyProps {\n this.checkPropertyProps(jsonObj);\n const fullname = `${this._currentItemFullName}.${String(jsonObj.name)}`;\n\n if (undefined === jsonObj.relationshipName)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);\n if (typeof (jsonObj.relationshipName) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);\n\n if (undefined === jsonObj.direction)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);\n if (typeof (jsonObj.direction) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);\n\n return (jsonObj as unknown) as NavigationPropertyProps;\n }\n\n public getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(this._rawSchema, \"Schema\", this._schemaName);\n }\n\n public getClassCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(jsonObj, \"ECClass\", this._currentItemFullName);\n }\n\n public getPropertyCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\n return this.getCustomAttributeProviders(jsonObj, \"ECProperty\", `${this._currentItemFullName}.${String(jsonObj.name)}`);\n }\n\n public getRelationshipConstraintCustomAttributeProviders(jsonObj: UnknownObject): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */] {\n const sourceCustomAttributes = this.getCustomAttributeProviders(jsonObj.source as UnknownObject, \"Source Constraint of\", this._currentItemFullName);\n const targetCustomAttributes = this.getCustomAttributeProviders(jsonObj.target as UnknownObject, \"Target Constraint of\", this._currentItemFullName);\n return [sourceCustomAttributes, targetCustomAttributes];\n }\n\n private *getCustomAttributeProviders(jsonObj: UnknownObject, type: string, name?: string): Iterable<CAProviderTuple> {\n if (undefined !== jsonObj.customAttributes) {\n if (!Array.isArray(jsonObj.customAttributes))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\n\n for (const instance of jsonObj.customAttributes) {\n if (!isObject(instance) || Array.isArray(instance))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\n if (undefined === instance.className)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);\n if (typeof (instance.className) !== \"string\")\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);\n\n const provider = (_caClass: CustomAttributeClass) => {\n return instance as CustomAttribute;\n };\n\n const caTuple: CAProviderTuple = [instance.className, provider];\n yield caTuple;\n }\n }\n }\n}\n"]}
|