@itwin/ecschema-metadata 5.6.0-dev.12 → 5.6.0-dev.14

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 (42) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/lib/cjs/Deserialization/JsonParser.d.ts.map +1 -1
  3. package/lib/cjs/Deserialization/JsonParser.js +12 -0
  4. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  5. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  6. package/lib/cjs/Deserialization/XmlParser.js +12 -0
  7. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  8. package/lib/cjs/Formatting/SchemaFormatsProvider.js +1 -1
  9. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -1
  10. package/lib/cjs/Metadata/Class.d.ts +14 -0
  11. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  12. package/lib/cjs/Metadata/Class.js +48 -3
  13. package/lib/cjs/Metadata/Class.js.map +1 -1
  14. package/lib/cjs/Metadata/Format.d.ts +3 -0
  15. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  16. package/lib/cjs/Metadata/Format.js +100 -26
  17. package/lib/cjs/Metadata/Format.js.map +1 -1
  18. package/lib/cjs/Metadata/OverrideFormat.d.ts +3 -0
  19. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  20. package/lib/cjs/Metadata/OverrideFormat.js +4 -1
  21. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  22. package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -1
  23. package/lib/esm/Deserialization/JsonParser.js +12 -0
  24. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  25. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  26. package/lib/esm/Deserialization/XmlParser.js +12 -0
  27. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  28. package/lib/esm/Formatting/SchemaFormatsProvider.js +1 -1
  29. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -1
  30. package/lib/esm/Metadata/Class.d.ts +14 -0
  31. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  32. package/lib/esm/Metadata/Class.js +49 -4
  33. package/lib/esm/Metadata/Class.js.map +1 -1
  34. package/lib/esm/Metadata/Format.d.ts +3 -0
  35. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  36. package/lib/esm/Metadata/Format.js +100 -26
  37. package/lib/esm/Metadata/Format.js.map +1 -1
  38. package/lib/esm/Metadata/OverrideFormat.d.ts +3 -0
  39. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  40. package/lib/esm/Metadata/OverrideFormat.js +4 -1
  41. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  42. package/package.json +7 -7
package/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log - @itwin/ecschema-metadata
2
2
 
3
- This log was last generated on Wed, 14 Jan 2026 17:54:14 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 22 Jan 2026 16:18:35 GMT and should not be manually modified.
4
+
5
+ ## 5.5.2
6
+ Thu, 22 Jan 2026 16:16:54 GMT
7
+
8
+ ### Updates
9
+
10
+ - Fixed the issue of getAllBaseClasses() method of ECClass not returning all the base classes
4
11
 
5
12
  ## 5.5.1
6
13
  Wed, 14 Jan 2026 17:52:53 GMT
@@ -1 +1 @@
1
- {"version":3,"file":"JsonParser.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/JsonParser.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EACL,aAAa,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,UAAU,EAChI,uBAAuB,EAAE,eAAe,EAAE,2BAA2B,EAAoC,sBAAsB,EAC/H,qBAAqB,EAAiB,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,E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6 +537,18 @@ class JsonParser extends AbstractParser_1.AbstractParser {
537
537
  throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'uomSeparator' attribute. It should be of type 'string'.`);
538
538
  if (undefined !== jsonObj.scientificType && typeof (jsonObj.scientificType) !== "string")
539
539
  throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'scientificType' attribute. It should be of type 'string'.`);
540
+ if (undefined !== jsonObj.ratioType && typeof (jsonObj.ratioType) !== "string")
541
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioType' attribute. It should be of type 'string'.`);
542
+ if (undefined !== jsonObj.ratioSeparator && typeof (jsonObj.ratioSeparator) !== "string")
543
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioSeparator' attribute. It should be of type 'string'.`);
544
+ if (undefined !== jsonObj.ratioFormatType && typeof (jsonObj.ratioFormatType) !== "string")
545
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioFormatType' attribute. It should be of type 'string'.`);
546
+ // Validate EC version if ratio properties exist - they require EC version 3.3+
547
+ if (jsonObj.ratioType !== undefined || jsonObj.ratioSeparator !== undefined || jsonObj.ratioFormatType !== undefined) {
548
+ if (this._ecSpecVersion === undefined || this._ecSpecVersion.readVersion < 3 || (this._ecSpecVersion.readVersion === 3 && this._ecSpecVersion.writeVersion < 3)) {
549
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has ratio properties that require EC version 3.3 or newer.`);
550
+ }
551
+ }
540
552
  if (undefined !== jsonObj.stationOffsetSize && typeof (jsonObj.stationOffsetSize) !== "number")
541
553
  throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be of type 'number'.`);
542
554
  if (undefined !== jsonObj.stationSeparator && typeof (jsonObj.stationSeparator) !== "string")
@@ -1 +1 @@
1
- {"version":3,"file":"JsonParser.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,4CAA6D;AAG7D,sCAAmC;AACnC,qDAAmE;AAOnE,qCAA2D;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,MAAa,UAAW,SAAQ,+BAA6B;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,yBAAa,CAAC,0BAAc,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,OAAO;QAET,MAAM,WAAW,GAAG,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K,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,yBAAa,CAAC,0BAAc,CAAC,aAAa,EAAE,OAAO,IAAI,IAAI,IAAI,gFAAgF,CAAC,CAAC;gBAC7J,IAAI,SAAS,KAAK,QAAQ,CAAC,SAAS;oBAClC,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,aAAa,EAAE,wBAAwB,IAAI,kEAAkE,CAAC,CAAC;gBACxJ,IAAI,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAC,KAAK,QAAQ;oBAC1C,MAAM,IAAI,yBAAa,CAAC,0BAAc,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;AAt1BD,gCAs1BC","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,4CAA6D;AAG7D,sCAAmC;AACnC,qDAAmE;AAOnE,qCAA2D;AAG3D,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC;AACjC,CAAC;AAED,MAAM,cAAc,GAAG,6CAA6C,CAAC;AAErE,g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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;AAt2BD,gCAs2BC","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.ratioType && typeof (jsonObj.ratioType) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioType' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.ratioSeparator && typeof (jsonObj.ratioSeparator) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioSeparator' attribute. It should be of type 'string'.`);\r\n\r\n if (undefined !== jsonObj.ratioFormatType && typeof (jsonObj.ratioFormatType) !== \"string\")\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has an invalid 'ratioFormatType' attribute. It should be of type 'string'.`);\r\n\r\n // Validate EC version if ratio properties exist - they require EC version 3.3+\r\n if (jsonObj.ratioType !== undefined || jsonObj.ratioSeparator !== undefined || jsonObj.ratioFormatType !== undefined) {\r\n if (this._ecSpecVersion === undefined || this._ecSpecVersion.readVersion < 3 || (this._ecSpecVersion.readVersion === 3 && this._ecSpecVersion.writeVersion < 3)) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Format ${this._currentItemFullName} has ratio properties that require EC version 3.3 or newer.`);\r\n }\r\n }\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 +1 @@
1
- {"version":3,"file":"XmlParser.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/XmlParser.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,eAAe,EAA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BAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS;IAWhF,OAAO,CAAC,oBAAoB;IAa5B;;OAEG;IACH,OAAO,CAAC,6BAA6B;CAwBtC"}
@@ -382,6 +382,15 @@ class XmlParser extends AbstractParser_1.AbstractParser {
382
382
  const thousandSeparator = this.getOptionalAttribute(xmlElement, "thousandSeparator");
383
383
  const uomSeparator = this.getOptionalAttribute(xmlElement, "uomSeparator");
384
384
  const scientificType = this.getOptionalAttribute(xmlElement, "scientificType");
385
+ const ratioType = this.getOptionalAttribute(xmlElement, "ratioType");
386
+ const ratioSeparator = this.getOptionalAttribute(xmlElement, "ratioSeparator");
387
+ const ratioFormatType = this.getOptionalAttribute(xmlElement, "ratioFormatType");
388
+ // Validate EC version if ratio properties exist - they require EC version 3.3+
389
+ if (ratioType !== undefined || ratioSeparator !== undefined || ratioFormatType !== undefined) {
390
+ if (this._ecSpecVersion === undefined || this._ecSpecVersion.readVersion < 3 || (this._ecSpecVersion.readVersion === 3 && this._ecSpecVersion.writeVersion < 3)) {
391
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaXML, `The Format ${this._currentItemFullName} has ratio properties that require EC version 3.3 or newer.`);
392
+ }
393
+ }
385
394
  const stationOffsetSize = this.getOptionalIntAttribute(xmlElement, "stationOffsetSize", `The Format ${this._currentItemFullName} has an invalid 'stationOffsetSize' attribute. It should be a numeric value.`);
386
395
  const stationSeparator = this.getOptionalAttribute(xmlElement, "stationSeparator");
387
396
  let composite;
@@ -424,6 +433,9 @@ class XmlParser extends AbstractParser_1.AbstractParser {
424
433
  thousandSeparator,
425
434
  uomSeparator,
426
435
  scientificType,
436
+ ratioType,
437
+ ratioSeparator,
438
+ ratioFormatType,
427
439
  stationOffsetSize,
428
440
  stationSeparator,
429
441
  composite,