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

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 (122) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Constants.js.map +1 -1
  3. package/lib/cjs/DelayedPromise.js.map +1 -1
  4. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  5. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  6. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  7. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  8. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  9. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  10. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  11. package/lib/cjs/ECName.js.map +1 -1
  12. package/lib/cjs/ECObjects.js.map +1 -1
  13. package/lib/cjs/Exception.js.map +1 -1
  14. package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -1
  15. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -1
  16. package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -1
  17. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  18. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +466 -466
  19. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  20. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  21. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  22. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  23. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +235 -235
  24. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  25. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -1
  26. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +309 -309
  27. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  28. package/lib/cjs/Interfaces.js.map +1 -1
  29. package/lib/cjs/Metadata/Class.js.map +1 -1
  30. package/lib/cjs/Metadata/Constant.js.map +1 -1
  31. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  32. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  33. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  34. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  35. package/lib/cjs/Metadata/Format.js.map +1 -1
  36. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  37. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  38. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  39. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  40. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  41. package/lib/cjs/Metadata/Property.js.map +1 -1
  42. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  43. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  44. package/lib/cjs/Metadata/Schema.js.map +1 -1
  45. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  46. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  47. package/lib/cjs/PropertyTypes.js.map +1 -1
  48. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  49. package/lib/cjs/SchemaKey.js.map +1 -1
  50. package/lib/cjs/SchemaLoader.js.map +1 -1
  51. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  52. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  53. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  54. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  55. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  56. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  57. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  58. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  59. package/lib/cjs/ecschema-metadata.js.map +1 -1
  60. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  61. package/lib/cjs/utils/SchemaLoadingController.js.map +1 -1
  62. package/lib/esm/Constants.js.map +1 -1
  63. package/lib/esm/DelayedPromise.js.map +1 -1
  64. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  65. package/lib/esm/Deserialization/Helper.js.map +1 -1
  66. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  67. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  68. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  69. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  70. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  71. package/lib/esm/ECName.js.map +1 -1
  72. package/lib/esm/ECObjects.js.map +1 -1
  73. package/lib/esm/Exception.js.map +1 -1
  74. package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -1
  75. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -1
  76. package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -1
  77. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  78. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +466 -466
  79. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  80. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  81. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  82. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  83. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +235 -235
  84. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  85. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -1
  86. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +309 -309
  87. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  88. package/lib/esm/Interfaces.js.map +1 -1
  89. package/lib/esm/Metadata/Class.js.map +1 -1
  90. package/lib/esm/Metadata/Constant.js.map +1 -1
  91. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  92. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  93. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  94. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  95. package/lib/esm/Metadata/Format.js.map +1 -1
  96. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  97. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  98. package/lib/esm/Metadata/Mixin.js.map +1 -1
  99. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  100. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  101. package/lib/esm/Metadata/Property.js.map +1 -1
  102. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  103. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  104. package/lib/esm/Metadata/Schema.js.map +1 -1
  105. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  106. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  107. package/lib/esm/PropertyTypes.js.map +1 -1
  108. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  109. package/lib/esm/SchemaKey.js.map +1 -1
  110. package/lib/esm/SchemaLoader.js.map +1 -1
  111. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  112. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  113. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  114. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  115. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  116. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  117. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  118. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  119. package/lib/esm/ecschema-metadata.js.map +1 -1
  120. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  121. package/lib/esm/utils/SchemaLoadingController.js.map +1 -1
  122. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA4E;AAC5E,8DAA2D;AAE3D,4DAAyD;AACzD,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAE7D,4CAAmE;AACnE,sCAAmC;AACnC,mCAA+C;AAC/C,yCAAsC;AACtC,uDAAkI;AAClI,iEAA8D;AAC9D,+CAA4C;AAC5C,+CAA4C;AAC5C,qCAAkC;AAClC,iDAA8C;AAC9C,qDAAkD;AAClD,mCAAgC;AAChC,6CAA0C;AAC1C,yDAAsD;AACtD,2DAAwD;AACxD,6CAA0C;AAC1C,iCAA8B;AAC9B,6CAA0C;AAC1C,4CAAqD;AAGrD;;GAEG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACrC,QAAQ,CAAgB;IACxB,UAAU,CAAa;IACvB,MAAM,CAAU;IAChB,MAAM,CAAU;IAChB,YAAY,CAAU;IACd,UAAU,CAAW;IACpB,MAAM,CAA0B;IACzC,iBAAiB,CAAgC;IACjD,2BAA2B,CAAU;IACrC,2BAA2B,CAAU;IACrC,kBAAkB,CAA2B;IAwBrD,gBAAgB;IAChB,YAAY,OAAsB,EAAE,SAA8B,EAAE,KAAc,EAAE,OAAgB,EAAE,QAAiB,EAAE,QAAiB;QACxI,IAAI,CAAC,UAAU,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,qBAAS,CAAC,SAAS,EAAE,IAAI,qBAAS,CAAC,OAAiB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACjJ,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,UAAU,GAA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AKG;AACH,MAAsB,aAAc,SAAQ,MAAM;CAuCjD;AAvCD,sCAuCC","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}"]}
1
+ {"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA4E;AAC5E,8DAA2D;AAE3D,4DAAyD;AACzD,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAE7D,4CAAmE;AACnE,sCAAmC;AACnC,mCAA+C;AAC/C,yCAAsC;AACtC,uDAAkI;AAClI,iEAA8D;AAC9D,+CAA4C;AAC5C,+CAA4C;AAC5C,qCAAkC;AAClC,iDAA8C;AAC9C,qDAAkD;AAClD,mCAAgC;AAChC,6CAA0C;AAC1C,yDAAsD;AACtD,2DAAwD;AACxD,6CAA0C;AAC1C,iCAA8B;AAC9B,6CAA0C;AAC1C,4CAAqD;AAGrD;;GAEG;AACH,MAAa,MAAM;IACT,MAAM,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACrC,QAAQ,CAAgB;IACxB,UAAU,CAAa;IACvB,MAAM,CAAU;IAChB,MAAM,CAAU;IAChB,YAAY,CAAU;IACd,UAAU,CAAW;IACpB,MAAM,CAA0B;IACzC,iBAAiB,CAAgC;IACjD,2BAA2B,CAAU;IACrC,2BAA2B,CAAU;IACr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AAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED,gBAAgB;IACN,QAAQ,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,yBAAa,CAAC,0BAAc,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;;AA33BH,wBA43BC;AAED;;;;;GAKG;AACH,MAAsB,aAAc,SAAQ,MAAM;CAuCjD;AAvCD,sCAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { SchemaContext } from \"../Context\";\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\nimport { JsonParser } from \"../Deserialization/JsonParser\";\r\nimport { SchemaProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlParser } from \"../Deserialization/XmlParser\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { ECClassModifier, isSupportedSchemaItemType, PrimitiveType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, SchemaInfo } from \"../Interfaces\";\r\nimport { ECVersion, SchemaItemKey, SchemaKey } from \"../SchemaKey\";\r\nimport { ECName } from \"../ECName\";\r\nimport { ECClass, StructClass } from \"./Class\";\r\nimport { Constant } from \"./Constant\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { CustomAttributeClass } from \"./CustomAttributeClass\";\r\nimport { EntityClass } from \"./EntityClass\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport { Format } from \"./Format\";\r\nimport { InvertedUnit } from \"./InvertedUnit\";\r\nimport { KindOfQuantity } from \"./KindOfQuantity\";\r\nimport { Mixin } from \"./Mixin\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { PropertyCategory } from \"./PropertyCategory\";\r\nimport { RelationshipClass } from \"./RelationshipClass\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { Unit } from \"./Unit\";\r\nimport { UnitSystem } from \"./UnitSystem\";\r\nimport { ECSchemaNamespaceUris } from \"../Constants\";\r\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class Schema implements CustomAttributeContainerProps {\r\n private static _currentECSpecVersion = \"3.2\";\r\n private _context: SchemaContext;\r\n private _schemaKey?: SchemaKey;\r\n private _alias?: string;\r\n private _label?: string;\r\n private _description?: string;\r\n public readonly references: Schema[];\r\n private readonly _items: Map<string, SchemaItem>;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n private _originalECSpecMajorVersion?: number;\r\n private _originalECSpecMinorVersion?: number;\r\n private _loadingController?: SchemaLoadingController;\r\n\r\n /**\r\n * Constructs an empty Schema with the given name and version in the provided context.\r\n * @param context The SchemaContext that will control the lifetime of the schema\r\n * @param name The schema's name\r\n * @param readVersion The integer read (major) version of the schema\r\n * @param writeVersion The integer write version of the schema\r\n * @param minorVersion The integer minor version of the schema\r\n */\r\n constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);\r\n /**\r\n * Constructs an empty Schema with the given key in the provided context.\r\n * @param context The SchemaContext that will control the lifetime of the schema\r\n * @param key A SchemaKey that uniquely identifies the schema\r\n */\r\n constructor(context: SchemaContext, key: SchemaKey, alias: string);\r\n /**\r\n * Constructs an empty Schema (without a SchemaKey) in the provided context.\r\n * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.\r\n * @param context The SchemaContext that will control the lifetime of the schema\r\n * @internal\r\n */\r\n constructor(context: SchemaContext);\r\n /** @internal */\r\n constructor(context: SchemaContext, nameOrKey?: SchemaKey | string, alias?: string, readVer?: number, writeVer?: number, minorVer?: number) {\r\n this._schemaKey = (typeof (nameOrKey) === \"string\") ? new SchemaKey(nameOrKey, new ECVersion(readVer as number, writeVer, minorVer)) : nameOrKey;\r\n this._context = context;\r\n this.references = [];\r\n this._items = new Map<string, SchemaItem>();\r\n\r\n if (alias !== undefined && ECName.validate(alias)) {\r\n this._alias = alias;\r\n } else if (nameOrKey !== undefined) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\r\n }\r\n\r\n this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;\r\n this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;\r\n }\r\n\r\n public get schemaKey() {\r\n if (undefined === this._schemaKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\r\n return this._schemaKey;\r\n }\r\n\r\n public get name() {\r\n if (this._schemaKey === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\r\n return this.schemaKey.name;\r\n }\r\n\r\n public get readVersion() {\r\n if (this._schemaKey === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\r\n return this.schemaKey.readVersion;\r\n }\r\n\r\n public get writeVersion() {\r\n if (this._schemaKey === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\r\n return this.schemaKey.writeVersion;\r\n }\r\n\r\n public get minorVersion() {\r\n if (this._schemaKey === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\r\n return this.schemaKey.minorVersion;\r\n }\r\n\r\n public get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }\r\n public get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }\r\n public static get currentECSpecMajorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[0], 10); }\r\n public static get currentECSpecMinorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[1], 10); }\r\n\r\n private get _isECSpecVersionUnsupported(): boolean {\r\n return (this.originalECSpecMajorVersion !== 3 || this.originalECSpecMinorVersion === undefined\r\n || (this.originalECSpecMinorVersion < 2 || this.originalECSpecMinorVersion > Schema.currentECSpecMinorVersion))\r\n }\r\n\r\n public get alias() {\r\n if (this._alias === undefined || this._alias === null) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\r\n } else { return this._alias; }\r\n }\r\n\r\n public get label() { return this._label; }\r\n\r\n public get description() { return this._description; }\r\n\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** Returns the schema name. */\r\n public get fullName() { return this.schemaKey.name; }\r\n\r\n /** Returns the schema. */\r\n public get schema(): Schema { return this; }\r\n\r\n /** Returns the schema context this schema is within. */\r\n public get context(): SchemaContext { return this._context; }\r\n\r\n /** Returns whether this schema is dynamic schema */\r\n public get isDynamic(): boolean {\r\n return this.customAttributes !== undefined && this.customAttributes.has(\"CoreCustomAttributes.DynamicSchema\");\r\n }\r\n\r\n /**\r\n * Returns the SchemaLoadingController for this Schema. This would only be set if the schema is\r\n * loaded incrementally.\r\n * @internal\r\n */\r\n public get loadingController(): SchemaLoadingController | undefined{\r\n return this._loadingController;\r\n }\r\n\r\n /**\r\n * Returns a SchemaItemKey given the item name and the schema it belongs to\r\n * @param fullName fully qualified name {Schema name}.{Item Name}\r\n */\r\n public getSchemaItemKey(fullName: string): SchemaItemKey {\r\n const [schemaName, itemName] = SchemaItem.parseFullName(fullName);\r\n let schemaKey = this.schemaKey;\r\n if (this.name !== schemaName) {\r\n const newSchemaRef = this.getReferenceSync(schemaName);\r\n if (undefined === newSchemaRef)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);\r\n schemaKey = newSchemaRef.schemaKey;\r\n }\r\n return new SchemaItemKey(itemName, schemaKey);\r\n }\r\n\r\n /** @internal */\r\n protected addItem<T extends SchemaItem>(item: T): void {\r\n if (undefined !== this.getItemSync(item.name))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);\r\n\r\n this._items.set(item.name.toUpperCase(), item);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected createClass<T extends AnyClass>(type: (new (_schema: Schema, _name: string, _modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T {\r\n const item = new type(this, name, modifier);\r\n this.addItem(item);\r\n return item;\r\n }\r\n\r\n /**\r\n * Deletes a class from within this schema.\r\n * @param name the local (unqualified) class name, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteClass(name: string): Promise<void> {\r\n const schemaItem = await this.getItem(name);\r\n if (ECClass.isECClass(schemaItem)) {\r\n this._items.delete(name.toUpperCase());\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a class from within this schema.\r\n * @param name the local (unqualified) class name, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deleteClassSync(name: string): void {\r\n const schemaItem = this.getItemSync(name);\r\n if (ECClass.isECClass(schemaItem))\r\n this._items.delete(name.toUpperCase());\r\n }\r\n\r\n /**\r\n * Deletes a SchemaItem from within this schema.\r\n * @param name the local (unqualified) class name, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected async deleteSchemaItem(name: string): Promise<void> {\r\n const schemaItem = await this.getItem(name);\r\n if (SchemaItem.isSchemaItem(schemaItem)) {\r\n this._items.delete(name.toUpperCase());\r\n }\r\n }\r\n\r\n /**\r\n * Deletes a SchemaItem from within this schema.\r\n * @param name the local (unqualified) class name, lookup is case-insensitive\r\n * @internal\r\n */\r\n protected deleteSchemaItemSync(name: string): void {\r\n const schemaItem = this.getItemSync(name);\r\n if (SchemaItem.isSchemaItem(schemaItem))\r\n this._items.delete(name.toUpperCase());\r\n }\r\n\r\n /** @internal */\r\n protected createItem<T extends SchemaItem>(type: (new (_schema: Schema, _name: string) => T), name: string): T {\r\n const item = new type(this, name);\r\n this.addItem(item);\r\n return item;\r\n }\r\n\r\n /** @internal */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /**\r\n * Creates a EntityClass with the provided name in this schema.\r\n * @param name\r\n * @param modifier\r\n * @internal\r\n */\r\n protected async createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass> {\r\n return this.createClass<EntityClass>(EntityClass, name, modifier);\r\n }\r\n\r\n /** @internal */\r\n protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass {\r\n return this.createClass<EntityClass>(EntityClass, name, modifier);\r\n }\r\n\r\n /**\r\n * Creates a Mixin with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createMixinClass(name: string): Promise<Mixin> { return this.createClass<Mixin>(Mixin, name); }\r\n /** @internal */\r\n protected createMixinClassSync(name: string): Mixin { return this.createClass<Mixin>(Mixin, name); }\r\n\r\n /**\r\n * Creates a StructClass with the provided name in this schema.\r\n * @param name\r\n * @param modifier\r\n * @internal\r\n */\r\n protected async createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass> {\r\n return this.createClass<StructClass>(StructClass, name, modifier);\r\n }\r\n\r\n /** @internal */\r\n protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass {\r\n return this.createClass<StructClass>(StructClass, name, modifier);\r\n }\r\n\r\n /**\r\n * Creates a CustomAttributeClass with the provided name in this schema.\r\n * @param name\r\n * @param modifier\r\n * @internal\r\n */\r\n protected async createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass> {\r\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\r\n }\r\n\r\n /** @internal */\r\n protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass {\r\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\r\n }\r\n\r\n /**\r\n * Creates a RelationshipClass with the provided name in this schema.\r\n * @param name\r\n * @param modifier\r\n * @internal\r\n */\r\n protected async createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass> {\r\n return this.createRelationshipClassSync(name, modifier);\r\n }\r\n\r\n /** @internal */\r\n protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass {\r\n return this.createClass<RelationshipClass>(RelationshipClass, name, modifier);\r\n }\r\n\r\n /**\r\n * Creates an Enumeration with the provided name in this schema.\r\n * @param name\r\n * @param primitiveType\r\n *\r\n * @internal\r\n */\r\n protected async createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration> {\r\n return this.createEnumerationSync(name, primitiveType);\r\n }\r\n\r\n /** @internal */\r\n protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration {\r\n const item = new Enumeration(this, name, primitiveType);\r\n this.addItem(item);\r\n return item;\r\n }\r\n\r\n /**\r\n * Creates an KindOfQuantity with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createKindOfQuantity(name: string): Promise<KindOfQuantity> {\r\n return this.createKindOfQuantitySync(name);\r\n }\r\n\r\n /** @internal */\r\n protected createKindOfQuantitySync(name: string): KindOfQuantity {\r\n return this.createItem<KindOfQuantity>(KindOfQuantity, name);\r\n }\r\n\r\n /**\r\n * Creates a Constant with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createConstant(name: string): Promise<Constant> {\r\n return this.createItem<Constant>(Constant, name);\r\n }\r\n\r\n /** @internal */\r\n protected createConstantSync(name: string): Constant {\r\n return this.createItem<Constant>(Constant, name);\r\n }\r\n\r\n /**\r\n * Creates a Inverted Unit with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createInvertedUnit(name: string): Promise<InvertedUnit> {\r\n return this.createItem<InvertedUnit>(InvertedUnit, name);\r\n }\r\n\r\n /** @internal */\r\n protected createInvertedUnitSync(name: string): InvertedUnit {\r\n return this.createItem<InvertedUnit>(InvertedUnit, name);\r\n }\r\n\r\n /**\r\n * Creates an Format with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createFormat(name: string): Promise<Format> {\r\n return this.createItem<Format>(Format, name);\r\n }\r\n\r\n /** @internal */\r\n protected createFormatSync(name: string): Format {\r\n return this.createItem<Format>(Format, name);\r\n }\r\n\r\n /**\r\n * Creates a UnitSystem with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createUnitSystem(name: string): Promise<UnitSystem> {\r\n return this.createItem<UnitSystem>(UnitSystem, name);\r\n }\r\n\r\n /** @internal */\r\n protected createUnitSystemSync(name: string): UnitSystem {\r\n return this.createItem<UnitSystem>(UnitSystem, name);\r\n }\r\n\r\n /**\r\n * Creates a Phenomenon with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createPhenomenon(name: string): Promise<Phenomenon> {\r\n return this.createItem<Phenomenon>(Phenomenon, name);\r\n }\r\n\r\n /** @internal */\r\n protected createPhenomenonSync(name: string): Phenomenon {\r\n return this.createItem<Phenomenon>(Phenomenon, name);\r\n }\r\n\r\n /**\r\n * Creates a Unit with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createUnit(name: string): Promise<Unit> {\r\n return this.createItem<Unit>(Unit, name);\r\n }\r\n\r\n /** @internal */\r\n protected createUnitSync(name: string): Unit {\r\n return this.createItem<Unit>(Unit, name);\r\n }\r\n\r\n /**\r\n * Creates an PropertyCategory with the provided name in this schema.\r\n * @param name\r\n * @internal\r\n */\r\n protected async createPropertyCategory(name: string): Promise<PropertyCategory> {\r\n return this.createItem<PropertyCategory>(PropertyCategory, name);\r\n }\r\n\r\n /** @internal */\r\n protected createPropertyCategorySync(name: string): PropertyCategory {\r\n return this.createItem<PropertyCategory>(PropertyCategory, name);\r\n }\r\n\r\n /**\r\n *\r\n * @param refSchema\r\n * @internal\r\n */\r\n protected async addReference(refSchema: Schema): Promise<void> {\r\n // TODO validation of reference schema. For now just adding\r\n this.addReferenceSync(refSchema);\r\n }\r\n\r\n /** @internal */\r\n protected addReferenceSync(refSchema: Schema): void {\r\n this.references.push(refSchema);\r\n }\r\n\r\n /** @internal */\r\n protected setContext(context: SchemaContext): void {\r\n this._context = context;\r\n }\r\n\r\n /**\r\n * Sets the version of the SchemaKey identifying the schema.\r\n * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.\r\n * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.\r\n * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.\r\n * @internal\r\n */\r\n public setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void {\r\n if (!this._schemaKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);\r\n\r\n const newVersion = new ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);\r\n this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);\r\n }\r\n\r\n /**\r\n * Shortcut for calling getItem with EntityClass.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested EntityClass or undefined if not found.\r\n */\r\n public async getEntityClass(name: string): Promise<EntityClass | undefined> { return this.getItem(name, EntityClass); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Mixin.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Mixin or undefined if not found.\r\n */\r\n public async getMixin(name: string): Promise<Mixin | undefined> { return this.getItem(name, Mixin); }\r\n\r\n /**\r\n * Shortcut for calling getItem with StructClass.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested StructClass or undefined if not found.\r\n */\r\n public async getStructClass(name: string): Promise<StructClass | undefined> { return this.getItem(name, StructClass); }\r\n\r\n /**\r\n * Shortcut for calling getItem with CustomAttributeClass.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested CustomAttributeClass or undefined if not found.\r\n */\r\n public async getCustomAttributeClass(name: string): Promise<CustomAttributeClass | undefined> { return this.getItem(name, CustomAttributeClass); }\r\n\r\n /**\r\n * Shortcut for calling getItem with RelationshipClass.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested RelationshipClass or undefined if not found.\r\n */\r\n public async getRelationshipClass(name: string): Promise<RelationshipClass | undefined> { return this.getItem(name, RelationshipClass); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Enumeration.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Enumeration or undefined if not found.\r\n */\r\n public async getEnumeration(name: string): Promise<Enumeration | undefined> { return this.getItem(name, Enumeration); }\r\n\r\n /**\r\n * Shortcut for calling getItem with KindOfQuantity.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested KindOfQuantity or undefined if not found.\r\n */\r\n public async getKindOfQuantity(name: string): Promise<KindOfQuantity | undefined> { return this.getItem(name, KindOfQuantity); }\r\n\r\n /**\r\n * Shortcut for calling getItem with PropertyCategory.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested PropertyCategory or undefined if not found.\r\n */\r\n public async getPropertyCategory(name: string): Promise<PropertyCategory | undefined> { return this.getItem(name, PropertyCategory); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Unit.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Unit or undefined if not found.\r\n */\r\n public async getUnit(name: string): Promise<Unit | undefined> { return this.getItem(name, Unit); }\r\n\r\n /**\r\n * Shortcut for calling getItem with InvertedUnit.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested InvertedUnit or undefined if not found.\r\n */\r\n public async getInvertedUnit(name: string): Promise<InvertedUnit | undefined> { return this.getItem(name, InvertedUnit); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Constant.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Constant or undefined if not found.\r\n */\r\n public async getConstant(name: string): Promise<Constant | undefined> { return this.getItem(name, Constant); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Phenomenon.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Phenomenon or undefined if not found.\r\n */\r\n public async getPhenomenon(name: string): Promise<Phenomenon | undefined> { return this.getItem(name, Phenomenon); }\r\n\r\n /**\r\n * Shortcut for calling getItem with UnitSystem.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested UnitSystem or undefined if not found.\r\n */\r\n public async getUnitSystem(name: string): Promise<UnitSystem | undefined> { return this.getItem(name, UnitSystem); }\r\n\r\n /**\r\n * Shortcut for calling getItem with Format.\r\n * @param name The local (unqualified) name of the item to return.\r\n * @returns The requested Format or undefined if not found.\r\n */\r\n public async getFormat(name: string): Promise<Format | undefined> { return this.getItem(name, Format); }\r\n /**\r\n * Gets an item from within this schema. To get by full name use lookupItem instead.\r\n * @param key the local (unqualified) name, lookup is case-insensitive\r\n */\r\n public async getItem(name: string): Promise<SchemaItem | undefined>\r\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor: T): Promise<InstanceType<T> | undefined>\r\n public async getItem<T extends typeof SchemaItem>(name: string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\r\n // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version\r\n if (itemConstructor === undefined)\r\n return this.getItemSync(name) as InstanceType<T> | undefined;\r\n\r\n return this.getItemSync(name, itemConstructor);\r\n }\r\n\r\n /**\r\n * Gets an item from within this schema. To get by full name use lookupItem instead.\r\n * If an item of the name exists but does not match the requested type, undefined is returned\r\n * @param key the local (unqualified) name, lookup is case-insensitive\r\n * @param itemConstructor The constructor of the item to return.\r\n */\r\n public getItemSync(name: string): SchemaItem | undefined\r\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor: T): InstanceType<T> | undefined\r\n public getItemSync<T extends typeof SchemaItem>(name: string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\r\n const value = this._items.get(name.toUpperCase());\r\n if (value === undefined || itemConstructor === undefined)\r\n return value;\r\n\r\n if (isSupportedSchemaItemType(value.schemaItemType, itemConstructor.schemaItemType))\r\n return value as InstanceType<T>;\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Attempts to find a schema item within this schema or a (directly) referenced schema\r\n * @param key The full name or a SchemaItemKey identifying the desired item.\r\n */\r\n public async lookupItem(key: Readonly<SchemaItemKey> | string): Promise<SchemaItem | undefined>;\r\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): Promise<InstanceType<T> | undefined>;\r\n public async lookupItem<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\r\n let schemaName, itemName: string;\r\n if (typeof (key) === \"string\") {\r\n [schemaName, itemName] = SchemaItem.parseFullName(key);\r\n } else {\r\n itemName = key.name;\r\n schemaName = key.schemaName;\r\n }\r\n\r\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\r\n return itemConstructor\r\n ? this.getItem(itemName, itemConstructor)\r\n : this.getItem(itemName);\r\n }\r\n\r\n const refSchema = await this.getReference(schemaName);\r\n if (!refSchema)\r\n return undefined;\r\n\r\n return itemConstructor\r\n ? refSchema.getItem(itemName, itemConstructor)\r\n : refSchema.getItem(itemName);\r\n }\r\n\r\n /**\r\n * Attempts to find a schema item within this schema or a (directly) referenced schema\r\n * @param key The full name or a SchemaItemKey identifying the desired item.\r\n */\r\n public lookupItemSync(key: Readonly<SchemaItemKey> | string): SchemaItem | undefined;\r\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor: T): InstanceType<T> | undefined;\r\n public lookupItemSync<T extends typeof SchemaItem>(key: Readonly<SchemaItemKey> | string, itemConstructor?: T): SchemaItem | InstanceType<T> | undefined {\r\n let schemaName, itemName: string;\r\n if (typeof (key) === \"string\") {\r\n [schemaName, itemName] = SchemaItem.parseFullName(key);\r\n } else {\r\n itemName = key.name;\r\n schemaName = key.schemaName;\r\n }\r\n\r\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\r\n return itemConstructor\r\n ? this.getItemSync(itemName, itemConstructor)\r\n : this.getItemSync(itemName);\r\n }\r\n\r\n const refSchema = this.getReferenceSync(schemaName);\r\n if (!refSchema)\r\n return undefined;\r\n\r\n return itemConstructor\r\n ? refSchema.getItemSync(itemName, itemConstructor)\r\n : refSchema.getItemSync(itemName);\r\n }\r\n\r\n /**\r\n * Returns all of the loaded items in this schema.\r\n */\r\n public getItems(): Iterable<SchemaItem>;\r\n public getItems<T extends typeof SchemaItem>(itemConstructor: T): Iterable<InstanceType<T>>;\r\n public * getItems<T extends typeof SchemaItem>(itemConstructor?: T): Iterable<InstanceType<T> | SchemaItem> {\r\n if (!this._items)\r\n return;\r\n\r\n for (const item of this._items.values()) {\r\n if (itemConstructor === undefined || isSupportedSchemaItemType(item.schemaItemType, itemConstructor.schemaItemType))\r\n yield item;\r\n }\r\n }\r\n\r\n /**\r\n * Gets a referenced schema by name\r\n * @param refSchemaName schema name to find\r\n */\r\n public async getReference(refSchemaName: string): Promise<Schema | undefined> {\r\n if (this.references.length === 0)\r\n return undefined;\r\n\r\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\r\n }\r\n\r\n /**\r\n * Gets a referenced schema by alias\r\n * @param alias alias to find\r\n */\r\n public getReferenceNameByAlias(alias: string): string | undefined {\r\n if (this.references.length === 0)\r\n return undefined;\r\n\r\n const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);\r\n return schema ? schema.name : undefined;\r\n }\r\n\r\n /**\r\n * Gets a referenced schema by name\r\n * @param refSchemaName schema name to find\r\n */\r\n public getReferenceSync(refSchemaName: string): Schema | undefined {\r\n if (this.references.length === 0)\r\n return undefined;\r\n\r\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase());\r\n }\r\n\r\n /**\r\n * Save this Schema's properties to an object for serializing to JSON.\r\n */\r\n public toJSON(): SchemaProps {\r\n if (this._isECSpecVersionUnsupported)\r\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\r\n\r\n const schemaJson: { [value: string]: any } = {};\r\n schemaJson.$schema = ECSchemaNamespaceUris.SCHEMAURL3_2_JSON; // $schema is required\r\n schemaJson.name = this.name; // name is required\r\n schemaJson.version = this.schemaKey.version.toString(true);\r\n schemaJson.alias = this.alias; // alias is required\r\n if (undefined !== this.label) // label is optional\r\n schemaJson.label = this.label;\r\n if (undefined !== this.description) // description is optional\r\n schemaJson.description = this.description;\r\n if (undefined !== this.references && this.references.length > 0) // references is optional\r\n schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));\r\n\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (undefined !== customAttributes)\r\n schemaJson.customAttributes = customAttributes;\r\n if (this._items.size > 0) {\r\n schemaJson.items = {};\r\n this._items.forEach((schemaItem: SchemaItem) => {\r\n schemaJson.items[schemaItem.name] = schemaItem.toJSON(false, true);\r\n });\r\n }\r\n return schemaJson as SchemaProps;\r\n }\r\n\r\n /**\r\n * Converts the schema to a DOM XML Document.\r\n * @param schemaXml An empty DOM document to which the schema will be written\r\n */\r\n public async toXml(schemaXml: Document): Promise<Document> {\r\n if (this._isECSpecVersionUnsupported)\r\n throw new ECSchemaError(ECSchemaStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\r\n\r\n const schemaMetadata = schemaXml.createElement(\"ECSchema\");\r\n schemaMetadata.setAttribute(\"xmlns\", ECSchemaNamespaceUris.SCHEMAURL3_2_XML);\r\n schemaMetadata.setAttribute(\"version\", this.schemaKey.version.toString());\r\n schemaMetadata.setAttribute(\"schemaName\", this.name);\r\n schemaMetadata.setAttribute(\"alias\", this.alias ? this.alias : \"\");\r\n if (undefined !== this.label)\r\n schemaMetadata.setAttribute(\"displayLabel\", this.label);\r\n if (undefined !== this.description)\r\n schemaMetadata.setAttribute(\"description\", this.description);\r\n\r\n // Map used for CA serialization\r\n const refSchemaMap = new Map<string, string>();\r\n\r\n this.references.forEach(({ name, schemaKey, alias }) => {\r\n const schemaRef = schemaXml.createElement(\"ECSchemaReference\");\r\n schemaRef.setAttribute(\"name\", name);\r\n schemaRef.setAttribute(\"version\", schemaKey.version.toString());\r\n schemaRef.setAttribute(\"alias\", alias ? alias : \"\");\r\n schemaMetadata.appendChild(schemaRef);\r\n refSchemaMap.set(name, schemaKey.version.toString());\r\n });\r\n\r\n if (this._customAttributes) {\r\n const parentElem = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElem = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);\r\n parentElem.appendChild(caElem);\r\n }\r\n schemaMetadata.appendChild(parentElem);\r\n }\r\n\r\n for (const [, item] of this._items) {\r\n const itemXml = await item.toXml(schemaXml);\r\n schemaMetadata.appendChild(itemXml);\r\n }\r\n\r\n schemaXml.appendChild(schemaMetadata);\r\n return schemaXml;\r\n }\r\n\r\n /**\r\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\r\n */\r\n public fromJSONSync(schemaProps: SchemaProps) {\r\n if (undefined === this._schemaKey) {\r\n const schemaName = schemaProps.name;\r\n const version = ECVersion.fromString(schemaProps.version);\r\n this._schemaKey = new SchemaKey(schemaName, version);\r\n } else {\r\n if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);\r\n if (this.schemaKey.version.compare(ECVersion.fromString(schemaProps.version)))\r\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}'.`);\r\n }\r\n\r\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)\r\n throw new ECSchemaError(ECSchemaStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);\r\n\r\n // The schema props have not been parsed. Parse the ECXml version from the $schema attribute\r\n let ecVersion: ECSpecVersion;\r\n if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {\r\n ecVersion = ((schemaProps.$schema.search(\"ECXML\") !== -1) ? XmlParser.parseXmlNamespace(schemaProps.$schema) : JsonParser.parseJSUri(schemaProps.$schema)) as ECSpecVersion;\r\n } else {\r\n ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion } as ECSpecVersion;\r\n }\r\n\r\n this._originalECSpecMajorVersion = ecVersion.readVersion;\r\n this._originalECSpecMinorVersion = ecVersion.writeVersion;\r\n\r\n if (ecVersion.readVersion !== 3 || (ecVersion.readVersion === 3 && ecVersion.writeVersion < 2))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The Schema '${this.name}' has an unsupported ECVersion ${ecVersion.readVersion}.${ecVersion.writeVersion} and cannot be loaded.`);\r\n\r\n if (ECName.validate(schemaProps.alias)) {\r\n this._alias = schemaProps.alias;\r\n } else {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);\r\n }\r\n\r\n if (undefined !== schemaProps.label)\r\n this._label = schemaProps.label;\r\n\r\n if (undefined !== schemaProps.description)\r\n this._description = schemaProps.description;\r\n }\r\n\r\n /**\r\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\r\n */\r\n public async fromJSON(schemaProps: SchemaProps) {\r\n this.fromJSONSync(schemaProps);\r\n }\r\n\r\n /**\r\n * Completely loads the SchemaInfo from the input json and starts loading the entire schema. The complete schema can be retrieved from the\r\n * schema context using the getCachedSchema method\r\n */\r\n public static async startLoadingFromJson(jsonObj: object | string, context: SchemaContext): Promise<SchemaInfo> {\r\n const schema = new Schema(context);\r\n\r\n const reader = new SchemaReadHelper(JsonParser, context);\r\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\r\n return reader.readSchemaInfo(schema, rawSchema);\r\n }\r\n\r\n public static async fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema> {\r\n let schema: Schema = new Schema(context);\r\n\r\n const reader = new SchemaReadHelper(JsonParser, context);\r\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\r\n schema = await reader.readSchema(schema, rawSchema);\r\n\r\n return schema;\r\n }\r\n\r\n /**\r\n * Completely loads the Schema from the input json. The schema is cached in the schema context.\r\n */\r\n public static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema {\r\n let schema: Schema = new Schema(context);\r\n\r\n const reader = new SchemaReadHelper(JsonParser, context);\r\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\r\n schema = reader.readSchemaSync(schema, rawSchema);\r\n\r\n return schema;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isSchema(object: any): object is Schema {\r\n const schema = object as Schema;\r\n\r\n return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;\r\n }\r\n\r\n /** @internal */\r\n protected setDisplayLabel(displayLabel: string) {\r\n this._label = displayLabel;\r\n }\r\n\r\n /** @internal */\r\n protected setDescription(description: string) {\r\n this._description = description;\r\n }\r\n\r\n /** @internal */\r\n protected setAlias(alias: string) {\r\n if (!ECName.validate(alias)) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, \"The specified schema alias is invalid.\");\r\n }\r\n this._alias = alias;\r\n }\r\n\r\n /** @internal */\r\n public setLoadingController(controller: SchemaLoadingController) {\r\n this._loadingController = controller;\r\n }\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\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\r\n * would prevent this class from extending Schema.\r\n * @internal\r\n */\r\nexport abstract class MutableSchema extends Schema {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\r\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\r\n public abstract override createMixinClass(name: string): Promise<Mixin>;\r\n public abstract override createMixinClassSync(name: string): Mixin;\r\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\r\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\r\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\r\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\r\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\r\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\r\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\r\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\r\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\r\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\r\n public abstract override createUnit(name: string): Promise<Unit>;\r\n public abstract override createUnitSync(name: string): Unit;\r\n public abstract override createConstant(name: string): Promise<Constant>;\r\n public abstract override createConstantSync(name: string): Constant;\r\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\r\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\r\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\r\n public abstract override createPhenomenonSync(name: string): Phenomenon;\r\n public abstract override createFormat(name: string): Promise<Format>;\r\n public abstract override createFormatSync(name: string): Format;\r\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\r\n public abstract override createUnitSystemSync(name: string): UnitSystem;\r\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\r\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\r\n public abstract override addItem<T extends SchemaItem>(item: T): void;\r\n public abstract override addReference(refSchema: Schema): Promise<void>;\r\n public abstract override addReferenceSync(refSchema: Schema): void;\r\n public abstract override setContext(schemaContext: SchemaContext): void;\r\n public abstract override deleteClass(name: string): Promise<void>;\r\n public abstract override deleteClassSync(name: string): void;\r\n public abstract override deleteSchemaItem(name: string): Promise<void>;\r\n public abstract override deleteSchemaItemSync(name: string): void;\r\n public abstract override setAlias(alias: string): void;\r\n}"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaItem.js","sourceRoot":"","sources":["../../../src/Metadata/SchemaItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAqD;AAGrD,4CAA0H;AAC1H,4CAA6D;AAC7D,4CAAwD;AAGxD;;;GAGG;AACH,MAAsB,UAAU;IAC9B;;;OAGG;IACI,MAAM,KAAK,cAAc,KAA8B,OAAO,kCAAsB,CAAC,UAAU,CAAA,CAAC,CAAC;IAMxF,MAAM,CAAS;IACvB,IAAI,CAAgB;IACpB,YAAY,CAAU;IACtB,MAAM,CAAU;IAChB,kBAAkB,CAA2B;IAErD,gBAAgB;IAChB,YAAY,MAAc,E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,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC7D,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;IACT,oBAAoB,CAAC,UAAmC;QAC7D,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvC,CAAC;CACF;AAzKD,gCAyKC","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 { ECSchemaNamespaceUris } from \"../Constants\";\nimport { SchemaItemProps } from \"../Deserialization/JsonProps\";\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\nimport { AbstractSchemaItemType, SchemaItemType, schemaItemTypeToXmlString, SupportedSchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { ECVersion, SchemaItemKey } from \"../SchemaKey\";\nimport { Schema } from \"./Schema\";\n\n/**\n * An abstract class that supplies all of the common parts of a SchemaItem.\n * @public @preview\n */\nexport abstract class SchemaItem {\n /**\n * Get the type of item represented by this class\n * @internal\n */\n public static get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.SchemaItem }\n\n /**\n * Get the type of item represented by this instance\n */\n public abstract get schemaItemType(): SchemaItemType;\n public readonly schema: Schema;\n private _key: SchemaItemKey;\n private _description?: string;\n private _label?: string;\n private _loadingController?: SchemaLoadingController;\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n this._key = new SchemaItemKey(name, schema.schemaKey);\n this.schema = schema;\n }\n\n public get name() { return this.key.name; }\n public get fullName() { return this.key.schemaKey ? `${this.key.schemaName}.${this.name}` : this.name; }\n public get key() { return this._key; }\n public get label() { return this._label; }\n public get description() { return this._description; }\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 // Proposal: Create protected setter methods for description and label? For UnitSystems as an example, where using createFromProps isn't that necessary and can just use basic create().\n /**\n * Save this SchemaItem's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false) {\n const itemJson: { [value: string]: any } = {};\n if (standalone) {\n itemJson.$schema = ECSchemaNamespaceUris.SCHEMAITEMURL3_2; // $schema is required\n itemJson.schema = this.schema.name;\n itemJson.name = this.name; // name is required\n if (includeSchemaVersion) // check flag to see if we should output version\n itemJson.schemaVersion = this.key.schemaKey.version.toString();\n }\n itemJson.schemaItemType = this.schemaItemType;\n if (undefined !== this.label)\n itemJson.label = this.label;\n if (undefined !== this.description)\n itemJson.description = this.description;\n\n return itemJson as SchemaItemProps;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const itemType = schemaItemTypeToXmlString(this.schemaItemType);\n const itemElement = schemaXml.createElement(itemType);\n itemElement.setAttribute(\"typeName\", this.name);\n if (undefined !== this.label)\n itemElement.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.description)\n itemElement.setAttribute(\"description\", this.description);\n\n // When all schema items support custom attributes they should be added here rather than in ECClass\n\n return itemElement;\n }\n\n public fromJSONSync(schemaItemProps: SchemaItemProps) {\n if (undefined !== schemaItemProps.label)\n this._label = schemaItemProps.label;\n\n this._description = schemaItemProps.description;\n\n if (undefined !== schemaItemProps.schema) {\n if (schemaItemProps.schema.toLowerCase() !== this.schema.name.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema name, ${schemaItemProps.schema}, than the current Schema of this SchemaItem, ${this.schema.fullName}.`);\n }\n\n if (undefined !== schemaItemProps.schemaVersion) {\n if (this.key.schemaKey.version.compare(ECVersion.fromString(schemaItemProps.schemaVersion)))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema version, ${schemaItemProps.schemaVersion}, than the current Schema version of this SchemaItem, ${this.key.schemaKey.version}.`);\n }\n }\n\n public async fromJSON(schemaItemProps: SchemaItemProps) {\n if (undefined !== schemaItemProps.label)\n this._label = schemaItemProps.label;\n\n this._description = schemaItemProps.description;\n\n if (undefined !== schemaItemProps.schema) {\n if (schemaItemProps.schema.toLowerCase() !== this.schema.name.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem ${this.fullName}' with a different schema name, ${schemaItemProps.schema}, than the current Schema of this SchemaItem, ${this.schema.fullName}`);\n }\n\n if (undefined !== schemaItemProps.schemaVersion) {\n if (this.key.schemaKey.version.compare(ECVersion.fromString(schemaItemProps.schemaVersion)))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema version, ${schemaItemProps.schemaVersion}, than the current Schema version of this SchemaItem, ${this.key.schemaKey.version}.`);\n }\n }\n\n /**\n * Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.\n * @note The schema name can be a schema alias.\n * @param fullName The full name to be parsed.\n * @returns A tuple of the parsed Schema name and Schema Item name. If the full name does not contain a '.' or ':', the second string in the tuple will returned the exact string pass in.\n */\n public static parseFullName(fullName: string): [string, string] {\n const matches = /^([a-zA-Z_]+[a-zA-Z0-9_]*(\\.\\d+\\.\\d+\\.\\d+)?)[.:]([a-zA-Z_]+[a-zA-Z0-9_]*)$/.exec(fullName);\n\n // The first match will be the full string match, the second three will be the three groups\n if (matches === null || matches.length !== 4)\n return [\"\", fullName];\n\n return [matches[1], matches[3]];\n }\n\n /**\n * Indicates if the two SchemaItem objects are equal by comparing their respective [[key]] properties.\n * @param thisSchemaItem The first SchemaItem.\n * @param thatSchemaItemOrKey The second SchemaItem or SchemaItemKey.\n */\n public static equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItem | SchemaItemKey): boolean {\n if (!thatSchemaItemOrKey)\n return true;\n SchemaItemType.EntityClass\n const key = SchemaItem.isSchemaItem(thatSchemaItemOrKey) ? thatSchemaItemOrKey.key : thatSchemaItemOrKey;\n return thisSchemaItem.key.matches(key);\n }\n\n /**\n * @internal\n */\n public static isSchemaItem(item: unknown): item is SchemaItem {\n const schemaItem = item as Partial<SchemaItem>;\n\n return schemaItem !== undefined && schemaItem.key !== undefined && schemaItem.schema !== undefined\n && schemaItem.schemaItemType !== undefined;\n }\n\n /** @internal */\n protected setName(name: string) {\n this._key = new SchemaItemKey(name, this.schema.schemaKey);\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 public setLoadingController(controller: SchemaLoadingController) {\n this._loadingController = controller;\n }\n}\n\n"]}
1
+ {"version":3,"file":"SchemaItem.js","sourceRoot":"","sources":["../../../src/Metadata/SchemaItem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAAqD;AAGrD,4CAA0H;AAC1H,4CAA6D;AAC7D,4CAAwD;AAGxD;;;GAGG;AACH,MAAsB,UAAU;IAC9B;;;OAGG;IACI,MAAM,KAAK,cAAc,KAA8B,OAAO,kCAAsB,CAAC,UAAU,CAAA,CAAC,CAAC;IAMxF,MAAM,CAAS;IACvB,IAAI,CAAgB;IACpB,YAAY,CAAU;IACtB,MAAM,CAAU;IAChB,kBAAkB,CAA2B;IAErD,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAAY;QACtC,IAAI,CAAC,IAAI,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C,SAAS,CAAC,CAAC;IAC7D,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;IACT,oBAAoB,CAAC,UAAmC;QAC7D,IAAI,CAAC,kBAAkB,GAAG,UAAU,CAAC;IACvC,CAAC;CACF;AAzKD,gCAyKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { ECSchemaNamespaceUris } from \"../Constants\";\r\nimport { SchemaItemProps } from \"../Deserialization/JsonProps\";\r\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\r\nimport { AbstractSchemaItemType, SchemaItemType, schemaItemTypeToXmlString, SupportedSchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { ECVersion, SchemaItemKey } from \"../SchemaKey\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * An abstract class that supplies all of the common parts of a SchemaItem.\r\n * @public @preview\r\n */\r\nexport abstract class SchemaItem {\r\n /**\r\n * Get the type of item represented by this class\r\n * @internal\r\n */\r\n public static get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.SchemaItem }\r\n\r\n /**\r\n * Get the type of item represented by this instance\r\n */\r\n public abstract get schemaItemType(): SchemaItemType;\r\n public readonly schema: Schema;\r\n private _key: SchemaItemKey;\r\n private _description?: string;\r\n private _label?: string;\r\n private _loadingController?: SchemaLoadingController;\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n this._key = new SchemaItemKey(name, schema.schemaKey);\r\n this.schema = schema;\r\n }\r\n\r\n public get name() { return this.key.name; }\r\n public get fullName() { return this.key.schemaKey ? `${this.key.schemaName}.${this.name}` : this.name; }\r\n public get key() { return this._key; }\r\n public get label() { return this._label; }\r\n public get description() { return this._description; }\r\n\r\n /**\r\n * Returns the SchemaLoadingController for this Schema. This would only be set if the schema is\r\n * loaded incrementally.\r\n * @internal\r\n */\r\n public get loadingController(): SchemaLoadingController | undefined{\r\n return this._loadingController;\r\n }\r\n\r\n // Proposal: Create protected setter methods for description and label? For UnitSystems as an example, where using createFromProps isn't that necessary and can just use basic create().\r\n /**\r\n * Save this SchemaItem's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false) {\r\n const itemJson: { [value: string]: any } = {};\r\n if (standalone) {\r\n itemJson.$schema = ECSchemaNamespaceUris.SCHEMAITEMURL3_2; // $schema is required\r\n itemJson.schema = this.schema.name;\r\n itemJson.name = this.name; // name is required\r\n if (includeSchemaVersion) // check flag to see if we should output version\r\n itemJson.schemaVersion = this.key.schemaKey.version.toString();\r\n }\r\n itemJson.schemaItemType = this.schemaItemType;\r\n if (undefined !== this.label)\r\n itemJson.label = this.label;\r\n if (undefined !== this.description)\r\n itemJson.description = this.description;\r\n\r\n return itemJson as SchemaItemProps;\r\n }\r\n\r\n /** @internal */\r\n public async toXml(schemaXml: Document): Promise<Element> {\r\n const itemType = schemaItemTypeToXmlString(this.schemaItemType);\r\n const itemElement = schemaXml.createElement(itemType);\r\n itemElement.setAttribute(\"typeName\", this.name);\r\n if (undefined !== this.label)\r\n itemElement.setAttribute(\"displayLabel\", this.label);\r\n if (undefined !== this.description)\r\n itemElement.setAttribute(\"description\", this.description);\r\n\r\n // When all schema items support custom attributes they should be added here rather than in ECClass\r\n\r\n return itemElement;\r\n }\r\n\r\n public fromJSONSync(schemaItemProps: SchemaItemProps) {\r\n if (undefined !== schemaItemProps.label)\r\n this._label = schemaItemProps.label;\r\n\r\n this._description = schemaItemProps.description;\r\n\r\n if (undefined !== schemaItemProps.schema) {\r\n if (schemaItemProps.schema.toLowerCase() !== this.schema.name.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema name, ${schemaItemProps.schema}, than the current Schema of this SchemaItem, ${this.schema.fullName}.`);\r\n }\r\n\r\n if (undefined !== schemaItemProps.schemaVersion) {\r\n if (this.key.schemaKey.version.compare(ECVersion.fromString(schemaItemProps.schemaVersion)))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema version, ${schemaItemProps.schemaVersion}, than the current Schema version of this SchemaItem, ${this.key.schemaKey.version}.`);\r\n }\r\n }\r\n\r\n public async fromJSON(schemaItemProps: SchemaItemProps) {\r\n if (undefined !== schemaItemProps.label)\r\n this._label = schemaItemProps.label;\r\n\r\n this._description = schemaItemProps.description;\r\n\r\n if (undefined !== schemaItemProps.schema) {\r\n if (schemaItemProps.schema.toLowerCase() !== this.schema.name.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem ${this.fullName}' with a different schema name, ${schemaItemProps.schema}, than the current Schema of this SchemaItem, ${this.schema.fullName}`);\r\n }\r\n\r\n if (undefined !== schemaItemProps.schemaVersion) {\r\n if (this.key.schemaKey.version.compare(ECVersion.fromString(schemaItemProps.schemaVersion)))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to deserialize the SchemaItem '${this.fullName}' with a different schema version, ${schemaItemProps.schemaVersion}, than the current Schema version of this SchemaItem, ${this.key.schemaKey.version}.`);\r\n }\r\n }\r\n\r\n /**\r\n * Parses the given full name, {schemaName}.{schemaItemName} or {schemaName}:{schemaItemName}, into two separate strings.\r\n * @note The schema name can be a schema alias.\r\n * @param fullName The full name to be parsed.\r\n * @returns A tuple of the parsed Schema name and Schema Item name. If the full name does not contain a '.' or ':', the second string in the tuple will returned the exact string pass in.\r\n */\r\n public static parseFullName(fullName: string): [string, string] {\r\n const matches = /^([a-zA-Z_]+[a-zA-Z0-9_]*(\\.\\d+\\.\\d+\\.\\d+)?)[.:]([a-zA-Z_]+[a-zA-Z0-9_]*)$/.exec(fullName);\r\n\r\n // The first match will be the full string match, the second three will be the three groups\r\n if (matches === null || matches.length !== 4)\r\n return [\"\", fullName];\r\n\r\n return [matches[1], matches[3]];\r\n }\r\n\r\n /**\r\n * Indicates if the two SchemaItem objects are equal by comparing their respective [[key]] properties.\r\n * @param thisSchemaItem The first SchemaItem.\r\n * @param thatSchemaItemOrKey The second SchemaItem or SchemaItemKey.\r\n */\r\n public static equalByKey(thisSchemaItem: SchemaItem, thatSchemaItemOrKey?: SchemaItem | SchemaItemKey): boolean {\r\n if (!thatSchemaItemOrKey)\r\n return true;\r\n SchemaItemType.EntityClass\r\n const key = SchemaItem.isSchemaItem(thatSchemaItemOrKey) ? thatSchemaItemOrKey.key : thatSchemaItemOrKey;\r\n return thisSchemaItem.key.matches(key);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isSchemaItem(item: unknown): item is SchemaItem {\r\n const schemaItem = item as Partial<SchemaItem>;\r\n\r\n return schemaItem !== undefined && schemaItem.key !== undefined && schemaItem.schema !== undefined\r\n && schemaItem.schemaItemType !== undefined;\r\n }\r\n\r\n /** @internal */\r\n protected setName(name: string) {\r\n this._key = new SchemaItemKey(name, this.schema.schemaKey);\r\n }\r\n\r\n /** @internal */\r\n protected setDisplayLabel(displayLabel: string) {\r\n this._label = displayLabel;\r\n }\r\n\r\n /** @internal */\r\n protected setDescription(description: string) {\r\n this._description = description;\r\n }\r\n\r\n /** @internal */\r\n public setLoadingController(controller: SchemaLoadingController) {\r\n this._loadingController = controller;\r\n }\r\n}\r\n\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;AAC9C,4CAA6D;AAC7D,6CAA0C;AAE1C;;GAEG;AACH,MAAa,UAAW,SAAQ,uBAAU;IACf,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IACpE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjF;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,IAAiB;QAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,UAAU;YAC3D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YAC1B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,UAAU,gBAAgB,CAAC,CAAC;IAC1H,CAAC;CACF;AA3BD,gCA2BC;AAED;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,UAAU;CAEzD;AAFD,8CAEC","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 { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * @public @preview\n */\nexport class UnitSystem extends SchemaItem {\n public override readonly schemaItemType = UnitSystem.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.UnitSystem; }\n\n /**\n * Type guard to check if the SchemaItem is of type UnitSystem.\n * @param item The SchemaItem to check.\n * @returns True if the item is a UnitSystem, false otherwise.\n */\n public static isUnitSystem(item?: SchemaItem): item is UnitSystem {\n if (item && item.schemaItemType === SchemaItemType.UnitSystem)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type UnitSystem.\n * @param item The SchemaItem to check.\n * @returns The item cast to UnitSystem if it is a UnitSystem, undefined otherwise.\n * @internal\n */\n public static assertIsUnitSystem(item?: SchemaItem): asserts item is UnitSystem {\n if (!this.isUnitSystem(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.UnitSystem}' (UnitSystem)`);\n }\n}\n\n/**\n * @internal\n * Used for schema editing.\n */\nexport abstract class MutableUnitSystem extends UnitSystem {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;AAC9C,4CAA6D;AAC7D,6CAA0C;AAE1C;;GAEG;AACH,MAAa,UAAW,SAAQ,uBAAU;IACf,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IACpE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjF;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,IAAiB;QAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,UAAU;YAC3D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YAC1B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,UAAU,gBAAgB,CAAC,CAAC;IAC1H,CAAC;CACF;AA3BD,gCA2BC;AAED;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,UAAU;CAEzD;AAFD,8CAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class UnitSystem extends SchemaItem {\r\n public override readonly schemaItemType = UnitSystem.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.UnitSystem; }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type UnitSystem.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a UnitSystem, false otherwise.\r\n */\r\n public static isUnitSystem(item?: SchemaItem): item is UnitSystem {\r\n if (item && item.schemaItemType === SchemaItemType.UnitSystem)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type UnitSystem.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to UnitSystem if it is a UnitSystem, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsUnitSystem(item?: SchemaItem): asserts item is UnitSystem {\r\n if (!this.isUnitSystem(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.UnitSystem}' (UnitSystem)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * Used for schema editing.\r\n */\r\nexport abstract class MutableUnitSystem extends UnitSystem {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyTypes.js","sourceRoot":"","sources":["../../src/PropertyT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AI,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACtF,IAAI,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC;QACtC,OAAO,oBAAoB,CAAC;IAC9B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;AAC9E,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 { PrimitiveType } from \"./ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\n\nenum PropertyFlags {\n Primitive = 0x01,\n Struct = 0x02,\n Array = 0x04,\n Navigation = 0x08,\n Enumeration = 0x10,\n}\n\n/**\n * @public @preview\n */\nexport enum PropertyType {\n Struct = 0x02, // PropertyFlags.Struct\n Struct_Array = 0x06, // PropertyFlags.Struct | PropertyFlags.Array\n Navigation = 0x08, // PropertyFlags.Navigation\n Binary = 0x101, // PrimitiveType.Binary\n Binary_Array = 0x105, // PrimitiveType.Binary | PropertyFlags.Array\n Boolean = 0x201, // PrimitiveType.Boolean\n Boolean_Array = 0x205, // PrimitiveType.Boolean | PropertyFlags.Array\n DateTime = 0x301, // PrimitiveType.DateTime\n DateTime_Array = 0x305, // PrimitiveType.DateTime | PropertyFlags.Array\n Double = 0x401, // PrimitiveType.Double\n Double_Array = 0x405, // PrimitiveType.Double | PropertyFlags.Array\n Integer = 0x501, // PrimitiveType.Integer\n Integer_Array = 0x505, // PrimitiveType.Integer | PropertyFlags.Array\n Integer_Enumeration = 0x511, // PrimitiveType.Integer | PropertyFlags.Enumeration\n Integer_Enumeration_Array = 0x515, // PrimitiveType.Integer | PropertyFlags.Enumeration | PropertyFlags.Array\n Long = 0x601, // PrimitiveType.Long\n Long_Array = 0x605, // PrimitiveType.Long | PropertyFlags.Array\n Point2d = 0x701, // PrimitiveType.Point2d\n Point2d_Array = 0x705, // PrimitiveType.Point2d | PropertyFlags.Array\n Point3d = 0x801, // PrimitiveType.Point3d\n Point3d_Array = 0x805, // PrimitiveType.Point3d | PropertyFlags.Array\n String = 0x901, // PrimitiveType.String\n String_Array = 0x905, // PrimitiveType.String | PropertyFlags.Array\n String_Enumeration = 0x911, // PrimitiveType.String | PropertyFlags.Enumeration\n String_Enumeration_Array = 0x915, // PrimitiveType.String | PropertyFlags.Enumeration | PropertyFlags.Array\n IGeometry = 0xA01, // PrimitiveType.IGeometry\n IGeometry_Array = 0xA05, // PrimitiveType.IGeometry | PropertyFlags.Array\n}\n\n/** @internal */\nexport namespace PropertyTypeUtils {\n export function isArray(type: PropertyType) {\n return (type === (PropertyFlags.Array | type));\n }\n export function isPrimitive(type: PropertyType) {\n return (type === (PropertyFlags.Primitive | type));\n }\n export function isStruct(type: PropertyType) {\n return (type === (PropertyFlags.Struct | type));\n }\n export function isNavigation(type: PropertyType) {\n return (type === (PropertyFlags.Navigation | type));\n }\n export function isEnumeration(type: PropertyType) {\n return (type === (PropertyFlags.Enumeration | type));\n }\n export function asArray(type: PropertyType): PropertyType {\n return type | PropertyFlags.Array;\n }\n export function getPrimitiveType(type: PropertyType): PrimitiveType {\n return (0xFF01 & type);\n }\n export function fromPrimitiveType(type: PrimitiveType): PropertyType {\n return type| 0;\n }\n}\n\n/** @internal */\nexport function propertyTypeToString(type: PropertyType) {\n if (PropertyTypeUtils.isPrimitive(type))\n return (PropertyTypeUtils.isArray(type)) ? \"PrimitiveArrayProperty\" : \"PrimitiveProperty\";\n if (PropertyTypeUtils.isStruct(type))\n return (PropertyTypeUtils.isArray(type)) ? \"StructArrayProperty\" : \"StructProperty\";\n if (PropertyTypeUtils.isNavigation(type))\n return \"NavigationProperty\";\n throw new ECSchemaError(ECSchemaStatus.InvalidType, \"Invalid propertyType\");\n}\n"]}
1
+ {"version":3,"file":"PropertyTypes.js","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AAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gBAAgB,CAAC;IACtF,IAAI,iBAAiB,CAAC,YAAY,CAAC,IAAI,CAAC;QACtC,OAAO,oBAAoB,CAAC;IAC9B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;AAC9E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { PrimitiveType } from \"./ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\r\n\r\nenum PropertyFlags {\r\n Primitive = 0x01,\r\n Struct = 0x02,\r\n Array = 0x04,\r\n Navigation = 0x08,\r\n Enumeration = 0x10,\r\n}\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport enum PropertyType {\r\n Struct = 0x02, // PropertyFlags.Struct\r\n Struct_Array = 0x06, // PropertyFlags.Struct | PropertyFlags.Array\r\n Navigation = 0x08, // PropertyFlags.Navigation\r\n Binary = 0x101, // PrimitiveType.Binary\r\n Binary_Array = 0x105, // PrimitiveType.Binary | PropertyFlags.Array\r\n Boolean = 0x201, // PrimitiveType.Boolean\r\n Boolean_Array = 0x205, // PrimitiveType.Boolean | PropertyFlags.Array\r\n DateTime = 0x301, // PrimitiveType.DateTime\r\n DateTime_Array = 0x305, // PrimitiveType.DateTime | PropertyFlags.Array\r\n Double = 0x401, // PrimitiveType.Double\r\n Double_Array = 0x405, // PrimitiveType.Double | PropertyFlags.Array\r\n Integer = 0x501, // PrimitiveType.Integer\r\n Integer_Array = 0x505, // PrimitiveType.Integer | PropertyFlags.Array\r\n Integer_Enumeration = 0x511, // PrimitiveType.Integer | PropertyFlags.Enumeration\r\n Integer_Enumeration_Array = 0x515, // PrimitiveType.Integer | PropertyFlags.Enumeration | PropertyFlags.Array\r\n Long = 0x601, // PrimitiveType.Long\r\n Long_Array = 0x605, // PrimitiveType.Long | PropertyFlags.Array\r\n Point2d = 0x701, // PrimitiveType.Point2d\r\n Point2d_Array = 0x705, // PrimitiveType.Point2d | PropertyFlags.Array\r\n Point3d = 0x801, // PrimitiveType.Point3d\r\n Point3d_Array = 0x805, // PrimitiveType.Point3d | PropertyFlags.Array\r\n String = 0x901, // PrimitiveType.String\r\n String_Array = 0x905, // PrimitiveType.String | PropertyFlags.Array\r\n String_Enumeration = 0x911, // PrimitiveType.String | PropertyFlags.Enumeration\r\n String_Enumeration_Array = 0x915, // PrimitiveType.String | PropertyFlags.Enumeration | PropertyFlags.Array\r\n IGeometry = 0xA01, // PrimitiveType.IGeometry\r\n IGeometry_Array = 0xA05, // PrimitiveType.IGeometry | PropertyFlags.Array\r\n}\r\n\r\n/** @internal */\r\nexport namespace PropertyTypeUtils {\r\n export function isArray(type: PropertyType) {\r\n return (type === (PropertyFlags.Array | type));\r\n }\r\n export function isPrimitive(type: PropertyType) {\r\n return (type === (PropertyFlags.Primitive | type));\r\n }\r\n export function isStruct(type: PropertyType) {\r\n return (type === (PropertyFlags.Struct | type));\r\n }\r\n export function isNavigation(type: PropertyType) {\r\n return (type === (PropertyFlags.Navigation | type));\r\n }\r\n export function isEnumeration(type: PropertyType) {\r\n return (type === (PropertyFlags.Enumeration | type));\r\n }\r\n export function asArray(type: PropertyType): PropertyType {\r\n return type | PropertyFlags.Array;\r\n }\r\n export function getPrimitiveType(type: PropertyType): PrimitiveType {\r\n return (0xFF01 & type);\r\n }\r\n export function fromPrimitiveType(type: PrimitiveType): PropertyType {\r\n return type| 0;\r\n }\r\n}\r\n\r\n/** @internal */\r\nexport function propertyTypeToString(type: PropertyType) {\r\n if (PropertyTypeUtils.isPrimitive(type))\r\n return (PropertyTypeUtils.isArray(type)) ? \"PrimitiveArrayProperty\" : \"PrimitiveProperty\";\r\n if (PropertyTypeUtils.isStruct(type))\r\n return (PropertyTypeUtils.isArray(type)) ? \"StructArrayProperty\" : \"StructProperty\";\r\n if (PropertyTypeUtils.isNavigation(type))\r\n return \"NavigationProperty\";\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, \"Invalid propertyType\");\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaJsonLocater.js","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,uCAA0D;AAI1D,8CAA2C;AAU3C;;;;GAIG;AACH,MAAa,iBAAiB;IACpB,eAAe,CAAoB;IAE3C,YAAmB,cAAiC;QAClD,qFAAqF;QACrF,6FAA6F;QAC7F,mCAAmC;QACnC,IAAI,CAAC,eAAe,GAAG,CAAC,UAAU,EAAE,EAAE;YACpC,IAAI,CAAC;gBACH,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC;gBACpC,6DAA6D;YAC7D,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC7F,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QACjG,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,WAAW;YACd,OAAO,SAAS,CAAC;QAEnB,MAAM,UAAU,GAAG,MAAM,eAAM,CAAC,oBAAoB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;QAC3E,IAAI,UAAU,KAAK,SAAS,IAAI,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC;YAChF,OAAO,UAAU,CAAC;QAEpB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED;;;;;OAKG;IACI,aAAa,CAAC,SAAoB,EAAE,UAA2B,EAAE,OAAsB;QAC5F,MAAM,WAAW,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,WAAW;YACd,OAAO,SAAS,CAAC;QAEnB,OAAO,eAAM,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,IAAI,IAAI,uBAAa,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AA1DD,8CA0DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { ISchemaLocater, SchemaContext } from \"./Context\";\nimport { SchemaProps } from \"./Deserialization/JsonProps\";\nimport { SchemaMatchType } from \"./ECObjects\";\nimport { SchemaInfo } from \"./Interfaces\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaKey } from \"./SchemaKey\";\n\n/**\n * Gets the full schema Json for the input schema name or undefined if not found\n * @throws [Error] if the schema is found but json cannot be returned\n * @public @preview\n */\nexport type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;\n\n/**\n * An ISchemaLocater implementation for locating and retrieving EC Schema objects using a function\n * that returns the Schema Json for a given schema name\n * @public @preview\n */\nexport class SchemaJsonLocater implements ISchemaLocater {\n private _getSchemaProps: SchemaPropsGetter;\n\n public constructor(getSchemaProps: SchemaPropsGetter) {\n // Since the getSchemaProps may throw an error, but the locater contract defines that\n // getSchema should return undefined if the schema could not be located, we wrap the provided\n // lookup function in a safe block.\n this._getSchemaProps = (schemaName) => {\n try {\n return getSchemaProps(schemaName);\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n } catch (error) {\n return undefined;\n }\n };\n }\n\n /** Get a schema by [SchemaKey]\n * @param schemaKey The [SchemaKey] that identifies the schema.\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\n * @param context The [SchemaContext] used to facilitate schema location.\n * @throws [ECSchemaError]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n await this.getSchemaInfo(schemaKey, matchType, context);\n return context.getCachedSchema(schemaKey, matchType);\n }\n\n /**\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\n * @param matchType The match type to use when locating the schema\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n const schemaProps = this._getSchemaProps(schemaKey.name);\n if (!schemaProps)\n return undefined;\n\n const schemaInfo = await Schema.startLoadingFromJson(schemaProps, context);\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType))\n return schemaInfo;\n\n return undefined;\n }\n\n /** Get a schema by [SchemaKey] synchronously.\n * @param schemaKey The [SchemaKey] that identifies the schema.\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\n * @param context The [SchemaContext] used to facilitate schema location.\n * @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public getSchemaSync(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Schema | undefined {\n const schemaProps = this._getSchemaProps(schemaKey.name);\n if (!schemaProps)\n return undefined;\n\n return Schema.fromJsonSync(schemaProps, context || new SchemaContext());\n }\n}\n"]}
1
+ {"version":3,"file":"SchemaJsonLocater.js","sourceRoot":"","sources":["../../src/SchemaJsonLocater.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,uCAA0D;AAI1D,8CAA2C;AA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C;QAEnB,OAAO,eAAM,CAAC,YAAY,CAAC,WAAW,EAAE,OAAO,IAAI,IAAI,uBAAa,EAAE,CAAC,CAAC;IAC1E,CAAC;CACF;AA1DD,8CA0DC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { ISchemaLocater, SchemaContext } from \"./Context\";\r\nimport { SchemaProps } from \"./Deserialization/JsonProps\";\r\nimport { SchemaMatchType } from \"./ECObjects\";\r\nimport { SchemaInfo } from \"./Interfaces\";\r\nimport { Schema } from \"./Metadata/Schema\";\r\nimport { SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * Gets the full schema Json for the input schema name or undefined if not found\r\n * @throws [Error] if the schema is found but json cannot be returned\r\n * @public @preview\r\n */\r\nexport type SchemaPropsGetter = (schemaName: string) => SchemaProps | undefined;\r\n\r\n/**\r\n * An ISchemaLocater implementation for locating and retrieving EC Schema objects using a function\r\n * that returns the Schema Json for a given schema name\r\n * @public @preview\r\n */\r\nexport class SchemaJsonLocater implements ISchemaLocater {\r\n private _getSchemaProps: SchemaPropsGetter;\r\n\r\n public constructor(getSchemaProps: SchemaPropsGetter) {\r\n // Since the getSchemaProps may throw an error, but the locater contract defines that\r\n // getSchema should return undefined if the schema could not be located, we wrap the provided\r\n // lookup function in a safe block.\r\n this._getSchemaProps = (schemaName) => {\r\n try {\r\n return getSchemaProps(schemaName);\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n } catch (error) {\r\n return undefined;\r\n }\r\n };\r\n }\r\n\r\n /** Get a schema by [SchemaKey]\r\n * @param schemaKey The [SchemaKey] that identifies the schema.\r\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\r\n * @param context The [SchemaContext] used to facilitate schema location.\r\n * @throws [ECSchemaError]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\r\n await this.getSchemaInfo(schemaKey, matchType, context);\r\n return context.getCachedSchema(schemaKey, matchType);\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\r\n const schemaProps = this._getSchemaProps(schemaKey.name);\r\n if (!schemaProps)\r\n return undefined;\r\n\r\n const schemaInfo = await Schema.startLoadingFromJson(schemaProps, context);\r\n if (schemaInfo !== undefined && schemaInfo.schemaKey.matches(schemaKey, matchType))\r\n return schemaInfo;\r\n\r\n return undefined;\r\n }\r\n\r\n /** Get a schema by [SchemaKey] synchronously.\r\n * @param schemaKey The [SchemaKey] that identifies the schema.\r\n * @param matchType The [SchemaMatchType] to used for comparing schema versions.\r\n * @param context The [SchemaContext] used to facilitate schema location.\r\n * @throws [Error]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public getSchemaSync(schemaKey: SchemaKey, _matchType: SchemaMatchType, context: SchemaContext): Schema | undefined {\r\n const schemaProps = this._getSchemaProps(schemaKey.name);\r\n if (!schemaProps)\r\n return undefined;\r\n\r\n return Schema.fromJsonSync(schemaProps, context || new SchemaContext());\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaKey.js","sourceRoot":"","sources":["../../src/SchemaKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,2CAA8C;AAC9C,2CAA4D;AAC5D,qCAAkC;AAElC;;GAEG;AACH,MAAa,SAAS;IACZ,KAAK,GAAW,CAAC,CAAC;IAClB,MAAM,GAAW,CAAC,CAAC;IACnB,MAAM,GAAW,CAAC,CAAC;IAE3B;;;;OAIG;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AAC;IAC3B,CAAC;IAED,IAAW,SAAS,KAAK,OAAO,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAClD,IAAW,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAE7C,IAAW,UAAU,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAEvD,2DAA2D;IAC3D,IAAW,QAAQ,KAAK,OAAO,GAAG,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,iCAAiC;IAC1B,OAAO,CAAC,GAAkB;QAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;YACxB,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC;YAChE,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,eAAe,CAAC,IAAY;QACjC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9E,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,OAAO,aAAa,SAAS,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QACpG,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AArCD,sCAqCC","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 { SchemaKeyProps } from \"./Deserialization/JsonProps\";\nimport { SchemaMatchType } from \"./ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\nimport { ECName } from \"./ECName\";\n\n/**\n * @public @preview\n */\nexport class ECVersion {\n private _read: number = 0;\n private _write: number = 0;\n private _minor: number = 0;\n\n /**\n * Using a version with all zero is invalid\n * for a schema, but it can be used to indicate\n * \"no version has been specified\" when locating things\n */\n public static readonly NO_VERSION = new ECVersion(0, 0, 0);\n\n /**\n * The constructor will throw an ECSchemaError if any of the parameters below are above the threshold.\n * @param read Can support up to 999.\n * @param write Can support up to 999.\n * @param minor Can support up to 9999999.\n *\n */\n constructor(read?: number, write?: number, minor?: number) {\n if (undefined !== read)\n this._read = read;\n if (undefined !== write)\n this._write = write;\n if (undefined !== minor)\n this._minor = minor;\n\n if (this._read > 999 || this._read < 0 || this._write > 999 || this._write < 0 || this._minor > 9999999 || this._minor < 0)\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion);\n }\n\n public get read() { return this._read; }\n public get write() { return this._write; }\n public get minor() { return this._minor; }\n\n /**\n * Creates a string, in the format 'RR.ww.mm', representing this ECVersion.\n * @note The default is to pad with zeroes.\n * @param padZeroes If true, the returned string will strictly follow `RR.ww.mm` and add leading zeroes if necessary.\n */\n public toString(padZeroes: boolean = true): string {\n if (!padZeroes)\n return `${this.read}.${this.write}.${this.minor}`;\n\n const padWithZeroes = (num: number) => {\n return (num < 10 ? \"0\" : \"\") + num;\n };\n\n return `${padWithZeroes(this.read)}.${padWithZeroes(this.write)}.${padWithZeroes(this.minor)}`;\n }\n\n /**\n * Given a valid version string the\n * @param versionString A valid version string of the format, 'RR.ww.mm'.\n */\n public static fromString(versionString: string): ECVersion {\n const [read, write, minor] = versionString.split(\".\");\n if (!read)\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The read version is missing from version string, ${versionString}`);\n\n if (!write)\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The write version is missing from version string, ${versionString}`);\n\n if (!minor)\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The minor version is missing from version string, ${versionString}`);\n\n return new ECVersion(+read, +write, +minor);\n }\n\n /**\n * Compares two schema versions.\n * @param rhs The schema to compare.\n * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.\n */\n public compare(rhv: ECVersion): number {\n if (this.read !== rhv.read)\n return this.read - rhv.read;\n\n if (this.write !== rhv.write)\n return this.write - rhv.write;\n\n return this.minor - rhv.minor;\n }\n}\n\n/**\n * The SchemaKey contains a Schemas name and version.\n * @public @preview\n */\nexport class SchemaKey {\n private _name: ECName;\n private _version: ECVersion;\n // public checksum: number;\n // TODO: need to add a checksum\n\n constructor(name: string, version: ECVersion);\n constructor(name: string, readVersion?: number, writeVersion?: number, minorVersion?: number);\n constructor(name: string, readOrVersion?: number | ECVersion, writeVersion?: number, minorVersion?: number) {\n this._name = new ECName(name);\n if (readOrVersion !== undefined && typeof (readOrVersion) !== \"number\")\n this._version = readOrVersion;\n else\n this._version = new ECVersion(readOrVersion, writeVersion, minorVersion);\n }\n\n public get version() { return this._version; }\n public get name() { return this._name.name; }\n public get readVersion() { return this.version.read; }\n public get writeVersion() { return this.version.write; }\n public get minorVersion() { return this.version.minor; }\n\n /**\n * Creates a string, in the format 'RR.ww.mm', representing this SchemaKey.\n * @note The default is to pad the full name with zeroes.\n * @param padZeroes If true, the returned string will strictly follow `Name.RR.ww.mm` and add leading zeroes if necessary.\n */\n public toString(padZeroes: boolean = true) { return `${this.name}.${this.version.toString(padZeroes)}`; }\n\n public static parseString(fullName: string) {\n const keyPieces = fullName.split(\".\");\n if (keyPieces.length !== 4)\n throw new ECSchemaError(ECSchemaStatus.InvalidECName);\n\n const schemaName = keyPieces[0];\n const readVer = Number(keyPieces[1]);\n const writeVer = Number(keyPieces[2]);\n const minorVer = Number(keyPieces[3]);\n return new SchemaKey(schemaName, new ECVersion(readVer, writeVer, minorVer));\n }\n\n /**\n * Compares two schema names, case-insensitive.\n * @return True if they match; otherwise, false.\n */\n public compareByName(rhs: SchemaKey | string | undefined): boolean {\n if (undefined === rhs)\n return false;\n\n if (typeof (rhs) === \"string\")\n return rhs.toLowerCase() === this.name.toLowerCase();\n\n return rhs.name.toLowerCase() === this.name.toLowerCase();\n }\n\n /**\n * Compares two schema versions.\n * @param rhs The schema to compare.\n * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.\n */\n public compareByVersion(rhs: SchemaKey): number {\n return this.version.compare(rhs.version);\n }\n\n /**\n *\n * @param rhs The SchemaKey to compare with\n * @param matchType The match type to use for comparison.\n */\n public matches(rhs: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Exact): boolean {\n switch (matchType) {\n case SchemaMatchType.Identical:\n case SchemaMatchType.Exact:\n return this.compareByName(rhs.name) && this.readVersion === rhs.readVersion &&\n this.writeVersion === rhs.writeVersion && this.minorVersion === rhs.minorVersion;\n case SchemaMatchType.LatestReadCompatible:\n if (!this.compareByName(rhs.name))\n return false;\n\n if (rhs.readVersion !== this.readVersion)\n return false;\n\n if (this.writeVersion === rhs.writeVersion)\n return this.minorVersion >= rhs.minorVersion;\n\n return this.writeVersion > rhs.writeVersion;\n case SchemaMatchType.LatestWriteCompatible:\n return this.compareByName(rhs.name) && this.readVersion === rhs.readVersion &&\n this.writeVersion === rhs.writeVersion && this.minorVersion >= rhs.minorVersion;\n case SchemaMatchType.Latest:\n return this.compareByName(rhs.name);\n default:\n return false;\n }\n }\n\n /**\n * Deserializes a SchemaKeyProps JSON object into a SchemaKey object.\n * @param props SchemaKeyProps\n * @returns A SchemaKey object.\n */\n public static fromJSON(props: SchemaKeyProps): SchemaKey {\n return new SchemaKey(props.name, props.read, props.write, props.minor);\n }\n\n /**\n * Save this SchemaKey's properties to an object for serializing to JSON.\n */\n public toJSON(): SchemaKeyProps {\n return {\n name: this.name,\n read: this.readVersion,\n write: this.writeVersion,\n minor: this.minorVersion,\n };\n }\n}\n\n/**\n * The SchemaItemKey contains a SchemaItem's name and SchemaKey.\n * @public @preview\n */\nexport class SchemaItemKey {\n private _name: ECName;\n private _schemaKey: SchemaKey;\n\n constructor(name: string, schema: SchemaKey) {\n this._name = new ECName(name);\n this._schemaKey = schema;\n }\n\n public get schemaKey() { return this._schemaKey; }\n public get name() { return this._name.name; }\n\n public get schemaName() { return this.schemaKey.name; }\n\n /** Returns the name in the format, {schemaName}.{name}. */\n public get fullName() { return `${this.schemaName}.${this.name}`; }\n\n /**\n * Checks whether this SchemaItemKey matches the one provided.\n * @param rhs The SchemaItemKey to compare to this.\n */\n // TODO: Need to add a match type\n public matches(rhs: SchemaItemKey): boolean {\n if (rhs.name !== this.name)\n return false;\n\n if (!rhs.schemaKey.matches(this.schemaKey, SchemaMatchType.Latest))\n return false;\n\n return true;\n }\n\n public matchesFullName(name: string): boolean {\n const schemaVersion = this.schemaKey.version.toString().replace(/\\./g, \"\\\\.\");\n const fullNameRegex = new RegExp(`^${this.schemaName}(\\\\.${schemaVersion})?[.:]${this.name}$`, \"i\");\n return fullNameRegex.test(name);\n }\n}\n"]}
1
+ {"version":3,"file":"SchemaKey.js","sourceRoot":"","sources":["../../src/SchemaKey.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,2CAA8C;AAC9C,2CAA4D;AAC5D,qCAAkC;AAElC;;GAEG;AACH,MAAa,SAAS;IACZ,KAAK,GAAW,CAAC,CAAC;IAClB,MAAM,GAAW,CAAC,CAAC;IACnB,MAAM,GAAW,CAAC,CAAC;IAE3B;;;;OAIG;IACI,MAAM,CAAU,UAAU,GAAG,IAAI,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE3D;;;;;;OAMG;IACH,YAAY,IAAa,EAAE,KAAc,EAAE,KAAc;QACvD,IAAI,SAAS,KAAK,IAAI;YACpB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QACpB,IAAI,SAAS,KAAK,KAAK;YACrB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACtB,IAAI,SAAS,KAAK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I,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEnE;;;OAGG;IACH,iCAAiC;IAC1B,OAAO,CAAC,GAAkB;QAC/B,IAAI,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI;YACxB,OAAO,KAAK,CAAC;QAEf,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC;YAChE,OAAO,KAAK,CAAC;QAEf,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,eAAe,CAAC,IAAY;QACjC,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;QAC9E,MAAM,aAAa,GAAG,IAAI,MAAM,CAAC,IAAI,IAAI,CAAC,UAAU,OAAO,aAAa,SAAS,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QACpG,OAAO,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AArCD,sCAqCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { SchemaKeyProps } from \"./Deserialization/JsonProps\";\r\nimport { SchemaMatchType } from \"./ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\r\nimport { ECName } from \"./ECName\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class ECVersion {\r\n private _read: number = 0;\r\n private _write: number = 0;\r\n private _minor: number = 0;\r\n\r\n /**\r\n * Using a version with all zero is invalid\r\n * for a schema, but it can be used to indicate\r\n * \"no version has been specified\" when locating things\r\n */\r\n public static readonly NO_VERSION = new ECVersion(0, 0, 0);\r\n\r\n /**\r\n * The constructor will throw an ECSchemaError if any of the parameters below are above the threshold.\r\n * @param read Can support up to 999.\r\n * @param write Can support up to 999.\r\n * @param minor Can support up to 9999999.\r\n *\r\n */\r\n constructor(read?: number, write?: number, minor?: number) {\r\n if (undefined !== read)\r\n this._read = read;\r\n if (undefined !== write)\r\n this._write = write;\r\n if (undefined !== minor)\r\n this._minor = minor;\r\n\r\n if (this._read > 999 || this._read < 0 || this._write > 999 || this._write < 0 || this._minor > 9999999 || this._minor < 0)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion);\r\n }\r\n\r\n public get read() { return this._read; }\r\n public get write() { return this._write; }\r\n public get minor() { return this._minor; }\r\n\r\n /**\r\n * Creates a string, in the format 'RR.ww.mm', representing this ECVersion.\r\n * @note The default is to pad with zeroes.\r\n * @param padZeroes If true, the returned string will strictly follow `RR.ww.mm` and add leading zeroes if necessary.\r\n */\r\n public toString(padZeroes: boolean = true): string {\r\n if (!padZeroes)\r\n return `${this.read}.${this.write}.${this.minor}`;\r\n\r\n const padWithZeroes = (num: number) => {\r\n return (num < 10 ? \"0\" : \"\") + num;\r\n };\r\n\r\n return `${padWithZeroes(this.read)}.${padWithZeroes(this.write)}.${padWithZeroes(this.minor)}`;\r\n }\r\n\r\n /**\r\n * Given a valid version string the\r\n * @param versionString A valid version string of the format, 'RR.ww.mm'.\r\n */\r\n public static fromString(versionString: string): ECVersion {\r\n const [read, write, minor] = versionString.split(\".\");\r\n if (!read)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The read version is missing from version string, ${versionString}`);\r\n\r\n if (!write)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The write version is missing from version string, ${versionString}`);\r\n\r\n if (!minor)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECVersion, `The minor version is missing from version string, ${versionString}`);\r\n\r\n return new ECVersion(+read, +write, +minor);\r\n }\r\n\r\n /**\r\n * Compares two schema versions.\r\n * @param rhs The schema to compare.\r\n * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.\r\n */\r\n public compare(rhv: ECVersion): number {\r\n if (this.read !== rhv.read)\r\n return this.read - rhv.read;\r\n\r\n if (this.write !== rhv.write)\r\n return this.write - rhv.write;\r\n\r\n return this.minor - rhv.minor;\r\n }\r\n}\r\n\r\n/**\r\n * The SchemaKey contains a Schemas name and version.\r\n * @public @preview\r\n */\r\nexport class SchemaKey {\r\n private _name: ECName;\r\n private _version: ECVersion;\r\n // public checksum: number;\r\n // TODO: need to add a checksum\r\n\r\n constructor(name: string, version: ECVersion);\r\n constructor(name: string, readVersion?: number, writeVersion?: number, minorVersion?: number);\r\n constructor(name: string, readOrVersion?: number | ECVersion, writeVersion?: number, minorVersion?: number) {\r\n this._name = new ECName(name);\r\n if (readOrVersion !== undefined && typeof (readOrVersion) !== \"number\")\r\n this._version = readOrVersion;\r\n else\r\n this._version = new ECVersion(readOrVersion, writeVersion, minorVersion);\r\n }\r\n\r\n public get version() { return this._version; }\r\n public get name() { return this._name.name; }\r\n public get readVersion() { return this.version.read; }\r\n public get writeVersion() { return this.version.write; }\r\n public get minorVersion() { return this.version.minor; }\r\n\r\n /**\r\n * Creates a string, in the format 'RR.ww.mm', representing this SchemaKey.\r\n * @note The default is to pad the full name with zeroes.\r\n * @param padZeroes If true, the returned string will strictly follow `Name.RR.ww.mm` and add leading zeroes if necessary.\r\n */\r\n public toString(padZeroes: boolean = true) { return `${this.name}.${this.version.toString(padZeroes)}`; }\r\n\r\n public static parseString(fullName: string) {\r\n const keyPieces = fullName.split(\".\");\r\n if (keyPieces.length !== 4)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECName);\r\n\r\n const schemaName = keyPieces[0];\r\n const readVer = Number(keyPieces[1]);\r\n const writeVer = Number(keyPieces[2]);\r\n const minorVer = Number(keyPieces[3]);\r\n return new SchemaKey(schemaName, new ECVersion(readVer, writeVer, minorVer));\r\n }\r\n\r\n /**\r\n * Compares two schema names, case-insensitive.\r\n * @return True if they match; otherwise, false.\r\n */\r\n public compareByName(rhs: SchemaKey | string | undefined): boolean {\r\n if (undefined === rhs)\r\n return false;\r\n\r\n if (typeof (rhs) === \"string\")\r\n return rhs.toLowerCase() === this.name.toLowerCase();\r\n\r\n return rhs.name.toLowerCase() === this.name.toLowerCase();\r\n }\r\n\r\n /**\r\n * Compares two schema versions.\r\n * @param rhs The schema to compare.\r\n * @return A negative number if this schema version is less than the given version, a positive number if greater, and 0 if are equivalent.\r\n */\r\n public compareByVersion(rhs: SchemaKey): number {\r\n return this.version.compare(rhs.version);\r\n }\r\n\r\n /**\r\n *\r\n * @param rhs The SchemaKey to compare with\r\n * @param matchType The match type to use for comparison.\r\n */\r\n public matches(rhs: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Exact): boolean {\r\n switch (matchType) {\r\n case SchemaMatchType.Identical:\r\n case SchemaMatchType.Exact:\r\n return this.compareByName(rhs.name) && this.readVersion === rhs.readVersion &&\r\n this.writeVersion === rhs.writeVersion && this.minorVersion === rhs.minorVersion;\r\n case SchemaMatchType.LatestReadCompatible:\r\n if (!this.compareByName(rhs.name))\r\n return false;\r\n\r\n if (rhs.readVersion !== this.readVersion)\r\n return false;\r\n\r\n if (this.writeVersion === rhs.writeVersion)\r\n return this.minorVersion >= rhs.minorVersion;\r\n\r\n return this.writeVersion > rhs.writeVersion;\r\n case SchemaMatchType.LatestWriteCompatible:\r\n return this.compareByName(rhs.name) && this.readVersion === rhs.readVersion &&\r\n this.writeVersion === rhs.writeVersion && this.minorVersion >= rhs.minorVersion;\r\n case SchemaMatchType.Latest:\r\n return this.compareByName(rhs.name);\r\n default:\r\n return false;\r\n }\r\n }\r\n\r\n /**\r\n * Deserializes a SchemaKeyProps JSON object into a SchemaKey object.\r\n * @param props SchemaKeyProps\r\n * @returns A SchemaKey object.\r\n */\r\n public static fromJSON(props: SchemaKeyProps): SchemaKey {\r\n return new SchemaKey(props.name, props.read, props.write, props.minor);\r\n }\r\n\r\n /**\r\n * Save this SchemaKey's properties to an object for serializing to JSON.\r\n */\r\n public toJSON(): SchemaKeyProps {\r\n return {\r\n name: this.name,\r\n read: this.readVersion,\r\n write: this.writeVersion,\r\n minor: this.minorVersion,\r\n };\r\n }\r\n}\r\n\r\n/**\r\n * The SchemaItemKey contains a SchemaItem's name and SchemaKey.\r\n * @public @preview\r\n */\r\nexport class SchemaItemKey {\r\n private _name: ECName;\r\n private _schemaKey: SchemaKey;\r\n\r\n constructor(name: string, schema: SchemaKey) {\r\n this._name = new ECName(name);\r\n this._schemaKey = schema;\r\n }\r\n\r\n public get schemaKey() { return this._schemaKey; }\r\n public get name() { return this._name.name; }\r\n\r\n public get schemaName() { return this.schemaKey.name; }\r\n\r\n /** Returns the name in the format, {schemaName}.{name}. */\r\n public get fullName() { return `${this.schemaName}.${this.name}`; }\r\n\r\n /**\r\n * Checks whether this SchemaItemKey matches the one provided.\r\n * @param rhs The SchemaItemKey to compare to this.\r\n */\r\n // TODO: Need to add a match type\r\n public matches(rhs: SchemaItemKey): boolean {\r\n if (rhs.name !== this.name)\r\n return false;\r\n\r\n if (!rhs.schemaKey.matches(this.schemaKey, SchemaMatchType.Latest))\r\n return false;\r\n\r\n return true;\r\n }\r\n\r\n public matchesFullName(name: string): boolean {\r\n const schemaVersion = this.schemaKey.version.toString().replace(/\\./g, \"\\\\.\");\r\n const fullNameRegex = new RegExp(`^${this.schemaName}(\\\\.${schemaVersion})?[.:]${this.name}$`, \"i\");\r\n return fullNameRegex.test(name);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaLoader.js","sourceRoot":"","sources":["../../src/SchemaLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0C;AAC1C,2CAA8C;AAC9C,2CAA4D;AAE5D,2DAA2E;AAC3E,2CAAmD;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAa,YAAY;IACf,QAAQ,CAAgB;IAEhC,YAAmB,SAA4B;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAa,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,qCAAiB,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,UAAkB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,oBAAoB,EAAE,kBAAkB,UAAU,EAAE,CAAC,CAAC;QAE/F,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,UAAkB;QACpC,gGAAgG;QAChG,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,UAAU,EAAE,IAAI,qBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,iDAAiD;IACjD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AApCD,oCAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\nimport { SchemaContext } from \"./Context\";\nimport { SchemaMatchType } from \"./ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaJsonLocater, SchemaPropsGetter } from \"./SchemaJsonLocater\";\nimport { ECVersion, SchemaKey } from \"./SchemaKey\";\n\n/**\n * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.\n * Loaded schemas are held in memory within a schema context managed by SchemaLoader.\n * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]\n * is a possibility, thereby avoiding unnecessary schema retrievals from the function.\n *\n * Since the development of this class, the IModelDb class has been enhanced to include a schema context.\n * In most cases, that is sufficient so a SchemaLoader is not needed. This class is likely to be removed in the future.\n *\n * ** Example **\n * ```ts\n * [[include:IModelSchemas.loadFromDb]]\n * ```\n * @beta This will no longer be needed as of 5.0.0 since IModelDb now has a schema context.\n */\nexport class SchemaLoader {\n private _context: SchemaContext;\n\n public constructor(getSchema: SchemaPropsGetter) {\n this._context = new SchemaContext();\n const locater = new SchemaJsonLocater(getSchema);\n this._context.addLocater(locater);\n }\n\n /** Get a schema by name\n * @param schemaName a string with the name of the schema to load.\n * @throws [ECSchemaError]($ecschema-metadata) if the schema is not found or cannot be loaded.\n */\n public getSchema(schemaName: string): Schema {\n const schema = this.tryGetSchema(schemaName);\n if (!schema)\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `reading schema=${schemaName}`);\n\n return schema;\n }\n\n /** Attempts to get a schema by name\n * @param schemaName a string with the name of the schema to load.\n * @throws [ECSchemaError]($ecschema-metadata) if the schema exists, but cannot be loaded.\n */\n public tryGetSchema(schemaName: string): Schema | undefined {\n // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.\n const key = new SchemaKey(schemaName, new ECVersion(1, 0, 0));\n const schema = this._context.getSchemaSync(key, SchemaMatchType.Latest);\n return schema;\n }\n\n /** Gets the SchemaContext used by the loader. */\n public get context(): SchemaContext {\n return this._context;\n }\n}\n"]}
1
+ {"version":3,"file":"SchemaLoader.js","sourceRoot":"","sources":["../../src/SchemaLoader.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,uCAA0C;AAC1C,2CAA8C;AAC9C,2CAA4D;AAE5D,2DAA2E;AAC3E,2CAAmD;AAEnD;;;;;;;;;;;;;;GAcG;AACH,MAAa,YAAY;IACf,QAAQ,CAAgB;IAEhC,YAAmB,SAA4B;QAC7C,IAAI,CAAC,QAAQ,GAAG,IAAI,uBAAa,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,IAAI,qCAAiB,CAAC,SAAS,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,UAAkB;QACjC,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;QAC7C,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,oBAAoB,EAAE,kBAAkB,UAAU,EAAE,CAAC,CAAC;QAE/F,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;OAGG;IACI,YAAY,CAAC,UAAkB;QACpC,gGAAgG;QAChG,MAAM,GAAG,GAAG,IAAI,qBAAS,CAAC,UAAU,EAAE,IAAI,qBAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,iDAAiD;IACjD,IAAW,OAAO;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AApCD,oCAoCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\nimport { SchemaContext } from \"./Context\";\r\nimport { SchemaMatchType } from \"./ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"./Exception\";\r\nimport { Schema } from \"./Metadata/Schema\";\r\nimport { SchemaJsonLocater, SchemaPropsGetter } from \"./SchemaJsonLocater\";\r\nimport { ECVersion, SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * A utility class for loading EC Schema objects using a function that returns schema json for a given schema name.\r\n * Loaded schemas are held in memory within a schema context managed by SchemaLoader.\r\n * The SchemaLoader object should be held in memory if multiple calls to [[getSchema]] or [[tryGetSchema]]\r\n * is a possibility, thereby avoiding unnecessary schema retrievals from the function.\r\n *\r\n * Since the development of this class, the IModelDb class has been enhanced to include a schema context.\r\n * In most cases, that is sufficient so a SchemaLoader is not needed. This class is likely to be removed in the future.\r\n *\r\n * ** Example **\r\n * ```ts\r\n * [[include:IModelSchemas.loadFromDb]]\r\n * ```\r\n * @beta This will no longer be needed as of 5.0.0 since IModelDb now has a schema context.\r\n */\r\nexport class SchemaLoader {\r\n private _context: SchemaContext;\r\n\r\n public constructor(getSchema: SchemaPropsGetter) {\r\n this._context = new SchemaContext();\r\n const locater = new SchemaJsonLocater(getSchema);\r\n this._context.addLocater(locater);\r\n }\r\n\r\n /** Get a schema by name\r\n * @param schemaName a string with the name of the schema to load.\r\n * @throws [ECSchemaError]($ecschema-metadata) if the schema is not found or cannot be loaded.\r\n */\r\n public getSchema(schemaName: string): Schema {\r\n const schema = this.tryGetSchema(schemaName);\r\n if (!schema)\r\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `reading schema=${schemaName}`);\r\n\r\n return schema;\r\n }\r\n\r\n /** Attempts to get a schema by name\r\n * @param schemaName a string with the name of the schema to load.\r\n * @throws [ECSchemaError]($ecschema-metadata) if the schema exists, but cannot be loaded.\r\n */\r\n public tryGetSchema(schemaName: string): Schema | undefined {\r\n // SchemaKey version is not used when locating schema in an iModel, so the version is arbitrary.\r\n const key = new SchemaKey(schemaName, new ECVersion(1, 0, 0));\r\n const schema = this._context.getSchemaSync(key, SchemaMatchType.Latest);\r\n return schema;\r\n }\r\n\r\n /** Gets the SchemaContext used by the loader. */\r\n public get context(): SchemaContext {\r\n return this._context;\r\n }\r\n}\r\n"]}