@itwin/ecschema-metadata 5.2.0-dev.8 → 5.2.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 (200) hide show
  1. package/CHANGELOG.md +46 -1
  2. package/lib/cjs/Constants.js.map +1 -1
  3. package/lib/cjs/DelayedPromise.js.map +1 -1
  4. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  5. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  6. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  7. package/lib/cjs/Deserialization/JsonProps.d.ts +9 -2
  8. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  9. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  10. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  11. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  12. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  13. package/lib/cjs/ECName.js.map +1 -1
  14. package/lib/cjs/ECObjects.js.map +1 -1
  15. package/lib/cjs/Exception.js.map +1 -1
  16. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts +37 -0
  17. package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
  18. package/lib/cjs/Formatting/FormatSetFormatsProvider.js +58 -0
  19. package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -0
  20. package/lib/cjs/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
  21. package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
  22. package/lib/cjs/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
  23. package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -0
  24. package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -1
  25. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
  26. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
  27. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +62 -34
  28. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  29. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -1
  30. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +466 -465
  31. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  32. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +20 -3
  33. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
  34. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +7 -4
  35. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  36. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
  37. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +2 -7
  38. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  39. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
  40. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
  41. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +17 -17
  42. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  43. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +235 -235
  44. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  45. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +10 -4
  46. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -1
  47. package/lib/cjs/IncrementalLoading/SchemaParser.js +19 -19
  48. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -1
  49. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -1
  50. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +309 -326
  51. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  52. package/lib/cjs/Interfaces.js.map +1 -1
  53. package/lib/cjs/Metadata/Class.js.map +1 -1
  54. package/lib/cjs/Metadata/Constant.js.map +1 -1
  55. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  56. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  57. package/lib/cjs/Metadata/EntityClass.js +1 -1
  58. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  59. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  60. package/lib/cjs/Metadata/Format.js.map +1 -1
  61. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  62. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  63. package/lib/cjs/Metadata/KindOfQuantity.js +9 -22
  64. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  65. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  66. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  67. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  68. package/lib/cjs/Metadata/Property.js.map +1 -1
  69. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  70. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  71. package/lib/cjs/Metadata/Schema.d.ts +2 -0
  72. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  73. package/lib/cjs/Metadata/Schema.js +4 -0
  74. package/lib/cjs/Metadata/Schema.js.map +1 -1
  75. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  76. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  77. package/lib/cjs/PropertyTypes.js.map +1 -1
  78. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  79. package/lib/cjs/SchemaKey.js.map +1 -1
  80. package/lib/cjs/SchemaLoader.js.map +1 -1
  81. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  82. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  83. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  84. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  85. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  86. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  87. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  88. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  89. package/lib/cjs/ecschema-metadata.d.ts +2 -1
  90. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  91. package/lib/cjs/ecschema-metadata.js +2 -1
  92. package/lib/cjs/ecschema-metadata.js.map +1 -1
  93. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  94. package/lib/cjs/utils/SchemaLoadingController.js.map +1 -1
  95. package/lib/esm/Constants.js.map +1 -1
  96. package/lib/esm/DelayedPromise.js.map +1 -1
  97. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  98. package/lib/esm/Deserialization/Helper.js.map +1 -1
  99. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  100. package/lib/esm/Deserialization/JsonProps.d.ts +9 -2
  101. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  102. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  103. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  104. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  105. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  106. package/lib/esm/ECName.js.map +1 -1
  107. package/lib/esm/ECObjects.js.map +1 -1
  108. package/lib/esm/Exception.js.map +1 -1
  109. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts +37 -0
  110. package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts.map +1 -0
  111. package/lib/esm/Formatting/FormatSetFormatsProvider.js +54 -0
  112. package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -0
  113. package/lib/esm/{SchemaFormatsProvider.d.ts → Formatting/SchemaFormatsProvider.d.ts} +1 -1
  114. package/lib/esm/Formatting/SchemaFormatsProvider.d.ts.map +1 -0
  115. package/lib/esm/{SchemaFormatsProvider.js → Formatting/SchemaFormatsProvider.js} +6 -6
  116. package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -0
  117. package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -1
  118. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +18 -24
  119. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -1
  120. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +61 -33
  121. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
  122. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -1
  123. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +466 -465
  124. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -1
  125. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +20 -3
  126. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -1
  127. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +7 -4
  128. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
  129. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -1
  130. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +2 -7
  131. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -1
  132. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +4 -4
  133. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -1
  134. package/lib/esm/IncrementalLoading/SchemaItemParsers.js +17 -17
  135. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -1
  136. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +235 -235
  137. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -1
  138. package/lib/esm/IncrementalLoading/SchemaParser.d.ts +10 -4
  139. package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -1
  140. package/lib/esm/IncrementalLoading/SchemaParser.js +19 -19
  141. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -1
  142. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -1
  143. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +309 -326
  144. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -1
  145. package/lib/esm/Interfaces.js.map +1 -1
  146. package/lib/esm/Metadata/Class.js.map +1 -1
  147. package/lib/esm/Metadata/Constant.js.map +1 -1
  148. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  149. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  150. package/lib/esm/Metadata/EntityClass.js +1 -1
  151. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  152. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  153. package/lib/esm/Metadata/Format.js.map +1 -1
  154. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  155. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  156. package/lib/esm/Metadata/KindOfQuantity.js +9 -22
  157. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  158. package/lib/esm/Metadata/Mixin.js.map +1 -1
  159. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  160. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  161. package/lib/esm/Metadata/Property.js.map +1 -1
  162. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  163. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  164. package/lib/esm/Metadata/Schema.d.ts +2 -0
  165. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  166. package/lib/esm/Metadata/Schema.js +4 -0
  167. package/lib/esm/Metadata/Schema.js.map +1 -1
  168. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  169. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  170. package/lib/esm/PropertyTypes.js.map +1 -1
  171. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  172. package/lib/esm/SchemaKey.js.map +1 -1
  173. package/lib/esm/SchemaLoader.js.map +1 -1
  174. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  175. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  176. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  177. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  178. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  179. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  180. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  181. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  182. package/lib/esm/ecschema-metadata.d.ts +2 -1
  183. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  184. package/lib/esm/ecschema-metadata.js +2 -1
  185. package/lib/esm/ecschema-metadata.js.map +1 -1
  186. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  187. package/lib/esm/utils/SchemaLoadingController.js.map +1 -1
  188. package/package.json +6 -6
  189. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +0 -60
  190. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
  191. package/lib/cjs/IncrementalLoading/PerformanceLogger.js +0 -82
  192. package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +0 -1
  193. package/lib/cjs/SchemaFormatsProvider.d.ts.map +0 -1
  194. package/lib/cjs/SchemaFormatsProvider.js.map +0 -1
  195. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +0 -60
  196. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +0 -1
  197. package/lib/esm/IncrementalLoading/PerformanceLogger.js +0 -78
  198. package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +0 -1
  199. package/lib/esm/SchemaFormatsProvider.d.ts.map +0 -1
  200. package/lib/esm/SchemaFormatsProvider.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Mixin.js","sour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QAAQ,GAAG,CAAC,CAAC;QAE/G,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC;QACvC,IAAI,SAAS,KAAK,SAAS;YACzB,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,WAAW,EAAE,kCAAkC,IAAI,CAAC,SAAS,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEpH,OAAO,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,OAAO,CAAC,IAAiB;QACrC,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,KAAK;YACtD,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACrB,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,KAAK,WAAW,CAAC,CAAC;IAChH,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;CAK/C","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 { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { MixinProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { ECClassModifier, SchemaItemType, StrengthDirection } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { LazyLoadedEntityClass } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { createNavigationProperty, createNavigationPropertySync, EntityClass } from \"./EntityClass\";\nimport { NavigationProperty } from \"./Property\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Typescript class representation of a Mixin.\n * @public @preview\n */\nexport class Mixin extends ECClass {\n public override readonly schemaItemType = Mixin.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.Mixin; }\n private _appliesTo?: LazyLoadedEntityClass;\n\n public get appliesTo(): LazyLoadedEntityClass | undefined {\n return this._appliesTo;\n }\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n super(schema, name, ECClassModifier.Abstract);\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @returns\n *\n * @internal\n */\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * @internal\n */\n protected setAppliesTo(appliesTo: LazyLoadedEntityClass) {\n this._appliesTo = appliesTo;\n }\n\n /**\n * Save this Mixin's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): MixinProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (undefined !== this.appliesTo) {\n schemaJson.appliesTo = this.appliesTo.fullName;\n }\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n\n // When CustomAttributes are added, there must be a check to see if the ECCustomAttributes\n // already exist for this item before creating a new one to apply IsMixin\n const customAttributes = schemaXml.createElement(\"ECCustomAttributes\");\n const isMixinElement = schemaXml.createElement(\"IsMixin\");\n const coreCustomSchema = this.schema.getReferenceSync(\"CoreCustomAttributes\");\n if (undefined !== coreCustomSchema) {\n const xmlns = `CoreCustomAttributes.${coreCustomSchema.schemaKey.version.toString()}`;\n isMixinElement.setAttribute(\"xmlns\", xmlns);\n }\n\n const appliesToElement = schemaXml.createElement(\"AppliesToEntityClass\");\n const appliesTo = await this.appliesTo;\n if (undefined !== appliesTo) {\n const appliesToName = XmlSerializationUtils.createXmlTypedName(this.schema, appliesTo.schema, appliesTo.name);\n appliesToElement.textContent = appliesToName;\n isMixinElement.appendChild(appliesToElement);\n }\n\n customAttributes.appendChild(isMixinElement);\n itemElement.appendChild(customAttributes);\n\n return itemElement;\n }\n\n public override fromJSONSync(mixinProps: MixinProps) {\n super.fromJSONSync(mixinProps);\n const entityClassSchemaItemKey = this.schema.getSchemaItemKey(mixinProps.appliesTo);\n if (!entityClassSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the appliesTo ${mixinProps.appliesTo}.`);\n this._appliesTo = new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(entityClassSchemaItemKey,\n async () => {\n const appliesTo = await this.schema.lookupItem(entityClassSchemaItemKey, EntityClass);\n if (undefined === appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the appliesTo ${mixinProps.appliesTo}.`);\n return appliesTo;\n });\n }\n\n public override async fromJSON(mixinProps: MixinProps) {\n this.fromJSONSync(mixinProps);\n }\n\n public async applicableTo(entityClass: EntityClass) {\n if (!this.appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `appliesTo is undefined in the class ${this.fullName}.`);\n\n const appliesTo = await this.appliesTo;\n if (appliesTo === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `Unable to locate the appliesTo ${this.appliesTo.fullName}.`);\n\n return appliesTo.is(entityClass);\n }\n\n /**\n * Type guard to check if the SchemaItem is of type Mixin.\n * @param item The SchemaItem to check.\n * @returns True if the item is a Mixin, false otherwise.\n */\n public static isMixin(item?: SchemaItem): item is Mixin {\n if (item && item.schemaItemType === SchemaItemType.Mixin)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type Mixin.\n * @param item The SchemaItem to check.\n * @returns The item cast to Mixin if it is a Mixin, undefined otherwise.\n * @internal\n */\n public static assertIsMixin(item?: SchemaItem): asserts item is Mixin {\n if (!this.isMixin(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Mixin}' (Mixin)`);\n }\n}\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableMixin extends Mixin {\n public abstract override setAppliesTo(entityClass: LazyLoadedEntityClass): void;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"Mixin.js","sourceRoot":"","sources":["../../../src/Metadata/Mixin.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,eAAe,EAAE,cAAc,EAAqB,MAAM,cAAc,CAAC;AAClF,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAMpG;;;GAGG;AACH,MAAM,OAAO,KAAM,SAAQ,OAAO;IACP,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IA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CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;YACrB,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,KAAK,WAAW,CAAC,CAAC;IAChH,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;CAK/C","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { MixinProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { ECClassModifier, SchemaItemType, StrengthDirection } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { LazyLoadedEntityClass } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { ECClass } from \"./Class\";\r\nimport { createNavigationProperty, createNavigationPropertySync, EntityClass } from \"./EntityClass\";\r\nimport { NavigationProperty } from \"./Property\";\r\nimport { RelationshipClass } from \"./RelationshipClass\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Typescript class representation of a Mixin.\r\n * @public @preview\r\n */\r\nexport class Mixin extends ECClass {\r\n public override readonly schemaItemType = Mixin.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.Mixin; }\r\n private _appliesTo?: LazyLoadedEntityClass;\r\n\r\n public get appliesTo(): LazyLoadedEntityClass | undefined {\r\n return this._appliesTo;\r\n }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name, ECClassModifier.Abstract);\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param relationship\r\n * @param direction\r\n * @internal\r\n */\r\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\r\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param relationship\r\n * @param direction\r\n * @returns\r\n *\r\n * @internal\r\n */\r\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\r\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setAppliesTo(appliesTo: LazyLoadedEntityClass) {\r\n this._appliesTo = appliesTo;\r\n }\r\n\r\n /**\r\n * Save this Mixin's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): MixinProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n if (undefined !== this.appliesTo) {\r\n schemaJson.appliesTo = this.appliesTo.fullName;\r\n }\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n // When CustomAttributes are added, there must be a check to see if the ECCustomAttributes\r\n // already exist for this item before creating a new one to apply IsMixin\r\n const customAttributes = schemaXml.createElement(\"ECCustomAttributes\");\r\n const isMixinElement = schemaXml.createElement(\"IsMixin\");\r\n const coreCustomSchema = this.schema.getReferenceSync(\"CoreCustomAttributes\");\r\n if (undefined !== coreCustomSchema) {\r\n const xmlns = `CoreCustomAttributes.${coreCustomSchema.schemaKey.version.toString()}`;\r\n isMixinElement.setAttribute(\"xmlns\", xmlns);\r\n }\r\n\r\n const appliesToElement = schemaXml.createElement(\"AppliesToEntityClass\");\r\n const appliesTo = await this.appliesTo;\r\n if (undefined !== appliesTo) {\r\n const appliesToName = XmlSerializationUtils.createXmlTypedName(this.schema, appliesTo.schema, appliesTo.name);\r\n appliesToElement.textContent = appliesToName;\r\n isMixinElement.appendChild(appliesToElement);\r\n }\r\n\r\n customAttributes.appendChild(isMixinElement);\r\n itemElement.appendChild(customAttributes);\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(mixinProps: MixinProps) {\r\n super.fromJSONSync(mixinProps);\r\n const entityClassSchemaItemKey = this.schema.getSchemaItemKey(mixinProps.appliesTo);\r\n if (!entityClassSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the appliesTo ${mixinProps.appliesTo}.`);\r\n this._appliesTo = new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(entityClassSchemaItemKey,\r\n async () => {\r\n const appliesTo = await this.schema.lookupItem(entityClassSchemaItemKey, EntityClass);\r\n if (undefined === appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the appliesTo ${mixinProps.appliesTo}.`);\r\n return appliesTo;\r\n });\r\n }\r\n\r\n public override async fromJSON(mixinProps: MixinProps) {\r\n this.fromJSONSync(mixinProps);\r\n }\r\n\r\n public async applicableTo(entityClass: EntityClass) {\r\n if (!this.appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `appliesTo is undefined in the class ${this.fullName}.`);\r\n\r\n const appliesTo = await this.appliesTo;\r\n if (appliesTo === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `Unable to locate the appliesTo ${this.appliesTo.fullName}.`);\r\n\r\n return appliesTo.is(entityClass);\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type Mixin.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a Mixin, false otherwise.\r\n */\r\n public static isMixin(item?: SchemaItem): item is Mixin {\r\n if (item && item.schemaItemType === SchemaItemType.Mixin)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type Mixin.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to Mixin if it is a Mixin, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsMixin(item?: SchemaItem): asserts item is Mixin {\r\n if (!this.isMixin(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Mixin}' (Mixin)`);\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableMixin extends Mixin {\r\n public abstract override setAppliesTo(entityClass: LazyLoadedEntityClass): void;\r\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\r\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"OverrideFormat.js","sourceRoot":"","sources":["../../../src/Metadata/OverrideFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAiC,eAAe,EAAiF,MAAM,sBAAsB,CAAC;AAMrK,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAW7D;;;GAGG;AACH,MAAM,OAAO,cAAc;IACjB,UAAU,CAA0C;IACpD,MAAM,CAAwE;IAEtF,uDAAuD;IACvC,MAAM,CAAS;IAE/B;;;OAGG;IACa,IAAI,CAAS;IAE7B,gBAAgB;IAChB,YAAY,MAAc,EAAE,SAAkD,EAAE,aAAoF;QAClK,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC,4BAA4B,CAAC,MAAM,EAAE,SAAS,EA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KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC3C,yEAAyE;YACzE,UAAU,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChC,UAAU,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3C,CAAC;QAED,sCAAsC;QACtC,UAAU,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEtC,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;YAC7B,kCAAkC;YAClC,MAAM,KAAK,GAAG,EAAE,CAAC;YACjB,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBAC9B,KAAK,CAAC,IAAI,CAAC;oBACT,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ;oBACtB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;iBACf,CAAC,CAAC;YACL,CAAC;YAED,UAAU,CAAC,SAAS,GAAG;gBACrB,MAAM,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBACvD,WAAW,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;gBACxE,KAAK;aACN,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAA+B;IAC5D,OAAO,cAAc,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { DecimalPrecision, FormatProps, formatStringRgx, FormatTraits, FormatType, FractionalPrecision, ScientificType, ShowSignOption } from \"@itwin/core-quantity\";\nimport { Format } from \"./Format\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItemOverrideFormatProps } from \"../Deserialization/JsonProps\";\nimport { Mutable } from \"@itwin/core-bentley\";\nimport { LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\n\n/**\n * @public @preview\n */\nexport interface OverrideFormatProps {\n readonly name: string;\n readonly precision?: number;\n readonly unitAndLabels?: Array<[string, string | undefined]>; // Tuple of [unit name | unit label]\n}\n\n/**\n * Overrides of a Format, from a Schema, and is SchemaItem that is used specifically on KindOfQuantity.\n * @public @preview\n */\nexport class OverrideFormat {\n private _precision?: DecimalPrecision | FractionalPrecision;\n private _units?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>;\n\n /** The Format that this OverrideFormat is extending */\n public readonly parent: Format;\n\n /** The name of this OverrideFormat.\n *\n * This should be set to the [FormatString]($docs/bis/ec/kindofquantity/#format-string) which represents the format override.\n */\n public readonly name: string;\n\n /** @internal */\n constructor(parent: Format, precision?: DecimalPrecision | FractionalPrecision, unitAndLabels?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>) {\n this.parent = parent;\n this.name = OverrideFormat.createOverrideFormatFullName(parent, precision, unitAndLabels);\n this._precision = precision;\n this._units = unitAndLabels;\n }\n\n // Properties that can be overriden\n public get precision(): DecimalPrecision | FractionalPrecision {\n return (undefined === this._precision) ? this.parent.precision : this._precision;\n }\n\n public get units(): ReadonlyArray<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined {\n return (undefined === this._units) ? this.parent.units : this._units;\n }\n\n // Properties that cannot be overriden\n public get fullName(): string { return this.name; }\n public get roundFactor(): number { return this.parent.roundFactor; }\n public get type(): FormatType { return this.parent.type; }\n public get minWidth(): number | undefined { return this.parent.minWidth; }\n public get scientificType(): ScientificType | undefined { return this.parent.scientificType; }\n public get showSignOption(): ShowSignOption { return this.parent.showSignOption; }\n public get decimalSeparator(): string { return this.parent.decimalSeparator; }\n public get thousandSeparator(): string { return this.parent.thousandSeparator; }\n public get uomSeparator(): string { return this.parent.uomSeparator; }\n public get stationSeparator(): string { return this.parent.stationSeparator; }\n public get stationOffsetSize(): number | undefined { return this.parent.stationOffsetSize; }\n public get formatTraits(): FormatTraits { return this.parent.formatTraits; }\n public get spacer(): string | undefined { return this.parent.spacer; }\n public get includeZero(): boolean | undefined { return this.parent.includeZero; }\n\n public hasFormatTrait(formatTrait: FormatTraits) {\n return (this.parent.formatTraits & formatTrait) === formatTrait;\n }\n\n /** Returns the format string of this override in the Xml full name format.\n * @internal\n */\n public fullNameXml(koqSchema: Schema): string {\n let fullName = XmlSerializationUtils.createXmlTypedName(koqSchema, this.parent.schema, this.parent.name);\n\n if (undefined !== this.precision)\n fullName += `(${this.precision.toString()})`;\n\n if (undefined === this._units)\n return fullName;\n for (const [unit, unitLabel] of this._units) {\n const unitSchema = koqSchema.context.getSchemaSync(unit.schemaKey);\n if(unitSchema === undefined)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The unit schema ${unit.schemaKey} is not found in the context.`);\n\n fullName += \"[\";\n fullName += XmlSerializationUtils.createXmlTypedName(koqSchema, unitSchema, unit.name);\n if (unitLabel !== undefined)\n fullName += `|${unitLabel}`;\n fullName += `]`;\n }\n return fullName;\n }\n\n /**\n * Creates a valid OverrideFormat fullName from the parent Format and overridden units.\n * @param parent The parent Format.\n * @param unitAndLabels The overridden unit and labels collection.\n */\n public static createOverrideFormatFullName(parent: Format, precision?: DecimalPrecision | FractionalPrecision, unitAndLabels?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): string {\n let fullName = parent.fullName;\n\n if (precision)\n fullName += `(${precision.toString()})`;\n\n if (undefined === unitAndLabels)\n return fullName;\n for (const [unit, unitLabel] of unitAndLabels)\n if (undefined === unitLabel)\n fullName += `[${unit.fullName}]`;\n else\n fullName += `[${unit.fullName}|${unitLabel}]`;\n return fullName;\n }\n\n /** Parses the format string into the parts that make up an Override Format\n * @param formatString\n */\n public static parseFormatString(formatString: string): OverrideFormatProps {\n const match = formatString.split(formatStringRgx); // split string based on regex groups\n if (undefined === match[1])\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The format string, ${formatString}, on KindOfQuantity is missing a format.`);\n\n let precision: OverrideFormatProps[\"precision\"];\n if (undefined !== match[2] && undefined !== match[3]) {\n const overrideString = match[2];\n const tokens: string[] = [];\n let prevPos = 1; // Initial position is the character directly after the opening '(' in the override string.\n let currPos;\n\n // TODO need to include `,` as a valid search argument.\n while (-1 !== (currPos = overrideString.indexOf(\")\", prevPos))) {\n tokens.push(overrideString.substring(prevPos, currPos));\n prevPos = currPos + 1;\n }\n\n if (overrideString.length > 0 && undefined === tokens.find((token) => {\n return \"\" !== token; // there is at least one token that is not empty.\n })) {\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n }\n\n // The first override parameter overrides the default precision of the format\n const precisionIndx: number = 0;\n if (tokens.length >= precisionIndx + 1) {\n if (tokens[precisionIndx].length > 0) {\n precision = Number.parseInt(tokens[precisionIndx], 10);\n if (Number.isNaN(precision))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The format string '${formatString}' on KindOfQuantity has a precision override '${tokens[precisionIndx]}' that is not number.`);\n }\n }\n }\n\n let i = 4;\n let unitAndLabels: OverrideFormatProps[\"unitAndLabels\"];\n while (i < match.length - 1) { // The regex match ends with an empty last value, which causes problems when exactly 4 unit overrides as specified, so ignore this last empty value\n if (undefined === match[i])\n break;\n // Unit override required\n if (undefined === match[i + 1])\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n\n if (undefined === unitAndLabels)\n unitAndLabels = [];\n\n if (undefined !== match[i + 2]) // matches '|'\n unitAndLabels.push([match[i + 1], match[i + 3] ?? \"\"]); // add unit name and label override (if '|' matches and next value is undefined, save it as an empty string)\n else\n unitAndLabels.push([match[i + 1], undefined]); // add unit name\n\n i += 4;\n }\n\n return { name: match[1], precision, unitAndLabels };\n }\n\n /**\n * @internal\n */\n public static isOverrideFormat(format: unknown): format is OverrideFormat {\n const overrideFormat = format as Partial<OverrideFormat>;\n\n return overrideFormat !== undefined && overrideFormat.name !== undefined && overrideFormat.parent !== undefined && overrideFormat.parent.schemaItemType === SchemaItemType.Format;\n }\n\n /**\n * Returns a JSON object that contains the specification for the OverrideFormat where the precision and units properties have been overriden.\n * If the precision and/or units properties have been overriden, the returned object will contain a \"name\" and a \"parent\" property.\n * The \"name\" property identifies the OverrideFormat object itself and the \"parent\" property identifies the Format that has been overriden.\n * This method is not intended for complete serialization as it does not serialize any of the schema item properties.\n */\n public getFormatProps(): SchemaItemOverrideFormatProps {\n const formatJson = this.parent.toJSON() as Mutable<SchemaItemOverrideFormatProps>;\n\n if (this.parent.fullName !== this.fullName) {\n // Update name and parent properties to distinguish it from parent Format\n formatJson.name = this.fullName;\n formatJson.parent = this.parent.fullName;\n }\n\n // Update Precision overriden property\n formatJson.precision = this.precision;\n\n if (this.units !== undefined) {\n // Update Units overriden property\n const units = [];\n for (const unit of this.units) {\n units.push({\n name: unit[0].fullName,\n label: unit[1],\n });\n }\n\n formatJson.composite = {\n spacer: (this.spacer !== \" \") ? this.spacer : undefined,\n includeZero: (this.includeZero === false) ? this.includeZero : undefined,\n units,\n };\n }\n\n return formatJson;\n }\n}\n\n/**\n * @internal\n */\nexport function getFormatProps(format: Format | OverrideFormat): FormatProps {\n return OverrideFormat.isOverrideFormat(format) ? format.getFormatProps() : format.toJSON();\n}\n"]}
1
+ {"version":3,"file":"OverrideFormat.js","sourceRoot":"","sources":["../../../src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AAE,CAAC,IAAI,CAAC,MAAM,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;gBACvD,WAAW,EAAE,CAAC,IAAI,CAAC,WAAW,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,SAAS;gBACxE,KAAK;aACN,CAAC;QACJ,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,MAA+B;IAC5D,OAAO,cAAc,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;AAC7F,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { DecimalPrecision, FormatProps, formatStringRgx, FormatTraits, FormatType, FractionalPrecision, ScientificType, ShowSignOption } from \"@itwin/core-quantity\";\r\nimport { Format } from \"./Format\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItemOverrideFormatProps } from \"../Deserialization/JsonProps\";\r\nimport { Mutable } from \"@itwin/core-bentley\";\r\nimport { LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport interface OverrideFormatProps {\r\n readonly name: string;\r\n readonly precision?: number;\r\n readonly unitAndLabels?: Array<[string, string | undefined]>; // Tuple of [unit name | unit label]\r\n}\r\n\r\n/**\r\n * Overrides of a Format, from a Schema, and is SchemaItem that is used specifically on KindOfQuantity.\r\n * @public @preview\r\n */\r\nexport class OverrideFormat {\r\n private _precision?: DecimalPrecision | FractionalPrecision;\r\n private _units?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>;\r\n\r\n /** The Format that this OverrideFormat is extending */\r\n public readonly parent: Format;\r\n\r\n /** The name of this OverrideFormat.\r\n *\r\n * This should be set to the [FormatString]($docs/bis/ec/kindofquantity/#format-string) which represents the format override.\r\n */\r\n public readonly name: string;\r\n\r\n /** @internal */\r\n constructor(parent: Format, precision?: DecimalPrecision | FractionalPrecision, unitAndLabels?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>) {\r\n this.parent = parent;\r\n this.name = OverrideFormat.createOverrideFormatFullName(parent, precision, unitAndLabels);\r\n this._precision = precision;\r\n this._units = unitAndLabels;\r\n }\r\n\r\n // Properties that can be overriden\r\n public get precision(): DecimalPrecision | FractionalPrecision {\r\n return (undefined === this._precision) ? this.parent.precision : this._precision;\r\n }\r\n\r\n public get units(): ReadonlyArray<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined {\r\n return (undefined === this._units) ? this.parent.units : this._units;\r\n }\r\n\r\n // Properties that cannot be overriden\r\n public get fullName(): string { return this.name; }\r\n public get roundFactor(): number { return this.parent.roundFactor; }\r\n public get type(): FormatType { return this.parent.type; }\r\n public get minWidth(): number | undefined { return this.parent.minWidth; }\r\n public get scientificType(): ScientificType | undefined { return this.parent.scientificType; }\r\n public get showSignOption(): ShowSignOption { return this.parent.showSignOption; }\r\n public get decimalSeparator(): string { return this.parent.decimalSeparator; }\r\n public get thousandSeparator(): string { return this.parent.thousandSeparator; }\r\n public get uomSeparator(): string { return this.parent.uomSeparator; }\r\n public get stationSeparator(): string { return this.parent.stationSeparator; }\r\n public get stationOffsetSize(): number | undefined { return this.parent.stationOffsetSize; }\r\n public get formatTraits(): FormatTraits { return this.parent.formatTraits; }\r\n public get spacer(): string | undefined { return this.parent.spacer; }\r\n public get includeZero(): boolean | undefined { return this.parent.includeZero; }\r\n\r\n public hasFormatTrait(formatTrait: FormatTraits) {\r\n return (this.parent.formatTraits & formatTrait) === formatTrait;\r\n }\r\n\r\n /** Returns the format string of this override in the Xml full name format.\r\n * @internal\r\n */\r\n public fullNameXml(koqSchema: Schema): string {\r\n let fullName = XmlSerializationUtils.createXmlTypedName(koqSchema, this.parent.schema, this.parent.name);\r\n\r\n if (undefined !== this.precision)\r\n fullName += `(${this.precision.toString()})`;\r\n\r\n if (undefined === this._units)\r\n return fullName;\r\n for (const [unit, unitLabel] of this._units) {\r\n const unitSchema = koqSchema.context.getSchemaSync(unit.schemaKey);\r\n if(unitSchema === undefined)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The unit schema ${unit.schemaKey} is not found in the context.`);\r\n\r\n fullName += \"[\";\r\n fullName += XmlSerializationUtils.createXmlTypedName(koqSchema, unitSchema, unit.name);\r\n if (unitLabel !== undefined)\r\n fullName += `|${unitLabel}`;\r\n fullName += `]`;\r\n }\r\n return fullName;\r\n }\r\n\r\n /**\r\n * Creates a valid OverrideFormat fullName from the parent Format and overridden units.\r\n * @param parent The parent Format.\r\n * @param unitAndLabels The overridden unit and labels collection.\r\n */\r\n public static createOverrideFormatFullName(parent: Format, precision?: DecimalPrecision | FractionalPrecision, unitAndLabels?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): string {\r\n let fullName = parent.fullName;\r\n\r\n if (precision)\r\n fullName += `(${precision.toString()})`;\r\n\r\n if (undefined === unitAndLabels)\r\n return fullName;\r\n for (const [unit, unitLabel] of unitAndLabels)\r\n if (undefined === unitLabel)\r\n fullName += `[${unit.fullName}]`;\r\n else\r\n fullName += `[${unit.fullName}|${unitLabel}]`;\r\n return fullName;\r\n }\r\n\r\n /** Parses the format string into the parts that make up an Override Format\r\n * @param formatString\r\n */\r\n public static parseFormatString(formatString: string): OverrideFormatProps {\r\n const match = formatString.split(formatStringRgx); // split string based on regex groups\r\n if (undefined === match[1])\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The format string, ${formatString}, on KindOfQuantity is missing a format.`);\r\n\r\n let precision: OverrideFormatProps[\"precision\"];\r\n if (undefined !== match[2] && undefined !== match[3]) {\r\n const overrideString = match[2];\r\n const tokens: string[] = [];\r\n let prevPos = 1; // Initial position is the character directly after the opening '(' in the override string.\r\n let currPos;\r\n\r\n // TODO need to include `,` as a valid search argument.\r\n while (-1 !== (currPos = overrideString.indexOf(\")\", prevPos))) {\r\n tokens.push(overrideString.substring(prevPos, currPos));\r\n prevPos = currPos + 1;\r\n }\r\n\r\n if (overrideString.length > 0 && undefined === tokens.find((token) => {\r\n return \"\" !== token; // there is at least one token that is not empty.\r\n })) {\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n\r\n // The first override parameter overrides the default precision of the format\r\n const precisionIndx: number = 0;\r\n if (tokens.length >= precisionIndx + 1) {\r\n if (tokens[precisionIndx].length > 0) {\r\n precision = Number.parseInt(tokens[precisionIndx], 10);\r\n if (Number.isNaN(precision))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The format string '${formatString}' on KindOfQuantity has a precision override '${tokens[precisionIndx]}' that is not number.`);\r\n }\r\n }\r\n }\r\n\r\n let i = 4;\r\n let unitAndLabels: OverrideFormatProps[\"unitAndLabels\"];\r\n while (i < match.length - 1) { // The regex match ends with an empty last value, which causes problems when exactly 4 unit overrides as specified, so ignore this last empty value\r\n if (undefined === match[i])\r\n break;\r\n // Unit override required\r\n if (undefined === match[i + 1])\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n\r\n if (undefined === unitAndLabels)\r\n unitAndLabels = [];\r\n\r\n if (undefined !== match[i + 2]) // matches '|'\r\n unitAndLabels.push([match[i + 1], match[i + 3] ?? \"\"]); // add unit name and label override (if '|' matches and next value is undefined, save it as an empty string)\r\n else\r\n unitAndLabels.push([match[i + 1], undefined]); // add unit name\r\n\r\n i += 4;\r\n }\r\n\r\n return { name: match[1], precision, unitAndLabels };\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public static isOverrideFormat(format: unknown): format is OverrideFormat {\r\n const overrideFormat = format as Partial<OverrideFormat>;\r\n\r\n return overrideFormat !== undefined && overrideFormat.name !== undefined && overrideFormat.parent !== undefined && overrideFormat.parent.schemaItemType === SchemaItemType.Format;\r\n }\r\n\r\n /**\r\n * Returns a JSON object that contains the specification for the OverrideFormat where the precision and units properties have been overriden.\r\n * If the precision and/or units properties have been overriden, the returned object will contain a \"name\" and a \"parent\" property.\r\n * The \"name\" property identifies the OverrideFormat object itself and the \"parent\" property identifies the Format that has been overriden.\r\n * This method is not intended for complete serialization as it does not serialize any of the schema item properties.\r\n */\r\n public getFormatProps(): SchemaItemOverrideFormatProps {\r\n const formatJson = this.parent.toJSON() as Mutable<SchemaItemOverrideFormatProps>;\r\n\r\n if (this.parent.fullName !== this.fullName) {\r\n // Update name and parent properties to distinguish it from parent Format\r\n formatJson.name = this.fullName;\r\n formatJson.parent = this.parent.fullName;\r\n }\r\n\r\n // Update Precision overriden property\r\n formatJson.precision = this.precision;\r\n\r\n if (this.units !== undefined) {\r\n // Update Units overriden property\r\n const units = [];\r\n for (const unit of this.units) {\r\n units.push({\r\n name: unit[0].fullName,\r\n label: unit[1],\r\n });\r\n }\r\n\r\n formatJson.composite = {\r\n spacer: (this.spacer !== \" \") ? this.spacer : undefined,\r\n includeZero: (this.includeZero === false) ? this.includeZero : undefined,\r\n units,\r\n };\r\n }\r\n\r\n return formatJson;\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function getFormatProps(format: Format | OverrideFormat): FormatProps {\r\n return OverrideFormat.isOverrideFormat(format) ? format.getFormatProps() : format.toJSON();\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Phenomenon.js","sourceRoot":"","sources":["../../../src/Metadata/Phenomenon.ts"],"names":[],"mappings":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,WAAW,EAAE,KAAK,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;YACxG,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,kBAAkB,IAAI,CAAC,IAAI,yCAAyC,CAAC,CAAC;aACzH,IAAI,IAAI,CAAC,WAAW,KAAK,EAAE;YAC9B,IAAI,CAAC,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC;IAClD,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,eAAgC;QAC7D,IAAI,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACO,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,YAAY,CAAC,IAAiB;QAC1C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,UAAU;YAC3D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;YAC1B,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,UAAU,gBAAgB,CAAC,CAAC;IAC1H,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,UAAU;CAGzD","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 { PhenomenonProps } from \"../Deserialization/JsonProps\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/** @public @preview */\nexport class Phenomenon extends SchemaItem {\n public override readonly schemaItemType = Phenomenon.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.Phenomenon; }\n private _definition: string; // Contains a combination of Phenomena names which form this Phenomenon. Each Phenomena name is separated by a * and may have an exponent, specified using parentheses\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this._definition = \"\";\n }\n\n public get definition(): string { return this._definition; }\n\n /**\n * Save this Phenomenon's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PhenomenonProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.definition = this.definition;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"definition\", this.definition);\n return itemElement;\n }\n\n public override fromJSONSync(phenomenonProps: PhenomenonProps) {\n super.fromJSONSync(phenomenonProps);\n if (this._definition !== \"\" && phenomenonProps.definition.toLowerCase() !== this._definition.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this.name} has an invalid 'definition' attribute.`);\n else if (this._definition === \"\")\n this._definition = phenomenonProps.definition;\n }\n\n public override async fromJSON(phenomenonProps: PhenomenonProps) {\n this.fromJSONSync(phenomenonProps);\n }\n\n /**\n *\n * @param definition\n * @internal\n */\n protected async setDefinition(definition: string) {\n this._definition = definition;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type Phenomenon.\n * @param item The SchemaItem to check.\n * @returns True if the item is a Phenomenon, false otherwise.\n */\n public static isPhenomenon(item?: SchemaItem): item is Phenomenon {\n if (item && item.schemaItemType === SchemaItemType.Phenomenon)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type Phenomenon.\n * @param item The SchemaItem to check.\n * @returns The item cast to Phenomenon if it is a Phenomenon, undefined otherwise.\n * @internal\n */\n public static assertIsPhenomenon(item?: SchemaItem): asserts item is Phenomenon {\n if (!this.isPhenomenon(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Phenomenon}' (Phenomenon)`);\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutablePhenomenon extends Phenomenon {\n public abstract override setDefinition(definition: string): Promise<void>;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"Phenomenon.js","sourceRoot":"","sources":["../../../src/Metadata/Phenomenon.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,uBAAuB;AACvB,MAAM,OAAO,UAAW,SAAQ,UAAU;IACf,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IACpE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC;IACzE,WAAW,CAAS,CAAC,sKAAsK;IAEnM,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,UAAU,KAAa,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAE5D;;;;OAIG;IACa,MAAM,CAAC,aAAsB,KAAK,EAAE,uBAAgC,KAAK;QACvF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,UAAU,CA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Aa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,UAAU,gBAAgB,CAAC,CAAC;IAC1H,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,UAAU;CAGzD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { PhenomenonProps } from \"../Deserialization/JsonProps\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/** @public @preview */\r\nexport class Phenomenon extends SchemaItem {\r\n public override readonly schemaItemType = Phenomenon.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.Phenomenon; }\r\n private _definition: string; // Contains a combination of Phenomena names which form this Phenomenon. Each Phenomena name is separated by a * and may have an exponent, specified using parentheses\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this._definition = \"\";\r\n }\r\n\r\n public get definition(): string { return this._definition; }\r\n\r\n /**\r\n * Save this Phenomenon's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PhenomenonProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.definition = this.definition;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"definition\", this.definition);\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(phenomenonProps: PhenomenonProps) {\r\n super.fromJSONSync(phenomenonProps);\r\n if (this._definition !== \"\" && phenomenonProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Phenomenon ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = phenomenonProps.definition;\r\n }\r\n\r\n public override async fromJSON(phenomenonProps: PhenomenonProps) {\r\n this.fromJSONSync(phenomenonProps);\r\n }\r\n\r\n /**\r\n *\r\n * @param definition\r\n * @internal\r\n */\r\n protected async setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type Phenomenon.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a Phenomenon, false otherwise.\r\n */\r\n public static isPhenomenon(item?: SchemaItem): item is Phenomenon {\r\n if (item && item.schemaItemType === SchemaItemType.Phenomenon)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type Phenomenon.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to Phenomenon if it is a Phenomenon, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsPhenomenon(item?: SchemaItem): asserts item is Phenomenon {\r\n if (!this.isPhenomenon(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Phenomenon}' (Phenomenon)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePhenomenon extends Phenomenon {\r\n public abstract override setDefinition(definition: string): Promise<void>;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAA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IAC7B,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","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 { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport {\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\n} from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { Enumeration } from \"./Enumeration\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { type RelationshipClass } from \"./RelationshipClass\";\nimport { Schema } from \"./Schema\";\n\n/**\n * A common abstract class for all ECProperty types.\n * @public @preview\n */\nexport abstract class Property implements CustomAttributeContainerProps {\n private _name: ECName;\n private _class: AnyClass; // TODO: class seems to be unused?\n private _description?: string;\n private _label?: string;\n private _isReadOnly?: boolean;\n private _priority?: number;\n private _category?: LazyLoadedPropertyCategory;\n private _kindOfQuantity?: LazyLoadedKindOfQuantity;\n private _customAttributes?: Map<string, CustomAttribute>;\n\n /** @internal */\n protected _type: PropertyType;\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n this._class = ecClass as AnyClass;\n this._name = new ECName(name);\n this._type = type;\n }\n\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\n\n public get name() { return this._name.name; }\n\n public get class() { return this._class; }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get isReadOnly() { return this._isReadOnly || false; }\n\n public get priority(): number {\n if (this._priority === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.priority;\n }\n }\n\n return this._priority || 0;\n }\n\n public get category(): LazyLoadedPropertyCategory | undefined {\n if (this._category === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.category;\n }\n }\n\n return this._category;\n }\n\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\n if (this._kindOfQuantity === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.kindOfQuantity;\n }\n }\n\n return this._kindOfQuantity;\n }\n\n public get propertyType() { return this._type; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the name in the format 'ClassName.PropertyName'. */\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\n\n /** Returns the schema of the class holding the property. */\n public get schema(): Schema { return this._class.schema; }\n\n public getCategorySync(): PropertyCategory | undefined {\n if (!this._category) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.getCategorySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\n }\n\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\n if (!this._kindOfQuantity) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.getKindOfQuantitySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\n }\n\n /**\n * Save this Property's properties to an object for serializing to JSON.\n */\n public toJSON(): PropertyProps {\n const schemaJson: any = {};\n schemaJson.name = this.name;\n schemaJson.type = propertyTypeToString(this._type);\n if (this.description !== undefined)\n schemaJson.description = this.description;\n if (this.label !== undefined)\n schemaJson.label = this.label;\n if (this._isReadOnly !== undefined)\n schemaJson.isReadOnly = this._isReadOnly;\n if (this._category !== undefined)\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\n if (this._priority !== undefined)\n schemaJson.priority = this._priority;\n if (this._kindOfQuantity !== undefined)\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (customAttributes !== undefined)\n schemaJson.customAttributes = customAttributes;\n return schemaJson;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\n const itemElement = schemaXml.createElement(propType);\n itemElement.setAttribute(\"propertyName\", this.name);\n if (undefined !== this.description)\n itemElement.setAttribute(\"description\", this.description);\n if (undefined !== this.label)\n itemElement.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.isReadOnly)\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\n\n if (undefined !== this._category) {\n const category = await this._category;\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\n itemElement.setAttribute(\"category\", categoryName);\n }\n\n if (undefined !== this._priority)\n itemElement.setAttribute(\"priority\", this._priority.toString());\n\n if (undefined !== this._kindOfQuantity) {\n const kindOfQuantity = await this._kindOfQuantity;\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\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 fromJSONSync(propertyProps: PropertyProps) {\n if (undefined !== propertyProps.label) {\n this._label = propertyProps.label;\n }\n\n if (undefined !== propertyProps.description) {\n this._description = propertyProps.description;\n }\n\n if (undefined !== propertyProps.priority) {\n this._priority = propertyProps.priority;\n }\n\n if (undefined !== propertyProps.isReadOnly) {\n this._isReadOnly = propertyProps.isReadOnly;\n }\n\n if (undefined !== propertyProps.category) {\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\n if (!propertyCategorySchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\n async () => {\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\n if (undefined === category)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n return category;\n });\n }\n\n if (undefined !== propertyProps.kindOfQuantity) {\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\n if (!koqSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\n async () => {\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\n if (undefined === koq)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n return koq;\n });\n }\n }\n\n public async fromJSON(propertyProps: PropertyProps) {\n this.fromJSONSync(propertyProps);\n }\n\n /** @internal */\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /** @internal */\n protected setName(name: ECName) {\n this._name = name;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setLabel(label: string) {\n this._label = label;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setIsReadOnly(isReadOnly: boolean) {\n this._isReadOnly = isReadOnly;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setPriority(priority: number) {\n this._priority = priority;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setCategory(category: LazyLoadedPropertyCategory) {\n this._category = category;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\n this._kindOfQuantity = kindOfQuantity;\n }\n\n /**\n * Retrieve all custom attributes in the current property and its base\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 property and its base.\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 const baseProperty = this.class.getInheritedPropertySync(this.name);\n let baseCustomAttributes;\n if (undefined !== baseProperty)\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\n if (undefined !== baseCustomAttributes) {\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\n }\n\n return customAttributes;\n }\n /**\n * @internal\n */\n public static isProperty(object: any): object is AnyProperty {\n const property = object as Property;\n\n return property !== undefined && property.class !== undefined && property.name !== undefined\n && property.propertyType !== undefined;\n }\n}\n\n\n\n/** @public @preview */\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\n /** @internal */\n protected _extendedTypeName?: string;\n /** @internal */\n protected _minLength?: number;\n /** @internal */\n protected _maxLength?: number;\n /** @internal */\n protected _minValue?: number;\n /** @internal */\n protected _maxValue?: number;\n\n public get extendedTypeName() { return this._extendedTypeName; }\n public get minLength() { return this._minLength; }\n public get maxLength() { return this._maxLength; }\n public get minValue() { return this._minValue; }\n public get maxValue() { return this._maxValue; }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n super(ecClass, name, type);\n }\n\n /**\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\n const schemaJson = super.toJSON() as any;\n if (this.extendedTypeName !== undefined)\n schemaJson.extendedTypeName = this.extendedTypeName;\n if (this._minLength !== undefined)\n schemaJson.minLength = this.minLength;\n if (this._maxLength !== undefined)\n schemaJson.maxLength = this.maxLength;\n if (this._minValue !== undefined)\n schemaJson.minValue = this.minValue;\n if (this._maxValue !== undefined)\n schemaJson.maxValue = this.maxValue;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n if (undefined !== this.extendedTypeName)\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\n if (undefined !== this.minValue)\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\n if (undefined !== this.maxValue)\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\n if (undefined !== this.minLength)\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\n if (undefined !== this.maxLength)\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\n\n return itemElement;\n }\n\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n super.fromJSONSync(propertyBaseProps);\n\n if (undefined !== propertyBaseProps.minLength) {\n this._minLength = propertyBaseProps.minLength;\n }\n\n if (undefined !== propertyBaseProps.maxLength) {\n this._maxLength = propertyBaseProps.maxLength;\n }\n\n if (undefined !== propertyBaseProps.minValue) {\n this._minValue = propertyBaseProps.minValue;\n }\n\n if (undefined !== propertyBaseProps.maxValue) {\n this._maxValue = propertyBaseProps.maxValue;\n }\n\n if (undefined !== propertyBaseProps.extendedTypeName) {\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\n }\n }\n /**\n * @internal Used in schema editing.\n */\n protected setExtendedTypeName(extendedTypeName: string) {\n this._extendedTypeName = extendedTypeName;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinLength(minLength: number) {\n this._minLength = minLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxLength(maxLength: number) {\n this._maxLength = maxLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinValue(minValue: number) {\n this._minValue = minValue;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxValue(maxValue: number) {\n this._maxValue = maxValue;\n }\n\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n this.fromJSONSync(propertyBaseProps);\n }\n}\n\n/** @public @preview */\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\n }\n\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\n super.fromJSONSync(primitivePropertyProps);\n if (undefined !== primitivePropertyProps.typeName) {\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\n this.fromJSONSync(primitivePropertyProps);\n }\n\n /**\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitivePropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\n return itemElement;\n }\n}\n\n/** @public @preview */\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\n /** @internal */\n protected _enumeration?: LazyLoadedEnumeration;\n\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\n\n /**\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): EnumerationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.enumeration!.fullName;\n return schemaJson;\n }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n // TODO: Should we allow specifying the backing type?\n super(ecClass, name, PropertyType.Integer_Enumeration);\n this._enumeration = type;\n }\n\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\n super.fromJSONSync(enumerationPropertyProps);\n if (undefined !== enumerationPropertyProps.typeName) {\n if (!(this.enumeration!.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration!.fullName);\n if (!enumSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\n async () => {\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\n if (undefined === enumeration)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n return enumeration;\n });\n }\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const enumeration = await this.enumeration;\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration!.schema, enumeration!.name);\n itemElement.setAttribute(\"typeName\", enumerationName);\n return itemElement;\n }\n\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\n this.fromJSONSync(enumerationPropertyProps);\n }\n\n}\n\n/** @public @preview */\nexport class StructProperty extends Property {\n /** @internal */\n protected _structClass: StructClass;\n\n public get structClass(): StructClass { return this._structClass; }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, PropertyType.Struct);\n this._structClass = type;\n }\n\n /**\n * Save this StructProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): StructPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.structClass.fullName;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\n itemElement.setAttribute(\"typeName\", structClassName);\n return itemElement;\n }\n\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\n super.fromJSONSync(structPropertyProps);\n if (undefined !== structPropertyProps.typeName) {\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\n this.fromJSONSync(structPropertyProps);\n }\n}\n\n/** @public @preview */\nexport class NavigationProperty extends Property {\n /** @internal */\n protected _relationshipClass: LazyLoadedRelationshipClass;\n /** @internal */\n protected _direction: StrengthDirection;\n\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\n\n public getRelationshipClassSync(): RelationshipClass | undefined {\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\n return undefined;\n\n // We cannot use the type guard here to avoid a circular dependency\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\n }\n\n public get direction() { return this._direction; }\n\n /**\n * Save this NavigationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): NavigationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.relationshipName = this.relationshipClass.fullName;\n schemaJson.direction = strengthDirectionToString(this.direction);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const relationshipClass = await this.relationshipClass;\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\n\n return itemElement;\n }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\n super(ecClass, name, PropertyType.Navigation);\n this._relationshipClass = relationship;\n\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\n }\n}\n\ntype Constructor<T> = new (...args: any[]) => T;\n\n// TODO: Consolidate all of the INT32_MAX variables.\nconst INT32_MAX = 2147483647;\n\n/** @public @preview */\nexport abstract class ArrayProperty extends Property {\n /** @internal */\n protected _minOccurs: number = 0;\n /** @internal */\n protected _maxOccurs?: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\n return class extends Base {\n /** @internal */\n protected _minOccurs: number = 0;\n /** @internal */\n protected _maxOccurs: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n constructor(...args: any[]) {\n super(...args);\n this._type = PropertyTypeUtils.asArray(this.propertyType);\n }\n\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n super.fromJSONSync(arrayPropertyProps);\n if (undefined !== arrayPropertyProps.minOccurs) {\n this._minOccurs = arrayPropertyProps.minOccurs;\n }\n\n if (undefined !== arrayPropertyProps.maxOccurs) {\n this._maxOccurs = arrayPropertyProps.maxOccurs;\n }\n }\n\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n this.fromJSONSync(arrayPropertyProps);\n }\n\n /**\n * Save this ArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): ArrayPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.minOccurs = this.minOccurs;\n if (this.maxOccurs !== undefined)\n schemaJson.maxOccurs = this.maxOccurs;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\n if (this.maxOccurs)\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\n\n return itemElement;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\n};\n\n/** @public @preview */\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\n /** @internal */\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, primitiveType);\n }\n\n /**\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveArrayPropertyProps {\n return super.toJSON();\n }\n\n}\n\n/** @public @preview */\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n super(ecClass, name, type);\n }\n}\n\n/** @public @preview */\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, type);\n }\n}\n\n/** @public @preview */\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\n/** @public @preview */\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\n/** @public @preview */\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\n/** @public @preview */\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\n/** @public @preview */\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\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 MutableProperty extends Property {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n}\n"]}
1
+ {"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IACpB,KAAK,CAAS;IACd,MAAM,CAAW,CAAC,kCAAkC;IACpD,YAAY,CAAU;IACtB,MAAM,CAAU;IAChB,WAAW,CAAW;IACtB,SAAS,CAAU;IACnB,SAAS,CAA8B;IACvC,eAAe,CAA4B;IAC3C,iBAAiB,CAAgC;IAEzD,gBAAgB;IACN,KAAK,CAAe;IAE9B,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAkB;QAC5D,IAAI,CAAC,MAAM,GAAG,OAAmB,CAAC;QAClC,IAAI,CAAC,KAAK,GAAG,IAAI,MAAM,CAAC,IAAI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AAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CAEF;AAED,uBAAuB;AACvB,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IACnF,YAAY,OAAgB,EAAE,IAAY,EAAE,IAA2B;QACrE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport {\r\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\r\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\r\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { ECName } from \"../ECName\";\r\nimport { ECClass, StructClass } from \"./Class\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport { KindOfQuantity } from \"./KindOfQuantity\";\r\nimport { PropertyCategory } from \"./PropertyCategory\";\r\nimport { type RelationshipClass } from \"./RelationshipClass\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A common abstract class for all ECProperty types.\r\n * @public @preview\r\n */\r\nexport abstract class Property implements CustomAttributeContainerProps {\r\n private _name: ECName;\r\n private _class: AnyClass; // TODO: class seems to be unused?\r\n private _description?: string;\r\n private _label?: string;\r\n private _isReadOnly?: boolean;\r\n private _priority?: number;\r\n private _category?: LazyLoadedPropertyCategory;\r\n private _kindOfQuantity?: LazyLoadedKindOfQuantity;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n\r\n /** @internal */\r\n protected _type: PropertyType;\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n this._class = ecClass as AnyClass;\r\n this._name = new ECName(name);\r\n this._type = type;\r\n }\r\n\r\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\r\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\r\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\r\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\r\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\r\n\r\n public get name() { return this._name.name; }\r\n\r\n public get class() { return this._class; }\r\n\r\n public get label() { return this._label; }\r\n\r\n public get description() { return this._description; }\r\n\r\n public get isReadOnly() { return this._isReadOnly || false; }\r\n\r\n public get priority(): number {\r\n if (this._priority === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.priority;\r\n }\r\n }\r\n\r\n return this._priority || 0;\r\n }\r\n\r\n public get category(): LazyLoadedPropertyCategory | undefined {\r\n if (this._category === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.category;\r\n }\r\n }\r\n\r\n return this._category;\r\n }\r\n\r\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\r\n if (this._kindOfQuantity === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.kindOfQuantity;\r\n }\r\n }\r\n\r\n return this._kindOfQuantity;\r\n }\r\n\r\n public get propertyType() { return this._type; }\r\n\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** Returns the name in the format 'ClassName.PropertyName'. */\r\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\r\n\r\n /** Returns the schema of the class holding the property. */\r\n public get schema(): Schema { return this._class.schema; }\r\n\r\n public getCategorySync(): PropertyCategory | undefined {\r\n if (!this._category) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getCategorySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\r\n }\r\n\r\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\r\n if (!this._kindOfQuantity) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getKindOfQuantitySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\r\n }\r\n\r\n /**\r\n * Save this Property's properties to an object for serializing to JSON.\r\n */\r\n public toJSON(): PropertyProps {\r\n const schemaJson: any = {};\r\n schemaJson.name = this.name;\r\n schemaJson.type = propertyTypeToString(this._type);\r\n if (this.description !== undefined)\r\n schemaJson.description = this.description;\r\n if (this.label !== undefined)\r\n schemaJson.label = this.label;\r\n if (this._isReadOnly !== undefined)\r\n schemaJson.isReadOnly = this._isReadOnly;\r\n if (this._category !== undefined)\r\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\r\n if (this._priority !== undefined)\r\n schemaJson.priority = this._priority;\r\n if (this._kindOfQuantity !== undefined)\r\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public async toXml(schemaXml: Document): Promise<Element> {\r\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\r\n const itemElement = schemaXml.createElement(propType);\r\n itemElement.setAttribute(\"propertyName\", this.name);\r\n if (undefined !== this.description)\r\n itemElement.setAttribute(\"description\", this.description);\r\n if (undefined !== this.label)\r\n itemElement.setAttribute(\"displayLabel\", this.label);\r\n if (undefined !== this.isReadOnly)\r\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\r\n\r\n if (undefined !== this._category) {\r\n const category = await this._category;\r\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\r\n itemElement.setAttribute(\"category\", categoryName);\r\n }\r\n\r\n if (undefined !== this._priority)\r\n itemElement.setAttribute(\"priority\", this._priority.toString());\r\n\r\n if (undefined !== this._kindOfQuantity) {\r\n const kindOfQuantity = await this._kindOfQuantity;\r\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\r\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public fromJSONSync(propertyProps: PropertyProps) {\r\n if (undefined !== propertyProps.label) {\r\n this._label = propertyProps.label;\r\n }\r\n\r\n if (undefined !== propertyProps.description) {\r\n this._description = propertyProps.description;\r\n }\r\n\r\n if (undefined !== propertyProps.priority) {\r\n this._priority = propertyProps.priority;\r\n }\r\n\r\n if (undefined !== propertyProps.isReadOnly) {\r\n this._isReadOnly = propertyProps.isReadOnly;\r\n }\r\n\r\n if (undefined !== propertyProps.category) {\r\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\r\n if (!propertyCategorySchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\r\n async () => {\r\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\r\n if (undefined === category)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n return category;\r\n });\r\n }\r\n\r\n if (undefined !== propertyProps.kindOfQuantity) {\r\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\r\n if (!koqSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\r\n async () => {\r\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\r\n if (undefined === koq)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n return koq;\r\n });\r\n }\r\n }\r\n\r\n public async fromJSON(propertyProps: PropertyProps) {\r\n this.fromJSONSync(propertyProps);\r\n }\r\n\r\n /** @internal */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /** @internal */\r\n protected setName(name: ECName) {\r\n this._name = name;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setDescription(description: string) {\r\n this._description = description;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setLabel(label: string) {\r\n this._label = label;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setIsReadOnly(isReadOnly: boolean) {\r\n this._isReadOnly = isReadOnly;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setPriority(priority: number) {\r\n this._priority = priority;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setCategory(category: LazyLoadedPropertyCategory) {\r\n this._category = category;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\r\n this._kindOfQuantity = kindOfQuantity;\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n let baseCustomAttributes;\r\n if (undefined !== baseProperty)\r\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\r\n if (undefined !== baseCustomAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\r\n }\r\n\r\n return customAttributes;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public static isProperty(object: any): object is AnyProperty {\r\n const property = object as Property;\r\n\r\n return property !== undefined && property.class !== undefined && property.name !== undefined\r\n && property.propertyType !== undefined;\r\n }\r\n}\r\n\r\n\r\n\r\n/** @public @preview */\r\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\r\n /** @internal */\r\n protected _extendedTypeName?: string;\r\n /** @internal */\r\n protected _minLength?: number;\r\n /** @internal */\r\n protected _maxLength?: number;\r\n /** @internal */\r\n protected _minValue?: number;\r\n /** @internal */\r\n protected _maxValue?: number;\r\n\r\n public get extendedTypeName() { return this._extendedTypeName; }\r\n public get minLength() { return this._minLength; }\r\n public get maxLength() { return this._maxLength; }\r\n public get minValue() { return this._minValue; }\r\n public get maxValue() { return this._maxValue; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n super(ecClass, name, type);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\r\n const schemaJson = super.toJSON() as any;\r\n if (this.extendedTypeName !== undefined)\r\n schemaJson.extendedTypeName = this.extendedTypeName;\r\n if (this._minLength !== undefined)\r\n schemaJson.minLength = this.minLength;\r\n if (this._maxLength !== undefined)\r\n schemaJson.maxLength = this.maxLength;\r\n if (this._minValue !== undefined)\r\n schemaJson.minValue = this.minValue;\r\n if (this._maxValue !== undefined)\r\n schemaJson.maxValue = this.maxValue;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n if (undefined !== this.extendedTypeName)\r\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\r\n if (undefined !== this.minValue)\r\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\r\n if (undefined !== this.maxValue)\r\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\r\n if (undefined !== this.minLength)\r\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\r\n if (undefined !== this.maxLength)\r\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n super.fromJSONSync(propertyBaseProps);\r\n\r\n if (undefined !== propertyBaseProps.minLength) {\r\n this._minLength = propertyBaseProps.minLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxLength) {\r\n this._maxLength = propertyBaseProps.maxLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.minValue) {\r\n this._minValue = propertyBaseProps.minValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxValue) {\r\n this._maxValue = propertyBaseProps.maxValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.extendedTypeName) {\r\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\r\n }\r\n }\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setExtendedTypeName(extendedTypeName: string) {\r\n this._extendedTypeName = extendedTypeName;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinLength(minLength: number) {\r\n this._minLength = minLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxLength(maxLength: number) {\r\n this._maxLength = maxLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinValue(minValue: number) {\r\n this._minValue = minValue;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxValue(maxValue: number) {\r\n this._maxValue = maxValue;\r\n }\r\n\r\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n this.fromJSONSync(propertyBaseProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\r\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\r\n }\r\n\r\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\r\n super.fromJSONSync(primitivePropertyProps);\r\n if (undefined !== primitivePropertyProps.typeName) {\r\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\r\n this.fromJSONSync(primitivePropertyProps);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitivePropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\r\n return itemElement;\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\r\n /** @internal */\r\n protected _enumeration?: LazyLoadedEnumeration;\r\n\r\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\r\n\r\n /**\r\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): EnumerationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.enumeration!.fullName;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n // TODO: Should we allow specifying the backing type?\r\n super(ecClass, name, PropertyType.Integer_Enumeration);\r\n this._enumeration = type;\r\n }\r\n\r\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\r\n super.fromJSONSync(enumerationPropertyProps);\r\n if (undefined !== enumerationPropertyProps.typeName) {\r\n if (!(this.enumeration!.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration!.fullName);\r\n if (!enumSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\r\n async () => {\r\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\r\n if (undefined === enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n return enumeration;\r\n });\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const enumeration = await this.enumeration;\r\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration!.schema, enumeration!.name);\r\n itemElement.setAttribute(\"typeName\", enumerationName);\r\n return itemElement;\r\n }\r\n\r\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\r\n this.fromJSONSync(enumerationPropertyProps);\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructProperty extends Property {\r\n /** @internal */\r\n protected _structClass: StructClass;\r\n\r\n public get structClass(): StructClass { return this._structClass; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, PropertyType.Struct);\r\n this._structClass = type;\r\n }\r\n\r\n /**\r\n * Save this StructProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): StructPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.structClass.fullName;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\r\n itemElement.setAttribute(\"typeName\", structClassName);\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\r\n super.fromJSONSync(structPropertyProps);\r\n if (undefined !== structPropertyProps.typeName) {\r\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\r\n this.fromJSONSync(structPropertyProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class NavigationProperty extends Property {\r\n /** @internal */\r\n protected _relationshipClass: LazyLoadedRelationshipClass;\r\n /** @internal */\r\n protected _direction: StrengthDirection;\r\n\r\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\r\n\r\n public getRelationshipClassSync(): RelationshipClass | undefined {\r\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\r\n return undefined;\r\n\r\n // We cannot use the type guard here to avoid a circular dependency\r\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\r\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\r\n }\r\n\r\n public get direction() { return this._direction; }\r\n\r\n /**\r\n * Save this NavigationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): NavigationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.relationshipName = this.relationshipClass.fullName;\r\n schemaJson.direction = strengthDirectionToString(this.direction);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const relationshipClass = await this.relationshipClass;\r\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\r\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\r\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\r\n\r\n return itemElement;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\r\n super(ecClass, name, PropertyType.Navigation);\r\n this._relationshipClass = relationship;\r\n\r\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\r\n }\r\n}\r\n\r\ntype Constructor<T> = new (...args: any[]) => T;\r\n\r\n// TODO: Consolidate all of the INT32_MAX variables.\r\nconst INT32_MAX = 2147483647;\r\n\r\n/** @public @preview */\r\nexport abstract class ArrayProperty extends Property {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs?: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\r\n return class extends Base {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n constructor(...args: any[]) {\r\n super(...args);\r\n this._type = PropertyTypeUtils.asArray(this.propertyType);\r\n }\r\n\r\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n super.fromJSONSync(arrayPropertyProps);\r\n if (undefined !== arrayPropertyProps.minOccurs) {\r\n this._minOccurs = arrayPropertyProps.minOccurs;\r\n }\r\n\r\n if (undefined !== arrayPropertyProps.maxOccurs) {\r\n this._maxOccurs = arrayPropertyProps.maxOccurs;\r\n }\r\n }\r\n\r\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n this.fromJSONSync(arrayPropertyProps);\r\n }\r\n\r\n /**\r\n * Save this ArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): ArrayPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.minOccurs = this.minOccurs;\r\n if (this.maxOccurs !== undefined)\r\n schemaJson.maxOccurs = this.maxOccurs;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\r\n if (this.maxOccurs)\r\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\r\n};\r\n\r\n/** @public @preview */\r\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, primitiveType);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveArrayPropertyProps {\r\n return super.toJSON();\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\r\n/** @public @preview */\r\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\r\n/** @public @preview */\r\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableProperty extends Property {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAA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CAAC;IAC3C,CAAC;IACD;;;OAGG;IACO,WAAW,CAAC,QAAgB;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,gBAAgB;YACjE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,wBAAwB,CAAC,IAAiB;QACtD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAChC,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,gBAAgB,sBAAsB,CAAC,CAAC;IACtI,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,uBAAwB,SAAQ,gBAAgB;CAGrE","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 { PropertyCategoryProps } from \"../Deserialization/JsonProps\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * @public @preview\n */\nexport class PropertyCategory extends SchemaItem {\n public override readonly schemaItemType = PropertyCategory.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.PropertyCategory; }\n private _priority: number;\n\n public get priority() {\n return this._priority;\n }\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this._priority = 0;\n }\n\n /**\n * Save this PropertyCategory's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PropertyCategoryProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.priority = this.priority;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"priority\", this.priority.toString());\n return itemElement;\n }\n\n public override fromJSONSync(propertyCategoryProps: PropertyCategoryProps) {\n super.fromJSONSync(propertyCategoryProps);\n this._priority = propertyCategoryProps.priority;\n }\n\n public override async fromJSON(propertyCategoryProps: PropertyCategoryProps) {\n this.fromJSONSync(propertyCategoryProps);\n }\n /**\n * Used for schema editing.\n * @internal\n */\n protected setPriority(priority: number) {\n this._priority = priority;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type PropertyCategory.\n * @param item The SchemaItem to check.\n * @returns True if the item is a PropertyCategory, false otherwise.\n */\n public static isPropertyCategory(item?: SchemaItem): item is PropertyCategory {\n if (item && item.schemaItemType === SchemaItemType.PropertyCategory)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type PropertyCategory.\n * @param item The SchemaItem to check.\n * @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.\n * @internal\n */\n public static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory {\n if (!this.isPropertyCategory(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.PropertyCategory}' (PropertyCategory)`);\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutablePropertyCategory extends PropertyCategory {\n public abstract override setPriority(priority: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,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E,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC3C,CAAC;IACD;;;OAGG;IACO,WAAW,CAAC,QAAgB;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,gBAAgB;YACjE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,wBAAwB,CAAC,IAAiB;QACtD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAChC,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,gBAAgB,sBAAsB,CAAC,CAAC;IACtI,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,uBAAwB,SAAQ,gBAAgB;CAGrE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { PropertyCategoryProps } from \"../Deserialization/JsonProps\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class PropertyCategory extends SchemaItem {\r\n public override readonly schemaItemType = PropertyCategory.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.PropertyCategory; }\r\n private _priority: number;\r\n\r\n public get priority() {\r\n return this._priority;\r\n }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this._priority = 0;\r\n }\r\n\r\n /**\r\n * Save this PropertyCategory's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PropertyCategoryProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.priority = this.priority;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"priority\", this.priority.toString());\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(propertyCategoryProps: PropertyCategoryProps) {\r\n super.fromJSONSync(propertyCategoryProps);\r\n this._priority = propertyCategoryProps.priority;\r\n }\r\n\r\n public override async fromJSON(propertyCategoryProps: PropertyCategoryProps) {\r\n this.fromJSONSync(propertyCategoryProps);\r\n }\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setPriority(priority: number) {\r\n this._priority = priority;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type PropertyCategory.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a PropertyCategory, false otherwise.\r\n */\r\n public static isPropertyCategory(item?: SchemaItem): item is PropertyCategory {\r\n if (item && item.schemaItemType === SchemaItemType.PropertyCategory)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type PropertyCategory.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory {\r\n if (!this.isPropertyCategory(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.PropertyCategory}' (PropertyCategory)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePropertyCategory extends PropertyCategory {\r\n public abstract override setPriority(priority: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}