@itwin/ecschema-metadata 5.2.0-dev.8 → 5.3.0-dev.1

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 (116) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/Deserialization/JsonProps.d.ts +9 -2
  3. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  4. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  5. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts +37 -0
  6. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
  7. package/lib/cjs/Formatting/FormatSetFormatsProvider.js +58 -0
  8. package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -0
  9. package/lib/cjs/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
  10. package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
  11. package/lib/cjs/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
  12. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -0
  13. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
  14. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
  15. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +62 -34
  16. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  17. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -1
  18. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +1 -0
  19. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  20. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +20 -3
  21. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
  22. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +7 -4
  23. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  24. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
  25. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +2 -7
  26. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  27. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
  28. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
  29. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +17 -17
  30. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  31. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +4 -4
  32. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  33. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +10 -4
  34. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -1
  35. package/lib/cjs/IncrementalLoading/SchemaParser.js +19 -19
  36. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -1
  37. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -1
  38. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +7 -24
  39. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  40. package/lib/cjs/Metadata/EntityClass.js +1 -1
  41. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  42. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  43. package/lib/cjs/Metadata/KindOfQuantity.js +9 -22
  44. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  45. package/lib/cjs/Metadata/Schema.d.ts +2 -0
  46. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  47. package/lib/cjs/Metadata/Schema.js +4 -0
  48. package/lib/cjs/Metadata/Schema.js.map +1 -1
  49. package/lib/cjs/ecschema-metadata.d.ts +2 -1
  50. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  51. package/lib/cjs/ecschema-metadata.js +2 -1
  52. package/lib/cjs/ecschema-metadata.js.map +1 -1
  53. package/lib/esm/Deserialization/JsonProps.d.ts +9 -2
  54. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  55. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  56. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts +37 -0
  57. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
  58. package/lib/esm/Formatting/FormatSetFormatsProvider.js +54 -0
  59. package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -0
  60. package/lib/esm/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
  61. package/lib/esm/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
  62. package/lib/esm/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
  63. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -0
  64. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
  65. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
  66. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +61 -33
  67. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  68. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -1
  69. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +1 -0
  70. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  71. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +20 -3
  72. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
  73. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +7 -4
  74. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  75. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
  76. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +2 -7
  77. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  78. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
  79. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
  80. package/lib/esm/IncrementalLoading/SchemaItemParsers.js +17 -17
  81. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  82. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +4 -4
  83. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  84. package/lib/esm/IncrementalLoading/SchemaParser.d.ts +10 -4
  85. package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -1
  86. package/lib/esm/IncrementalLoading/SchemaParser.js +19 -19
  87. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -1
  88. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -1
  89. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +7 -24
  90. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  91. package/lib/esm/Metadata/EntityClass.js +1 -1
  92. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  93. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  94. package/lib/esm/Metadata/KindOfQuantity.js +9 -22
  95. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  96. package/lib/esm/Metadata/Schema.d.ts +2 -0
  97. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  98. package/lib/esm/Metadata/Schema.js +4 -0
  99. package/lib/esm/Metadata/Schema.js.map +1 -1
  100. package/lib/esm/ecschema-metadata.d.ts +2 -1
  101. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  102. package/lib/esm/ecschema-metadata.js +2 -1
  103. package/lib/esm/ecschema-metadata.js.map +1 -1
  104. package/package.json +6 -6
  105. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +0 -60
  106. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
  107. package/lib/cjs/IncrementalLoading/PerformanceLogger.js +0 -82
  108. package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +0 -1
  109. package/lib/cjs/SchemaFormatsProvider.d.ts.map +0 -1
  110. package/lib/cjs/SchemaFormatsProvider.js.map +0 -1
  111. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +0 -60
  112. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
  113. package/lib/esm/IncrementalLoading/PerformanceLogger.js +0 -78
  114. package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +0 -1
  115. package/lib/esm/SchemaFormatsProvider.d.ts.map +0 -1
  116. package/lib/esm/SchemaFormatsProvider.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAiB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAmB,yBAAyB,EAAiB,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,oBAAoB,EAAE,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OAAO,CAAC,CAAC;QAEzC,MAAM,MAAM,GAAG,IAAI,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9E,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAElD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,QAAQ,CAAC,MAAW;QAChC,MAAM,MAAM,GAAG,MAAgB,CAAC;QAEhC,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC;IAChG,CAAC;IAED,gBAAgB;IACN,eAAe,CAAC,YAAoB;QAC5C,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;IAC7B,CAAC;IAED,gBAAgB;IACN,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,gBAAgB;IACN,QAAQ,CAAC,KAAa;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,wCAAwC,CAAC,CAAC;QAClG,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,oBAAoB,CAAC,UAAmC;QAC7D,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvC,CAAC;;AAGH;;;;;GAKG;AACH,MAAM,OAAgB,aAAc,SAAQ,MAAM;CAuCjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaContext } from \"../Context\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { JsonParser } from \"../Deserialization/JsonParser\";\nimport { SchemaProps } from \"../Deserialization/JsonProps\";\nimport { XmlParser } from \"../Deserialization/XmlParser\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { ECClassModifier, isSupportedSchemaItemType, PrimitiveType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, SchemaInfo } from \"../Interfaces\";\nimport { ECVersion, SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { Constant } from \"./Constant\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { CustomAttributeClass } from \"./CustomAttributeClass\";\nimport { EntityClass } from \"./EntityClass\";\nimport { Enumeration } from \"./Enumeration\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { Mixin } from \"./Mixin\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\nimport { UnitSystem } from \"./UnitSystem\";\nimport { ECSchemaNamespaceUris } from \"../Constants\";\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\n\n/**\n * @public @preview\n */\nexport class Schema implements CustomAttributeContainerProps {\n private static _currentECSpecVersion = \"3.2\";\n private _context: SchemaContext;\n private _schemaKey?: SchemaKey;\n private _alias?: string;\n private _label?: string;\n private _description?: string;\n public readonly references: Schema[];\n private readonly _items: Map<string, SchemaItem>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _originalECSpecMajorVersion?: number;\n private _originalECSpecMinorVersion?: number;\n private _loadingController?: SchemaLoadingController;\n\n /**\n * Constructs an empty Schema with the given name and version in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param name The schema's name\n * @param readVersion The integer read (major) version of the schema\n * @param writeVersion The integer write version of the schema\n * @param minorVersion The integer minor version of the schema\n */\n constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);\n /**\n * Constructs an empty Schema with the given key in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param key A SchemaKey that uniquely identifies the schema\n */\n constructor(context: SchemaContext, key: SchemaKey, alias: string);\n /**\n * Constructs an empty Schema (without a SchemaKey) in the provided context.\n * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @internal\n */\n constructor(context: SchemaContext);\n /** @internal */\n constructor(context: SchemaContext, nameOrKey?: SchemaKey | string, alias?: string, readVer?: number, writeVer?: number, minorVer?: number) {\n this._schemaKey = (typeof (nameOrKey) === \"string\") ? new SchemaKey(nameOrKey, new ECVersion(readVer as number, writeVer, minorVer)) : nameOrKey;\n this._context = context;\n this.references = [];\n this._items = new Map<string, SchemaItem>();\n\n if (alias !== undefined && ECName.validate(alias)) {\n this._alias = alias;\n } else if (nameOrKey !== undefined) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n }\n\n this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;\n this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;\n }\n\n public get schemaKey() {\n if (undefined === this._schemaKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this._schemaKey;\n }\n\n public get name() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.name;\n }\n\n public get readVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.readVersion;\n }\n\n public get writeVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.writeVersion;\n }\n\n public get minorVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.minorVersion;\n }\n\n public get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }\n public get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }\n public static get currentECSpecMajorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[0], 10); }\n public static get currentECSpecMinorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[1], 10); }\n\n private get _isECSpecVersionUnsupported(): boolean {\n return (this.originalECSpecMajorVersion !== 3 || this.originalECSpecMinorVersion === undefined\n || (this.originalECSpecMinorVersion < 2 || this.originalECSpecMinorVersion > Schema.currentECSpecMinorVersion))\n }\n\n public get alias() {\n if (this._alias === undefined || this._alias === null) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n } else { return this._alias; }\n }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the schema name. */\n public get fullName() { return this.schemaKey.name; }\n\n /** Returns the schema. */\n public get schema(): Schema { return this; }\n\n /** Returns the schema context this schema is within. */\n public get context(): SchemaContext { return this._context; }\n\n /**\n * Returns the SchemaLoadingController for this Schema. This would only be set if the schema is\n * loaded incrementally.\n * @internal\n */\n public get loadingController(): SchemaLoadingController | undefined{\n return this._loadingController;\n }\n\n /**\n * Returns a SchemaItemKey given the item name and the schema it belongs to\n * @param fullName fully qualified name {Schema name}.{Item Name}\n */\n public getSchemaItemKey(fullName: string): SchemaItemKey {\n const [schemaName, itemName] = SchemaItem.parseFullName(fullName);\n let schemaKey = this.schemaKey;\n if (this.name !== schemaName) {\n const newSchemaRef = this.getReferenceSync(schemaName);\n if (undefined === newSchemaRef)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);\n schemaKey = newSchemaRef.schemaKey;\n }\n return new SchemaItemKey(itemName, schemaKey);\n }\n\n /** @internal */\n protected addItem<T extends SchemaItem>(item: T): void {\n if (undefined !== this.getItemSync(item.name))\n throw new ECSchemaError(ECSchemaStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);\n\n this._items.set(item.name.toUpperCase(), item);\n }\n\n /**\n * @internal\n */\n protected createClass<T extends AnyClass>(type: (new (_schema: Schema, _name: string, _modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T {\n const item = new type(this, name, modifier);\n this.addItem(item);\n return item;\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected async deleteClass(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (ECClass.isECClass(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected deleteClassSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (ECClass.isECClass(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected async deleteSchemaItem(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (SchemaItem.isSchemaItem(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected deleteSchemaItemSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (SchemaItem.isSchemaItem(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /** @internal */\n protected createItem<T extends SchemaItem>(type: (new (_schema: Schema, _name: string) => T), name: string): T {\n const item = new type(this, name);\n this.addItem(item);\n return item;\n }\n\n /** @internal */\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /**\n * Creates a EntityClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass> {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /** @internal */\n protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /**\n * Creates a Mixin with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createMixinClass(name: string): Promise<Mixin> { return this.createClass<Mixin>(Mixin, name); }\n /** @internal */\n protected createMixinClassSync(name: string): Mixin { return this.createClass<Mixin>(Mixin, name); }\n\n /**\n * Creates a StructClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass> {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /** @internal */\n protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /**\n * Creates a CustomAttributeClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass> {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /** @internal */\n protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /**\n * Creates a RelationshipClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass> {\n return this.createRelationshipClassSync(name, modifier);\n }\n\n /** @internal */\n protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass {\n return this.createClass<RelationshipClass>(RelationshipClass, name, modifier);\n }\n\n /**\n * Creates an Enumeration with the provided name in this schema.\n * @param name\n * @param primitiveType\n *\n * @internal\n */\n protected async createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration> {\n return this.createEnumerationSync(name, primitiveType);\n }\n\n /** @internal */\n protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration {\n const item = new Enumeration(this, name, primitiveType);\n this.addItem(item);\n return item;\n }\n\n /**\n * Creates an KindOfQuantity with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createKindOfQuantity(name: string): Promise<KindOfQuantity> {\n return this.createKindOfQuantitySync(name);\n }\n\n /** @internal */\n protected createKindOfQuantitySync(name: string): KindOfQuantity {\n return this.createItem<KindOfQuantity>(KindOfQuantity, name);\n }\n\n /**\n * Creates a Constant with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createConstant(name: string): Promise<Constant> {\n return this.createItem<Constant>(Constant, name);\n }\n\n /** @internal */\n protected createConstantSync(name: string): Constant {\n return this.createItem<Constant>(Constant, name);\n }\n\n /**\n * Creates a Inverted Unit with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createInvertedUnit(name: string): Promise<InvertedUnit> {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /** @internal */\n protected createInvertedUnitSync(name: string): InvertedUnit {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /**\n * Creates an Format with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createFormat(name: string): Promise<Format> {\n return this.createItem<Format>(Format, name);\n }\n\n /** @internal */\n protected createFormatSync(name: string): Format {\n return this.createItem<Format>(Format, name);\n }\n\n /**\n * Creates a UnitSystem with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createUnitSystem(name: string): Promise<UnitSystem> {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /** @internal */\n protected createUnitSystemSync(name: string): UnitSystem {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /**\n * Creates a Phenomenon with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createPhenomenon(name: string): Promise<Phenomenon> {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /** @internal */\n protected createPhenomenonSync(name: string): Phenomenon {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /**\n * Creates a Unit with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createUnit(name: string): Promise<Unit> {\n return this.createItem<Unit>(Unit, name);\n }\n\n /** @internal */\n protected createUnitSync(name: string): Unit {\n return this.createItem<Unit>(Unit, name);\n }\n\n /**\n * Creates an PropertyCategory with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createPropertyCategory(name: string): Promise<PropertyCategory> {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n /** @internal */\n protected createPropertyCategorySync(name: string): PropertyCategory {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n /**\n *\n * @param refSchema\n * @internal\n */\n protected async addReference(refSchema: Schema): Promise<void> {\n // TODO validation of reference schema. For now just adding\n this.addReferenceSync(refSchema);\n }\n\n /** @internal */\n protected addReferenceSync(refSchema: Schema): void {\n this.references.push(refSchema);\n }\n\n /** @internal */\n protected setContext(context: SchemaContext): void {\n this._context = context;\n }\n\n /**\n * Sets the version of the SchemaKey identifying the schema.\n * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @internal\n */\n public setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void {\n if (!this._schemaKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);\n\n const newVersion = new ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);\n this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);\n }\n\n /**\n * Shortcut for calling getItem with EntityClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested EntityClass or undefined if not found.\n */\n public async getEntityClass(name: string): Promise<EntityClass | undefined> { return this.getItem(name, EntityClass); }\n\n /**\n * Shortcut for calling getItem with Mixin.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Mixin or undefined if not found.\n */\n public async getMixin(name: string): Promise<Mixin | undefined> { return this.getItem(name, Mixin); }\n\n /**\n * Shortcut for calling getItem with StructClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested StructClass or undefined if not found.\n */\n public async getStructClass(name: string): Promise<StructClass | undefined> { return this.getItem(name, StructClass); }\n\n /**\n * Shortcut for calling getItem with CustomAttributeClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested CustomAttributeClass or undefined if not found.\n */\n public async getCustomAttributeClass(name: string): Promise<CustomAttributeClass | undefined> { return this.getItem(name, CustomAttributeClass); }\n\n /**\n * Shortcut for calling getItem with RelationshipClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested RelationshipClass or undefined if not found.\n */\n public async getRelationshipClass(name: string): Promise<RelationshipClass | undefined> { return this.getItem(name, RelationshipClass); }\n\n /**\n * Shortcut for calling getItem with Enumeration.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Enumeration or undefined if not found.\n */\n public async getEnumeration(name: string): Promise<Enumeration | undefined> { return this.getItem(name, Enumeration); }\n\n /**\n * Shortcut for calling getItem with KindOfQuantity.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested KindOfQuantity or undefined if not found.\n */\n public async getKindOfQuantity(name: string): Promise<KindOfQuantity | undefined> { return this.getItem(name, KindOfQuantity); }\n\n /**\n * Shortcut for calling getItem with PropertyCategory.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested PropertyCategory or undefined if not found.\n */\n public async getPropertyCategory(name: string): Promise<PropertyCategory | undefined> { return this.getItem(name, PropertyCategory); }\n\n /**\n * Shortcut for calling getItem with Unit.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Unit or undefined if not found.\n */\n public async getUnit(name: string): Promise<Unit | undefined> { return this.getItem(name, Unit); }\n\n /**\n * Shortcut for calling getItem with InvertedUnit.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested InvertedUnit or undefined if not found.\n */\n public async getInvertedUnit(name: string): Promise<InvertedUnit | undefined> { return this.getItem(name, InvertedUnit); }\n\n /**\n * Shortcut for calling getItem with Constant.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Constant or undefined if not found.\n */\n public async getConstant(name: string): Promise<Constant | undefined> { return this.getItem(name, Constant); }\n\n /**\n * Shortcut for calling getItem with Phenomenon.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Phenomenon or undefined if not found.\n */\n public async getPhenomenon(name: string): Promise<Phenomenon | undefined> { return this.getItem(name, Phenomenon); }\n\n /**\n * Shortcut for calling getItem with UnitSystem.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested UnitSystem or undefined if not found.\n */\n public async getUnitSystem(name: string): Promise<UnitSystem | undefined> { return this.getItem(name, UnitSystem); }\n\n /**\n * Shortcut for calling getItem with Format.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Format or undefined if not found.\n */\n public async getFormat(name: string): Promise<Format | undefined> { return this.getItem(name, Format); }\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public async getItem(name: string): Promise<SchemaItem | undefined>\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor: T): Promise<InstanceType<T> | undefined>\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version\n if (itemConstructor === undefined)\n return this.getItemSync(name) as InstanceType<T> | undefined;\n\n return this.getItemSync(name, itemConstructor);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * If an item of the name exists but does not match the requested type, undefined is returned\n * @param key the local (unqualified) name, lookup is case-insensitive\n * @param itemConstructor The constructor of the item to return.\n */\n public getItemSync(name: string): SchemaItem | undefined\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor: T): InstanceType<T> | undefined\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\n const value = this._items.get(name.toUpperCase());\n if (value === undefined || itemConstructor === undefined)\n return value;\n\n if (isSupportedSchemaItemType(value.schemaItemType, itemConstructor.schemaItemType))\n return value as InstanceType<T>;\n\n return undefined;\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public async lookupItem(key: Readonly<SchemaItemKey> | string): Promise<SchemaItem | undefined>;\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): Promise<InstanceType<T> | undefined>;\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return itemConstructor\n ? this.getItem(itemName, itemConstructor)\n : this.getItem(itemName);\n }\n\n const refSchema = await this.getReference(schemaName);\n if (!refSchema)\n return undefined;\n\n return itemConstructor\n ? refSchema.getItem(itemName, itemConstructor)\n : refSchema.getItem(itemName);\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public lookupItemSync(key: Readonly<SchemaItemKey> | string): SchemaItem | undefined;\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): InstanceType<T> | undefined;\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return itemConstructor\n ? this.getItemSync(itemName, itemConstructor)\n : this.getItemSync(itemName);\n }\n\n const refSchema = this.getReferenceSync(schemaName);\n if (!refSchema)\n return undefined;\n\n return itemConstructor\n ? refSchema.getItemSync(itemName, itemConstructor)\n : refSchema.getItemSync(itemName);\n }\n\n /**\n * Returns all of the loaded items in this schema.\n */\n public getItems(): Iterable<SchemaItem>;\n public getItems<T extends typeof SchemaItem>(itemConstructor: T): Iterable<InstanceType<T>>;\n public * getItems<T extends typeof SchemaItem>(itemConstructor?: T): Iterable<InstanceType<T> | SchemaItem> {\n if (!this._items)\n return;\n\n for (const item of this._items.values()) {\n if (itemConstructor === undefined || isSupportedSchemaItemType(item.schemaItemType, itemConstructor.schemaItemType))\n yield item;\n }\n }\n\n /**\n * Gets a referenced schema by name\n * @param refSchemaName schema name to find\n */\n public async getReference(refSchemaName: string): Promise<Schema | undefined> {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\n }\n\n /**\n * Gets a referenced schema by alias\n * @param alias alias to find\n */\n public getReferenceNameByAlias(alias: string): string | undefined {\n if (this.references.length === 0)\n return undefined;\n\n const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);\n return schema ? schema.name : undefined;\n }\n\n /**\n * Gets a referenced schema by name\n * @param refSchemaName schema name to find\n */\n public getReferenceSync(refSchemaName: string): Schema | undefined {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\n }\n\n /**\n * Save this Schema's properties to an object for serializing to JSON.\n */\n public toJSON(): SchemaProps {\n if (this._isECSpecVersionUnsupported)\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaJson: { [value: string]: any } = {};\n schemaJson.$schema = ECSchemaNamespaceUris.SCHEMAURL3_2_JSON; // $schema is required\n schemaJson.name = this.name; // name is required\n schemaJson.version = this.schemaKey.version.toString(true);\n schemaJson.alias = this.alias; // alias is required\n if (undefined !== this.label) // label is optional\n schemaJson.label = this.label;\n if (undefined !== this.description) // description is optional\n schemaJson.description = this.description;\n if (undefined !== this.references && this.references.length > 0) // references is optional\n schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n if (this._items.size > 0) {\n schemaJson.items = {};\n this._items.forEach((schemaItem: SchemaItem) => {\n schemaJson.items[schemaItem.name] = schemaItem.toJSON(false, true);\n });\n }\n return schemaJson as SchemaProps;\n }\n\n /**\n * Converts the schema to a DOM XML Document.\n * @param schemaXml An empty DOM document to which the schema will be written\n */\n public async toXml(schemaXml: Document): Promise<Document> {\n if (this._isECSpecVersionUnsupported)\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaMetadata = schemaXml.createElement(\"ECSchema\");\n schemaMetadata.setAttribute(\"xmlns\", ECSchemaNamespaceUris.SCHEMAURL3_2_XML);\n schemaMetadata.setAttribute(\"version\", this.schemaKey.version.toString());\n schemaMetadata.setAttribute(\"schemaName\", this.name);\n schemaMetadata.setAttribute(\"alias\", this.alias ? this.alias : \"\");\n if (undefined !== this.label)\n schemaMetadata.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.description)\n schemaMetadata.setAttribute(\"description\", this.description);\n\n // Map used for CA serialization\n const refSchemaMap = new Map<string, string>();\n\n this.references.forEach(({ name, schemaKey, alias }) => {\n const schemaRef = schemaXml.createElement(\"ECSchemaReference\");\n schemaRef.setAttribute(\"name\", name);\n schemaRef.setAttribute(\"version\", schemaKey.version.toString());\n schemaRef.setAttribute(\"alias\", alias ? alias : \"\");\n schemaMetadata.appendChild(schemaRef);\n refSchemaMap.set(name, schemaKey.version.toString());\n });\n\n if (this._customAttributes) {\n const parentElem = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElem = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);\n parentElem.appendChild(caElem);\n }\n schemaMetadata.appendChild(parentElem);\n }\n\n for (const [, item] of this._items) {\n const itemXml = await item.toXml(schemaXml);\n schemaMetadata.appendChild(itemXml);\n }\n\n schemaXml.appendChild(schemaMetadata);\n return schemaXml;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public fromJSONSync(schemaProps: SchemaProps) {\n if (undefined === this._schemaKey) {\n const schemaName = schemaProps.name;\n const version = ECVersion.fromString(schemaProps.version);\n this._schemaKey = new SchemaKey(schemaName, version);\n } else {\n if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);\n if (this.schemaKey.version.compare(ECVersion.fromString(schemaProps.version)))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);\n }\n\n if (schemaProps.$schema.match(`https://dev\\\\.bentley\\\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\\\\.([0-9]+)`) == null)\n throw new ECSchemaError(ECSchemaStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);\n\n // The schema props have not been parsed. Parse the ECXml version from the $schema attribute\n let ecVersion: ECSpecVersion;\n if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {\n ecVersion = ((schemaProps.$schema.search(\"ECXML\") !== -1) ? XmlParser.parseXmlNamespace(schemaProps.$schema) : JsonParser.parseJSUri(schemaProps.$schema)) as ECSpecVersion;\n } else {\n ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion } as ECSpecVersion;\n }\n\n this._originalECSpecMajorVersion = ecVersion.readVersion;\n this._originalECSpecMinorVersion = ecVersion.writeVersion;\n\n if (ecVersion.readVersion !== 3 || (ecVersion.readVersion === 3 && ecVersion.writeVersion < 2))\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The Schema '${this.name}' has an unsupported ECVersion ${ecVersion.readVersion}.${ecVersion.writeVersion} and cannot be loaded.`);\n\n if (ECName.validate(schemaProps.alias)) {\n this._alias = schemaProps.alias;\n } else {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);\n }\n\n if (undefined !== schemaProps.label)\n this._label = schemaProps.label;\n\n if (undefined !== schemaProps.description)\n this._description = schemaProps.description;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public async fromJSON(schemaProps: SchemaProps) {\n this.fromJSONSync(schemaProps);\n }\n\n /**\n * Completely loads the SchemaInfo from the input json and starts loading the entire schema. The complete schema can be retrieved from the\n * schema context using the getCachedSchema method\n */\n public static async startLoadingFromJson(jsonObj: object | string, context: SchemaContext): Promise<SchemaInfo> {\n const schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n return reader.readSchemaInfo(schema, rawSchema);\n }\n\n public static async fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema> {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = await reader.readSchema(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * Completely loads the Schema from the input json. The schema is cached in the schema context.\n */\n public static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = reader.readSchemaSync(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * @internal\n */\n public static isSchema(object: any): object is Schema {\n const schema = object as Schema;\n\n return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;\n }\n\n /** @internal */\n protected setDisplayLabel(displayLabel: string) {\n this._label = displayLabel;\n }\n\n /** @internal */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /** @internal */\n protected setAlias(alias: string) {\n if (!ECName.validate(alias)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, \"The specified schema alias is invalid.\");\n }\n this._alias = alias;\n }\n\n /** @internal */\n public setLoadingController(controller: SchemaLoadingController) {\n this._loadingController = controller;\n }\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\n * would prevent this class from extending Schema.\n * @internal\n */\nexport abstract class MutableSchema extends Schema {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\n public abstract override createMixinClass(name: string): Promise<Mixin>;\n public abstract override createMixinClassSync(name: string): Mixin;\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\n public abstract override createUnit(name: string): Promise<Unit>;\n public abstract override createUnitSync(name: string): Unit;\n public abstract override createConstant(name: string): Promise<Constant>;\n public abstract override createConstantSync(name: string): Constant;\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\n public abstract override createPhenomenonSync(name: string): Phenomenon;\n public abstract override createFormat(name: string): Promise<Format>;\n public abstract override createFormatSync(name: string): Format;\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\n public abstract override createUnitSystemSync(name: string): UnitSystem;\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\n public abstract override addItem<T extends SchemaItem>(item: T): void;\n public abstract override addReference(refSchema: Schema): Promise<void>;\n public abstract override addReferenceSync(refSchema: Schema): void;\n public abstract override setContext(schemaContext: SchemaContext): void;\n public abstract override deleteClass(name: string): Promise<void>;\n public abstract override deleteClassSync(name: string): void;\n public abstract override deleteSchemaItem(name: string): Promise<void>;\n public abstract override deleteSchemaItemSync(name: string): void;\n public abstract override setAlias(alias: string): void;\n}"]}
1
+ {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAiB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAmB,yBAAyB,EAAiB,MAAM,cAAc,CAAC;AACzF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,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GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QAC9E,MAAM,GAAG,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;QAElD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,QAAQ,CAAC,MAAW;QAChC,MAAM,MAAM,GAAG,MAAgB,CAAC;QAEhC,OAAO,MAAM,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC;IAChG,CAAC;IAED,gBAAgB;IACN,eAAe,CAAC,YAAoB;QAC5C,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC;IAC7B,CAAC;IAED,gBAAgB;IACN,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,gBAAgB;IACN,QAAQ,CAAC,KAAa;QAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,wCAAwC,CAAC,CAAC;QAClG,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,gBAAgB;IACT,oBAAoB,CAAC,UAAmC;QAC7D,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvC,CAAC;;AAGH;;;;;GAKG;AACH,MAAM,OAAgB,aAAc,SAAQ,MAAM;CAuCjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaContext } from \"../Context\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { JsonParser } from \"../Deserialization/JsonParser\";\nimport { SchemaProps } from \"../Deserialization/JsonProps\";\nimport { XmlParser } from \"../Deserialization/XmlParser\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { ECClassModifier, isSupportedSchemaItemType, PrimitiveType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, SchemaInfo } from \"../Interfaces\";\nimport { ECVersion, SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { Constant } from \"./Constant\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { CustomAttributeClass } from \"./CustomAttributeClass\";\nimport { EntityClass } from \"./EntityClass\";\nimport { Enumeration } from \"./Enumeration\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { Mixin } from \"./Mixin\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\nimport { UnitSystem } from \"./UnitSystem\";\nimport { ECSchemaNamespaceUris } from \"../Constants\";\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\n\n/**\n * @public @preview\n */\nexport class Schema implements CustomAttributeContainerProps {\n private static _currentECSpecVersion = \"3.2\";\n private _context: SchemaContext;\n private _schemaKey?: SchemaKey;\n private _alias?: string;\n private _label?: string;\n private _description?: string;\n public readonly references: Schema[];\n private readonly _items: Map<string, SchemaItem>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _originalECSpecMajorVersion?: number;\n private _originalECSpecMinorVersion?: number;\n private _loadingController?: SchemaLoadingController;\n\n /**\n * Constructs an empty Schema with the given name and version in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param name The schema's name\n * @param readVersion The integer read (major) version of the schema\n * @param writeVersion The integer write version of the schema\n * @param minorVersion The integer minor version of the schema\n */\n constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);\n /**\n * Constructs an empty Schema with the given key in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param key A SchemaKey that uniquely identifies the schema\n */\n constructor(context: SchemaContext, key: SchemaKey, alias: string);\n /**\n * Constructs an empty Schema (without a SchemaKey) in the provided context.\n * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @internal\n */\n constructor(context: SchemaContext);\n /** @internal */\n constructor(context: SchemaContext, nameOrKey?: SchemaKey | string, alias?: string, readVer?: number, writeVer?: number, minorVer?: number) {\n this._schemaKey = (typeof (nameOrKey) === \"string\") ? new SchemaKey(nameOrKey, new ECVersion(readVer as number, writeVer, minorVer)) : nameOrKey;\n this._context = context;\n this.references = [];\n this._items = new Map<string, SchemaItem>();\n\n if (alias !== undefined && ECName.validate(alias)) {\n this._alias = alias;\n } else if (nameOrKey !== undefined) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n }\n\n this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;\n this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;\n }\n\n public get schemaKey() {\n if (undefined === this._schemaKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this._schemaKey;\n }\n\n public get name() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.name;\n }\n\n public get readVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.readVersion;\n }\n\n public get writeVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.writeVersion;\n }\n\n public get minorVersion() {\n if (this._schemaKey === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.minorVersion;\n }\n\n public get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }\n public get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }\n public static get currentECSpecMajorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[0], 10); }\n public static get currentECSpecMinorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[1], 10); }\n\n private get _isECSpecVersionUnsupported(): boolean {\n return (this.originalECSpecMajorVersion !== 3 || this.originalECSpecMinorVersion === undefined\n || (this.originalECSpecMinorVersion < 2 || this.originalECSpecMinorVersion > Schema.currentECSpecMinorVersion))\n }\n\n public get alias() {\n if (this._alias === undefined || this._alias === null) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n } else { return this._alias; }\n }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the schema name. */\n public get fullName() { return this.schemaKey.name; }\n\n /** Returns the schema. */\n public get schema(): Schema { return this; }\n\n /** Returns the schema context this schema is within. */\n public get context(): SchemaContext { return this._context; }\n\n /** Returns whether this schema is dynamic schema */\n public get isDynamic(): boolean {\n return this.customAttributes !== undefined && this.customAttributes.has(\"CoreCustomAttributes.DynamicSchema\");\n }\n\n /**\n * Returns the SchemaLoadingController for this Schema. This would only be set if the schema is\n * loaded incrementally.\n * @internal\n */\n public get loadingController(): SchemaLoadingController | undefined{\n return this._loadingController;\n }\n\n /**\n * Returns a SchemaItemKey given the item name and the schema it belongs to\n * @param fullName fully qualified name {Schema name}.{Item Name}\n */\n public getSchemaItemKey(fullName: string): SchemaItemKey {\n const [schemaName, itemName] = SchemaItem.parseFullName(fullName);\n let schemaKey = this.schemaKey;\n if (this.name !== schemaName) {\n const newSchemaRef = this.getReferenceSync(schemaName);\n if (undefined === newSchemaRef)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);\n schemaKey = newSchemaRef.schemaKey;\n }\n return new SchemaItemKey(itemName, schemaKey);\n }\n\n /** @internal */\n protected addItem<T extends SchemaItem>(item: T): void {\n if (undefined !== this.getItemSync(item.name))\n throw new ECSchemaError(ECSchemaStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);\n\n this._items.set(item.name.toUpperCase(), item);\n }\n\n /**\n * @internal\n */\n protected createClass<T extends AnyClass>(type: (new (_schema: Schema, _name: string, _modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T {\n const item = new type(this, name, modifier);\n this.addItem(item);\n return item;\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected async deleteClass(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (ECClass.isECClass(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected deleteClassSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (ECClass.isECClass(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected async deleteSchemaItem(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (SchemaItem.isSchemaItem(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @internal\n */\n protected deleteSchemaItemSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (SchemaItem.isSchemaItem(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /** @internal */\n protected createItem<T extends SchemaItem>(type: (new (_schema: Schema, _name: string) => T), name: string): T {\n const item = new type(this, name);\n this.addItem(item);\n return item;\n }\n\n /** @internal */\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /**\n * Creates a EntityClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass> {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /** @internal */\n protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /**\n * Creates a Mixin with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createMixinClass(name: string): Promise<Mixin> { return this.createClass<Mixin>(Mixin, name); }\n /** @internal */\n protected createMixinClassSync(name: string): Mixin { return this.createClass<Mixin>(Mixin, name); }\n\n /**\n * Creates a StructClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass> {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /** @internal */\n protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /**\n * Creates a CustomAttributeClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass> {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /** @internal */\n protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /**\n * Creates a RelationshipClass with the provided name in this schema.\n * @param name\n * @param modifier\n * @internal\n */\n protected async createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass> {\n return this.createRelationshipClassSync(name, modifier);\n }\n\n /** @internal */\n protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass {\n return this.createClass<RelationshipClass>(RelationshipClass, name, modifier);\n }\n\n /**\n * Creates an Enumeration with the provided name in this schema.\n * @param name\n * @param primitiveType\n *\n * @internal\n */\n protected async createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration> {\n return this.createEnumerationSync(name, primitiveType);\n }\n\n /** @internal */\n protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration {\n const item = new Enumeration(this, name, primitiveType);\n this.addItem(item);\n return item;\n }\n\n /**\n * Creates an KindOfQuantity with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createKindOfQuantity(name: string): Promise<KindOfQuantity> {\n return this.createKindOfQuantitySync(name);\n }\n\n /** @internal */\n protected createKindOfQuantitySync(name: string): KindOfQuantity {\n return this.createItem<KindOfQuantity>(KindOfQuantity, name);\n }\n\n /**\n * Creates a Constant with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createConstant(name: string): Promise<Constant> {\n return this.createItem<Constant>(Constant, name);\n }\n\n /** @internal */\n protected createConstantSync(name: string): Constant {\n return this.createItem<Constant>(Constant, name);\n }\n\n /**\n * Creates a Inverted Unit with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createInvertedUnit(name: string): Promise<InvertedUnit> {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /** @internal */\n protected createInvertedUnitSync(name: string): InvertedUnit {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /**\n * Creates an Format with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createFormat(name: string): Promise<Format> {\n return this.createItem<Format>(Format, name);\n }\n\n /** @internal */\n protected createFormatSync(name: string): Format {\n return this.createItem<Format>(Format, name);\n }\n\n /**\n * Creates a UnitSystem with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createUnitSystem(name: string): Promise<UnitSystem> {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /** @internal */\n protected createUnitSystemSync(name: string): UnitSystem {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /**\n * Creates a Phenomenon with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createPhenomenon(name: string): Promise<Phenomenon> {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /** @internal */\n protected createPhenomenonSync(name: string): Phenomenon {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /**\n * Creates a Unit with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createUnit(name: string): Promise<Unit> {\n return this.createItem<Unit>(Unit, name);\n }\n\n /** @internal */\n protected createUnitSync(name: string): Unit {\n return this.createItem<Unit>(Unit, name);\n }\n\n /**\n * Creates an PropertyCategory with the provided name in this schema.\n * @param name\n * @internal\n */\n protected async createPropertyCategory(name: string): Promise<PropertyCategory> {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n /** @internal */\n protected createPropertyCategorySync(name: string): PropertyCategory {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n /**\n *\n * @param refSchema\n * @internal\n */\n protected async addReference(refSchema: Schema): Promise<void> {\n // TODO validation of reference schema. For now just adding\n this.addReferenceSync(refSchema);\n }\n\n /** @internal */\n protected addReferenceSync(refSchema: Schema): void {\n this.references.push(refSchema);\n }\n\n /** @internal */\n protected setContext(context: SchemaContext): void {\n this._context = context;\n }\n\n /**\n * Sets the version of the SchemaKey identifying the schema.\n * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @internal\n */\n public setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void {\n if (!this._schemaKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);\n\n const newVersion = new ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);\n this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);\n }\n\n /**\n * Shortcut for calling getItem with EntityClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested EntityClass or undefined if not found.\n */\n public async getEntityClass(name: string): Promise<EntityClass | undefined> { return this.getItem(name, EntityClass); }\n\n /**\n * Shortcut for calling getItem with Mixin.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Mixin or undefined if not found.\n */\n public async getMixin(name: string): Promise<Mixin | undefined> { return this.getItem(name, Mixin); }\n\n /**\n * Shortcut for calling getItem with StructClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested StructClass or undefined if not found.\n */\n public async getStructClass(name: string): Promise<StructClass | undefined> { return this.getItem(name, StructClass); }\n\n /**\n * Shortcut for calling getItem with CustomAttributeClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested CustomAttributeClass or undefined if not found.\n */\n public async getCustomAttributeClass(name: string): Promise<CustomAttributeClass | undefined> { return this.getItem(name, CustomAttributeClass); }\n\n /**\n * Shortcut for calling getItem with RelationshipClass.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested RelationshipClass or undefined if not found.\n */\n public async getRelationshipClass(name: string): Promise<RelationshipClass | undefined> { return this.getItem(name, RelationshipClass); }\n\n /**\n * Shortcut for calling getItem with Enumeration.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Enumeration or undefined if not found.\n */\n public async getEnumeration(name: string): Promise<Enumeration | undefined> { return this.getItem(name, Enumeration); }\n\n /**\n * Shortcut for calling getItem with KindOfQuantity.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested KindOfQuantity or undefined if not found.\n */\n public async getKindOfQuantity(name: string): Promise<KindOfQuantity | undefined> { return this.getItem(name, KindOfQuantity); }\n\n /**\n * Shortcut for calling getItem with PropertyCategory.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested PropertyCategory or undefined if not found.\n */\n public async getPropertyCategory(name: string): Promise<PropertyCategory | undefined> { return this.getItem(name, PropertyCategory); }\n\n /**\n * Shortcut for calling getItem with Unit.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Unit or undefined if not found.\n */\n public async getUnit(name: string): Promise<Unit | undefined> { return this.getItem(name, Unit); }\n\n /**\n * Shortcut for calling getItem with InvertedUnit.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested InvertedUnit or undefined if not found.\n */\n public async getInvertedUnit(name: string): Promise<InvertedUnit | undefined> { return this.getItem(name, InvertedUnit); }\n\n /**\n * Shortcut for calling getItem with Constant.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Constant or undefined if not found.\n */\n public async getConstant(name: string): Promise<Constant | undefined> { return this.getItem(name, Constant); }\n\n /**\n * Shortcut for calling getItem with Phenomenon.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Phenomenon or undefined if not found.\n */\n public async getPhenomenon(name: string): Promise<Phenomenon | undefined> { return this.getItem(name, Phenomenon); }\n\n /**\n * Shortcut for calling getItem with UnitSystem.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested UnitSystem or undefined if not found.\n */\n public async getUnitSystem(name: string): Promise<UnitSystem | undefined> { return this.getItem(name, UnitSystem); }\n\n /**\n * Shortcut for calling getItem with Format.\n * @param name The local (unqualified) name of the item to return.\n * @returns The requested Format or undefined if not found.\n */\n public async getFormat(name: string): Promise<Format | undefined> { return this.getItem(name, Format); }\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public async getItem(name: string): Promise<SchemaItem | undefined>\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor: T): Promise<InstanceType<T> | undefined>\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version\n if (itemConstructor === undefined)\n return this.getItemSync(name) as InstanceType<T> | undefined;\n\n return this.getItemSync(name, itemConstructor);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * If an item of the name exists but does not match the requested type, undefined is returned\n * @param key the local (unqualified) name, lookup is case-insensitive\n * @param itemConstructor The constructor of the item to return.\n */\n public getItemSync(name: string): SchemaItem | undefined\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor: T): InstanceType<T> | undefined\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\n const value = this._items.get(name.toUpperCase());\n if (value === undefined || itemConstructor === undefined)\n return value;\n\n if (isSupportedSchemaItemType(value.schemaItemType, itemConstructor.schemaItemType))\n return value as InstanceType<T>;\n\n return undefined;\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public async lookupItem(key: Readonly<SchemaItemKey> | string): Promise<SchemaItem | undefined>;\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): Promise<InstanceType<T> | undefined>;\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return itemConstructor\n ? this.getItem(itemName, itemConstructor)\n : this.getItem(itemName);\n }\n\n const refSchema = await this.getReference(schemaName);\n if (!refSchema)\n return undefined;\n\n return itemConstructor\n ? refSchema.getItem(itemName, itemConstructor)\n : refSchema.getItem(itemName);\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public lookupItemSync(key: Readonly<SchemaItemKey> | string): SchemaItem | undefined;\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): InstanceType<T> | undefined;\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return itemConstructor\n ? this.getItemSync(itemName, itemConstructor)\n : this.getItemSync(itemName);\n }\n\n const refSchema = this.getReferenceSync(schemaName);\n if (!refSchema)\n return undefined;\n\n return itemConstructor\n ? refSchema.getItemSync(itemName, itemConstructor)\n : refSchema.getItemSync(itemName);\n }\n\n /**\n * Returns all of the loaded items in this schema.\n */\n public getItems(): Iterable<SchemaItem>;\n public getItems<T extends typeof SchemaItem>(itemConstructor: T): Iterable<InstanceType<T>>;\n public * getItems<T extends typeof SchemaItem>(itemConstructor?: T): Iterable<InstanceType<T> | SchemaItem> {\n if (!this._items)\n return;\n\n for (const item of this._items.values()) {\n if (itemConstructor === undefined || isSupportedSchemaItemType(item.schemaItemType, itemConstructor.schemaItemType))\n yield item;\n }\n }\n\n /**\n * Gets a referenced schema by name\n * @param refSchemaName schema name to find\n */\n public async getReference(refSchemaName: string): Promise<Schema | undefined> {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\n }\n\n /**\n * Gets a referenced schema by alias\n * @param alias alias to find\n */\n public getReferenceNameByAlias(alias: string): string | undefined {\n if (this.references.length === 0)\n return undefined;\n\n const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);\n return schema ? schema.name : undefined;\n }\n\n /**\n * Gets a referenced schema by name\n * @param refSchemaName schema name to find\n */\n public getReferenceSync(refSchemaName: string): Schema | undefined {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\n }\n\n /**\n * Save this Schema's properties to an object for serializing to JSON.\n */\n public toJSON(): SchemaProps {\n if (this._isECSpecVersionUnsupported)\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaJson: { [value: string]: any } = {};\n schemaJson.$schema = ECSchemaNamespaceUris.SCHEMAURL3_2_JSON; // $schema is required\n schemaJson.name = this.name; // name is required\n schemaJson.version = this.schemaKey.version.toString(true);\n schemaJson.alias = this.alias; // alias is required\n if (undefined !== this.label) // label is optional\n schemaJson.label = this.label;\n if (undefined !== this.description) // description is optional\n schemaJson.description = this.description;\n if (undefined !== this.references && this.references.length > 0) // references is optional\n schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n if (this._items.size > 0) {\n schemaJson.items = {};\n this._items.forEach((schemaItem: SchemaItem) => {\n schemaJson.items[schemaItem.name] = schemaItem.toJSON(false, true);\n });\n }\n return schemaJson as SchemaProps;\n }\n\n /**\n * Converts the schema to a DOM XML Document.\n * @param schemaXml An empty DOM document to which the schema will be written\n */\n public async toXml(schemaXml: Document): Promise<Document> {\n if (this._isECSpecVersionUnsupported)\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaMetadata = schemaXml.createElement(\"ECSchema\");\n schemaMetadata.setAttribute(\"xmlns\", ECSchemaNamespaceUris.SCHEMAURL3_2_XML);\n schemaMetadata.setAttribute(\"version\", this.schemaKey.version.toString());\n schemaMetadata.setAttribute(\"schemaName\", this.name);\n schemaMetadata.setAttribute(\"alias\", this.alias ? this.alias : \"\");\n if (undefined !== this.label)\n schemaMetadata.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.description)\n schemaMetadata.setAttribute(\"description\", this.description);\n\n // Map used for CA serialization\n const refSchemaMap = new Map<string, string>();\n\n this.references.forEach(({ name, schemaKey, alias }) => {\n const schemaRef = schemaXml.createElement(\"ECSchemaReference\");\n schemaRef.setAttribute(\"name\", name);\n schemaRef.setAttribute(\"version\", schemaKey.version.toString());\n schemaRef.setAttribute(\"alias\", alias ? alias : \"\");\n schemaMetadata.appendChild(schemaRef);\n refSchemaMap.set(name, schemaKey.version.toString());\n });\n\n if (this._customAttributes) {\n const parentElem = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElem = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);\n parentElem.appendChild(caElem);\n }\n schemaMetadata.appendChild(parentElem);\n }\n\n for (const [, item] of this._items) {\n const itemXml = await item.toXml(schemaXml);\n schemaMetadata.appendChild(itemXml);\n }\n\n schemaXml.appendChild(schemaMetadata);\n return schemaXml;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public fromJSONSync(schemaProps: SchemaProps) {\n if (undefined === this._schemaKey) {\n const schemaName = schemaProps.name;\n const version = ECVersion.fromString(schemaProps.version);\n this._schemaKey = new SchemaKey(schemaName, version);\n } else {\n if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);\n if (this.schemaKey.version.compare(ECVersion.fromString(schemaProps.version)))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);\n }\n\n if (schemaProps.$schema.match(`https://dev\\\\.bentley\\\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\\\\.([0-9]+)`) == null)\n throw new ECSchemaError(ECSchemaStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);\n\n // The schema props have not been parsed. Parse the ECXml version from the $schema attribute\n let ecVersion: ECSpecVersion;\n if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {\n ecVersion = ((schemaProps.$schema.search(\"ECXML\") !== -1) ? XmlParser.parseXmlNamespace(schemaProps.$schema) : JsonParser.parseJSUri(schemaProps.$schema)) as ECSpecVersion;\n } else {\n ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion } as ECSpecVersion;\n }\n\n this._originalECSpecMajorVersion = ecVersion.readVersion;\n this._originalECSpecMinorVersion = ecVersion.writeVersion;\n\n if (ecVersion.readVersion !== 3 || (ecVersion.readVersion === 3 && ecVersion.writeVersion < 2))\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The Schema '${this.name}' has an unsupported ECVersion ${ecVersion.readVersion}.${ecVersion.writeVersion} and cannot be loaded.`);\n\n if (ECName.validate(schemaProps.alias)) {\n this._alias = schemaProps.alias;\n } else {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);\n }\n\n if (undefined !== schemaProps.label)\n this._label = schemaProps.label;\n\n if (undefined !== schemaProps.description)\n this._description = schemaProps.description;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public async fromJSON(schemaProps: SchemaProps) {\n this.fromJSONSync(schemaProps);\n }\n\n /**\n * Completely loads the SchemaInfo from the input json and starts loading the entire schema. The complete schema can be retrieved from the\n * schema context using the getCachedSchema method\n */\n public static async startLoadingFromJson(jsonObj: object | string, context: SchemaContext): Promise<SchemaInfo> {\n const schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n return reader.readSchemaInfo(schema, rawSchema);\n }\n\n public static async fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema> {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = await reader.readSchema(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * Completely loads the Schema from the input json. The schema is cached in the schema context.\n */\n public static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = reader.readSchemaSync(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * @internal\n */\n public static isSchema(object: any): object is Schema {\n const schema = object as Schema;\n\n return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;\n }\n\n /** @internal */\n protected setDisplayLabel(displayLabel: string) {\n this._label = displayLabel;\n }\n\n /** @internal */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /** @internal */\n protected setAlias(alias: string) {\n if (!ECName.validate(alias)) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, \"The specified schema alias is invalid.\");\n }\n this._alias = alias;\n }\n\n /** @internal */\n public setLoadingController(controller: SchemaLoadingController) {\n this._loadingController = controller;\n }\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\n * would prevent this class from extending Schema.\n * @internal\n */\nexport abstract class MutableSchema extends Schema {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\n public abstract override createMixinClass(name: string): Promise<Mixin>;\n public abstract override createMixinClassSync(name: string): Mixin;\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\n public abstract override createUnit(name: string): Promise<Unit>;\n public abstract override createUnitSync(name: string): Unit;\n public abstract override createConstant(name: string): Promise<Constant>;\n public abstract override createConstantSync(name: string): Constant;\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\n public abstract override createPhenomenonSync(name: string): Phenomenon;\n public abstract override createFormat(name: string): Promise<Format>;\n public abstract override createFormatSync(name: string): Format;\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\n public abstract override createUnitSystemSync(name: string): UnitSystem;\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\n public abstract override addItem<T extends SchemaItem>(item: T): void;\n public abstract override addReference(refSchema: Schema): Promise<void>;\n public abstract override addReferenceSync(refSchema: Schema): void;\n public abstract override setContext(schemaContext: SchemaContext): void;\n public abstract override deleteClass(name: string): Promise<void>;\n public abstract override deleteClassSync(name: string): void;\n public abstract override deleteSchemaItem(name: string): Promise<void>;\n public abstract override deleteSchemaItemSync(name: string): void;\n public abstract override setAlias(alias: string): void;\n}"]}
@@ -36,7 +36,8 @@ export * from "./UnitConversion/UnitConverter";
36
36
  export * from "./UnitProvider/SchemaUnitProvider";
37
37
  export * from "./Validation/SchemaWalker";
38
38
  export * from "./SchemaPartVisitorDelegate";
39
- export * from "./SchemaFormatsProvider";
39
+ export * from "./Formatting/SchemaFormatsProvider";
40
+ export * from "./Formatting/FormatSetFormatsProvider";
40
41
  export * from "./IncrementalLoading/ECSqlSchemaLocater";
41
42
  export * from "./IncrementalLoading/IncrementalSchemaLocater";
42
43
  export { CustomAttribute, CustomAttributeContainerProps } from "./Metadata/CustomAttribute";
@@ -1 +1 @@
1
- {"version":3,"file":"ecschema-metadata.d.ts","sourceRoot":"","sources":["../../src/ecschema-metadata.ts"],"names":[],"mappings":"AAKA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MA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AAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,2BAA2B,GACjG,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACnH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAC,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH;;;GAGG;AACH;;;GAGG"}
@@ -40,7 +40,8 @@ export * from "./UnitConversion/UnitConverter";
40
40
  export * from "./UnitProvider/SchemaUnitProvider";
41
41
  export * from "./Validation/SchemaWalker";
42
42
  export * from "./SchemaPartVisitorDelegate";
43
- export * from "./SchemaFormatsProvider";
43
+ export * from "./Formatting/SchemaFormatsProvider";
44
+ export * from "./Formatting/FormatSetFormatsProvider";
44
45
  export * from "./IncrementalLoading/ECSqlSchemaLocater";
45
46
  export * from "./IncrementalLoading/IncrementalSchemaLocater";
46
47
  export { SchemaGraph } from "./utils/Sch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E,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACnH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AACxC,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./Constants\";\nexport * from \"./Context\";\nexport * from \"./DelayedPromise\";\nexport * from \"./Deserialization/SchemaGraphUtil\";\nexport * from \"./Deserialization/JsonProps\";\nexport * from \"./Deserialization/Helper\";\nexport * from \"./Deserialization/XmlParser\";\nexport * from \"./ECName\";\nexport * from \"./ECObjects\";\nexport * from \"./Exception\";\nexport * from \"./Interfaces\";\nexport { ECClass, StructClass } from \"./Metadata/Class\";\nexport { Constant } from \"./Metadata/Constant\";\nexport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nexport { EntityClass } from \"./Metadata/EntityClass\";\nexport { AnyEnumerator, Enumeration, Enumerator } from \"./Metadata/Enumeration\";\nexport { Format } from \"./Metadata/Format\";\nexport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nexport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nexport { Mixin } from \"./Metadata/Mixin\";\nexport * from \"./Metadata/OverrideFormat\";\nexport { Phenomenon } from \"./Metadata/Phenomenon\";\nexport {\n Property, PrimitiveProperty, PrimitiveArrayProperty, EnumerationProperty, StructProperty,\n StructArrayProperty, EnumerationArrayProperty, NavigationProperty, AnyArrayProperty, AnyEnumerationProperty,\n AnyPrimitiveProperty, AnyProperty, AnyStructProperty, ArrayProperty, PrimitiveOrEnumPropertyBase,\n} from \"./Metadata/Property\";\nexport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nexport { RelationshipClass, RelationshipConstraint, RelationshipMultiplicity } from \"./Metadata/RelationshipClass\";\nexport { Schema } from \"./Metadata/Schema\";\nexport * from \"./Metadata/SchemaItem\";\nexport { Unit } from \"./Metadata/Unit\";\nexport { UnitSystem } from \"./Metadata/UnitSystem\";\nexport * from \"./PropertyTypes\";\nexport * from \"./SchemaJsonLocater\";\nexport * from \"./SchemaKey\";\nexport * from \"./SchemaLoader\";\nexport * from \"./UnitConversion/UnitConversion\";\nexport * from \"./UnitConversion/UnitConverter\";\nexport * from \"./UnitProvider/SchemaUnitProvider\";\nexport * from \"./Validation/SchemaWalker\";\nexport * from \"./SchemaPartVisitorDelegate\";\nexport * from \"./SchemaFormatsProvider\";\nexport * from \"./IncrementalLoading/ECSqlSchemaLocater\";\nexport * from \"./IncrementalLoading/IncrementalSchemaLocater\";\nexport { CustomAttribute, CustomAttributeContainerProps} from \"./Metadata/CustomAttribute\";\nexport { SchemaGraph } from \"./utils/SchemaGraph\";\n\n/** @docs-package-description\n * The ecschema-metadata package contains classes for working with ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\n */\n/**\n * @docs-group-description Metadata\n * Definitions of classes and interfaces that represent all [EC elements]($docs/bis/ec/index.md).\n */\n/**\n * @docs-group-description Utils\n * A set of utility classes used throughout the package.\n */\n"]}
1
+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A8B,CAAC;AACnH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mCAAmC,CAAC;AAClD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oCAAoC,CAAC;AACnD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,+CAA+C,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD;;GAEG;AACH;;;GAGG;AACH;;;GAGG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nexport * from \"./Constants\";\nexport * from \"./Context\";\nexport * from \"./DelayedPromise\";\nexport * from \"./Deserialization/SchemaGraphUtil\";\nexport * from \"./Deserialization/JsonProps\";\nexport * from \"./Deserialization/Helper\";\nexport * from \"./Deserialization/XmlParser\";\nexport * from \"./ECName\";\nexport * from \"./ECObjects\";\nexport * from \"./Exception\";\nexport * from \"./Interfaces\";\nexport { ECClass, StructClass } from \"./Metadata/Class\";\nexport { Constant } from \"./Metadata/Constant\";\nexport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nexport { EntityClass } from \"./Metadata/EntityClass\";\nexport { AnyEnumerator, Enumeration, Enumerator } from \"./Metadata/Enumeration\";\nexport { Format } from \"./Metadata/Format\";\nexport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nexport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nexport { Mixin } from \"./Metadata/Mixin\";\nexport * from \"./Metadata/OverrideFormat\";\nexport { Phenomenon } from \"./Metadata/Phenomenon\";\nexport {\n Property, PrimitiveProperty, PrimitiveArrayProperty, EnumerationProperty, StructProperty,\n StructArrayProperty, EnumerationArrayProperty, NavigationProperty, AnyArrayProperty, AnyEnumerationProperty,\n AnyPrimitiveProperty, AnyProperty, AnyStructProperty, ArrayProperty, PrimitiveOrEnumPropertyBase,\n} from \"./Metadata/Property\";\nexport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nexport { RelationshipClass, RelationshipConstraint, RelationshipMultiplicity } from \"./Metadata/RelationshipClass\";\nexport { Schema } from \"./Metadata/Schema\";\nexport * from \"./Metadata/SchemaItem\";\nexport { Unit } from \"./Metadata/Unit\";\nexport { UnitSystem } from \"./Metadata/UnitSystem\";\nexport * from \"./PropertyTypes\";\nexport * from \"./SchemaJsonLocater\";\nexport * from \"./SchemaKey\";\nexport * from \"./SchemaLoader\";\nexport * from \"./UnitConversion/UnitConversion\";\nexport * from \"./UnitConversion/UnitConverter\";\nexport * from \"./UnitProvider/SchemaUnitProvider\";\nexport * from \"./Validation/SchemaWalker\";\nexport * from \"./SchemaPartVisitorDelegate\";\nexport * from \"./Formatting/SchemaFormatsProvider\";\nexport * from \"./Formatting/FormatSetFormatsProvider\";\nexport * from \"./IncrementalLoading/ECSqlSchemaLocater\";\nexport * from \"./IncrementalLoading/IncrementalSchemaLocater\";\nexport { CustomAttribute, CustomAttributeContainerProps} from \"./Metadata/CustomAttribute\";\nexport { SchemaGraph } from \"./utils/SchemaGraph\";\n\n/** @docs-package-description\n * The ecschema-metadata package contains classes for working with ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\n */\n/**\n * @docs-group-description Metadata\n * Definitions of classes and interfaces that represent all [EC elements]($docs/bis/ec/index.md).\n */\n/**\n * @docs-group-description Utils\n * A set of utility classes used throughout the package.\n */\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itwin/ecschema-metadata",
3
- "version": "5.2.0-dev.8",
3
+ "version": "5.3.0-dev.1",
4
4
  "description": "ECObjects core concepts in typescript",
5
5
  "license": "MIT",
6
6
  "main": "lib/cjs/ecschema-metadata.js",
@@ -48,13 +48,13 @@
48
48
  "rimraf": "^6.0.1",
49
49
  "sinon": "^17.0.2",
50
50
  "typescript": "~5.6.2",
51
- "@itwin/build-tools": "5.2.0-dev.8",
52
- "@itwin/core-quantity": "5.2.0-dev.8",
53
- "@itwin/core-bentley": "5.2.0-dev.8"
51
+ "@itwin/build-tools": "5.3.0-dev.1",
52
+ "@itwin/core-bentley": "5.3.0-dev.1",
53
+ "@itwin/core-quantity": "5.3.0-dev.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@itwin/core-bentley": "5.2.0-dev.8",
57
- "@itwin/core-quantity": "5.2.0-dev.8"
56
+ "@itwin/core-bentley": "5.3.0-dev.1",
57
+ "@itwin/core-quantity": "5.3.0-dev.1"
58
58
  },
59
59
  "nyc": {
60
60
  "extends": "./node_modules/@itwin/build-tools/.nycrc"
@@ -1,60 +0,0 @@
1
- /**
2
- * Contains the properties needed to track load times
3
- * for SchemaItem queries.
4
- * @internal
5
- */
6
- export interface SchemaItemLoadData {
7
- loadTime: number;
8
- itemCount: number;
9
- }
10
- /**
11
- * Contains the properties needed to track load times
12
- * for Schema queries.
13
- * @internal
14
- */
15
- export interface SchemaLoadData {
16
- loadTime?: number;
17
- schemaItemMap: Map<string, SchemaItemLoadData>;
18
- }
19
- /**
20
- * Utility class used to log query load times for Schema and
21
- * SchemaItem queries.
22
- * @internal
23
- */
24
- export declare class PerformanceLogger {
25
- private _iModelItems;
26
- private _label;
27
- disableLogging: boolean;
28
- /**
29
- * Initializes a new PerformanceLogger instance.
30
- * @param label Arbitrary label used to tag this logging session (ex. IModel name)
31
- */
32
- constructor(label?: string);
33
- /**
34
- * Gets the Map of logged Schema entries. The Map key is the iModel name. The Map
35
- * value is a second Map whose key is a Schema name and value is a SchemaLoadData
36
- * object.
37
- */
38
- get logItems(): Map<string, Map<string, SchemaLoadData>>;
39
- /**
40
- * Adds a new log entry to the Schema Map.
41
- * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
42
- * @param schemaName The Schema being queried.
43
- */
44
- logSchema(startTime: number, schemaName: string): void;
45
- /**
46
- * Adds a new log entry to the SchemaItem Map.
47
- * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
48
- * @param schemaName The name of the Schema being queried.
49
- * @param schemaItemType The SchemaItemType name of the type being queried.
50
- * @param itemCount The number of items retrieved in the query.
51
- */
52
- logSchemaItem(startTime: number, schemaName: string, schemaItemType: string, itemCount: number): void;
53
- /**
54
- * Clears all log entries from the Map.
55
- */
56
- clearLogs(): void;
57
- private getSchemaMap;
58
- private getSchemaLoadData;
59
- }
60
- //# sourceMappingURL=PerformanceLogger.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PerformanceLogger.d.ts","sourceRoot":"","sources":["../../../src/IncrementalLoading/PerformanceLogger.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAChD;AAED;;;;GAIG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,YAAY,CAAuD;IAC3E,OAAO,CAAC,MAAM,CAAS;IAGhB,cAAc,UAAS;IAE9B;;;OAGG;gBACS,KAAK,CAAC,EAAE,MAAM;IAI1B;;;;OAIG;IACH,IAAW,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,CAE9D;IAED;;;;OAIG;IACI,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAYtD;;;;;;OAMG;IACI,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAerG;;OAEG;IACI,SAAS;IAIhB,OAAO,CAAC,YAAY;IAQpB,OAAO,CAAC,iBAAiB;CAM1B"}
@@ -1,82 +0,0 @@
1
- "use strict";
2
- /*---------------------------------------------------------------------------------------------
3
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
- * See LICENSE.md in the project root for license terms and full copyright notice.
5
- *--------------------------------------------------------------------------------------------*/
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.PerformanceLogger = void 0;
8
- /**
9
- * Utility class used to log query load times for Schema and
10
- * SchemaItem queries.
11
- * @internal
12
- */
13
- class PerformanceLogger {
14
- _iModelItems = new Map();
15
- _label;
16
- // flag that controls if logging is enabled.
17
- disableLogging = false;
18
- /**
19
- * Initializes a new PerformanceLogger instance.
20
- * @param label Arbitrary label used to tag this logging session (ex. IModel name)
21
- */
22
- constructor(label) {
23
- this._label = label || "";
24
- }
25
- /**
26
- * Gets the Map of logged Schema entries. The Map key is the iModel name. The Map
27
- * value is a second Map whose key is a Schema name and value is a SchemaLoadData
28
- * object.
29
- */
30
- get logItems() {
31
- return this._iModelItems;
32
- }
33
- /**
34
- * Adds a new log entry to the Schema Map.
35
- * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
36
- * @param schemaName The Schema being queried.
37
- */
38
- logSchema(startTime, schemaName) {
39
- if (this.disableLogging)
40
- return;
41
- const loadTime = new Date().getTime() - startTime;
42
- const schemaMap = this.getSchemaMap(this._label);
43
- const schemaLoadData = this.getSchemaLoadData(schemaMap, schemaName);
44
- schemaLoadData.loadTime = loadTime;
45
- }
46
- /**
47
- * Adds a new log entry to the SchemaItem Map.
48
- * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).
49
- * @param schemaName The name of the Schema being queried.
50
- * @param schemaItemType The SchemaItemType name of the type being queried.
51
- * @param itemCount The number of items retrieved in the query.
52
- */
53
- logSchemaItem(startTime, schemaName, schemaItemType, itemCount) {
54
- if (this.disableLogging)
55
- return;
56
- const loadTime = new Date().getTime() - startTime;
57
- const schemaMap = this.getSchemaMap(this._label);
58
- const schemaLoadData = this.getSchemaLoadData(schemaMap, schemaName);
59
- if (schemaLoadData.schemaItemMap.has(schemaItemType))
60
- throw new Error("There should not be a multiple load times for a given iModel, Schema, SchemaItemType combination.");
61
- schemaLoadData.schemaItemMap.set(schemaItemType, { loadTime, itemCount });
62
- }
63
- /**
64
- * Clears all log entries from the Map.
65
- */
66
- clearLogs() {
67
- this._iModelItems.clear();
68
- }
69
- getSchemaMap(iModel) {
70
- if (!this._iModelItems.has(iModel)) {
71
- this._iModelItems.set(iModel, new Map());
72
- }
73
- return this._iModelItems.get(iModel);
74
- }
75
- getSchemaLoadData(schemaMap, schemaName) {
76
- if (!schemaMap.has(schemaName))
77
- schemaMap.set(schemaName, { schemaItemMap: new Map() });
78
- return schemaMap.get(schemaName);
79
- }
80
- }
81
- exports.PerformanceLogger = PerformanceLogger;
82
- //# sourceMappingURL=PerformanceLogger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"PerformanceLogger.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/PerformanceLogger.ts"],"names":[],"mappings":";AAAA;;;gGAGgG;;;AAsBhG;;;;GAIG;AACH,MAAa,iBAAiB;IACpB,YAAY,GAA6C,IAAI,GAAG,EAAE,CAAC;IACnE,MAAM,CAAS;IAEvB,4CAA4C;IACrC,cAAc,GAAG,KAAK,CAAC;IAE9B;;;OAGG;IACH,YAAY,KAAc;QACxB,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACH,IAAW,QAAQ;QACjB,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G,CAAC,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAgC,CAAC;IACtE,CAAC;IAEO,iBAAiB,CAAC,SAAsC,EAAE,UAAkB;QAClF,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,UAAU,CAAC;YAC5B,SAAS,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,aAAa,EAAE,IAAI,GAAG,EAAE,EAAE,CAAC,CAAA;QAEzD,OAAO,SAAS,CAAC,GAAG,CAAC,UAAU,CAAmB,CAAC;IACrD,CAAC;CACF;AApFD,8CAoFC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\n\n/**\n * Contains the properties needed to track load times\n * for SchemaItem queries.\n * @internal\n */\nexport interface SchemaItemLoadData {\n loadTime: number,\n itemCount: number\n}\n\n/**\n * Contains the properties needed to track load times\n * for Schema queries.\n * @internal\n */\nexport interface SchemaLoadData {\n loadTime?: number,\n schemaItemMap: Map<string, SchemaItemLoadData>;\n}\n\n/**\n * Utility class used to log query load times for Schema and\n * SchemaItem queries.\n * @internal\n */\nexport class PerformanceLogger {\n private _iModelItems: Map<string, Map<string, SchemaLoadData>> = new Map();\n private _label: string;\n\n // flag that controls if logging is enabled.\n public disableLogging = false;\n\n /**\n * Initializes a new PerformanceLogger instance.\n * @param label Arbitrary label used to tag this logging session (ex. IModel name)\n */\n constructor(label?: string) {\n this._label = label || \"\";\n }\n\n /**\n * Gets the Map of logged Schema entries. The Map key is the iModel name. The Map\n * value is a second Map whose key is a Schema name and value is a SchemaLoadData\n * object.\n */\n public get logItems(): Map<string, Map<string, SchemaLoadData>> {\n return this._iModelItems;\n }\n\n /**\n * Adds a new log entry to the Schema Map.\n * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).\n * @param schemaName The Schema being queried.\n */\n public logSchema(startTime: number, schemaName: string) {\n if (this.disableLogging)\n return;\n\n const loadTime = new Date().getTime() - startTime;\n\n const schemaMap = this.getSchemaMap(this._label);\n const schemaLoadData = this.getSchemaLoadData(schemaMap, schemaName);\n\n schemaLoadData.loadTime = loadTime;\n }\n\n /**\n * Adds a new log entry to the SchemaItem Map.\n * @param startTime The start time of the entry to be logged (end time/duration is handled in this method).\n * @param schemaName The name of the Schema being queried.\n * @param schemaItemType The SchemaItemType name of the type being queried.\n * @param itemCount The number of items retrieved in the query.\n */\n public logSchemaItem(startTime: number, schemaName: string, schemaItemType: string, itemCount: number) {\n if (this.disableLogging)\n return;\n\n const loadTime = new Date().getTime() - startTime;\n\n const schemaMap = this.getSchemaMap(this._label);\n const schemaLoadData = this.getSchemaLoadData(schemaMap, schemaName);\n\n if (schemaLoadData.schemaItemMap.has(schemaItemType))\n throw new Error(\"There should not be a multiple load times for a given iModel, Schema, SchemaItemType combination.\");\n\n schemaLoadData.schemaItemMap.set(schemaItemType, { loadTime, itemCount });\n }\n\n /**\n * Clears all log entries from the Map.\n */\n public clearLogs() {\n this._iModelItems.clear();\n }\n\n private getSchemaMap(iModel: string): Map<string, SchemaLoadData> {\n if (!this._iModelItems.has(iModel)) {\n this._iModelItems.set(iModel, new Map());\n }\n\n return this._iModelItems.get(iModel) as Map<string, SchemaLoadData>;\n }\n\n private getSchemaLoadData(schemaMap: Map<string, SchemaLoadData>, schemaName: string): SchemaLoadData {\n if (!schemaMap.has(schemaName))\n schemaMap.set(schemaName, { schemaItemMap: new Map() })\n\n return schemaMap.get(schemaName) as SchemaLoadData;\n }\n}"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"SchemaFormatsProvider.d.ts","sourceRoot":"","sources":["../../src/SchemaFormatsProvider.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAK1D,OAAO,EAAE,OAA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UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACjF,KAAK,QAAQ;YACX,OAAO,CAAC,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3E,KAAK,aAAa;YAChB,OAAO,CAAC,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACrE,KAAK,UAAU;YACb,OAAO,CAAC,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,SAAS,CAAC,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,6BAA6B,CAAC,eAAoC;IACzE,oDAAoD;IACpD,OAAO;QACL,YAAY,EAAE,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,CAAC;QACrE,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,SAAS;QACf,SAAS,EAAE;YACT,KAAK,EAAE;gBACL;oBACE,IAAI,EAAE,eAAe,CAAC,QAAQ;oBAC9B,KAAK,EAAE,eAAe,CAAC,KAAK;iBAC7B;aACF;SACF;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { ISchemaLocater, SchemaContext } from \"./Context\";\nimport { SchemaItemKey, SchemaKey } from \"./SchemaKey\";\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\nimport { Format } from \"./Metadata/Format\";\nimport { SchemaItemFormatProps } from \"./Deserialization/JsonProps\";\nimport { BeEvent, Logger } from \"@itwin/core-bentley\";\nimport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nimport { getFormatProps } from \"./Metadata/OverrideFormat\";\nimport { FormatDefinition, FormatProps, FormatsChangedArgs, FormatsProvider, UnitSystemKey } from \"@itwin/core-quantity\";\nimport { Unit } from \"./Metadata/Unit\";\nimport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { UnitSystem } from \"./Metadata/UnitSystem\";\nconst loggerCategory = \"SchemaFormatsProvider\";\n/**\n * Provides default formats and kind of quantities from a given SchemaContext or SchemaLocater.\n * @beta\n */\nexport class SchemaFormatsProvider implements FormatsProvider {\n private _context: SchemaContext;\n private _unitSystem: UnitSystemKey;\n private _formatsRetrieved: Set<string> = new Set();\n public onFormatsChanged = new BeEvent<(args: FormatsChangedArgs) => void>();\n /**\n *\n * @param contextOrLocater The SchemaContext or a different ISchemaLocater implementation used to retrieve the schema. The SchemaContext\n * class implements the ISchemaLocater interface. If the provided locater is not a SchemaContext instance a new SchemaContext will be\n * created and the locater will be added.\n * @param unitSystem Used to lookup a default format through a schema specific algorithm, when the format retrieved is associated with a KindOfQuantity.\n */\n constructor(contextOrLocater: ISchemaLocater, unitSystem: UnitSystemKey) {\n if (contextOrLocater instanceof SchemaContext) {\n this._context = contextOrLocater;\n } else {\n this._context = new SchemaContext();\n this._context.addLocater(contextOrLocater);\n }\n this._unitSystem = unitSystem;\n }\n\n public get context() { return this._context; }\n public get unitSystem() { return this._unitSystem; }\n\n public set unitSystem(unitSystem: UnitSystemKey) {\n this._unitSystem = unitSystem;\n this.clear();\n }\n\n private clear(): void {\n const formatsChanged = Array.from(this._formatsRetrieved);\n this._formatsRetrieved.clear();\n this.onFormatsChanged.raiseEvent({ formatsChanged });\n }\n\n /** When using a presentation unit from a KindOfQuantity, the label and description should come from the KindOfQuantity */\n private convertToFormatDefinition(format: SchemaItemFormatProps, kindOfQuantity: KindOfQuantity): FormatDefinition {\n // Destructure all properties except 'rest'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { name, label, description, $schema, schema, schemaVersion, schemaItemType,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n customAttributes, originalECSpecMajorVersion, originalECSpecMinorVersion, ...rest } = format;\n\n return {\n ...rest,\n name: kindOfQuantity.fullName,\n label: kindOfQuantity.label ?? format.label,\n description: kindOfQuantity.description ?? format.description,\n }\n }\n\n private async getKindOfQuantityFormatFromSchema(itemKey: SchemaItemKey): Promise<FormatDefinition | undefined> {\n let kindOfQuantity: KindOfQuantity | undefined;\n try {\n kindOfQuantity = await this._context.getSchemaItem(itemKey, KindOfQuantity);\n } catch {\n Logger.logError(loggerCategory, `Failed to find KindOfQuantity ${itemKey.fullName}`);\n return undefined;\n }\n\n if (!kindOfQuantity) {\n return undefined;\n }\n\n // Find the first presentation format that matches the provided unit system.\n const unitSystemMatchers = getUnitSystemGroupMatchers(this._unitSystem);\n const presentationFormats = kindOfQuantity.presentationFormats;\n for (const matcher of unitSystemMatchers) {\n for (const lazyFormat of presentationFormats) {\n const format = await lazyFormat;\n const unit = await (format.units && format.units[0][0]);\n if (!unit) {\n continue;\n }\n const currentUnitSystem = await unit.unitSystem;\n if (currentUnitSystem && matcher(currentUnitSystem)) {\n this._formatsRetrieved.add(itemKey.fullName);\n const props = getFormatProps(format);\n return this.convertToFormatDefinition(props, kindOfQuantity);\n }\n }\n }\n\n // If no matching presentation format was found, use persistence unit format if it matches unit system.\n const persistenceUnit = await kindOfQuantity.persistenceUnit;\n const persistenceUnitSystem = await persistenceUnit?.unitSystem;\n if (persistenceUnitSystem && unitSystemMatchers.some((matcher) => matcher(persistenceUnitSystem))) {\n this._formatsRetrieved.add(itemKey.fullName);\n const props = getPersistenceUnitFormatProps(persistenceUnit!);\n return this.convertToFormatDefinition(props, kindOfQuantity);\n }\n\n const defaultFormat = kindOfQuantity.defaultPresentationFormat;\n if (!defaultFormat) {\n return undefined;\n }\n this._formatsRetrieved.add(itemKey.fullName);\n const defaultProps = getFormatProps(await defaultFormat);\n return this.convertToFormatDefinition(defaultProps, kindOfQuantity);\n }\n\n\n /**\n * Retrieves a Format from a SchemaContext. If the format is part of a KindOfQuantity, the first presentation format in the KindOfQuantity that matches the current unit system will be retrieved.\n * If no presentation format matches the current unit system, the persistence unit format will be retrieved if it matches the current unit system.\n * Else, the default presentation format will be retrieved.\n * @param name The full name of the Format or KindOfQuantity.\n * @returns\n */\n public async getFormat(name: string): Promise<FormatDefinition | undefined> {\n const [schemaName, schemaItemName] = SchemaItem.parseFullName(name);\n const schemaKey = new SchemaKey(schemaName);\n let schema: Schema | undefined;\n try {\n schema = await this._context.getSchema(schemaKey);\n } catch {\n Logger.logError(loggerCategory, `Failed to find schema ${schemaName}`);\n return undefined;\n }\n if (!schema) {\n return undefined;\n }\n const itemKey = new SchemaItemKey(schemaItemName, schema.schemaKey);\n\n if (schema.name === \"Formats\") {\n let format: Format | undefined;\n try {\n format = await this._context.getSchemaItem(itemKey, Format);\n } catch {\n Logger.logError(loggerCategory, `Failed to find Format ${itemKey.fullName}`);\n return undefined;\n }\n if (!format) {\n return undefined;\n }\n return format.toJSON(true);\n }\n return this.getKindOfQuantityFormatFromSchema(itemKey);\n }\n}\n\nfunction getUnitSystemGroupMatchers(groupKey?: UnitSystemKey) {\n function createMatcher(name: string | string[]) {\n const names = Array.isArray(name) ? name : [name];\n return (unitSystem: UnitSystem) => names.some((n) => n === unitSystem.name.toUpperCase());\n }\n switch (groupKey) {\n case \"imperial\":\n return [\"IMPERIAL\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"metric\":\n return [[\"SI\", \"METRIC\"], \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"usCustomary\":\n return [\"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n case \"usSurvey\":\n return [\"USSURVEY\", \"USCUSTOM\", \"INTERNATIONAL\", \"FINANCE\"].map(createMatcher);\n }\n return [];\n}\n\nfunction getPersistenceUnitFormatProps(persistenceUnit: Unit | InvertedUnit): FormatProps {\n // Same as Format \"DefaultRealU\" in Formats ecschema\n return {\n formatTraits: [\"keepSingleZero\", \"keepDecimalPoint\", \"showUnitLabel\"],\n precision: 6,\n type: \"Decimal\",\n composite: {\n units: [\n {\n name: persistenceUnit.fullName,\n label: persistenceUnit.label,\n },\n ],\n },\n };\n}"]}