@itwin/ecschema-metadata 5.5.0-dev.1 → 5.5.0-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/lib/cjs/Constants.js.map +1 -1
  2. package/lib/cjs/DelayedPromise.js.map +1 -1
  3. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  4. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  5. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  6. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  7. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  8. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  9. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  10. package/lib/cjs/ECName.js.map +1 -1
  11. package/lib/cjs/ECObjects.js.map +1 -1
  12. package/lib/cjs/Exception.js.map +1 -1
  13. package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -1
  14. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -1
  15. package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -1
  16. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  17. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +466 -466
  18. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  19. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  20. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  21. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  22. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +235 -235
  23. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  24. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -1
  25. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +309 -309
  26. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  27. package/lib/cjs/Interfaces.js.map +1 -1
  28. package/lib/cjs/Metadata/Class.js.map +1 -1
  29. package/lib/cjs/Metadata/Constant.js.map +1 -1
  30. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  31. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  32. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  33. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  34. package/lib/cjs/Metadata/Format.js.map +1 -1
  35. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  36. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  37. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  38. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  39. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  40. package/lib/cjs/Metadata/Property.js.map +1 -1
  41. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  42. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  43. package/lib/cjs/Metadata/Schema.js.map +1 -1
  44. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  45. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  46. package/lib/cjs/PropertyTypes.js.map +1 -1
  47. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  48. package/lib/cjs/SchemaKey.js.map +1 -1
  49. package/lib/cjs/SchemaLoader.js.map +1 -1
  50. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  51. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  52. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  53. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  54. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  55. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  56. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  57. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  58. package/lib/cjs/ecschema-metadata.js.map +1 -1
  59. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  60. package/lib/cjs/utils/SchemaLoadingController.js.map +1 -1
  61. package/lib/esm/Constants.js.map +1 -1
  62. package/lib/esm/DelayedPromise.js.map +1 -1
  63. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  64. package/lib/esm/Deserialization/Helper.js.map +1 -1
  65. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  66. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  67. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  68. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  69. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  70. package/lib/esm/ECName.js.map +1 -1
  71. package/lib/esm/ECObjects.js.map +1 -1
  72. package/lib/esm/Exception.js.map +1 -1
  73. package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -1
  74. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -1
  75. package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -1
  76. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  77. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +466 -466
  78. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  79. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  80. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  81. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  82. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +235 -235
  83. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  84. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -1
  85. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +309 -309
  86. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  87. package/lib/esm/Interfaces.js.map +1 -1
  88. package/lib/esm/Metadata/Class.js.map +1 -1
  89. package/lib/esm/Metadata/Constant.js.map +1 -1
  90. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  91. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  92. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  93. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  94. package/lib/esm/Metadata/Format.js.map +1 -1
  95. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  96. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  97. package/lib/esm/Metadata/Mixin.js.map +1 -1
  98. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  99. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  100. package/lib/esm/Metadata/Property.js.map +1 -1
  101. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  102. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  103. package/lib/esm/Metadata/Schema.js.map +1 -1
  104. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  105. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  106. package/lib/esm/PropertyTypes.js.map +1 -1
  107. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  108. package/lib/esm/SchemaKey.js.map +1 -1
  109. package/lib/esm/SchemaLoader.js.map +1 -1
  110. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  111. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  112. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  113. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  114. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  115. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  116. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  117. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  118. package/lib/esm/ecschema-metadata.js.map +1 -1
  119. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  120. package/lib/esm/utils/SchemaLoadingController.js.map +1 -1
  121. package/package.json +6 -6
@@ -1 +1 @@
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,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,IAA0B,CAAC;QACxD,IAAI,CAAC,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,OAAiB,CAAC,CAAC;IAC3E,CAAC;IAED,IAAW,gBAAgB,KAAgC,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAEjF,MAAM,CAAC,UAAU,CAAC,GAAW;QAClC,IAAI,GAAG,KAAK,SAAS;YACnB,OAAO,SAAS,CAAC;QAEnB,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,cAAc,qBAAqB,CAAC,CAAC;QACjE,IAAI,CAAC,KAAK;YACR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AAc,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":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\r\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\r\nimport { ECName } from \"../ECName\";\r\nimport { AbstractParser, CAProviderTuple } from \"./AbstractParser\";\r\nimport {\r\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\r\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps, PrimitivePropertyProps,\r\n PropertyCategoryProps, PropertyProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps,\r\n StructPropertyProps, UnitSystemProps,\r\n} from \"./JsonProps\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"./Helper\";\r\n\r\ninterface UnknownObject { readonly [name: string]: unknown }\r\nfunction isObject(x: unknown): x is UnknownObject {\r\n return typeof (x) === \"object\";\r\n}\r\n\r\nconst SCHEMAURL_JSON = \"https://dev\\\\.bentley\\\\.com/json_schemas/ec\";\r\n\r\n/** @internal */\r\nexport class JsonParser extends AbstractParser<UnknownObject> {\r\n private _rawSchema: UnknownObject;\r\n private _schemaName?: string;\r\n private _currentItemFullName?: string;\r\n\r\n constructor(rawSchema: Readonly<unknown>) {\r\n super();\r\n\r\n if (!isObject(rawSchema))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Invalid JSON object.`);\r\n\r\n this._rawSchema = rawSchema;\r\n this._schemaName = rawSchema.name as string | undefined;\r\n this._ecSpecVersion = JsonParser.parseJSUri(rawSchema.$schema as string);\r\n }\r\n\r\n public get getECSpecVersion(): ECSpecVersion | undefined { return this._ecSpecVersion; }\r\n\r\n public static parseJSUri(uri: string): ECSpecVersion | undefined {\r\n if (uri === undefined)\r\n return undefined;\r\n\r\n const match = uri.match(`^${SCHEMAURL_JSON}/([0-9]+)/ecschema$`);\r\n if (!match)\r\n return;\r\n\r\n const readVersion = parseInt(match[1][0], 10);\r\n const writeVersion = parseInt(match[1][1], 10);\r\n return { readVersion, writeVersion };\r\n }\r\n\r\n /**\r\n * Type checks Schema and returns SchemaProps interface\r\n * @param this._rawSchema\r\n * @returns SchemaProps\r\n */\r\n public parseSchema(): SchemaProps {\r\n if (undefined === this._rawSchema.name)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema is missing the required 'name' attribute.`);\r\n if (typeof (this._rawSchema.name) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECSchema has an invalid 'name' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === this._rawSchema.$schema)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required '$schema' attribute.`);\r\n if (typeof (this._rawSchema.$schema) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid '$schema' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === this._rawSchema.version)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} is missing the required 'version' attribute.`);\r\n if (typeof (this._rawSchema.version) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'version' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== this._rawSchema.alias) {\r\n if (typeof (this._rawSchema.alias) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'alias' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n if (undefined !== this._rawSchema.label) {\r\n if (typeof (this._rawSchema.label) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'label' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n if (undefined !== this._rawSchema.description) {\r\n if (typeof (this._rawSchema.description) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECSchema ${this._schemaName} has an invalid 'description' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n const ecVersions = JsonParser.parseJSUri(this._rawSchema.$schema);\r\n\r\n return {\r\n ...this._rawSchema,\r\n ecSpecMajorVersion: ecVersions?.readVersion,\r\n ecSpecMinorVersion: ecVersions?.writeVersion,\r\n } as SchemaProps;\r\n }\r\n\r\n public *getReferences(): Iterable<SchemaReferenceProps> {\r\n if (undefined !== this._rawSchema.references) {\r\n if (!Array.isArray(this._rawSchema.references))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._rawSchema.name} has an invalid 'references' attribute. It should be of type 'object[]'.`);\r\n\r\n for (const ref of this._rawSchema.references) {\r\n yield this.checkSchemaReference(ref);\r\n }\r\n }\r\n }\r\n\r\n private checkSchemaReference(jsonObj: Readonly<unknown>): SchemaReferenceProps {\r\n if (!isObject(jsonObj))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'references' attribute. It should be of type 'object[]'.`);\r\n if (undefined === jsonObj.name)\r\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.`);\r\n if (typeof (jsonObj.name) !== \"string\")\r\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'.`);\r\n if (undefined === jsonObj.version)\r\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.`);\r\n if (typeof (jsonObj.version) !== \"string\")\r\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'.`);\r\n return (jsonObj as unknown) as SchemaReferenceProps;\r\n }\r\n\r\n public *getItems(): Iterable<[string, string, UnknownObject]> {\r\n const items = this._rawSchema.items;\r\n if (undefined !== items) {\r\n if (!isObject(items) || Array.isArray(items))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\r\n\r\n // eslint-disable-next-line guard-for-in\r\n for (const itemName in items) {\r\n const item = items[itemName];\r\n if (!isObject(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\r\n\r\n if (!ECName.validate(itemName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\r\n\r\n if (undefined === item.schemaItemType)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\r\n if (typeof (item.schemaItemType) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\r\n\r\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\r\n yield [itemName, item.schemaItemType, item];\r\n }\r\n }\r\n }\r\n\r\n public findItem(itemName: string): [string, string, UnknownObject] | undefined {\r\n const items = this._rawSchema.items;\r\n if (undefined !== items) {\r\n if (!isObject(items) || Array.isArray(items))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema ${this._schemaName} has an invalid 'items' attribute. It should be of type 'object'.`);\r\n\r\n const item = items[itemName];\r\n if (undefined !== item) {\r\n if (!isObject(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A SchemaItem in ${this._schemaName} is an invalid JSON object.`);\r\n\r\n if (!ECName.validate(itemName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `A SchemaItem in ${this._schemaName} has an invalid 'name' attribute. '${itemName}' is not a valid ECName.`);\r\n\r\n if (undefined === item.schemaItemType)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} is missing the required 'schemaItemType' attribute.`);\r\n if (typeof (item.schemaItemType) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._schemaName}.${itemName} has an invalid 'schemaItemType' attribute. It should be of type 'string'.`);\r\n\r\n this._currentItemFullName = `${this._schemaName}.${itemName}`;\r\n return [itemName, item.schemaItemType, item];\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Type checks all Schema Item attributes.\r\n * @param jsonObj The JSON object to check if it represents a Schema Item.\r\n */\r\n private checkSchemaItemProps(jsonObj: UnknownObject): void {\r\n if (undefined !== jsonObj.description) {\r\n if (typeof (jsonObj.description) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'description' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.label) {\r\n if (typeof (jsonObj.label) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The SchemaItem ${this._currentItemFullName} has an invalid 'label' attribute. It should be of type 'string'.`);\r\n }\r\n }\r\n\r\n public *getProperties(jsonObj: UnknownObject, itemName: string): Iterable<[string, string, UnknownObject]> {\r\n const properties = jsonObj.properties;\r\n if (undefined !== properties) {\r\n if (!Array.isArray(properties))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${itemName} has an invalid 'properties' attribute. It should be of type 'object[]'.`);\r\n\r\n for (const property of properties as unknown[]) {\r\n if (!isObject(property))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is an invalid JSON object.`);\r\n\r\n if (undefined === property.name)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} is missing the required 'name' attribute.`);\r\n if (typeof (property.name) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `An ECProperty in ${itemName} has an invalid 'name' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === property.type)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} does not have the required 'type' attribute.`);\r\n if (typeof (property.type) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. It should be of type 'string'.`);\r\n if (!this.isValidPropertyType(property.type)) {\r\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\r\n return;\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${itemName}.${property.name} has an invalid 'type' attribute. '${property.type}' is not a valid type.`);\r\n }\r\n\r\n yield [property.name, property.type, property];\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Type checks Class and returns ClassProps interface\r\n * @param jsonObj The JSON object to check if it represents a Class.\r\n */\r\n private checkClassProps(jsonObj: UnknownObject): void {\r\n this.checkSchemaItemProps(jsonObj);\r\n\r\n if (undefined !== jsonObj.modifier) {\r\n if (typeof (jsonObj.modifier) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'modifier' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.baseClass) {\r\n if (typeof (jsonObj.baseClass) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'baseClass' attribute. It should be of type 'string'.`);\r\n }\r\n if (undefined !== jsonObj.customAttributes) {\r\n if (!Array.isArray(jsonObj.customAttributes)) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECClass ${this._currentItemFullName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Type checks entity class and returns EntityClassProps interface\r\n * @param jsonObj\r\n * @returns EntityClassProps\r\n */\r\n public parseEntityClass(jsonObj: UnknownObject): EntityClassProps {\r\n this.checkClassProps(jsonObj);\r\n\r\n if (undefined !== jsonObj.mixins) {\r\n if (!Array.isArray(jsonObj.mixins))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\r\n for (const mixinName of jsonObj.mixins) {\r\n if (typeof (mixinName) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this._currentItemFullName} has an invalid 'mixins' attribute. It should be of type 'string[]'.`);\r\n }\r\n }\r\n\r\n return {\r\n ...jsonObj,\r\n originalECSpecMajorVersion : this._ecSpecVersion?.readVersion,\r\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\r\n } as unknown as EntityClassProps;\r\n }\r\n\r\n /**\r\n * Type checks mixin and returns MixinProps interface\r\n * @param jsonObj\r\n * @returns MixinProps\r\n */\r\n public parseMixin(jsonObj: UnknownObject): MixinProps {\r\n this.checkClassProps(jsonObj);\r\n if (undefined === jsonObj.appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\r\n if (typeof (jsonObj.appliesTo) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Mixin ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\r\n return {\r\n ...jsonObj,\r\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\r\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\r\n } as unknown as MixinProps;\r\n }\r\n\r\n /**\r\n * Type checks custom attribute class and returns CustomAttributeClassProps interface\r\n * @param jsonObj\r\n * @returns CustomAttributeClassProps\r\n */\r\n public parseCustomAttributeClass(jsonObj: UnknownObject): CustomAttributeClassProps {\r\n this.checkClassProps(jsonObj);\r\n if (undefined === jsonObj.appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} is missing the required 'appliesTo' attribute.`);\r\n if (typeof (jsonObj.appliesTo) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The CustomAttributeClass ${this._currentItemFullName} has an invalid 'appliesTo' attribute. It should be of type 'string'.`);\r\n return {\r\n ...jsonObj,\r\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\r\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\r\n } as unknown as CustomAttributeClassProps;\r\n }\r\n\r\n public parseStructClass(jsonObj: UnknownObject): StructClassProps {\r\n this.checkClassProps(jsonObj);\r\n return {\r\n ...jsonObj,\r\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\r\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\r\n } as unknown as StructClassProps;\r\n }\r\n\r\n public parseUnitSystem(jsonObj: UnknownObject): UnitSystemProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n return jsonObj as UnitSystemProps;\r\n }\r\n\r\n /**\r\n * Type checks Relationship Class and returns RelationshipClassProps interface\r\n * @param jsonObj\r\n * @returns RelationshipClassProps\r\n */\r\n public parseRelationshipClass(jsonObj: UnknownObject): RelationshipClassProps {\r\n this.checkClassProps(jsonObj);\r\n if (undefined === jsonObj.strength)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strength' attribute.`);\r\n if (typeof (jsonObj.strength) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strength' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.strengthDirection)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required 'strengthDirection' attribute.`);\r\n if (typeof (jsonObj.strengthDirection) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid 'strengthDirection' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.source)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required source constraint.`);\r\n if (!isObject(jsonObj.source))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid source constraint. It should be of type 'object'.`);\r\n this.checkRelationshipConstraintProps(jsonObj.source, true);\r\n\r\n if (undefined === jsonObj.target)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} is missing the required target constraint.`);\r\n if (!isObject(jsonObj.target))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The RelationshipClass ${this._currentItemFullName} has an invalid target constraint. It should be of type 'object'.`);\r\n this.checkRelationshipConstraintProps(jsonObj.target, false);\r\n\r\n return {\r\n ...jsonObj,\r\n originalECSpecMajorVersion: this._ecSpecVersion?.readVersion,\r\n originalECSpecMinorVersion: this._ecSpecVersion?.writeVersion,\r\n } as unknown as RelationshipClassProps;\r\n }\r\n\r\n /**\r\n * Type checks Relationship Constraint and returns RelationshipConstraintProps interface.\r\n * @param jsonObj\r\n * @param isSource For sake of error message, is this relationship constraint a source or target\r\n * @returns RelationshipConstraintProps\r\n */\r\n private checkRelationshipConstraintProps(jsonObj: UnknownObject, isSource: boolean): void {\r\n const constraintName = `${(isSource) ? \"Source\" : \"Target\"} Constraint of ${this._currentItemFullName}`; // most specific name to call RelationshipConstraint\r\n\r\n if (undefined === jsonObj.multiplicity)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'multiplicity' attribute.`);\r\n if (typeof (jsonObj.multiplicity) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'multiplicity' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.roleLabel)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'roleLabel' attribute.`);\r\n if (typeof (jsonObj.roleLabel) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'roleLabel' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.polymorphic)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'polymorphic' attribute.`);\r\n if (typeof (jsonObj.polymorphic) !== \"boolean\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'polymorphic' attribute. It should be of type 'boolean'.`);\r\n\r\n if (undefined !== jsonObj.abstractConstraint && typeof (jsonObj.abstractConstraint) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'abstractConstraint' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.constraintClasses)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} is missing the required 'constraintClasses' attribute.`);\r\n if (!Array.isArray(jsonObj.constraintClasses))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\r\n\r\n for (const constraintClassName of jsonObj.constraintClasses) {\r\n if (typeof (constraintClassName) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'constraintClasses' attribute. It should be of type 'string[]'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${constraintName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\r\n }\r\n\r\n /**\r\n * Type checks Enumeration and returns EnumerationProps interface\r\n * @param jsonObj\r\n * @returns EnumerationProps\r\n */\r\n public parseEnumeration(jsonObj: UnknownObject): EnumerationProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.type)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'type' attribute.`);\r\n if (typeof (jsonObj.type) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\r\n\r\n const isValidEnumerationType = (type: string): boolean => {\r\n type = type.toLowerCase();\r\n return (type === \"int\") ||\r\n (type === \"integer\") ||\r\n (type === \"string\");\r\n };\r\n if (!isValidEnumerationType(jsonObj.type)) {\r\n if (SchemaReadHelper.isECSpecVersionNewer(this._ecSpecVersion))\r\n (jsonObj as any).type = \"string\";\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'type' attribute. It should be either \"int\" or \"string\".`);\r\n }\r\n\r\n if (undefined !== jsonObj.isStrict) { // TODO: make required\r\n if (typeof (jsonObj.isStrict) !== \"boolean\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'isStrict' attribute. It should be of type 'boolean'.`);\r\n }\r\n\r\n if (undefined === jsonObj.enumerators)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} is missing the required 'enumerators' attribute.`);\r\n if (!Array.isArray(jsonObj.enumerators))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\r\n\r\n for (const enumerator of jsonObj.enumerators) {\r\n if (!isObject(enumerator))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an invalid 'enumerators' attribute. It should be of type 'object[]'.`);\r\n\r\n if (undefined === enumerator.value)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'value'.`);\r\n\r\n // TODO: Should this really be handled here?\r\n const expectedType = jsonObj.type;\r\n const receivedType = (typeof (enumerator.value) === \"number\") ? \"int\" : typeof (enumerator.value);\r\n if (!expectedType.includes(receivedType)) // is receivedType a substring of expectedType? - easiest way to check \"int\" === \"int\" | \"integer\" && \"string\" === \"string\"\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an incompatible type. It must be \"${expectedType}\", not \"${receivedType}\".`);\r\n\r\n if (undefined === enumerator.name)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator that is missing the required attribute 'name'.`);\r\n if (typeof (enumerator.name) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'name' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== enumerator.label) {\r\n if (typeof (enumerator.label) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'label' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n if (undefined !== enumerator.description) {\r\n if (typeof (enumerator.description) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this._currentItemFullName} has an enumerator with an invalid 'description' attribute. It should be of type 'string'.`);\r\n }\r\n }\r\n\r\n return (jsonObj as unknown) as EnumerationProps;\r\n }\r\n\r\n /**\r\n * Type checks KindOfQuantity and returns KindOfQuantityProps interface\r\n * @param jsonObj\r\n * @returns KindOfQuantityProps\r\n */\r\n public parseKindOfQuantity(jsonObj: UnknownObject): KindOfQuantityProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.relativeError)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'relativeError' attribute.`);\r\n if (typeof (jsonObj.relativeError) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'relativeError' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.presentationUnits) {\r\n if (!Array.isArray(jsonObj.presentationUnits) && typeof (jsonObj.presentationUnits) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'presentationUnits' attribute. It should be of type 'string' or 'string[]'.`);\r\n }\r\n\r\n if (undefined === jsonObj.persistenceUnit)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} is missing the required 'persistenceUnit' attribute.`);\r\n if (typeof (jsonObj.persistenceUnit) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The KindOfQuantity ${this._currentItemFullName} has an invalid 'persistenceUnit' attribute. It should be of type 'string'.`);\r\n\r\n return (jsonObj as unknown) as KindOfQuantityProps;\r\n }\r\n\r\n /**\r\n * Type checks Property Category and returns PropertyCategoryProps interface\r\n * @param jsonObj\r\n * @returns PropertyCategoryProps\r\n */\r\n public parsePropertyCategory(jsonObj: UnknownObject): PropertyCategoryProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined !== jsonObj.priority) { // TODO: make required\r\n if (typeof (jsonObj.priority) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The PropertyCategory ${this._currentItemFullName} has an invalid 'priority' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n return (jsonObj as unknown) as PropertyCategoryProps;\r\n }\r\n\r\n /**\r\n * Type checks unit and returns UnitProps interface\r\n * @param jsonObj\r\n * @returns UnitProps\r\n */\r\n public parseUnit(jsonObj: UnknownObject): SchemaItemUnitProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.phenomenon)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\r\n if (typeof (jsonObj.phenomenon) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.unitSystem)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\r\n if (typeof (jsonObj.unitSystem) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.definition)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} does not have the required 'definition' attribute.`);\r\n if (typeof (jsonObj.definition) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.numerator) {\r\n if (typeof (jsonObj.numerator) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.denominator) {\r\n if (typeof (jsonObj.denominator) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.offset) {\r\n if (typeof (jsonObj.offset) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Unit ${this._currentItemFullName} has an invalid 'offset' attribute. It should be of type 'number'.`);\r\n }\r\n return (jsonObj as unknown) as SchemaItemUnitProps;\r\n }\r\n\r\n /**\r\n * Type checks inverted unit and returns InvertedUnitProps interface\r\n * @param jsonObj\r\n * @returns InvertedUnitProps\r\n */\r\n public parseInvertedUnit(jsonObj: UnknownObject): InvertedUnitProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.invertsUnit)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'invertsUnit' attribute.`);\r\n if (typeof (jsonObj.invertsUnit) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'invertsUnit' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.unitSystem)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} does not have the required 'unitSystem' attribute.`);\r\n if (typeof (jsonObj.unitSystem) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The InvertedUnit ${this._currentItemFullName} has an invalid 'unitSystem' attribute. It should be of type 'string'.`);\r\n\r\n return (jsonObj as unknown) as InvertedUnitProps;\r\n }\r\n\r\n /**\r\n * Type checks constant and returns ConstantProps interface\r\n * @param jsonObj\r\n * @returns ConstantProps\r\n */\r\n public parseConstant(jsonObj: UnknownObject): ConstantProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.phenomenon)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'phenomenon' attribute.`);\r\n if (typeof (jsonObj.phenomenon) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'phenomenon' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.definition)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} does not have the required 'definition' attribute.`);\r\n if (typeof (jsonObj.definition) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.numerator) {\r\n if (typeof (jsonObj.numerator) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'numerator' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.denominator) {\r\n if (typeof (jsonObj.denominator) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this._currentItemFullName} has an invalid 'denominator' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n return (jsonObj as unknown) as ConstantProps;\r\n }\r\n\r\n /**\r\n * Type checks phenomenon and returns PhenomenonProps interface\r\n * @param jsonObj\r\n * @returns PhenomenonProps\r\n */\r\n public parsePhenomenon(jsonObj: UnknownObject): PhenomenonProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.definition)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} does not have the required 'definition' attribute.`);\r\n if (typeof (jsonObj.definition) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this._currentItemFullName} has an invalid 'definition' attribute. It should be of type 'string'.`);\r\n return (jsonObj as unknown) as PhenomenonProps;\r\n }\r\n\r\n /**\r\n * Type checks format and returns SchemaItemFormatProps interface\r\n * @param jsonObj\r\n * @returns SchemaItemFormatProps\r\n */\r\n public parseFormat(jsonObj: UnknownObject): SchemaItemFormatProps {\r\n this.checkSchemaItemProps(jsonObj);\r\n if (undefined === jsonObj.type)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} does not have the required 'type' attribute.`);\r\n if (typeof (jsonObj.type) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'type' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.precision && typeof (jsonObj.precision) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'precision' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.roundFactor && typeof (jsonObj.roundFactor) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'roundFactor' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.minWidth && typeof (jsonObj.minWidth) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'minWidth' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.showSignOption && typeof (jsonObj.showSignOption) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'showSignOption' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.formatTraits) {\r\n if (!Array.isArray(jsonObj.formatTraits) && typeof (jsonObj.formatTraits) !== \"string\") // must be either an array of strings or a string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'formatTraits' attribute. It should be of type 'string' or 'string[]'.`);\r\n }\r\n\r\n if (undefined !== jsonObj.decimalSeparator && typeof (jsonObj.decimalSeparator) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'decimalSeparator' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.thousandSeparator && typeof (jsonObj.thousandSeparator) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'thousandSeparator' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.uomSeparator && typeof (jsonObj.uomSeparator) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationSeparator' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.composite) { // optional\r\n if (!isObject(jsonObj.composite))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'composite' object.`);\r\n if (undefined !== jsonObj.composite.includeZero && typeof (jsonObj.composite.includeZero) !== \"boolean\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'includeZero' attribute. It should be of type 'boolean'.`);\r\n\r\n if (undefined !== jsonObj.composite.spacer && typeof (jsonObj.composite.spacer) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'spacer' attribute. It should be of type 'string'.`);\r\n\r\n // if composite is defined\r\n if (undefined === jsonObj.composite.units)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'Composite' attribute. It should have 1-4 units.`);\r\n if (!Array.isArray(jsonObj.composite.units))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\r\n\r\n for (let i = 0; i < jsonObj.composite.units.length; i++) {\r\n if (!isObject(jsonObj.composite.units[i]))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has a Composite with an invalid 'units' attribute. It should be of type 'object[]'.`);\r\n\r\n if (undefined === jsonObj.composite.units[i].name) // required\r\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.`);\r\n if (typeof (jsonObj.composite.units[i].name) !== \"string\")\r\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'.`);\r\n\r\n if (undefined !== jsonObj.composite.units[i].label && typeof (jsonObj.composite.units[i].label) !== \"string\")\r\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'.`);\r\n }\r\n }\r\n return (jsonObj as unknown) as SchemaItemFormatProps;\r\n }\r\n\r\n private isValidPropertyType(type: string): boolean {\r\n type = type.toLowerCase();\r\n return (type === \"primitiveproperty\") ||\r\n (type === \"structproperty\") ||\r\n (type === \"primitivearrayproperty\") ||\r\n (type === \"structarrayproperty\") ||\r\n (type === \"navigationproperty\");\r\n }\r\n\r\n /**\r\n * Type checks property and returns PropertyProps interface\r\n * @param jsonObj\r\n * @returns PropertyProps\r\n */\r\n private checkPropertyProps(jsonObj: UnknownObject): PropertyProps {\r\n const propName = jsonObj.name;\r\n\r\n if (undefined !== jsonObj.label && typeof (jsonObj.label) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'label' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.description && typeof (jsonObj.description) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'description' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.priority && typeof (jsonObj.priority) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'priority' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.isReadOnly && typeof (jsonObj.isReadOnly) !== \"boolean\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'isReadOnly' attribute. It should be of type 'boolean'.`);\r\n\r\n if (undefined !== jsonObj.category && typeof (jsonObj.category) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'category' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.kindOfQuantity && typeof (jsonObj.kindOfQuantity) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'kindOfQuantity' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.inherited && typeof (jsonObj.inherited) !== \"boolean\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'inherited' attribute. It should be of type 'boolean'.`);\r\n\r\n if (undefined !== jsonObj.customAttributes && !Array.isArray(jsonObj.customAttributes))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'customAttributes' attribute. It should be of type 'array'.`);\r\n return (jsonObj as unknown) as PropertyProps;\r\n }\r\n\r\n private checkPropertyTypename(jsonObj: UnknownObject): void {\r\n const propName = jsonObj.name;\r\n if (undefined === jsonObj.typeName)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} is missing the required 'typeName' attribute.`);\r\n if (typeof (jsonObj.typeName) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'typeName' attribute. It should be of type 'string'.`);\r\n }\r\n\r\n private checkPropertyMinAndMaxOccurs(jsonObj: UnknownObject): void {\r\n const propName = jsonObj.name;\r\n if (undefined !== jsonObj.minOccurs && typeof (jsonObj.minOccurs) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minOccurs' attribute. It should be of type 'number'.`);\r\n if (undefined !== jsonObj.maxOccurs && typeof (jsonObj.maxOccurs) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxOccurs' attribute. It should be of type 'number'.`);\r\n }\r\n\r\n /**\r\n * Type checks PrimitiveOrEnumProperty and returns PrimitiveOrEnumPropertyBaseProps interface\r\n * @param jsonObj\r\n * @returns PrimitiveOrEnumPropertyBaseProps\r\n */\r\n private checkPrimitiveOrEnumPropertyBaseProps(jsonObj: UnknownObject): PrimitiveOrEnumPropertyBaseProps {\r\n this.checkPropertyProps(jsonObj);\r\n this.checkPropertyTypename(jsonObj);\r\n const propName = jsonObj.name;\r\n\r\n if (undefined !== jsonObj.minLength && typeof (jsonObj.minLength) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minLength' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.maxLength && typeof (jsonObj.maxLength) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxLength' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.minValue && typeof (jsonObj.minValue) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'minValue' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.maxValue && typeof (jsonObj.maxValue) !== \"number\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'maxValue' attribute. It should be of type 'number'.`);\r\n\r\n if (undefined !== jsonObj.extendedTypeName && typeof (jsonObj.extendedTypeName) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECProperty ${this._currentItemFullName}.${propName} has an invalid 'extendedTypeName' attribute. It should be of type 'string'.`);\r\n return (jsonObj as unknown) as PrimitiveOrEnumPropertyBaseProps;\r\n }\r\n\r\n /**\r\n * Type checks PrimitiveProperty and returns PrimitivePropertyProps interface\r\n * @param jsonObj\r\n * @returns PrimitivePropertyProps\r\n */\r\n public parsePrimitiveProperty(jsonObj: UnknownObject): PrimitivePropertyProps {\r\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\r\n return (jsonObj as unknown) as PrimitivePropertyProps;\r\n }\r\n\r\n /**\r\n * Type checks StructProperty and returns StructPropertyProps interface\r\n * @param jsonObj\r\n * @returns StructPropertyProps\r\n */\r\n public parseStructProperty(jsonObj: UnknownObject): StructPropertyProps {\r\n this.checkPropertyProps(jsonObj);\r\n this.checkPropertyTypename(jsonObj);\r\n return (jsonObj as unknown) as StructPropertyProps;\r\n }\r\n\r\n /**\r\n * Type checks PrimitiveArrayProperty and returns PrimitiveArrayPropertyProps interface\r\n * @param jsonObj\r\n * @returns PrimitiveArrayPropertyProps\r\n */\r\n public parsePrimitiveArrayProperty(jsonObj: UnknownObject): PrimitiveArrayPropertyProps {\r\n this.checkPrimitiveOrEnumPropertyBaseProps(jsonObj);\r\n this.checkPropertyMinAndMaxOccurs(jsonObj);\r\n return (jsonObj as unknown) as PrimitiveArrayPropertyProps;\r\n }\r\n\r\n /**\r\n * Type checks StructArrayProperty and returns StructArrayPropertyProps interface\r\n * @param jsonObj\r\n * @returns StructArrayPropertyProps\r\n */\r\n public parseStructArrayProperty(jsonObj: UnknownObject): StructArrayPropertyProps {\r\n this.checkPropertyProps(jsonObj);\r\n this.checkPropertyTypename(jsonObj);\r\n this.checkPropertyMinAndMaxOccurs(jsonObj);\r\n return (jsonObj as unknown) as StructArrayPropertyProps;\r\n }\r\n\r\n /**\r\n * Type checks NavigationProperty and returns NavigationPropertyProps interface\r\n * @param jsonObj\r\n * @returns NavigationPropertyProps\r\n */\r\n public parseNavigationProperty(jsonObj: UnknownObject): NavigationPropertyProps {\r\n this.checkPropertyProps(jsonObj);\r\n const fullname = `${this._currentItemFullName}.${jsonObj.name}`;\r\n\r\n if (undefined === jsonObj.relationshipName)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'relationshipName' property.`);\r\n if (typeof (jsonObj.relationshipName) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'relationshipName' property. It should be of type 'string'.`);\r\n\r\n if (undefined === jsonObj.direction)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} is missing the required 'direction' property.`);\r\n if (typeof (jsonObj.direction) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Navigation Property ${fullname} has an invalid 'direction' property. It should be of type 'string'.`);\r\n\r\n return (jsonObj as unknown) as NavigationPropertyProps;\r\n }\r\n\r\n public getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple> {\r\n return this.getCustomAttributeProviders(this._rawSchema, \"Schema\", this._schemaName);\r\n }\r\n\r\n public getClassCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\r\n return this.getCustomAttributeProviders(jsonObj, \"ECClass\", this._currentItemFullName);\r\n }\r\n\r\n public getPropertyCustomAttributeProviders(jsonObj: UnknownObject): Iterable<CAProviderTuple> {\r\n return this.getCustomAttributeProviders(jsonObj, \"ECProperty\", `${this._currentItemFullName}.${jsonObj.name}`);\r\n }\r\n\r\n public getRelationshipConstraintCustomAttributeProviders(jsonObj: UnknownObject): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */] {\r\n const sourceCustomAttributes = this.getCustomAttributeProviders(jsonObj.source as UnknownObject, \"Source Constraint of\", this._currentItemFullName);\r\n const targetCustomAttributes = this.getCustomAttributeProviders(jsonObj.target as UnknownObject, \"Target Constraint of\", this._currentItemFullName);\r\n return [sourceCustomAttributes, targetCustomAttributes];\r\n }\r\n\r\n private *getCustomAttributeProviders(jsonObj: UnknownObject, type: string, name?: string): Iterable<CAProviderTuple> {\r\n if (undefined !== jsonObj.customAttributes) {\r\n if (!Array.isArray(jsonObj.customAttributes))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\r\n\r\n for (const instance of jsonObj.customAttributes) {\r\n if (!isObject(instance) || Array.isArray(instance))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ${type} ${name} has an invalid 'customAttributes' attribute. It should be of type 'object[]'.`);\r\n if (undefined === instance.className)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes is missing the required 'className' attribute.`);\r\n if (typeof (instance.className) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `A CustomAttribute in ${name}.customAttributes has an invalid 'className' attribute. It should be of type 'string'.`);\r\n\r\n const provider = (_caClass: CustomAttributeClass) => {\r\n return instance as CustomAttribute;\r\n };\r\n\r\n const caTuple: CAProviderTuple = [instance.className, provider];\r\n yield caTuple;\r\n }\r\n }\r\n }\r\n}\r\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;YACt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AK,OAAO,CAAC,gBAAgB,EAAE,CAAC;YAC3C,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC;gBAC1C,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,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 ${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.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 = 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 = 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 = 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 = 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}.${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}.${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 +1 @@
1
- {"version":3,"file":"JsonProps.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonProps.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n * See LICENSE.md in the project root for license terms and full copyright notice.\r\n *--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { FormatDefinition, FormatProps, UnitSystemKey } from \"@itwin/core-quantity\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport type AnyPropertyProps =\r\n | PrimitivePropertyProps\r\n | StructPropertyProps\r\n | PrimitiveArrayPropertyProps\r\n | StructArrayPropertyProps\r\n | NavigationPropertyProps;\r\n/**\r\n * @public @preview\r\n */\r\nexport type AnyClassProps =\r\n | EntityClassProps\r\n | MixinProps\r\n | CustomAttributeClassProps\r\n | RelationshipClassProps;\r\n/**\r\n * @public @preview\r\n */\r\nexport type AnySchemaItemProps =\r\n | AnyClassProps\r\n | EnumerationProps\r\n | KindOfQuantityProps\r\n | PropertyCategoryProps\r\n | SchemaItemUnitProps\r\n | InvertedUnitProps\r\n | ConstantProps\r\n | PhenomenonProps\r\n | SchemaItemFormatProps\r\n | SchemaItemOverrideFormatProps;\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface SchemaProps {\r\n readonly $schema: string;\r\n readonly name: string;\r\n readonly version: string;\r\n readonly alias: string;\r\n readonly label?: string;\r\n readonly description?: string;\r\n readonly references?: SchemaReferenceProps[];\r\n readonly items?: { [name: string]: SchemaItemProps };\r\n readonly customAttributes?: Array<{ [value: string]: any }>;\r\n readonly ecSpecMajorVersion?: number;\r\n readonly ecSpecMinorVersion?: number;\r\n}\r\n\r\n/**\r\n * JSON Object interface used to deserialize into a [[SchemaKey]].\r\n * @public @preview\r\n */\r\nexport interface SchemaKeyProps {\r\n /** The schema name */\r\n readonly name: string;\r\n /** Read version of the schema */\r\n readonly read: number;\r\n /** Write version of the schema */\r\n readonly write: number;\r\n /** Minor version of the schema */\r\n readonly minor: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface SchemaReferenceProps {\r\n readonly name: string;\r\n readonly version: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface SchemaItemProps {\r\n // NEEDSWORK: Still need to clarify how single-item deserialization works...\r\n readonly $schema?: string;\r\n readonly schema?: string; // conditionally required\r\n readonly schemaVersion?: string;\r\n readonly name?: string;\r\n readonly schemaItemType?: string;\r\n readonly label?: string;\r\n readonly description?: string;\r\n readonly customAttributes?: Array<{ [value: string]: any }>;\r\n readonly originalECSpecMajorVersion?: number;\r\n readonly originalECSpecMinorVersion?: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface ClassProps extends SchemaItemProps {\r\n readonly modifier?: string;\r\n readonly baseClass?: string;\r\n readonly properties?: AnyPropertyProps[];\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface EntityClassProps extends ClassProps {\r\n readonly mixins?: string[];\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface MixinProps extends ClassProps {\r\n readonly appliesTo: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport type StructClassProps = ClassProps;\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface CustomAttributeClassProps extends ClassProps {\r\n /**\r\n * Can be any combination of the [CustomAttributeContainerType]$(docs/bis/ec/customattribute-container-types.md) string values\r\n * separated by commas.\r\n */\r\n readonly appliesTo: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface RelationshipClassProps extends ClassProps {\r\n readonly strength: string;\r\n readonly strengthDirection: string;\r\n readonly source: RelationshipConstraintProps;\r\n readonly target: RelationshipConstraintProps;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface RelationshipConstraintProps {\r\n readonly multiplicity: string;\r\n readonly roleLabel: string;\r\n readonly polymorphic: boolean;\r\n readonly abstractConstraint?: string;\r\n readonly constraintClasses: string[];\r\n readonly customAttributes?: Array<{ [value: string]: any }>;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface EnumerationProps extends SchemaItemProps {\r\n readonly type: string;\r\n readonly isStrict: boolean;\r\n readonly enumerators: EnumeratorProps[];\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface EnumeratorProps {\r\n readonly name: string;\r\n readonly value: string | number;\r\n readonly label?: string;\r\n readonly description?: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface KindOfQuantityProps extends SchemaItemProps {\r\n readonly persistenceUnit: string;\r\n readonly presentationUnits?: string | string[];\r\n readonly relativeError: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PropertyCategoryProps extends SchemaItemProps {\r\n readonly priority: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PropertyProps {\r\n readonly name: string;\r\n readonly type: string;\r\n readonly description?: string;\r\n readonly label?: string;\r\n readonly isReadOnly?: boolean;\r\n readonly category?: string;\r\n readonly priority?: number;\r\n readonly inherited?: boolean;\r\n readonly kindOfQuantity?: string;\r\n readonly customAttributes?: Array<{ [value: string]: any }>;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PrimitiveOrEnumPropertyBaseProps extends PropertyProps {\r\n readonly extendedTypeName?: string;\r\n readonly minLength?: number;\r\n readonly maxLength?: number;\r\n readonly minValue?: number;\r\n readonly maxValue?: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PrimitivePropertyProps\r\n extends PrimitiveOrEnumPropertyBaseProps {\r\n readonly typeName: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface StructPropertyProps extends PropertyProps {\r\n readonly typeName: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface EnumerationPropertyProps\r\n extends PrimitiveOrEnumPropertyBaseProps {\r\n readonly typeName: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface ArrayPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\r\n readonly minOccurs?: number;\r\n readonly maxOccurs?: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PrimitiveArrayPropertyProps extends ArrayPropertyProps {\r\n readonly typeName: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface StructArrayPropertyProps extends ArrayPropertyProps {\r\n readonly typeName: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface NavigationPropertyProps extends PropertyProps {\r\n readonly relationshipName: string;\r\n readonly direction: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface ConstantProps extends SchemaItemProps {\r\n readonly phenomenon: string;\r\n readonly definition: string;\r\n readonly numerator?: number;\r\n readonly denominator?: number;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport type SchemaItemFormatProps = SchemaItemProps & FormatProps;\r\n\r\n/**\r\n * This interface defines properties necessary to support persistence of a set of formats.\r\n * @beta\r\n */\r\nexport interface FormatSet {\r\n /** The unique name identifier for this format set. */\r\n name: string;\r\n /** The display label for this format set. */\r\n label: string;\r\n /** The description for this format set. */\r\n description?: string;\r\n /** A [UnitSystemKey]($quantity) that determines the unit system for this format set. */\r\n unitSystem: UnitSystemKey;\r\n /** \r\n * A mapping of kind of quantity identifiers to their corresponding format properties.\r\n * When a format is a [FormatDefinition]($quantity), it defines the complete format specification.\r\n * When a format is a string, it references another kindOfQuantityId to map one format to another.\r\n */\r\n formats: { [kindOfQuantityId: string]: FormatDefinition | string };\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface SchemaItemOverrideFormatProps extends SchemaItemFormatProps {\r\n readonly parent: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface InvertedUnitProps extends SchemaItemProps {\r\n readonly invertsUnit: string;\r\n readonly unitSystem: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface PhenomenonProps extends SchemaItemProps {\r\n readonly definition: string;\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport type UnitSystemProps = SchemaItemProps;\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface SchemaItemUnitProps extends SchemaItemProps {\r\n readonly phenomenon: string;\r\n readonly unitSystem: string;\r\n readonly definition: string;\r\n readonly numerator?: number;\r\n readonly denominator?: number;\r\n readonly offset?: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"JsonProps.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonProps.ts"],"names":[],"mappings":"AAAA;;;gGAGgG;AAChG;;GAEG","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/** @packageDocumentation\n * @module Metadata\n */\n\nimport { FormatDefinition, FormatProps, UnitSystemKey } from \"@itwin/core-quantity\";\n\n/**\n * @public @preview\n */\nexport type AnyPropertyProps =\n | PrimitivePropertyProps\n | StructPropertyProps\n | PrimitiveArrayPropertyProps\n | StructArrayPropertyProps\n | NavigationPropertyProps;\n/**\n * @public @preview\n */\nexport type AnyClassProps =\n | EntityClassProps\n | MixinProps\n | CustomAttributeClassProps\n | RelationshipClassProps;\n/**\n * @public @preview\n */\nexport type AnySchemaItemProps =\n | AnyClassProps\n | EnumerationProps\n | KindOfQuantityProps\n | PropertyCategoryProps\n | SchemaItemUnitProps\n | InvertedUnitProps\n | ConstantProps\n | PhenomenonProps\n | SchemaItemFormatProps\n | SchemaItemOverrideFormatProps;\n\n/**\n * @public @preview\n */\nexport interface SchemaProps {\n readonly $schema: string;\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly label?: string;\n readonly description?: string;\n readonly references?: SchemaReferenceProps[];\n readonly items?: { [name: string]: SchemaItemProps };\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly ecSpecMajorVersion?: number;\n readonly ecSpecMinorVersion?: number;\n}\n\n/**\n * JSON Object interface used to deserialize into a [[SchemaKey]].\n * @public @preview\n */\nexport interface SchemaKeyProps {\n /** The schema name */\n readonly name: string;\n /** Read version of the schema */\n readonly read: number;\n /** Write version of the schema */\n readonly write: number;\n /** Minor version of the schema */\n readonly minor: number;\n}\n\n/**\n * @public @preview\n */\nexport interface SchemaReferenceProps {\n readonly name: string;\n readonly version: string;\n}\n\n/**\n * @public @preview\n */\nexport interface SchemaItemProps {\n // NEEDSWORK: Still need to clarify how single-item deserialization works...\n readonly $schema?: string;\n readonly schema?: string; // conditionally required\n readonly schemaVersion?: string;\n readonly name?: string;\n readonly schemaItemType?: string;\n readonly label?: string;\n readonly description?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly originalECSpecMajorVersion?: number;\n readonly originalECSpecMinorVersion?: number;\n}\n\n/**\n * @public @preview\n */\nexport interface ClassProps extends SchemaItemProps {\n readonly modifier?: string;\n readonly baseClass?: string;\n readonly properties?: AnyPropertyProps[];\n}\n\n/**\n * @public @preview\n */\nexport interface EntityClassProps extends ClassProps {\n readonly mixins?: string[];\n}\n\n/**\n * @public @preview\n */\nexport interface MixinProps extends ClassProps {\n readonly appliesTo: string;\n}\n\n/**\n * @public @preview\n */\nexport type StructClassProps = ClassProps;\n\n/**\n * @public @preview\n */\nexport interface CustomAttributeClassProps extends ClassProps {\n /**\n * Can be any combination of the [CustomAttributeContainerType]$(docs/bis/ec/customattribute-container-types.md) string values\n * separated by commas.\n */\n readonly appliesTo: string;\n}\n\n/**\n * @public @preview\n */\nexport interface RelationshipClassProps extends ClassProps {\n readonly strength: string;\n readonly strengthDirection: string;\n readonly source: RelationshipConstraintProps;\n readonly target: RelationshipConstraintProps;\n}\n\n/**\n * @public @preview\n */\nexport interface RelationshipConstraintProps {\n readonly multiplicity: string;\n readonly roleLabel: string;\n readonly polymorphic: boolean;\n readonly abstractConstraint?: string;\n readonly constraintClasses: string[];\n readonly customAttributes?: Array<{ [value: string]: any }>;\n}\n\n/**\n * @public @preview\n */\nexport interface EnumerationProps extends SchemaItemProps {\n readonly type: string;\n readonly isStrict: boolean;\n readonly enumerators: EnumeratorProps[];\n}\n\n/**\n * @public @preview\n */\nexport interface EnumeratorProps {\n readonly name: string;\n readonly value: string | number;\n readonly label?: string;\n readonly description?: string;\n}\n\n/**\n * @public @preview\n */\nexport interface KindOfQuantityProps extends SchemaItemProps {\n readonly persistenceUnit: string;\n readonly presentationUnits?: string | string[];\n readonly relativeError: number;\n}\n\n/**\n * @public @preview\n */\nexport interface PropertyCategoryProps extends SchemaItemProps {\n readonly priority: number;\n}\n\n/**\n * @public @preview\n */\nexport interface PropertyProps {\n readonly name: string;\n readonly type: string;\n readonly description?: string;\n readonly label?: string;\n readonly isReadOnly?: boolean;\n readonly category?: string;\n readonly priority?: number;\n readonly inherited?: boolean;\n readonly kindOfQuantity?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n}\n\n/**\n * @public @preview\n */\nexport interface PrimitiveOrEnumPropertyBaseProps extends PropertyProps {\n readonly extendedTypeName?: string;\n readonly minLength?: number;\n readonly maxLength?: number;\n readonly minValue?: number;\n readonly maxValue?: number;\n}\n\n/**\n * @public @preview\n */\nexport interface PrimitivePropertyProps\n extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @public @preview\n */\nexport interface StructPropertyProps extends PropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @public @preview\n */\nexport interface EnumerationPropertyProps\n extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @public @preview\n */\nexport interface ArrayPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly minOccurs?: number;\n readonly maxOccurs?: number;\n}\n\n/**\n * @public @preview\n */\nexport interface PrimitiveArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @public @preview\n */\nexport interface StructArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @public @preview\n */\nexport interface NavigationPropertyProps extends PropertyProps {\n readonly relationshipName: string;\n readonly direction: string;\n}\n\n/**\n * @public @preview\n */\nexport interface ConstantProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n}\n\n/**\n * @public @preview\n */\nexport type SchemaItemFormatProps = SchemaItemProps & FormatProps;\n\n/**\n * This interface defines properties necessary to support persistence of a set of formats.\n * @beta\n */\nexport interface FormatSet {\n /** The unique name identifier for this format set. */\n name: string;\n /** The display label for this format set. */\n label: string;\n /** The description for this format set. */\n description?: string;\n /** A [UnitSystemKey]($quantity) that determines the unit system for this format set. */\n unitSystem: UnitSystemKey;\n /** \n * A mapping of kind of quantity identifiers to their corresponding format properties.\n * When a format is a [FormatDefinition]($quantity), it defines the complete format specification.\n * When a format is a string, it references another kindOfQuantityId to map one format to another.\n */\n formats: { [kindOfQuantityId: string]: FormatDefinition | string };\n}\n\n/**\n * @public @preview\n */\nexport interface SchemaItemOverrideFormatProps extends SchemaItemFormatProps {\n readonly parent: string;\n}\n\n/**\n * @public @preview\n */\nexport interface InvertedUnitProps extends SchemaItemProps {\n readonly invertsUnit: string;\n readonly unitSystem: string;\n}\n\n/**\n * @public @preview\n */\nexport interface PhenomenonProps extends SchemaItemProps {\n readonly definition: string;\n}\n\n/**\n * @public @preview\n */\nexport type UnitSystemProps = SchemaItemProps;\n\n/**\n * @public @preview\n */\nexport interface SchemaItemUnitProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly unitSystem: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n readonly offset?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaGraphUtil.js","sourceRoot":"","sources":["../../../src/Deserialization/SchemaGraphUtil.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,OAAO,eAAe;IAC1B;;;;;;OAMG;IACI,MAAM,CAAC,gCAAgC,CAAC,YAAoB,EAAE,OAAkB;QACrF,IAAI,CAAC,OAAO;YACV,OAAO,GAAG,EAAE,CAAC;QAEf,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,YAAuB,EAAE,EAAE;YAC3D,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;QAC/E,CAAC,CAAC;QAEF,IAAI,CAAC,mCAAmC,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC1E,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;YAChD,IAAI,CAAC,gCAAgC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,oCAAoC,CAAC,WAAsC;QACvF,MAAM,UAAU,GAAsB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,CAAC,OAAmB,EAAE,SAAoB,EAAE,EAAE;YAC7D,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;QAEF,KAAI,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,mCAAmC,CAAC,UA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AM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAC1C,WAAW,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBACzC,OAAO;YACT,CAAC;QACH,CAAC;QAED,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACnC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport type { SchemaInfo } from \"../Interfaces\";\r\nimport type { SchemaKey } from \"../SchemaKey\";\r\nimport type { Schema } from \"../Metadata/Schema\";\r\n\r\ntype SchemaReferenceLookup<T extends SchemaInfo> = (input: T, reference: SchemaKey) => T | undefined;\r\n\r\n/**\r\n * Utility class for working with Schema graphs.\r\n * @internal\r\n */\r\nexport class SchemaGraphUtil {\r\n /**\r\n * Creates a flattened list of schemas in topological order, typically used before schema import\r\n * so that dependent schemas are processed after their references.\r\n * @param insertSchema The schema to be imported.\r\n * @param schemas The schema collection that will hold the ordered schemas. If null, the collection\r\n * will be created internally and passed along during recursive calls.\r\n */\r\n public static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[] {\r\n if (!schemas)\r\n schemas = [];\r\n\r\n const lookupFn = (schema: Schema, referenceKey: SchemaKey) => {\r\n return schema.references.find((s) => s.schemaKey.name === referenceKey.name);\r\n };\r\n\r\n this.insertSchemaInDependencyOrderedList(schemas, insertSchema, lookupFn);\r\n for (const reference of insertSchema.references) {\r\n this.buildDependencyOrderedSchemaList(reference, schemas);\r\n }\r\n return schemas;\r\n }\r\n\r\n /**\r\n * Returns a flat list of schemas in topological order, typically used before schema import\r\n * so that dependent schemas are processed after their references. This method does not alter\r\n * the original schemaInfos array.\r\n * @param schemaInfos The schema collection that will hold the ordered schemas.\r\n * @returns A list of schemas in topological order.\r\n */\r\n public static buildDependencyOrderedSchemaInfoList(schemaInfos: ReadonlyArray<SchemaInfo>): ReadonlyArray<SchemaInfo> {\r\n const sortedList: Array<SchemaInfo> = [];\r\n const lookupFn = (_schema: SchemaInfo, reference: SchemaKey) => {\r\n return schemaInfos.find((s) => s.schemaKey.name === reference.name);\r\n };\r\n\r\n for(const schemaInfo of schemaInfos) {\r\n this.insertSchemaInDependencyOrderedList(sortedList, schemaInfo, lookupFn);\r\n }\r\n\r\n return sortedList;\r\n }\r\n\r\n /**\r\n * Indicates if the given Schema references the possibleDependency Schema.\r\n * @param schema The possible dependent schema.\r\n * @param possibleDependency The possible Schema dependency.\r\n */\r\n private static dependsOn<T extends SchemaInfo>(schema: T, possibleDependency: T, lookup: SchemaReferenceLookup<T>): boolean {\r\n if (this.directlyReferences(schema, possibleDependency))\r\n return true;\r\n\r\n // search for dependencies in indirect references\r\n for (const referenceInfo of schema.references) {\r\n const reference = lookup(schema, referenceInfo.schemaKey);\r\n if (reference && this.dependsOn(reference, possibleDependency, lookup))\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Indicates if the given Schema directly references the possiblyReferencedSchema Schema.\r\n * @param schema The possible parent schema.\r\n * @param possibleDependency The Schema that may be referenced.\r\n */\r\n private static directlyReferences<T extends SchemaInfo>(schema: T, possiblyReferencedSchema: T): boolean {\r\n return schema.references.some((ref) => ref.schemaKey.name === possiblyReferencedSchema.schemaKey.name);\r\n }\r\n\r\n /**\r\n * Helper method that manages the insertion of a Schema into the schemas collection\r\n * based on the topological ordering algorithm.\r\n * @param schemas The ordered collection.\r\n * @param insert The instance to insert.\r\n */\r\n private static insertSchemaInDependencyOrderedList<T extends SchemaInfo>(orderedList: T[], insert: T, lookup: SchemaReferenceLookup<T>) {\r\n if (orderedList.includes(insert))\r\n return;\r\n\r\n for (let i = orderedList.length - 1; i >= 0; --i) {\r\n const schema = orderedList[i];\r\n if (this.dependsOn(insert, schema, lookup)) {\r\n // insert right after the referenced schema in the list\r\n const index = orderedList.indexOf(schema);\r\n orderedList.splice(index + 1, 0, insert);\r\n return;\r\n }\r\n }\r\n\r\n orderedList.splice(0, 0, insert);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"SchemaGraphUtil.js","sourceRoot":"","sources":["../../../src/Deserialization/SchemaGraphUtil.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,MAAM,OAAO,eAAe;IAC1B;;;;;;OAMG;IACI,MAAM,CAAC,gCAAgC,CAAC,YAAoB,EAAE,OAAkB;QACrF,IAAI,CAAC,OAAO;YACV,OAAO,GAAG,EAAE,CAAC;QAEf,MAAM,QAAQ,GAAG,CAAC,MAAc,EAAE,YAAuB,EAAE,EAAE;YAC3D,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,YAAY,CAAC,IAAI,CAAC,CAAC;QAC/E,CAAC,CAAC;QAEF,IAAI,CAAC,mCAAmC,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAC;QAC1E,KAAK,MAAM,SAAS,IAAI,YAAY,CAAC,UAAU,EAAE,CAAC;YAChD,IAAI,CAAC,gCAAgC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,oCAAoC,CAAC,WAAsC;QACvF,MAAM,UAAU,GAAsB,EAAE,CAAC;QACzC,MAAM,QAAQ,GAAG,CAAC,OAAmB,EAAE,SAAoB,EAAE,EAAE;YAC7D,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;QACtE,CAAC,CAAC;QAEF,KAAI,MAAM,UAAU,IAAI,WAAW,E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,CAAC,EAAE,CAAC;gBAC3C,uDAAuD;gBACvD,MAAM,KAAK,GAAG,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;gBAC1C,WAAW,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;gBACzC,OAAO;YACT,CAAC;QACH,CAAC;QAED,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IACnC,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*--------------------------------------------------------------------------------------------*/\nimport type { SchemaInfo } from \"../Interfaces\";\nimport type { SchemaKey } from \"../SchemaKey\";\nimport type { Schema } from \"../Metadata/Schema\";\n\ntype SchemaReferenceLookup<T extends SchemaInfo> = (input: T, reference: SchemaKey) => T | undefined;\n\n/**\n * Utility class for working with Schema graphs.\n * @internal\n */\nexport class SchemaGraphUtil {\n /**\n * Creates a flattened list of schemas in topological order, typically used before schema import\n * so that dependent schemas are processed after their references.\n * @param insertSchema The schema to be imported.\n * @param schemas The schema collection that will hold the ordered schemas. If null, the collection\n * will be created internally and passed along during recursive calls.\n */\n public static buildDependencyOrderedSchemaList(insertSchema: Schema, schemas?: Schema[]): Schema[] {\n if (!schemas)\n schemas = [];\n\n const lookupFn = (schema: Schema, referenceKey: SchemaKey) => {\n return schema.references.find((s) => s.schemaKey.name === referenceKey.name);\n };\n\n this.insertSchemaInDependencyOrderedList(schemas, insertSchema, lookupFn);\n for (const reference of insertSchema.references) {\n this.buildDependencyOrderedSchemaList(reference, schemas);\n }\n return schemas;\n }\n\n /**\n * Returns a flat list of schemas in topological order, typically used before schema import\n * so that dependent schemas are processed after their references. This method does not alter\n * the original schemaInfos array.\n * @param schemaInfos The schema collection that will hold the ordered schemas.\n * @returns A list of schemas in topological order.\n */\n public static buildDependencyOrderedSchemaInfoList(schemaInfos: ReadonlyArray<SchemaInfo>): ReadonlyArray<SchemaInfo> {\n const sortedList: Array<SchemaInfo> = [];\n const lookupFn = (_schema: SchemaInfo, reference: SchemaKey) => {\n return schemaInfos.find((s) => s.schemaKey.name === reference.name);\n };\n\n for(const schemaInfo of schemaInfos) {\n this.insertSchemaInDependencyOrderedList(sortedList, schemaInfo, lookupFn);\n }\n\n return sortedList;\n }\n\n /**\n * Indicates if the given Schema references the possibleDependency Schema.\n * @param schema The possible dependent schema.\n * @param possibleDependency The possible Schema dependency.\n */\n private static dependsOn<T extends SchemaInfo>(schema: T, possibleDependency: T, lookup: SchemaReferenceLookup<T>): boolean {\n if (this.directlyReferences(schema, possibleDependency))\n return true;\n\n // search for dependencies in indirect references\n for (const referenceInfo of schema.references) {\n const reference = lookup(schema, referenceInfo.schemaKey);\n if (reference && this.dependsOn(reference, possibleDependency, lookup))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if the given Schema directly references the possiblyReferencedSchema Schema.\n * @param schema The possible parent schema.\n * @param possibleDependency The Schema that may be referenced.\n */\n private static directlyReferences<T extends SchemaInfo>(schema: T, possiblyReferencedSchema: T): boolean {\n return schema.references.some((ref) => ref.schemaKey.name === possiblyReferencedSchema.schemaKey.name);\n }\n\n /**\n * Helper method that manages the insertion of a Schema into the schemas collection\n * based on the topological ordering algorithm.\n * @param schemas The ordered collection.\n * @param insert The instance to insert.\n */\n private static insertSchemaInDependencyOrderedList<T extends SchemaInfo>(orderedList: T[], insert: T, lookup: SchemaReferenceLookup<T>) {\n if (orderedList.includes(insert))\n return;\n\n for (let i = orderedList.length - 1; i >= 0; --i) {\n const schema = orderedList[i];\n if (this.dependsOn(insert, schema, lookup)) {\n // insert right after the referenced schema in the list\n const index = orderedList.indexOf(schema);\n orderedList.splice(index + 1, 0, insert);\n return;\n }\n }\n\n orderedList.splice(0, 0, insert);\n }\n}\n"]}