@itwin/ecschema-metadata 5.9.0-dev.9 → 5.9.0

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 (148) hide show
  1. package/CHANGELOG.md +24 -1
  2. package/lib/cjs/Deserialization/Helper.d.ts +1 -1
  3. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  4. package/lib/cjs/Deserialization/Helper.js +35 -21
  5. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  6. package/lib/cjs/Deserialization/JsonParser.js +7 -7
  7. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  8. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  9. package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  10. package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
  11. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  12. package/lib/cjs/ECObjects.js.map +1 -1
  13. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts +3 -2
  14. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts.map +1 -1
  15. package/lib/cjs/Formatting/FormatSetFormatsProvider.js +7 -6
  16. package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -1
  17. package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts +1 -1
  18. package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts.map +1 -1
  19. package/lib/cjs/Formatting/SchemaFormatsProvider.js +6 -5
  20. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -1
  21. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  22. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
  23. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  24. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  25. package/lib/cjs/Metadata/Class.js +6 -4
  26. package/lib/cjs/Metadata/Class.js.map +1 -1
  27. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  28. package/lib/cjs/Metadata/EntityClass.js +2 -2
  29. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  30. package/lib/cjs/Metadata/InvertedUnit.js +2 -2
  31. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  32. package/lib/cjs/Metadata/KindOfQuantity.js +1 -1
  33. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  34. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  35. package/lib/cjs/Metadata/Property.js +6 -3
  36. package/lib/cjs/Metadata/Property.js.map +1 -1
  37. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  38. package/lib/cjs/Metadata/RelationshipClass.js +5 -4
  39. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  40. package/lib/cjs/Metadata/Schema.js +1 -1
  41. package/lib/cjs/Metadata/Schema.js.map +1 -1
  42. package/lib/cjs/Metadata/SchemaItem.js +2 -2
  43. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  44. package/lib/cjs/Metadata/Unit.js +2 -2
  45. package/lib/cjs/Metadata/Unit.js.map +1 -1
  46. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  47. package/lib/cjs/UnitConversion/UnitConverter.d.ts +1 -1
  48. package/lib/cjs/UnitConversion/UnitConverter.d.ts.map +1 -1
  49. package/lib/cjs/UnitConversion/UnitConverter.js +4 -4
  50. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  51. package/lib/cjs/UnitConversion/UnitTree.d.ts +3 -4
  52. package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
  53. package/lib/cjs/UnitConversion/UnitTree.js +11 -11
  54. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  55. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +3 -0
  56. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  57. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +3 -0
  58. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  59. package/lib/cjs/ecschema-metadata.d.ts +0 -1
  60. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  61. package/lib/cjs/ecschema-metadata.js +0 -1
  62. package/lib/cjs/ecschema-metadata.js.map +1 -1
  63. package/lib/esm/Deserialization/Helper.d.ts +1 -1
  64. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  65. package/lib/esm/Deserialization/Helper.js +35 -21
  66. package/lib/esm/Deserialization/Helper.js.map +1 -1
  67. package/lib/esm/Deserialization/JsonParser.js +7 -7
  68. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  69. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  70. package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
  71. package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
  72. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  73. package/lib/esm/ECObjects.js.map +1 -1
  74. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts +3 -2
  75. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts.map +1 -1
  76. package/lib/esm/Formatting/FormatSetFormatsProvider.js +7 -6
  77. package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -1
  78. package/lib/esm/Formatting/SchemaFormatsProvider.d.ts +1 -1
  79. package/lib/esm/Formatting/SchemaFormatsProvider.d.ts.map +1 -1
  80. package/lib/esm/Formatting/SchemaFormatsProvider.js +6 -5
  81. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -1
  82. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  83. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
  84. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  85. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  86. package/lib/esm/Metadata/Class.js +6 -4
  87. package/lib/esm/Metadata/Class.js.map +1 -1
  88. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  89. package/lib/esm/Metadata/EntityClass.js +2 -2
  90. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  91. package/lib/esm/Metadata/InvertedUnit.js +2 -2
  92. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  93. package/lib/esm/Metadata/KindOfQuantity.js +1 -1
  94. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  95. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  96. package/lib/esm/Metadata/Property.js +6 -3
  97. package/lib/esm/Metadata/Property.js.map +1 -1
  98. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  99. package/lib/esm/Metadata/RelationshipClass.js +5 -4
  100. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  101. package/lib/esm/Metadata/Schema.js +1 -1
  102. package/lib/esm/Metadata/Schema.js.map +1 -1
  103. package/lib/esm/Metadata/SchemaItem.js +2 -2
  104. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  105. package/lib/esm/Metadata/Unit.js +2 -2
  106. package/lib/esm/Metadata/Unit.js.map +1 -1
  107. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  108. package/lib/esm/UnitConversion/UnitConverter.d.ts +1 -1
  109. package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -1
  110. package/lib/esm/UnitConversion/UnitConverter.js +1 -1
  111. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  112. package/lib/esm/UnitConversion/UnitTree.d.ts +3 -4
  113. package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
  114. package/lib/esm/UnitConversion/UnitTree.js +6 -6
  115. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  116. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +3 -0
  117. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  118. package/lib/esm/UnitProvider/SchemaUnitProvider.js +3 -0
  119. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  120. package/lib/esm/ecschema-metadata.d.ts +0 -1
  121. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  122. package/lib/esm/ecschema-metadata.js +0 -1
  123. package/lib/esm/ecschema-metadata.js.map +1 -1
  124. package/package.json +7 -7
  125. package/lib/cjs/UnitConversion/Graph.d.ts +0 -35
  126. package/lib/cjs/UnitConversion/Graph.d.ts.map +0 -1
  127. package/lib/cjs/UnitConversion/Graph.js +0 -88
  128. package/lib/cjs/UnitConversion/Graph.js.map +0 -1
  129. package/lib/cjs/UnitConversion/Parser.d.ts +0 -9
  130. package/lib/cjs/UnitConversion/Parser.d.ts.map +0 -1
  131. package/lib/cjs/UnitConversion/Parser.js +0 -42
  132. package/lib/cjs/UnitConversion/Parser.js.map +0 -1
  133. package/lib/cjs/UnitConversion/UnitConversion.d.ts +0 -46
  134. package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +0 -1
  135. package/lib/cjs/UnitConversion/UnitConversion.js +0 -76
  136. package/lib/cjs/UnitConversion/UnitConversion.js.map +0 -1
  137. package/lib/esm/UnitConversion/Graph.d.ts +0 -35
  138. package/lib/esm/UnitConversion/Graph.d.ts.map +0 -1
  139. package/lib/esm/UnitConversion/Graph.js +0 -84
  140. package/lib/esm/UnitConversion/Graph.js.map +0 -1
  141. package/lib/esm/UnitConversion/Parser.d.ts +0 -9
  142. package/lib/esm/UnitConversion/Parser.d.ts.map +0 -1
  143. package/lib/esm/UnitConversion/Parser.js +0 -39
  144. package/lib/esm/UnitConversion/Parser.js.map +0 -1
  145. package/lib/esm/UnitConversion/UnitConversion.d.ts +0 -46
  146. package/lib/esm/UnitConversion/UnitConversion.d.ts.map +0 -1
  147. package/lib/esm/UnitConversion/UnitConversion.js +0 -72
  148. package/lib/esm/UnitConversion/UnitConversion.js.map +0 -1
@@ -118,7 +118,7 @@ class IncrementalSchemaLocater {
118
118
  * @returns The SchemaProps object.
119
119
  */
120
120
  async createSchemaProps(schemaKey, schemaContext) {
121
- const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, ECObjects_1.SchemaMatchType.Latest);
121
+ const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, ECObjects_1.SchemaMatchType.Latest); // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion
122
122
  if (!schemaInfo)
123
123
  throw new Error(`Schema ${schemaKey.name} could not be found.`);
124
124
  const schemaReferences = [];
@@ -1 +1 @@
1
- {"version":3,"file":"IncrementalSchemaLocater.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/IncrementalSchemaLocater.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,4CAAqD;AAGrD,wEAAqE;AACrE,4CAA+C;AAC/C,4CAA6D;AAE7D,+CAA4C;AAC5C,4CAAyC;AACzC,8EAA2E;AAC3E,uEAAoE;AAmBpE;;;;;;;;GAQG;AACH,MAAsB,wBAAwB;IAC3B,QAAQ,CAAuB;IAC7B,gBAAgB,CAAkB;IAErD;;;OAGG;IACH,YAAY,OAA8B;QACxC,IAAI,CAAC,QAAQ,GAAG,OAAO,IAAI,EAAE,CAAC;QAE9B,IAAI,CAAC,gBAAgB,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;YAC5D,OAAO,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;IAED,gEAAgE;IAChE,IAAc,OAAO;QACnB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QACjG,OAAO,IAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC7F,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kB;YACrB,OAAO;QAET,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;QACzG,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { ECSchemaNamespaceUris } from \"../Constants\";\nimport { ISchemaLocater, SchemaContext } from \"../Context\";\nimport { SchemaProps, SchemaReferenceProps } from \"../Deserialization/JsonProps\";\nimport { SchemaGraphUtil } from \"../Deserialization/SchemaGraphUtil\";\nimport { SchemaMatchType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { SchemaInfo } from \"../Interfaces\";\nimport { Schema } from \"../Metadata/Schema\";\nimport { SchemaKey } from \"../SchemaKey\";\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\nimport { IncrementalSchemaReader } from \"./IncrementalSchemaReader\";\n\ninterface IncrementalSchemaInfo extends SchemaInfo {\n readonly description?: string;\n readonly label?: string;\n}\n\ntype LoadSchemaInfoHandler = (context: SchemaContext) => Promise<Iterable<SchemaInfo>>;\n\n/**\n * Defines the SchemaLocater Options which determine how each schema is to be loaded.\n * All options are optional.\n * @beta\n */\nexport interface SchemaLocaterOptions {\n /** Only load partial schemas. Full schema information will not be retrieved. Defaults to false. */\n readonly loadPartialSchemaOnly?: boolean;\n}\n\n/**\n * A [[ISchemaLocater]] implementation for locating and retrieving EC [[Schema]]\n * objects incrementally instead of the full schema and it's references at once. This is useful for large schemas that\n * take a long time to load, but clients need a rough skeleton of the schema as fast as possible.\n *\n * The IncrementalSchemaLocater is a locater around the [[IncrementalSchemaLocater]] to be used in a\n * [[SchemaContext]].\n * @internal\n */\nexport abstract class IncrementalSchemaLocater implements ISchemaLocater {\n private readonly _options: SchemaLocaterOptions;\n protected readonly _schemaInfoCache: SchemaInfoCache;\n\n /**\n * Initializes a new instance of the IncrementalSchemaLocater class.\n * @param options The [[SchemaLocaterOptions]] that control the loading of the schema.\n */\n constructor(options?: SchemaLocaterOptions) {\n this._options = options || {};\n\n this._schemaInfoCache = new SchemaInfoCache(async (context) => {\n return this.loadSchemaInfos(context);\n });\n }\n\n /** Gets the options how the schema locater load the schemas. */\n protected get options(): SchemaLocaterOptions {\n return this._options;\n }\n\n /**\n * Gets the [[SchemaInfo]] which matches the provided SchemaKey. The SchemaInfo may be returned\n * before the schema is fully loaded. May return the entire Schema so long as it is completely loaded as it satisfies\n * the SchemaInfo interface.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n return this._schemaInfoCache.lookup(schemaKey, matchType, context);\n }\n\n /**\n * Attempts to get a [[Schema]] from the locater. Yields undefined if no matching schema is found.\n * For schemas that may have references, construct and call through a SchemaContext instead.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n const schemaInfo = await this.getSchemaInfo(schemaKey, matchType, context);\n return schemaInfo\n ? this.loadSchema(schemaInfo, context)\n : undefined;\n }\n\n /**\n * Attempts to get a [[Schema]] from the locater. Yields undefined if no matching schema is found.\n * For schemas that may have references, construct and call through a SchemaContext instead.\n * NOT IMPLEMENTED IN THIS LOCATER - ALWAYS RETURNS UNDEFINED.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n * @returns Incremental schema loading does not work synchronously, this will always return undefined.\n */\n public getSchemaSync(_schemaKey: Readonly<SchemaKey>, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined {\n return undefined;\n }\n\n /**\n * Gets the schema partials for the given schema key. The first item in the array is the\n * actual schema props of the schema to load, the following items are partial schema props\n * of referenced schemas.\n * @param schemaKey The schema key of the requested schema.\n * @param context The schema context.\n */\n protected abstract getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined>;\n\n /**\n * Gets the full schema json for the requested schema key.\n * @param schemaKey The schema key of the requested schema.\n * @param context The schema context.\n */\n protected abstract getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;\n\n /**\n * Loads the schema info objects for the given context.\n * @param context The schema context to load the schema infos for.\n * @returns A promise that resolves to an iterable of schema infos.\n */\n protected abstract loadSchemaInfos(context: SchemaContext): Promise<Iterable<SchemaInfo>>;\n\n /**\n * Checks if the context contains the right schemas to support incremental schema loading.\n * @param context The schema context to check.\n * @returns true if incremental schema loading is supported, false otherwise.\n */\n protected abstract supportPartialSchemaLoading(context: SchemaContext): Promise<boolean>;\n\n /**\n * Start loading the schema for the given schema info incrementally. The schema is returned\n * as soon as the schema stub is loaded while the schema fully resolves in the background. It should\n * only be called by the IncrementalSchemaLocater if a schema has not been loaded or started to\n * load yet.\n * @param schemaInfo The schema info of the schema to load.\n * @param schemaContext The schema context to load the schema into.\n */\n protected async loadSchema(schemaInfo: SchemaInfo, schemaContext: SchemaContext): Promise<Schema> {\n // If the meta schema is an earlier version than 4.0.3, we can't use the ECSql query interface to get the schema\n // information required to load the schema entirely. In this case, we fallback to use the ECSchema RPC interface\n // to fetch the whole schema json.\n if (!await this.supportPartialSchemaLoading(schemaContext)) {\n const schemaJson = await this.getSchemaJson(schemaInfo.schemaKey, schemaContext);\n if(schemaJson === undefined)\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the schema, ${schemaInfo.schemaKey.name}.${schemaInfo.schemaKey.version.toString()}`);\n\n return Schema.fromJson(schemaJson, schemaContext);\n }\n\n // Fetches the schema partials for the given schema key. The first item in the array is the\n // actual schema props of the schema to load, the following items are schema props of referenced\n // schema items that are needed to resolve the schema properly.\n const schemaPartials = await this.getSchemaPartials(schemaInfo.schemaKey, schemaContext);\n if (schemaPartials === undefined)\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the schema, ${schemaInfo.schemaKey.name}.${schemaInfo.schemaKey.version.toString()}`);\n\n // Sort the partials in dependency order to ensure referenced schemas exist in the schema context\n // when they get requested. Otherwise the context would call this method again and for referenced\n // schemas, we would not want to request the whole schema props.\n const sortedPartials = await this.sortSchemaPartials(schemaPartials, schemaContext);\n for (const schemaProps of sortedPartials) {\n await this.startLoadingPartialSchema(schemaProps, schemaContext);\n }\n\n const schema = await schemaContext.getCachedSchema(schemaInfo.schemaKey);\n if (!schema)\n throw new Error(`Schema ${schemaInfo.schemaKey.name} could not be found.`);\n\n return schema;\n }\n\n /**\n * Creates a SchemaProps object by loading the Schema information from the given SchemaContext.\n * @param schemaKey The SchemaKey of the Schema whose props are to be retrieved.\n * @param schemaContext The SchemaContext holding the Schema.\n * @returns The SchemaProps object.\n */\n protected async createSchemaProps(schemaKey: SchemaKey, schemaContext: SchemaContext): Promise<SchemaProps> {\n const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, SchemaMatchType.Latest) as IncrementalSchemaInfo | undefined;\n if (!schemaInfo)\n throw new Error(`Schema ${schemaKey.name} could not be found.`);\n\n const schemaReferences: Array<SchemaReferenceProps> = [];\n const schemaProps: SchemaProps = {\n $schema: ECSchemaNamespaceUris.SCHEMAURL3_2_JSON,\n name: schemaKey.name,\n alias: schemaInfo.alias,\n version: schemaInfo.schemaKey.version.toString(),\n description: schemaInfo.description,\n label: schemaInfo.label,\n references: schemaReferences,\n items: {}\n };\n\n schemaInfo.references.forEach((ref) => {\n schemaReferences.push({ name: ref.schemaKey.name, version: ref.schemaKey.version.toString() });\n });\n\n return schemaProps;\n }\n\n private async startLoadingPartialSchema(schemaProps: SchemaProps, schemaContext: SchemaContext): Promise<void> {\n if (schemaContext.schemaExists(SchemaKey.parseString(`${schemaProps.name}.${schemaProps.version}`))) {\n return;\n }\n\n const controller = new SchemaLoadingController();\n const schemaReader = new IncrementalSchemaReader(schemaContext, true);\n const schema = new Schema(schemaContext);\n schema.setLoadingController(controller);\n\n await schemaReader.readSchema(schema, schemaProps);\n\n if (!this._options.loadPartialSchemaOnly)\n controller.start(this.startLoadingFullSchema(schema));\n }\n\n private async loadFullSchema(schema: Schema): Promise<void> {\n const fullSchemaProps = await this.getSchemaJson(schema.schemaKey, schema.context)\n const reader = new IncrementalSchemaReader(schema.context, false);\n await reader.readSchema(schema, fullSchemaProps, false);\n }\n\n private async startLoadingFullSchema(schema: Schema): Promise<void> {\n if (!schema.loadingController)\n return;\n\n // If the schema is already resolved, return it directly.\n if (schema.loadingController.isComplete || schema.loadingController.inProgress) {\n return;\n }\n\n // Since the schema relies on it's references, they get triggered to be resolved\n // first by recursively calling this method. After all references has been resolved\n // the schema itself gets resolved.\n await Promise.all(schema.references.map(async (referenceSchema) => {\n if (referenceSchema.loadingController && referenceSchema.loadingController.inProgress)\n return referenceSchema.loadingController.wait();\n else\n return this.startLoadingFullSchema(referenceSchema);\n }));\n\n return this.loadFullSchema(schema);\n }\n\n private async sortSchemaPartials(schemaPartials: ReadonlyArray<SchemaProps>, schemaContext: SchemaContext): Promise<ReadonlyArray<SchemaProps>> {\n const schemaInfos: Array<SchemaInfo & { props: SchemaProps }> = [];\n for (const schemaProps of schemaPartials) {\n const schemaKey = SchemaKey.parseString(`${schemaProps.name}.${schemaProps.version}`);\n const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, SchemaMatchType.Latest);\n if (!schemaInfo)\n throw new Error(`Schema ${schemaKey.name} could not be found.`);\n\n schemaInfos.push({ ...schemaInfo, props: schemaProps });\n }\n\n const orderedSchemaInfos = SchemaGraphUtil.buildDependencyOrderedSchemaInfoList(schemaInfos) as Array<SchemaInfo & { props: SchemaProps }>;\n return orderedSchemaInfos.map((schemaInfo) => schemaInfo.props);\n }\n}\n\n/**\n * Helper class to manage schema infos for a schema context.\n */\nclass SchemaInfoCache {\n private readonly _schemaInfoCache: WeakMap<SchemaContext, Array<IncrementalSchemaInfo>>;\n private readonly _schemaInfoLoader: LoadSchemaInfoHandler;\n\n constructor(schemaInfoLoader: LoadSchemaInfoHandler) {\n this._schemaInfoCache = new WeakMap<SchemaContext, Array<IncrementalSchemaInfo>>();\n this._schemaInfoLoader = schemaInfoLoader;\n }\n\n public async getSchemasByContext(context: SchemaContext): Promise<IncrementalSchemaInfo[] | undefined> {\n if (!this._schemaInfoCache.has(context)) {\n const schemaInfos = await this._schemaInfoLoader(context);\n this._schemaInfoCache.set(context, Array.from(schemaInfos));\n }\n return this._schemaInfoCache.get(context);\n }\n\n public async lookup(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<IncrementalSchemaInfo | undefined> {\n const contextSchemaInfos = await this.getSchemasByContext(context);\n return contextSchemaInfos\n ? contextSchemaInfos.find((schemaInfo) => schemaInfo.schemaKey.matches(schemaKey, matchType))\n : undefined;\n }\n\n public remove(schemaKey: SchemaKey, context: SchemaContext): void {\n const contextSchemaInfos = this._schemaInfoCache.get(context);\n if (!contextSchemaInfos)\n return;\n\n const index = contextSchemaInfos.findIndex((schemaInfo) => schemaInfo.schemaKey.name === schemaKey.name);\n if (index !== -1) {\n contextSchemaInfos.splice(index, 1);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"IncrementalSchemaLocater.js","sourceRoot":"","sources":["../../../src/IncrementalLoading/IncrementalSchemaLocater.ts"],"names":[],"mappings":";;;AAAA;;;gGAGgG;AAChG,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IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACxC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;YAC1D,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,SAA0B,EAAE,OAAsB;QAC1F,MAAM,kBAAkB,GAAG,MAAM,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACnE,OAAO,kBAAkB;YACvB,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;YAC7F,CAAC,CAAC,SAAS,CAAC;IAChB,CAAC;IAEM,MAAM,CAAC,SAAoB,EAAE,OAAsB;QACxD,MAAM,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,CAAC,kBAAkB;YACrB,OAAO;QAET,MAAM,KAAK,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC;QACzG,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,kBAAkB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n * Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n * See LICENSE.md in the project root for license terms and full copyright notice.\n *--------------------------------------------------------------------------------------------*/\nimport { ECSchemaNamespaceUris } from \"../Constants\";\nimport { ISchemaLocater, SchemaContext } from \"../Context\";\nimport { SchemaProps, SchemaReferenceProps } from \"../Deserialization/JsonProps\";\nimport { SchemaGraphUtil } from \"../Deserialization/SchemaGraphUtil\";\nimport { SchemaMatchType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { SchemaInfo } from \"../Interfaces\";\nimport { Schema } from \"../Metadata/Schema\";\nimport { SchemaKey } from \"../SchemaKey\";\nimport { SchemaLoadingController } from \"../utils/SchemaLoadingController\";\nimport { IncrementalSchemaReader } from \"./IncrementalSchemaReader\";\n\ninterface IncrementalSchemaInfo extends SchemaInfo {\n readonly description?: string;\n readonly label?: string;\n}\n\ntype LoadSchemaInfoHandler = (context: SchemaContext) => Promise<Iterable<SchemaInfo>>;\n\n/**\n * Defines the SchemaLocater Options which determine how each schema is to be loaded.\n * All options are optional.\n * @beta\n */\nexport interface SchemaLocaterOptions {\n /** Only load partial schemas. Full schema information will not be retrieved. Defaults to false. */\n readonly loadPartialSchemaOnly?: boolean;\n}\n\n/**\n * A [[ISchemaLocater]] implementation for locating and retrieving EC [[Schema]]\n * objects incrementally instead of the full schema and it's references at once. This is useful for large schemas that\n * take a long time to load, but clients need a rough skeleton of the schema as fast as possible.\n *\n * The IncrementalSchemaLocater is a locater around the [[IncrementalSchemaLocater]] to be used in a\n * [[SchemaContext]].\n * @internal\n */\nexport abstract class IncrementalSchemaLocater implements ISchemaLocater {\n private readonly _options: SchemaLocaterOptions;\n protected readonly _schemaInfoCache: SchemaInfoCache;\n\n /**\n * Initializes a new instance of the IncrementalSchemaLocater class.\n * @param options The [[SchemaLocaterOptions]] that control the loading of the schema.\n */\n constructor(options?: SchemaLocaterOptions) {\n this._options = options || {};\n\n this._schemaInfoCache = new SchemaInfoCache(async (context) => {\n return this.loadSchemaInfos(context);\n });\n }\n\n /** Gets the options how the schema locater load the schemas. */\n protected get options(): SchemaLocaterOptions {\n return this._options;\n }\n\n /**\n * Gets the [[SchemaInfo]] which matches the provided SchemaKey. The SchemaInfo may be returned\n * before the schema is fully loaded. May return the entire Schema so long as it is completely loaded as it satisfies\n * the SchemaInfo interface.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n */\n public async getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined> {\n return this._schemaInfoCache.lookup(schemaKey, matchType, context);\n }\n\n /**\n * Attempts to get a [[Schema]] from the locater. Yields undefined if no matching schema is found.\n * For schemas that may have references, construct and call through a SchemaContext instead.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n */\n public async getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined> {\n const schemaInfo = await this.getSchemaInfo(schemaKey, matchType, context);\n return schemaInfo\n ? this.loadSchema(schemaInfo, context)\n : undefined;\n }\n\n /**\n * Attempts to get a [[Schema]] from the locater. Yields undefined if no matching schema is found.\n * For schemas that may have references, construct and call through a SchemaContext instead.\n * NOT IMPLEMENTED IN THIS LOCATER - ALWAYS RETURNS UNDEFINED.\n * @param schemaKey The [[SchemaKey]] to look up.\n * @param matchType The [[SchemaMatchType]] to use against candidate schemas.\n * @param context The [[SchemaContext]] for loading schema references.\n * @returns Incremental schema loading does not work synchronously, this will always return undefined.\n */\n public getSchemaSync(_schemaKey: Readonly<SchemaKey>, _matchType: SchemaMatchType, _context: SchemaContext): Schema | undefined {\n return undefined;\n }\n\n /**\n * Gets the schema partials for the given schema key. The first item in the array is the\n * actual schema props of the schema to load, the following items are partial schema props\n * of referenced schemas.\n * @param schemaKey The schema key of the requested schema.\n * @param context The schema context.\n */\n protected abstract getSchemaPartials(schemaKey: SchemaKey, context: SchemaContext): Promise<ReadonlyArray<SchemaProps> | undefined>;\n\n /**\n * Gets the full schema json for the requested schema key.\n * @param schemaKey The schema key of the requested schema.\n * @param context The schema context.\n */\n protected abstract getSchemaJson(schemaKey: SchemaKey, context: SchemaContext): Promise<SchemaProps | undefined>;\n\n /**\n * Loads the schema info objects for the given context.\n * @param context The schema context to load the schema infos for.\n * @returns A promise that resolves to an iterable of schema infos.\n */\n protected abstract loadSchemaInfos(context: SchemaContext): Promise<Iterable<SchemaInfo>>;\n\n /**\n * Checks if the context contains the right schemas to support incremental schema loading.\n * @param context The schema context to check.\n * @returns true if incremental schema loading is supported, false otherwise.\n */\n protected abstract supportPartialSchemaLoading(context: SchemaContext): Promise<boolean>;\n\n /**\n * Start loading the schema for the given schema info incrementally. The schema is returned\n * as soon as the schema stub is loaded while the schema fully resolves in the background. It should\n * only be called by the IncrementalSchemaLocater if a schema has not been loaded or started to\n * load yet.\n * @param schemaInfo The schema info of the schema to load.\n * @param schemaContext The schema context to load the schema into.\n */\n protected async loadSchema(schemaInfo: SchemaInfo, schemaContext: SchemaContext): Promise<Schema> {\n // If the meta schema is an earlier version than 4.0.3, we can't use the ECSql query interface to get the schema\n // information required to load the schema entirely. In this case, we fallback to use the ECSchema RPC interface\n // to fetch the whole schema json.\n if (!await this.supportPartialSchemaLoading(schemaContext)) {\n const schemaJson = await this.getSchemaJson(schemaInfo.schemaKey, schemaContext);\n if(schemaJson === undefined)\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the schema, ${schemaInfo.schemaKey.name}.${schemaInfo.schemaKey.version.toString()}`);\n\n return Schema.fromJson(schemaJson, schemaContext);\n }\n\n // Fetches the schema partials for the given schema key. The first item in the array is the\n // actual schema props of the schema to load, the following items are schema props of referenced\n // schema items that are needed to resolve the schema properly.\n const schemaPartials = await this.getSchemaPartials(schemaInfo.schemaKey, schemaContext);\n if (schemaPartials === undefined)\n throw new ECSchemaError(ECSchemaStatus.UnableToLocateSchema, `Could not locate the schema, ${schemaInfo.schemaKey.name}.${schemaInfo.schemaKey.version.toString()}`);\n\n // Sort the partials in dependency order to ensure referenced schemas exist in the schema context\n // when they get requested. Otherwise the context would call this method again and for referenced\n // schemas, we would not want to request the whole schema props.\n const sortedPartials = await this.sortSchemaPartials(schemaPartials, schemaContext);\n for (const schemaProps of sortedPartials) {\n await this.startLoadingPartialSchema(schemaProps, schemaContext);\n }\n\n const schema = await schemaContext.getCachedSchema(schemaInfo.schemaKey);\n if (!schema)\n throw new Error(`Schema ${schemaInfo.schemaKey.name} could not be found.`);\n\n return schema;\n }\n\n /**\n * Creates a SchemaProps object by loading the Schema information from the given SchemaContext.\n * @param schemaKey The SchemaKey of the Schema whose props are to be retrieved.\n * @param schemaContext The SchemaContext holding the Schema.\n * @returns The SchemaProps object.\n */\n protected async createSchemaProps(schemaKey: SchemaKey, schemaContext: SchemaContext): Promise<SchemaProps> {\n const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, SchemaMatchType.Latest) as IncrementalSchemaInfo | undefined; // eslint-disable-line @typescript-eslint/no-unnecessary-type-assertion\n if (!schemaInfo)\n throw new Error(`Schema ${schemaKey.name} could not be found.`);\n\n const schemaReferences: Array<SchemaReferenceProps> = [];\n const schemaProps: SchemaProps = {\n $schema: ECSchemaNamespaceUris.SCHEMAURL3_2_JSON,\n name: schemaKey.name,\n alias: schemaInfo.alias,\n version: schemaInfo.schemaKey.version.toString(),\n description: schemaInfo.description,\n label: schemaInfo.label,\n references: schemaReferences,\n items: {}\n };\n\n schemaInfo.references.forEach((ref) => {\n schemaReferences.push({ name: ref.schemaKey.name, version: ref.schemaKey.version.toString() });\n });\n\n return schemaProps;\n }\n\n private async startLoadingPartialSchema(schemaProps: SchemaProps, schemaContext: SchemaContext): Promise<void> {\n if (schemaContext.schemaExists(SchemaKey.parseString(`${schemaProps.name}.${schemaProps.version}`))) {\n return;\n }\n\n const controller = new SchemaLoadingController();\n const schemaReader = new IncrementalSchemaReader(schemaContext, true);\n const schema = new Schema(schemaContext);\n schema.setLoadingController(controller);\n\n await schemaReader.readSchema(schema, schemaProps);\n\n if (!this._options.loadPartialSchemaOnly)\n controller.start(this.startLoadingFullSchema(schema));\n }\n\n private async loadFullSchema(schema: Schema): Promise<void> {\n const fullSchemaProps = await this.getSchemaJson(schema.schemaKey, schema.context)\n const reader = new IncrementalSchemaReader(schema.context, false);\n await reader.readSchema(schema, fullSchemaProps, false);\n }\n\n private async startLoadingFullSchema(schema: Schema): Promise<void> {\n if (!schema.loadingController)\n return;\n\n // If the schema is already resolved, return it directly.\n if (schema.loadingController.isComplete || schema.loadingController.inProgress) {\n return;\n }\n\n // Since the schema relies on it's references, they get triggered to be resolved\n // first by recursively calling this method. After all references has been resolved\n // the schema itself gets resolved.\n await Promise.all(schema.references.map(async (referenceSchema) => {\n if (referenceSchema.loadingController && referenceSchema.loadingController.inProgress)\n return referenceSchema.loadingController.wait();\n else\n return this.startLoadingFullSchema(referenceSchema);\n }));\n\n return this.loadFullSchema(schema);\n }\n\n private async sortSchemaPartials(schemaPartials: ReadonlyArray<SchemaProps>, schemaContext: SchemaContext): Promise<ReadonlyArray<SchemaProps>> {\n const schemaInfos: Array<SchemaInfo & { props: SchemaProps }> = [];\n for (const schemaProps of schemaPartials) {\n const schemaKey = SchemaKey.parseString(`${schemaProps.name}.${schemaProps.version}`);\n const schemaInfo = await schemaContext.getSchemaInfo(schemaKey, SchemaMatchType.Latest);\n if (!schemaInfo)\n throw new Error(`Schema ${schemaKey.name} could not be found.`);\n\n schemaInfos.push({ ...schemaInfo, props: schemaProps });\n }\n\n const orderedSchemaInfos = SchemaGraphUtil.buildDependencyOrderedSchemaInfoList(schemaInfos) as Array<SchemaInfo & { props: SchemaProps }>;\n return orderedSchemaInfos.map((schemaInfo) => schemaInfo.props);\n }\n}\n\n/**\n * Helper class to manage schema infos for a schema context.\n */\nclass SchemaInfoCache {\n private readonly _schemaInfoCache: WeakMap<SchemaContext, Array<IncrementalSchemaInfo>>;\n private readonly _schemaInfoLoader: LoadSchemaInfoHandler;\n\n constructor(schemaInfoLoader: LoadSchemaInfoHandler) {\n this._schemaInfoCache = new WeakMap<SchemaContext, Array<IncrementalSchemaInfo>>();\n this._schemaInfoLoader = schemaInfoLoader;\n }\n\n public async getSchemasByContext(context: SchemaContext): Promise<IncrementalSchemaInfo[] | undefined> {\n if (!this._schemaInfoCache.has(context)) {\n const schemaInfos = await this._schemaInfoLoader(context);\n this._schemaInfoCache.set(context, Array.from(schemaInfos));\n }\n return this._schemaInfoCache.get(context);\n }\n\n public async lookup(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<IncrementalSchemaInfo | undefined> {\n const contextSchemaInfos = await this.getSchemasByContext(context);\n return contextSchemaInfos\n ? contextSchemaInfos.find((schemaInfo) => schemaInfo.schemaKey.matches(schemaKey, matchType))\n : undefined;\n }\n\n public remove(schemaKey: SchemaKey, context: SchemaContext): void {\n const contextSchemaInfos = this._schemaInfoCache.get(context);\n if (!contextSchemaInfos)\n return;\n\n const index = contextSchemaInfos.findIndex((schemaInfo) => schemaInfo.schemaKey.name === schemaKey.name);\n if (index !== -1) {\n contextSchemaInfos.splice(index, 1);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAiD,eAAe,EAA0C,aAAa,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AAE9L,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB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300
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
301
- throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);
300
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided Struct type, ${typeof structType === "string" ? structType : structType?.fullName ?? "undefined"}, is not a valid StructClass.`);
302
301
  return correctType;
303
302
  }
304
303
  /**
@@ -317,8 +316,7 @@ class ECClass extends SchemaItem_1.SchemaItem {
317
316
  else
318
317
  correctType = structType;
319
318
  if (!correctType)
320
- // eslint-disable-next-line @typescript-eslint/no-base-to-string
321
- throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);
319
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided Struct type, ${typeof structType === "string" ? structType : structType?.fullName ?? "undefined"}, is not a valid StructClass.`);
322
320
  return correctType;
323
321
  }
324
322
  /**
@@ -488,6 +486,8 @@ class ECClass extends SchemaItem_1.SchemaItem {
488
486
  const schemaList = [this.schema];
489
487
  while (schemaList.length > 0) {
490
488
  const currentSchema = schemaList.shift();
489
+ if (!currentSchema)
490
+ break;
491
491
  if (currentSchema.schemaKey.compareByName(itemKey.schemaKey)) {
492
492
  const baseClass = await currentSchema.getItem(itemKey.name, ECClass);
493
493
  schemaList.splice(0); // clear the list
@@ -514,6 +514,8 @@ class ECClass extends SchemaItem_1.SchemaItem {
514
514
  const schemaList = [this.schema];
515
515
  while (schemaList.length > 0) {
516
516
  const currentSchema = schemaList.shift();
517
+ if (!currentSchema)
518
+ break;
517
519
  if (currentSchema.schemaKey.compareByName(itemKey.schemaKey)) {
518
520
  const baseClass = currentSchema.getItemSync(itemKey.name, ECClass);
519
521
  schemaList.splice(0); // clear the list
@@ -1 +1 @@
1
- {"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":";AAA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AC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;CACF;AAv1BD,0BAu1BC;AAED;;;GAGG;AACH,MAAa,WAAY,SAAQ,OAAO;IACtC;;OAEG;IACsB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IAErE;;;OAGG;IACI,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,WAAW;YAC5D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AAjCD,kCAiCC;AAED;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,OAAO;CA6BjD;AA7BD,oCA6BC","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 { assert, Logger } from \"@itwin/core-bentley\";\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ClassProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { Enumeration } from \"./Enumeration\";\nimport {\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\n} from \"./Property\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\n\nconst loggingCategory = \"ECClass\";\n\n/**\n * A common abstract class for all of the ECClass types.\n * @public @preview\n */\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\n /** @internal */\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\n private _modifier: ECClassModifier;\n private _baseClass?: LazyLoadedECClass;\n private _properties?: Map<string, Property>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _mergedPropertyCache?: Map<string, Property>;\n\n public get modifier() { return this._modifier; }\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** @internal */\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\n super(schema, name);\n\n if (modifier)\n this._modifier = modifier;\n else\n this._modifier = ECClassModifier.None;\n }\n\n /**\n * Gets the base class if it exists, otherwise returns undefined.\n */\n public get baseClass(): LazyLoadedECClass | undefined {\n return this._baseClass;\n }\n\n public getBaseClassSync(): ECClass | undefined {\n if (!this.baseClass) {\n return undefined;\n }\n\n return this.schema.lookupItemSync(this.baseClass, ECClass);\n }\n\n /**\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\n *\n * @internal\n */\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\n const oldBaseClass = this._baseClass;\n this._baseClass = baseClass;\n\n if (baseClass)\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\n else if (oldBaseClass)\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\n }\n\n /**\n * Gets the derived classes belonging to this class.\n * @note This method relies on the `SchemaContext` to find derived classes.\n * It will **only** return derived classes from schemas that have already been loaded into the context.\n * If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.\n * To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`\n * before calling this method.\n * @returns An array of ECClasses or undefined if no derived classes exist.\n */\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\n const derivedClasses: ECClass[] = [];\n for(const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\n if (derivedClass) {\n derivedClasses.push(derivedClass);\n continue;\n }\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\n if (derivedClass)\n derivedClasses.push(derivedClass);\n }\n\n if (derivedClasses.length === 0)\n return undefined;\n\n return derivedClasses;\n }\n\n /**\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\n * @param prop The property to add.\n * @return The property that was added.\n *\n * @internal\n */\n protected addProperty<T extends Property>(prop: T): T {\n if (!this._properties)\n this._properties = new Map<string, Property>();\n\n this._properties.set(prop.name.toUpperCase(), prop);\n this.cleanCache();\n return prop;\n }\n\n /**\n * Deletes a property from within this class.\n * @param name The property name to delete, lookup is case-insensitive\n * @internal\n */\n protected async deleteProperty(name: string): Promise<void> {\n if (this._properties) {\n const property = await this.getProperty(name);\n if (property) {\n this._properties.delete(name.toUpperCase());\n this.cleanCache();\n }\n }\n }\n\n /**\n * Deletes a property from within this class.\n * @param name The property name to delete, lookup is case-insensitive\n * @internal\n */\n protected deletePropertySync(name: string): void {\n if (this._properties) {\n const property = this.getPropertySync(name);\n if (property) {\n this._properties.delete(name.toUpperCase());\n this.cleanCache();\n }\n }\n }\n\n\n /**\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\n * all base classes. Set excludeInherited to 'true' to only search the local class.\n * @param name The name of the property to retrieve.\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\n */\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\n const upperKey = name.toUpperCase();\n let property: Property | undefined;\n\n if (this._properties) {\n property = this._properties.get(upperKey);\n if (property) {\n return property;\n }\n }\n\n if (excludeInherited) {\n return undefined;\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = await this.buildPropertyCache();\n }\n\n return this._mergedPropertyCache.get(upperKey);\n }\n\n /**\n * Searches, case-insensitive, for a local ECProperty with the name provided.\n * @param name The name of the property to retrieve.\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\n */\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\n const upperKey = name.toUpperCase();\n let property: Property | undefined;\n\n if (this._properties) {\n property = this._properties.get(upperKey);\n if (property) {\n return property;\n }\n }\n\n if (excludeInherited) {\n return undefined;\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = this.buildPropertyCacheSync();\n }\n\n return this._mergedPropertyCache.get(upperKey);\n }\n\n /**\n * Searches the base class, if one exists, for the property with the name provided.\n * @param name The name of the inherited property to find.\n */\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\n if (this.baseClass) {\n const baseClassObj = await this.baseClass;\n return baseClassObj.getProperty(name);\n }\n\n return undefined;\n }\n\n /**\n * Searches the base class, if one exists, for the property with the name provided.\n * @param name The name of the inherited property to find.\n */\n public getInheritedPropertySync(name: string): Property | undefined {\n const baseClassObj = this.getBaseClassSync();\n if (baseClassObj)\n return baseClassObj.getPropertySync(name);\n\n return undefined;\n }\n\n /**\n * Creates a PrimitiveECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\n *\n * @internal\n */\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveProperty(this, name, propType));\n\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\n *\n * @internal\n */\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveProperty(this, name, propType));\n\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveArrayECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n *\n * @internal\n */\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\n\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveArrayECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n *\n * @internal\n */\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\n\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n *\n * @param name The name of property to create.\n * @param structType The struct type of property to create.\n *\n * @internal\n */\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\n }\n\n /**\n *\n * @param name The name of property to create.\n * @param structType The struct type of property to create.\n *\n * @internal\n */\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\n }\n\n /**\n *\n * @param name\n * @param type\n *\n * @internal\n */\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\n }\n\n /**\n *\n * @param name\n * @param type\n *\n * @internal\n */\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\n }\n\n /**\n *\n * @param structType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\n let correctType: StructClass | undefined;\n if (typeof (structType) === \"string\") {\n correctType = await schema.lookupItem(structType, StructClass);\n } else\n correctType = structType;\n\n if (!correctType)\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\n\n return correctType;\n }\n\n /**\n *\n * @param structType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\n let correctType: StructClass | undefined;\n if (typeof (structType) === \"string\") {\n correctType = schema.lookupItemSync(structType, StructClass);\n } else\n correctType = structType;\n\n if (!correctType)\n // eslint-disable-next-line @typescript-eslint/no-base-to-string\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${structType}, is not a valid StructClass.`);\n\n return correctType;\n }\n\n /**\n *\n * @param primitiveType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\n if (primitiveType === undefined)\n return PrimitiveType.Integer;\n\n if (typeof (primitiveType) === \"string\") {\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\n if (!resolvedType) {\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\n }\n\n if (resolvedType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n return resolvedType;\n }\n\n return primitiveType;\n }\n\n /**\n *\n * @param primitiveType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\n if (primitiveType === undefined)\n return PrimitiveType.Integer;\n\n if (typeof (primitiveType) === \"string\") {\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\n if (!resolvedType) {\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\n }\n\n if (resolvedType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n return resolvedType;\n }\n\n return primitiveType;\n }\n\n /**\n * Save this Classes 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 override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\n schemaJson.modifier = classModifierToString(this.modifier);\n if (this.baseClass !== undefined)\n schemaJson.baseClass = this.baseClass.fullName;\n if (this._properties !== undefined && this._properties.size > 0)\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (customAttributes !== undefined)\n schemaJson.customAttributes = customAttributes;\n return schemaJson as ClassProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n\n if (undefined !== this.modifier)\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\n\n if (undefined !== this.baseClass) {\n const baseClass = await this.baseClass;\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\n baseClassElement.textContent = baseClassName;\n itemElement.appendChild(baseClassElement);\n }\n\n if (this._properties) {\n for (const prop of this._properties.values()) {\n const propXml = await prop.toXml(schemaXml);\n itemElement.appendChild(propXml);\n }\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(classProps: ClassProps) {\n super.fromJSONSync(classProps);\n\n if (undefined !== classProps.modifier) {\n const modifier = parseClassModifier(classProps.modifier);\n if (undefined === modifier) {\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\n this._modifier = ECClassModifier.None;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\n } else {\n this._modifier = modifier;\n }\n }\n\n if (undefined !== classProps.baseClass) {\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\n if (!ecClassSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\n\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\n\n let lazyBase: LazyLoadedECClass;\n if (!baseClass) {\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\n async () => {\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\n return baseItem;\n });\n } else {\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\n async () => {\n return baseClass as ECClass;\n });\n }\n\n this._baseClass = lazyBase;\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\n }\n }\n\n public override async fromJSON(classProps: ClassProps): Promise<void> {\n this.fromJSONSync(classProps);\n }\n\n /**\n *\n * @param customAttribute\n *\n * @internal\n */\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 * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\n * This is essentially a depth-first traversal through the inheritance tree.\n */\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\n if (baseClass)\n yield baseClass;\n }\n }\n\n /**\n * gets a class from this schema or its references recursively using the item key\n * @param itemKey\n * @returns ECClass if it could be found, undefined otherwise\n * @internal\n */\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\n const schemaList: Schema[] = [this.schema];\n while(schemaList.length > 0) {\n const currentSchema = schemaList.shift();\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\n const baseClass = await currentSchema!.getItem(itemKey.name, ECClass);\n schemaList.splice(0); // clear the list\n return baseClass;\n }\n schemaList.push(...currentSchema!.references);\n }\n return undefined;\n }\n\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\n if (baseClass)\n yield baseClass;\n }\n }\n\n /**\n * gets a class from this schema or its references recursively using the item key synchronously\n * @param itemKey\n * @returns ECClass if it could be found, undefined otherwise\n * @internal\n */\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\n const schemaList: Schema[] = [this.schema];\n while(schemaList.length > 0) {\n const currentSchema = schemaList.shift();\n if(currentSchema!.schemaKey.compareByName(itemKey.schemaKey)) {\n const baseClass = currentSchema!.getItemSync(itemKey.name, ECClass);\n schemaList.splice(0); // clear the list\n return baseClass;\n }\n schemaList.push(...currentSchema!.references);\n }\n return undefined;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\n protected async buildPropertyCache(): Promise<Map<string, Property>> {\n const cache = new Map<string, Property>();\n const baseClass = await this.baseClass;\n if (baseClass) {\n for (const property of await baseClass.getProperties()) {\n if (!cache.has(property.name.toUpperCase())) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n }\n\n if (this._properties) {\n this._properties.forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\n protected buildPropertyCacheSync(): Map<string, Property> {\n const cache = new Map<string, Property>();\n const baseClass = this.getBaseClassSync();\n if (baseClass) {\n for (const property of baseClass.getPropertiesSync()) {\n if (!cache.has(property.name.toUpperCase())) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n }\n\n if (this._properties) {\n this._properties.forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n * Clears all caches on this object. This is called implicitly for this class,\n * but needs to be called if derived classes have changed.\n * @internal\n */\n public cleanCache() {\n this._mergedPropertyCache = undefined;\n }\n\n /**\n * Returns the properties on this class and its base classes.\n * Since this is an expensive operation, results will be cached after first call.\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\n * @returns An array of properties, empty array if none exist.\n */\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\n if (excludeInherited) {\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = this.buildPropertyCacheSync();\n }\n\n return this._mergedPropertyCache.values();\n }\n\n /**\n * Quick way to check whether this class has any local properties without having to use the iterable\n */\n public get hasLocalProperties(): boolean {\n return this._properties !== undefined && this._properties.size > 0;\n }\n\n /**\n * Returns the properties on this class and its base classes.\n * Since this is an expensive operation, results will be cached after first call.\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\n * @returns An array of properties, empty array if none exist.\n */\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\n return this.getPropertiesSync(excludeInherited);\n }\n\n /**\n * Retrieve all custom attributes in the current class and its bases\n * This is the async version of getCustomAttributesSync()\n */\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\n return this.getCustomAttributesSync();\n }\n\n /**\n * Retrieve all custom attributes in the current class and its bases.\n */\n public getCustomAttributesSync(): CustomAttributeSet {\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\n if (undefined === customAttributes) {\n customAttributes = new Map<string, CustomAttribute>();\n }\n\n this.traverseBaseClassesSync((ecClass: ECClass) => {\n if (undefined === ecClass.customAttributes)\n return false;\n\n for (const [className, customAttribute] of ecClass.customAttributes) {\n if (customAttributes.has(className))\n continue;\n customAttributes.set(className, customAttribute);\n }\n\n return false;\n });\n\n return customAttributes;\n }\n\n /**\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\n * function for each base class encountered.\n * @param callback The function to call for each base class in the hierarchy.\n * @param arg An argument that will be passed as the second parameter to the callback function.\n */\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\n for await (const baseClass of this.getAllBaseClasses()) {\n if (callback(baseClass, arg))\n return true;\n }\n\n return false;\n }\n\n /**\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\n * function for each base class encountered.\n * @param callback The function to call for each base class in the hierarchy.\n * @param arg An argument that will be passed as the second parameter to the callback function.\n */\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\n const baseClasses = this.getAllBaseClassesSync();\n if (!baseClasses)\n return false;\n\n for (const baseClass of baseClasses) {\n if (callback(baseClass, arg))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if the targetClass is of this type.\n * @param targetClass The ECClass or ECClass name to check.\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\n */\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\n public async is(targetClass: ECClass): Promise<boolean>;\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\n return typeof targetClass === \"string\"\n ? this.isSync(targetClass, schemaName ?? \"\")\n : this.isSync(targetClass);\n }\n\n /**\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\n * @param targetClass The class to check.\n */\n public isSync(targetClass: ECClass): boolean;\n public isSync(targetClass: string, schemaName: string): boolean;\n\n /** @internal */\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\n let targetSchemaKey: SchemaItemKey | undefined;\n if (schemaName !== undefined) {\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\n\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\n if (SchemaItem.equalByKey(this, targetSchemaKey))\n return true;\n\n } else {\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\n\n if (SchemaItem.equalByKey(this, targetClass))\n return true;\n\n targetSchemaKey = targetClass.key;\n }\n\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n if(baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * @internal\n */\n public static isECClass(object: any): object is ECClass {\n if (!SchemaItem.isSchemaItem(object))\n return false;\n\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\n }\n\n /**\n * A setter method for the ECClass modifier, used specifically for schema editing.\n * @param modifier\n * @internal\n */\n protected setModifier(modifier: ECClassModifier) {\n this._modifier = modifier;\n }\n}\n\n/**\n * A Typescript class representation of an ECStructClass.\n * @public @preview\n */\nexport class StructClass extends ECClass {\n /**\n * Get the type of item represented by this instance\n */\n public override readonly schemaItemType = StructClass.schemaItemType;\n\n /**\n * Get the type of item represented by this class\n * @internal\n */\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\n /**\n * Type guard to check if the SchemaItem is of type StructClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is a StructClass, false otherwise.\n */\n public static isStructClass(item?: SchemaItem): item is StructClass {\n if (item && item.schemaItemType === SchemaItemType.StructClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type StructClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\n * @internal\n */\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\n if (!this.isStructClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableStructClass extends StructClass {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableClass extends ECClass {\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override setModifier(modifier: ECClassModifier): void;\n public abstract override setName(name: string): void;\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\n\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\n\n public abstract override deleteProperty(name: string): Promise<void>;\n public abstract override deletePropertySync(name: string): void;\n}\n"]}
1
+ {"version":3,"file":"Class.js","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAAqD;AACrD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8L;AAC9L,4CAA6D;AAE7D,4CAAwD;AACxD,uDAAkI;AAClI,+CAA4C;AAC5C,yCAEoB;AAEpB,6CAA0C;AAC1C,sDAA4E;AAE5E,MAAM,eAAe,GAAG,SAAS,CAAC;AAElC;;;GAGG;AACH,MAAsB,OAAQ,SAAQ,uBAAU;IAC9C,gBAAgB;IACT,MAAM,KAAc,cAAc,KAA8B,OAAO,kCAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,wDAAwD;IAC9J,SAAS,CAAkB;IAC3B,UAAU,CAAqB;IAC/B,WAAW,CAAyB;IACpC,iBAAiB,CAAgC;IACjD,oBAAoB,CAAyB;IAErD,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;IAChD,IAAW,gBAAgB,KAAqC,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAEhG,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAAY,EAAE,QAA0B;QAClE,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAEpB,IAAI,QAAQ;YACV,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;;YAE1B,IAAI,CAAC,SAAS,GAAG,2BAAe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c,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AAjCD,kCAiCC;AAED;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,OAAO;CA6BjD;AA7BD,oCA6BC","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 { assert, Logger } from \"@itwin/core-bentley\";\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ClassProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { AbstractSchemaItemType, classModifierToString, ECClassModifier, parseClassModifier, parsePrimitiveType, PrimitiveType, SchemaItemType, SupportedSchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, LazyLoadedECClass } from \"../Interfaces\";\nimport { SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { Enumeration } from \"./Enumeration\";\nimport {\n EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, Property, StructArrayProperty, StructProperty,\n} from \"./Property\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\n\nconst loggingCategory = \"ECClass\";\n\n/**\n * A common abstract class for all of the ECClass types.\n * @public @preview\n */\nexport abstract class ECClass extends SchemaItem implements CustomAttributeContainerProps {\n /** @internal */\n public static override get schemaItemType(): SupportedSchemaItemType { return AbstractSchemaItemType.Class; } // need this so getItem(\"name\", ECClass) in schema works\n private _modifier: ECClassModifier;\n private _baseClass?: LazyLoadedECClass;\n private _properties?: Map<string, Property>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _mergedPropertyCache?: Map<string, Property>;\n\n public get modifier() { return this._modifier; }\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** @internal */\n constructor(schema: Schema, name: string, modifier?: ECClassModifier) {\n super(schema, name);\n\n if (modifier)\n this._modifier = modifier;\n else\n this._modifier = ECClassModifier.None;\n }\n\n /**\n * Gets the base class if it exists, otherwise returns undefined.\n */\n public get baseClass(): LazyLoadedECClass | undefined {\n return this._baseClass;\n }\n\n public getBaseClassSync(): ECClass | undefined {\n if (!this.baseClass) {\n return undefined;\n }\n\n return this.schema.lookupItemSync(this.baseClass, ECClass);\n }\n\n /**\n * Sets the base class of the ECClass. Pass undefined to 'remove' the base class.\n *\n * @internal\n */\n protected async setBaseClass(baseClass: LazyLoadedECClass | undefined) {\n const oldBaseClass = this._baseClass;\n this._baseClass = baseClass;\n\n if (baseClass)\n this.schema.context.classHierarchy.addBaseClass(this.key, baseClass);\n else if (oldBaseClass)\n this.schema.context.classHierarchy.removeBaseClass(this.key, oldBaseClass);\n }\n\n /**\n * Gets the derived classes belonging to this class.\n * @note This method relies on the `SchemaContext` to find derived classes.\n * It will **only** return derived classes from schemas that have already been loaded into the context.\n * If a derived class exists in a referencing schema that has not yet been loaded, it will not be included in the results.\n * To ensure all derived classes are found, ensure that all relevant referencing schemas are loaded into the `SchemaContext`\n * before calling this method.\n * @returns An array of ECClasses or undefined if no derived classes exist.\n */\n public async getDerivedClasses(): Promise<ECClass[] | undefined> {\n const derivedClasses: ECClass[] = [];\n for (const derivedClassKey of this.schema.context.classHierarchy.getDerivedClassKeys(this.key)) {\n let derivedClass = await this.schema.getItem(derivedClassKey.name, ECClass); // if the derived class is in the same schema this will get it without going to the context\n if (derivedClass) {\n derivedClasses.push(derivedClass);\n continue;\n }\n Logger.logInfo(loggingCategory, `Derived class ${derivedClassKey.name} not found in schema ${this.schema.name}, looking in schema context.`);\n derivedClass = await this.schema.context.getSchemaItem(derivedClassKey, ECClass);\n if (derivedClass)\n derivedClasses.push(derivedClass);\n }\n\n if (derivedClasses.length === 0)\n return undefined;\n\n return derivedClasses;\n }\n\n /**\n * Convenience method for adding an already loaded ECProperty used by create*Property methods.\n * @param prop The property to add.\n * @return The property that was added.\n *\n * @internal\n */\n protected addProperty<T extends Property>(prop: T): T {\n if (!this._properties)\n this._properties = new Map<string, Property>();\n\n this._properties.set(prop.name.toUpperCase(), prop);\n this.cleanCache();\n return prop;\n }\n\n /**\n * Deletes a property from within this class.\n * @param name The property name to delete, lookup is case-insensitive\n * @internal\n */\n protected async deleteProperty(name: string): Promise<void> {\n if (this._properties) {\n const property = await this.getProperty(name);\n if (property) {\n this._properties.delete(name.toUpperCase());\n this.cleanCache();\n }\n }\n }\n\n /**\n * Deletes a property from within this class.\n * @param name The property name to delete, lookup is case-insensitive\n * @internal\n */\n protected deletePropertySync(name: string): void {\n if (this._properties) {\n const property = this.getPropertySync(name);\n if (property) {\n this._properties.delete(name.toUpperCase());\n this.cleanCache();\n }\n }\n }\n\n\n /**\n * Searches, case-insensitive, for an ECProperty with given the name on this class and, by default, on\n * all base classes. Set excludeInherited to 'true' to only search the local class.\n * @param name The name of the property to retrieve.\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\n */\n public async getProperty(name: string, excludeInherited?: boolean): Promise<Property | undefined> {\n const upperKey = name.toUpperCase();\n let property: Property | undefined;\n\n if (this._properties) {\n property = this._properties.get(upperKey);\n if (property) {\n return property;\n }\n }\n\n if (excludeInherited) {\n return undefined;\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = await this.buildPropertyCache();\n }\n\n return this._mergedPropertyCache.get(upperKey);\n }\n\n /**\n * Searches, case-insensitive, for a local ECProperty with the name provided.\n * @param name The name of the property to retrieve.\n * @param excludeInherited If true, excludes inherited properties from the results. Defaults to false.\n */\n public getPropertySync(name: string, excludeInherited?: boolean): Property | undefined {\n const upperKey = name.toUpperCase();\n let property: Property | undefined;\n\n if (this._properties) {\n property = this._properties.get(upperKey);\n if (property) {\n return property;\n }\n }\n\n if (excludeInherited) {\n return undefined;\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = this.buildPropertyCacheSync();\n }\n\n return this._mergedPropertyCache.get(upperKey);\n }\n\n /**\n * Searches the base class, if one exists, for the property with the name provided.\n * @param name The name of the inherited property to find.\n */\n public async getInheritedProperty(name: string): Promise<Property | undefined> {\n if (this.baseClass) {\n const baseClassObj = await this.baseClass;\n return baseClassObj.getProperty(name);\n }\n\n return undefined;\n }\n\n /**\n * Searches the base class, if one exists, for the property with the name provided.\n * @param name The name of the inherited property to find.\n */\n public getInheritedPropertySync(name: string): Property | undefined {\n const baseClassObj = this.getBaseClassSync();\n if (baseClassObj)\n return baseClassObj.getPropertySync(name);\n\n return undefined;\n }\n\n /**\n * Creates a PrimitiveECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\n *\n * @internal\n */\n protected async createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n protected async createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n protected async createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveProperty(this, name, propType));\n\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n * @throws ECSchemaStatus DuplicateProperty: thrown if a property with the same name already exists in the class.\n *\n * @internal\n */\n protected createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n protected createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n protected createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveProperty(this, name, propType));\n\n return this.addProperty(new EnumerationProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveArrayECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n *\n * @internal\n */\n protected async createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n protected async createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n protected async createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = await this.loadPrimitiveType(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\n\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n * Creates a PrimitiveArrayECProperty.\n * @param name The name of property to create.\n * @param primitiveType The primitive type of property to create. If not provided the default is PrimitiveType.Integer\n *\n * @internal\n */\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n protected createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n protected createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n const propType = this.loadPrimitiveTypeSync(primitiveType, this.schema);\n if (typeof (propType) === \"number\")\n return this.addProperty(new PrimitiveArrayProperty(this, name, propType));\n\n return this.addProperty(new EnumerationArrayProperty(this, name, new DelayedPromiseWithProps(propType.key, async () => propType)));\n }\n\n /**\n *\n * @param name The name of property to create.\n * @param structType The struct type of property to create.\n *\n * @internal\n */\n protected async createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructProperty(this, name, await this.loadStructType(structType, this.schema)));\n }\n\n /**\n *\n * @param name The name of property to create.\n * @param structType The struct type of property to create.\n *\n * @internal\n */\n protected createStructPropertySync(name: string, structType: string | StructClass): StructProperty {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\n }\n\n /**\n *\n * @param name\n * @param type\n *\n * @internal\n */\n protected async createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty> {\n if (await this.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructArrayProperty(this, name, await this.loadStructType(structType, this.schema)));\n }\n\n /**\n *\n * @param name\n * @param type\n *\n * @internal\n */\n protected createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty {\n if (this.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${this.name}.`);\n\n return this.addProperty(new StructArrayProperty(this, name, this.loadStructTypeSync(structType, this.schema)));\n }\n\n /**\n *\n * @param structType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected async loadStructType(structType: string | StructClass | undefined, schema: Schema): Promise<StructClass> {\n let correctType: StructClass | undefined;\n if (typeof (structType) === \"string\") {\n correctType = await schema.lookupItem(structType, StructClass);\n } else\n correctType = structType;\n\n if (!correctType)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${typeof structType === \"string\" ? structType : structType?.fullName ?? \"undefined\"}, is not a valid StructClass.`);\n\n return correctType;\n }\n\n /**\n *\n * @param structType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected loadStructTypeSync(structType: string | StructClass | undefined, schema: Schema): StructClass {\n let correctType: StructClass | undefined;\n if (typeof (structType) === \"string\") {\n correctType = schema.lookupItemSync(structType, StructClass);\n } else\n correctType = structType;\n\n if (!correctType)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided Struct type, ${typeof structType === \"string\" ? structType : structType?.fullName ?? \"undefined\"}, is not a valid StructClass.`);\n\n return correctType;\n }\n\n /**\n *\n * @param primitiveType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected async loadPrimitiveType(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): Promise<PrimitiveType | Enumeration> {\n if (primitiveType === undefined)\n return PrimitiveType.Integer;\n\n if (typeof (primitiveType) === \"string\") {\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\n if (!resolvedType) {\n resolvedType = await schema.lookupItem(primitiveType, Enumeration);\n }\n\n if (resolvedType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n // If resolvedType is a SchemaItem, make sure it is an Enumeration- if not, throw an error\n if (typeof (resolvedType) !== \"number\" && resolvedType.schemaItemType !== SchemaItemType.Enumeration)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n return resolvedType;\n }\n\n return primitiveType;\n }\n\n /**\n *\n * @param primitiveType\n * @param schema\n * @returns\n *\n * @internal\n */\n protected loadPrimitiveTypeSync(primitiveType: string | PrimitiveType | Enumeration | undefined, schema: Schema): PrimitiveType | Enumeration {\n if (primitiveType === undefined)\n return PrimitiveType.Integer;\n\n if (typeof (primitiveType) === \"string\") {\n let resolvedType: (PrimitiveType | Enumeration | undefined) = parsePrimitiveType(primitiveType);\n if (!resolvedType) {\n resolvedType = schema.lookupItemSync(primitiveType, Enumeration);\n }\n\n if (resolvedType === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided primitive type, ${primitiveType}, is not a valid PrimitiveType or Enumeration.`);\n\n return resolvedType;\n }\n\n return primitiveType;\n }\n\n /**\n * Save this Classes 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 override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n const isMixin = SchemaItemType.Mixin === this.schemaItemType;\n const isRelationship = SchemaItemType.RelationshipClass === this.schemaItemType;\n if (!isMixin && (ECClassModifier.None !== this.modifier || isRelationship))\n schemaJson.modifier = classModifierToString(this.modifier);\n if (this.baseClass !== undefined)\n schemaJson.baseClass = this.baseClass.fullName;\n if (this._properties !== undefined && this._properties.size > 0)\n schemaJson.properties = [...this._properties.values()].map((prop) => prop.toJSON());\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (customAttributes !== undefined)\n schemaJson.customAttributes = customAttributes;\n return schemaJson as ClassProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n\n if (undefined !== this.modifier)\n itemElement.setAttribute(\"modifier\", classModifierToString(this.modifier));\n\n if (undefined !== this.baseClass) {\n const baseClass = await this.baseClass;\n const baseClassElement = schemaXml.createElement(\"BaseClass\");\n const baseClassName = XmlSerializationUtils.createXmlTypedName(this.schema, baseClass.schema, baseClass.name);\n baseClassElement.textContent = baseClassName;\n itemElement.appendChild(baseClassElement);\n }\n\n if (this._properties) {\n for (const prop of this._properties.values()) {\n const propXml = await prop.toXml(schemaXml);\n itemElement.appendChild(propXml);\n }\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(classProps: ClassProps) {\n super.fromJSONSync(classProps);\n\n if (undefined !== classProps.modifier) {\n const modifier = parseClassModifier(classProps.modifier);\n if (undefined === modifier) {\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: classProps.originalECSpecMajorVersion, writeVersion: classProps.originalECSpecMinorVersion } as ECSpecVersion))\n this._modifier = ECClassModifier.None;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidModifier, `The string '${classProps.modifier}' is not a valid ECClassModifier.`);\n } else {\n this._modifier = modifier;\n }\n }\n\n if (undefined !== classProps.baseClass) {\n const ecClassSchemaItemKey = this.schema.getSchemaItemKey(classProps.baseClass);\n if (!ecClassSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\n\n const baseClass = this.schema.lookupItemSync(ecClassSchemaItemKey);\n\n let lazyBase: LazyLoadedECClass;\n if (!baseClass) {\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\n async () => {\n const baseItem = await this.schema.lookupItem(ecClassSchemaItemKey);\n if (undefined === baseItem || !ECClass.isECClass(baseItem))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the baseClass ${classProps.baseClass}.`);\n return baseItem;\n });\n } else {\n lazyBase = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(ecClassSchemaItemKey,\n async () => {\n return baseClass as ECClass;\n });\n }\n\n this._baseClass = lazyBase;\n this.schema.context.classHierarchy.addBaseClass(this.key, lazyBase);\n }\n }\n\n public override async fromJSON(classProps: ClassProps): Promise<void> {\n this.fromJSONSync(classProps);\n }\n\n /**\n *\n * @param customAttribute\n *\n * @internal\n */\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 * Iterates (recursively) over all base classes and mixins, in \"property override\" order.\n * This is essentially a depth-first traversal through the inheritance tree.\n */\n public async *getAllBaseClasses(): AsyncIterable<ECClass> {\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n const baseClass = await this.getClassFromReferencesRecursively(baseClassKey); // Search in schema ref tree all the way to the top\n if (baseClass)\n yield baseClass;\n }\n }\n\n /**\n * gets a class from this schema or its references recursively using the item key\n * @param itemKey\n * @returns ECClass if it could be found, undefined otherwise\n * @internal\n */\n private async getClassFromReferencesRecursively(itemKey: SchemaItemKey): Promise<ECClass | undefined> {\n const schemaList: Schema[] = [this.schema];\n while (schemaList.length > 0) {\n const currentSchema = schemaList.shift();\n if (!currentSchema)\n break;\n if (currentSchema.schemaKey.compareByName(itemKey.schemaKey)) {\n const baseClass = await currentSchema.getItem(itemKey.name, ECClass);\n schemaList.splice(0); // clear the list\n return baseClass;\n }\n schemaList.push(...currentSchema.references);\n }\n return undefined;\n }\n\n public *getAllBaseClassesSync(): Iterable<AnyClass> {\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n const baseClass = this.getClassFromReferencesRecursivelySync(baseClassKey); // Search in schema ref tree all the way to the top\n if (baseClass)\n yield baseClass;\n }\n }\n\n /**\n * gets a class from this schema or its references recursively using the item key synchronously\n * @param itemKey\n * @returns ECClass if it could be found, undefined otherwise\n * @internal\n */\n private getClassFromReferencesRecursivelySync(itemKey: SchemaItemKey): ECClass | undefined {\n const schemaList: Schema[] = [this.schema];\n while (schemaList.length > 0) {\n const currentSchema = schemaList.shift();\n if (!currentSchema)\n break;\n if (currentSchema.schemaKey.compareByName(itemKey.schemaKey)) {\n const baseClass = currentSchema.getItemSync(itemKey.name, ECClass);\n schemaList.splice(0); // clear the list\n return baseClass;\n }\n schemaList.push(...currentSchema.references);\n }\n return undefined;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\n protected async buildPropertyCache(): Promise<Map<string, Property>> {\n const cache = new Map<string, Property>();\n const baseClass = await this.baseClass;\n if (baseClass) {\n for (const property of await baseClass.getProperties()) {\n if (!cache.has(property.name.toUpperCase())) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n }\n\n if (this._properties) {\n this._properties.forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\n protected buildPropertyCacheSync(): Map<string, Property> {\n const cache = new Map<string, Property>();\n const baseClass = this.getBaseClassSync();\n if (baseClass) {\n for (const property of baseClass.getPropertiesSync()) {\n if (!cache.has(property.name.toUpperCase())) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n }\n\n if (this._properties) {\n this._properties.forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n * Clears all caches on this object. This is called implicitly for this class,\n * but needs to be called if derived classes have changed.\n * @internal\n */\n public cleanCache() {\n this._mergedPropertyCache = undefined;\n }\n\n /**\n * Returns the properties on this class and its base classes.\n * Since this is an expensive operation, results will be cached after first call.\n * @param excludeInherited If true, only properties defined directly on this class will be returned. Defaults to false.\n * @returns An array of properties, empty array if none exist.\n */\n public getPropertiesSync(excludeInherited?: boolean): Iterable<Property> {\n if (excludeInherited) {\n return this._properties && this._properties.size > 0 ? this._properties.values() : [];\n }\n\n if (!this._mergedPropertyCache) {\n this._mergedPropertyCache = this.buildPropertyCacheSync();\n }\n\n return this._mergedPropertyCache.values();\n }\n\n /**\n * Quick way to check whether this class has any local properties without having to use the iterable\n */\n public get hasLocalProperties(): boolean {\n return this._properties !== undefined && this._properties.size > 0;\n }\n\n /**\n * Returns the properties on this class and its base classes.\n * Since this is an expensive operation, results will be cached after first call.\n * @param excludeInherited If true, only properties defined directly on this class will be returned.\n * @returns An array of properties, empty array if none exist.\n */\n public async getProperties(excludeInherited?: boolean): Promise<Iterable<Property>> {\n // At the moment we do not lazy load properties, so this is the same as getPropertiesSync\n return this.getPropertiesSync(excludeInherited);\n }\n\n /**\n * Retrieve all custom attributes in the current class and its bases\n * This is the async version of getCustomAttributesSync()\n */\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\n return this.getCustomAttributesSync();\n }\n\n /**\n * Retrieve all custom attributes in the current class and its bases.\n */\n public getCustomAttributesSync(): CustomAttributeSet {\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\n if (undefined === customAttributes) {\n customAttributes = new Map<string, CustomAttribute>();\n }\n\n this.traverseBaseClassesSync((ecClass: ECClass) => {\n if (undefined === ecClass.customAttributes)\n return false;\n\n for (const [className, customAttribute] of ecClass.customAttributes) {\n if (customAttributes.has(className))\n continue;\n customAttributes.set(className, customAttribute);\n }\n\n return false;\n });\n\n return customAttributes;\n }\n\n /**\n * Asynchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\n * function for each base class encountered.\n * @param callback The function to call for each base class in the hierarchy.\n * @param arg An argument that will be passed as the second parameter to the callback function.\n */\n public async traverseBaseClasses(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): Promise<boolean> {\n for await (const baseClass of this.getAllBaseClasses()) {\n if (callback(baseClass, arg))\n return true;\n }\n\n return false;\n }\n\n /**\n * Synchronously traverses through the inheritance tree, using depth-first traversal, calling the given callback\n * function for each base class encountered.\n * @param callback The function to call for each base class in the hierarchy.\n * @param arg An argument that will be passed as the second parameter to the callback function.\n */\n public traverseBaseClassesSync(callback: (ecClass: ECClass, arg?: any) => boolean, arg?: any): boolean {\n const baseClasses = this.getAllBaseClassesSync();\n if (!baseClasses)\n return false;\n\n for (const baseClass of baseClasses) {\n if (callback(baseClass, arg))\n return true;\n }\n\n return false;\n }\n\n /**\n * Indicates if the targetClass is of this type.\n * @param targetClass The ECClass or ECClass name to check.\n * @param schemaName The schema name. Required if targetClass is the ECClass name.\n */\n public async is(targetClass: string, schemaName: string): Promise<boolean>;\n public async is(targetClass: ECClass): Promise<boolean>;\n public async is(targetClass: ECClass | string, schemaName?: string): Promise<boolean> {\n return typeof targetClass === \"string\"\n ? this.isSync(targetClass, schemaName ?? \"\")\n : this.isSync(targetClass);\n }\n\n /**\n * A synchronous version of the [[ECClass.is]], indicating if the targetClass is of this type.\n * @param targetClass The class to check.\n */\n public isSync(targetClass: ECClass): boolean;\n public isSync(targetClass: string, schemaName: string): boolean;\n\n /** @internal */\n public isSync(targetClass: ECClass | string, schemaName?: string): boolean {\n let targetSchemaKey: SchemaItemKey | undefined;\n if (schemaName !== undefined) {\n assert(typeof (targetClass) === \"string\", \"Expected targetClass of type string because schemaName was specified\");\n\n targetSchemaKey = new SchemaItemKey(targetClass, new SchemaKey(schemaName));\n if (SchemaItem.equalByKey(this, targetSchemaKey))\n return true;\n\n } else {\n assert(ECClass.isECClass(targetClass), \"Expected targetClass to be of type ECClass\");\n\n if (SchemaItem.equalByKey(this, targetClass))\n return true;\n\n targetSchemaKey = targetClass.key;\n }\n\n for (const baseClassKey of this.schema.context.classHierarchy.getBaseClassKeys(this.key)) {\n if (baseClassKey.matchesFullName(targetSchemaKey.fullName)) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * @internal\n */\n public static isECClass(object: any): object is ECClass {\n if (!SchemaItem.isSchemaItem(object))\n return false;\n\n return object.schemaItemType === SchemaItemType.EntityClass || object.schemaItemType === SchemaItemType.Mixin || object.schemaItemType === SchemaItemType.RelationshipClass ||\n object.schemaItemType === SchemaItemType.StructClass || object.schemaItemType === SchemaItemType.CustomAttributeClass;\n }\n\n /**\n * A setter method for the ECClass modifier, used specifically for schema editing.\n * @param modifier\n * @internal\n */\n protected setModifier(modifier: ECClassModifier) {\n this._modifier = modifier;\n }\n}\n\n/**\n * A Typescript class representation of an ECStructClass.\n * @public @preview\n */\nexport class StructClass extends ECClass {\n /**\n * Get the type of item represented by this instance\n */\n public override readonly schemaItemType = StructClass.schemaItemType;\n\n /**\n * Get the type of item represented by this class\n * @internal\n */\n public static override get schemaItemType() { return SchemaItemType.StructClass; }\n /**\n * Type guard to check if the SchemaItem is of type StructClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is a StructClass, false otherwise.\n */\n public static isStructClass(item?: SchemaItem): item is StructClass {\n if (item && item.schemaItemType === SchemaItemType.StructClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type StructClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to StructClass if it is a StructClass, undefined otherwise.\n * @internal\n */\n public static assertIsStructClass(item?: SchemaItem): asserts item is StructClass {\n if (!this.isStructClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.StructClass}' (StructClass)`);\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableStructClass extends StructClass {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableClass extends ECClass {\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override setModifier(modifier: ECClassModifier): void;\n public abstract override setName(name: string): void;\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\n\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\n\n public abstract override deleteProperty(name: string): Promise<void>;\n public abstract override deletePropertySync(name: string): void;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"EntityClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAEhE,OAAO,EAA0B,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEzF,OAAO,EAAE,SAAS,EAAE,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E,MAAM,GAAG,iBAAiB,GAAG,kBAAkB;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE;AAED,gBAAgB;AAChB,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsB3L;AAED,gBAAgB;AAChB,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,kBAAkB,CAsBhL"}
@@ -259,7 +259,7 @@ async function createNavigationProperty(ecClass, name, relationship, direction)
259
259
  else
260
260
  resolvedRelationship = relationship;
261
261
  if (!resolvedRelationship)
262
- throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string
262
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${typeof relationship === "string" ? relationship : relationship.fullName}, is not a valid RelationshipClassInterface.`);
263
263
  if (typeof (direction) === "string") {
264
264
  const tmpDirection = (0, ECObjects_1.parseStrengthDirection)(direction);
265
265
  if (undefined === tmpDirection)
@@ -280,7 +280,7 @@ function createNavigationPropertySync(ecClass, name, relationship, direction) {
280
280
  else
281
281
  resolvedRelationship = relationship;
282
282
  if (!resolvedRelationship)
283
- throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string
283
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${typeof relationship === "string" ? relationship : relationship.fullName}, is not a valid RelationshipClassInterface.`);
284
284
  if (typeof (direction) === "string") {
285
285
  const tmpDirection = (0, ECObjects_1.parseStrengthDirection)(direction);
286
286
  if (undefined === tmpDirection)