@itwin/ecschema-editing 5.0.0-dev.7 → 5.0.0-dev.72

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 (196) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/Differencing/Errors.js +6 -0
  3. package/lib/cjs/Differencing/Errors.js.map +1 -1
  4. package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
  5. package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
  6. package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
  7. package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
  8. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
  9. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  10. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +57 -11
  11. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  12. package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
  13. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  14. package/lib/cjs/Differencing/SchemaDifference.js +55 -5
  15. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  16. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
  17. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
  18. package/lib/cjs/Differencing/SchemaDifferenceValidator.js +78 -19
  19. package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
  20. package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
  21. package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +5 -0
  22. package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
  23. package/lib/cjs/Editing/Constants.d.ts +2 -1
  24. package/lib/cjs/Editing/Constants.d.ts.map +1 -1
  25. package/lib/cjs/Editing/Constants.js +4 -1
  26. package/lib/cjs/Editing/Constants.js.map +1 -1
  27. package/lib/cjs/Editing/CustomAttributes.d.ts +2 -1
  28. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  29. package/lib/cjs/Editing/CustomAttributes.js +3 -0
  30. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  31. package/lib/cjs/Editing/ECClasses.d.ts +6 -0
  32. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  33. package/lib/cjs/Editing/ECClasses.js +48 -35
  34. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  35. package/lib/cjs/Editing/Editor.d.ts +2 -2
  36. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  37. package/lib/cjs/Editing/Editor.js +32 -21
  38. package/lib/cjs/Editing/Editor.js.map +1 -1
  39. package/lib/cjs/Editing/Entities.d.ts +2 -1
  40. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  41. package/lib/cjs/Editing/Entities.js +18 -14
  42. package/lib/cjs/Editing/Entities.js.map +1 -1
  43. package/lib/cjs/Editing/Enumerations.d.ts +2 -1
  44. package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
  45. package/lib/cjs/Editing/Enumerations.js +6 -3
  46. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  47. package/lib/cjs/Editing/Exception.js +35 -6
  48. package/lib/cjs/Editing/Exception.js.map +1 -1
  49. package/lib/cjs/Editing/Formats.d.ts +2 -1
  50. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  51. package/lib/cjs/Editing/Formats.js +5 -1
  52. package/lib/cjs/Editing/Formats.js.map +1 -1
  53. package/lib/cjs/Editing/InvertedUnits.d.ts +2 -1
  54. package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
  55. package/lib/cjs/Editing/InvertedUnits.js +10 -6
  56. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  57. package/lib/cjs/Editing/KindOfQuantities.d.ts +2 -1
  58. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  59. package/lib/cjs/Editing/KindOfQuantities.js +11 -7
  60. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  61. package/lib/cjs/Editing/Mixins.d.ts +2 -1
  62. package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
  63. package/lib/cjs/Editing/Mixins.js +13 -9
  64. package/lib/cjs/Editing/Mixins.js.map +1 -1
  65. package/lib/cjs/Editing/Mutable/MutableClass.d.ts +2 -1
  66. package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -1
  67. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  68. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
  69. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
  70. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  71. package/lib/cjs/Editing/Phenomena.d.ts +2 -1
  72. package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
  73. package/lib/cjs/Editing/Phenomena.js +3 -0
  74. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  75. package/lib/cjs/Editing/Properties.d.ts +2 -2
  76. package/lib/cjs/Editing/Properties.d.ts.map +1 -1
  77. package/lib/cjs/Editing/Properties.js +6 -4
  78. package/lib/cjs/Editing/Properties.js.map +1 -1
  79. package/lib/cjs/Editing/PropertyCategories.d.ts +2 -1
  80. package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
  81. package/lib/cjs/Editing/PropertyCategories.js +5 -1
  82. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  83. package/lib/cjs/Editing/RelationshipClasses.d.ts +1 -0
  84. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  85. package/lib/cjs/Editing/RelationshipClasses.js +17 -10
  86. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  87. package/lib/cjs/Editing/SchemaItems.d.ts +2 -2
  88. package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
  89. package/lib/cjs/Editing/SchemaItems.js +8 -11
  90. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  91. package/lib/cjs/Editing/Structs.d.ts +2 -1
  92. package/lib/cjs/Editing/Structs.d.ts.map +1 -1
  93. package/lib/cjs/Editing/Structs.js +3 -0
  94. package/lib/cjs/Editing/Structs.js.map +1 -1
  95. package/lib/cjs/Editing/UnitSystems.d.ts +2 -1
  96. package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
  97. package/lib/cjs/Editing/UnitSystems.js +3 -0
  98. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  99. package/lib/cjs/Editing/Units.d.ts +2 -1
  100. package/lib/cjs/Editing/Units.d.ts.map +1 -1
  101. package/lib/cjs/Editing/Units.js +5 -2
  102. package/lib/cjs/Editing/Units.js.map +1 -1
  103. package/lib/cjs/Merging/ConstantMerger.js +4 -4
  104. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  105. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  106. package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
  107. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  108. package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
  109. package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
  110. package/lib/cjs/Merging/Edits/NameMapping.js +54 -0
  111. package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
  112. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
  113. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
  114. package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
  115. package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
  116. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
  117. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
  118. package/lib/cjs/Merging/Edits/SchemaEdits.js +19 -14
  119. package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
  120. package/lib/cjs/Merging/EntityClassMerger.js +1 -2
  121. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  122. package/lib/cjs/Merging/EnumerationMerger.js +1 -1
  123. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  124. package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
  125. package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
  126. package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
  127. package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
  128. package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
  129. package/lib/cjs/Merging/FormatMerger.js +143 -0
  130. package/lib/cjs/Merging/FormatMerger.js.map +1 -0
  131. package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
  132. package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
  133. package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
  134. package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
  135. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
  136. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
  137. package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
  138. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  139. package/lib/cjs/Merging/MixinMerger.js +1 -1
  140. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  141. package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
  142. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
  143. package/lib/cjs/Merging/PropertyMerger.js +28 -26
  144. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  145. package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
  146. package/lib/cjs/Merging/RelationshipClassMerger.js +4 -4
  147. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  148. package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
  149. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  150. package/lib/cjs/Merging/SchemaMerger.js +40 -5
  151. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  152. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
  153. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
  154. package/lib/cjs/Merging/SchemaMergingVisitor.js +42 -17
  155. package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
  156. package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
  157. package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
  158. package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
  159. package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
  160. package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
  161. package/lib/cjs/Merging/UnitMerger.js +62 -0
  162. package/lib/cjs/Merging/UnitMerger.js.map +1 -0
  163. package/lib/cjs/Merging/Utils.d.ts +11 -0
  164. package/lib/cjs/Merging/Utils.d.ts.map +1 -1
  165. package/lib/cjs/Merging/Utils.js +23 -3
  166. package/lib/cjs/Merging/Utils.js.map +1 -1
  167. package/lib/cjs/Validation/Diagnostic.js +18 -16
  168. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  169. package/lib/cjs/Validation/DiagnosticReporter.js +3 -0
  170. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  171. package/lib/cjs/Validation/ECRules.js +1 -1
  172. package/lib/cjs/Validation/ECRules.js.map +1 -1
  173. package/lib/cjs/Validation/SchemaChanges.js +39 -69
  174. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  175. package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
  176. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  177. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
  178. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
  179. package/lib/cjs/Validation/SchemaCompareResultDelegate.js +4 -1
  180. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  181. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
  182. package/lib/cjs/Validation/SchemaCompareVisitor.js +23 -23
  183. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  184. package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
  185. package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
  186. package/lib/cjs/Validation/SchemaComparer.js +30 -5
  187. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  188. package/lib/cjs/Validation/SchemaValidater.js +1 -4
  189. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  190. package/lib/cjs/Validation/SchemaValidationVisitor.js +3 -4
  191. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  192. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  193. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  194. package/lib/cjs/Validation/SchemaWalker.js +4 -0
  195. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  196. package/package.json +10 -10
@@ -1 +1 @@
1
- {"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AAGxC,6CAAoD;AACpD,2CAA2E;AAE3E;;;GAGG;AACH,MAAa,MAAO,SAAQ,qBAAS;IACnC,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QAG5C;;WAEG;QACa,yBAAoB,GAAG,IAAI,iCAAoB,CAAC,kCAAc,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IALzG,CAAC;IAOM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,SAAwB,EAAE,YAAqB,EAAE,YAA4B;QACnI,IAAI,CAAC;YACH,MAAM,QA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,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YACzI,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,iCAAiC,EAAE,IAAI,mBAAO,CAAC,kCAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9I,CAAC;IACH,CAAC;CACF;AAxED,wBAwEC","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 Editing\r\n */\r\n\r\nimport {\r\n DelayedPromiseWithProps, EntityClass, Mixin, MixinProps, NavigationPropertyProps, RelationshipClass,\r\n SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\r\nimport { MutableMixin } from \"./Mutable/MutableMixin\";\r\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\r\nimport { NavigationProperties } from \"./Properties\";\r\nimport { ClassId, ECEditingStatus, SchemaEditingError } from \"./Exception\";\r\n\r\n/**\r\n * @alpha\r\n * A class extending ECClasses allowing you to create schema items of type Mixin.\r\n */\r\nexport class Mixins extends ECClasses {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Mixin, schemaEditor);\r\n }\r\n\r\n /**\r\n * Allows access for editing of NavigationProperty attributes.\r\n */\r\n public readonly navigationProperties = new NavigationProperties(SchemaItemType.Mixin, this.schemaEditor);\r\n\r\n public async create(schemaKey: SchemaKey, name: string, appliesTo: SchemaItemKey, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createClass<Mixin>(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), name, baseClassKey) as MutableMixin;\r\n const newAppliesTo = await this.getSchemaItem<EntityClass>(appliesTo, SchemaItemType.EntityClass);\r\n newClass.setAppliesTo(new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(newAppliesTo.key, async () => newAppliesTo));\r\n\r\n if (displayLabel)\r\n newClass.setDisplayLabel(displayLabel);\r\n\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a MixinClass through a MixinProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, mixinProps: MixinProps): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), mixinProps);\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, mixinProps.name!, schemaKey), e);\r\n }\r\n }\r\n\r\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\r\n try {\r\n const entity = await this.getSchemaItem<MutableEntityClass>(entityKey, SchemaItemType.EntityClass);\r\n const mixin = await this.getSchemaItem<Mixin>(mixinKey);\r\n entity.addMixin(mixin);\r\n } catch(e: any){\r\n throw new SchemaEditingError(ECEditingStatus.AddMixin, new ClassId(SchemaItemType.EntityClass, entityKey), e);\r\n }\r\n }\r\n\r\n public async createNavigationProperty(mixinKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<void> {\r\n try {\r\n const mixin = await this.getSchemaItem<MutableMixin>(mixinKey);\r\n await mixin.createNavigationProperty(name, relationship, direction);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationProperty, new ClassId(SchemaItemType.Mixin, mixinKey), e);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a Navigation Property through a NavigationPropertyProps.\r\n * @param classKey a SchemaItemKey of the Mixin that will house the new property.\r\n * @param navigationProps a json object that will be used to populate the new Navigation Property.\r\n */\r\n public async createNavigationPropertyFromProps(classKey: SchemaItemKey, navigationProps: NavigationPropertyProps): Promise<void> {\r\n try {\r\n const mixin = await this.getSchemaItem<MutableMixin>(classKey);\r\n const property = await mixin.createNavigationProperty(navigationProps.name, navigationProps.relationshipName, navigationProps.direction);\r\n await property.fromJSON(navigationProps);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationPropertyFromProps, new ClassId(SchemaItemType.RelationshipClass, classKey), e);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AACxC,yDAAsD;AAEtD,6CAAoD;AACpD,2CAA2E;AAE3E;;;GAGG;AACH,MAAa,MAAO,SAAQ,qBAAS;IACnC,IAAuB,aAAa;QAClC,OAAO,yBAAK,CAAC;IACf,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACa,oBAAoB,GAAG,IAAI,iCAAoB,CAAC,kCAAc,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAElG,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,SAAwB,EAAE,YAAqB,EAAE,YAA4B;QACnI,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAA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,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YACzI,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,iCAAiC,EAAE,IAAI,mBAAO,CAAC,kCAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9I,CAAC;IACH,CAAC;CACF;AA5ED,wBA4EC","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 Editing\r\n */\r\n\r\nimport {\r\n DelayedPromiseWithProps, EntityClass, Mixin, MixinProps, NavigationPropertyProps, RelationshipClass,\r\n SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\r\nimport { MutableMixin } from \"./Mutable/MutableMixin\";\r\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\r\nimport { NavigationProperties } from \"./Properties\";\r\nimport { ClassId, ECEditingStatus, SchemaEditingError } from \"./Exception\";\r\n\r\n/**\r\n * @alpha\r\n * A class extending ECClasses allowing you to create schema items of type Mixin.\r\n */\r\nexport class Mixins extends ECClasses {\r\n protected override get itemTypeClass(): typeof Mixin {\r\n return Mixin;\r\n }\r\n\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Mixin, schemaEditor);\r\n }\r\n\r\n /**\r\n * Allows access for editing of NavigationProperty attributes.\r\n */\r\n public readonly navigationProperties = new NavigationProperties(SchemaItemType.Mixin, this.schemaEditor);\r\n\r\n public async create(schemaKey: SchemaKey, name: string, appliesTo: SchemaItemKey, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createClass<Mixin>(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), name, baseClassKey) as MutableMixin;\r\n const newAppliesTo = await this.getSchemaItem(appliesTo, EntityClass);\r\n newClass.setAppliesTo(new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(newAppliesTo.key, async () => newAppliesTo));\r\n\r\n if (displayLabel)\r\n newClass.setDisplayLabel(displayLabel);\r\n\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a MixinClass through a MixinProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, mixinProps: MixinProps): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), mixinProps);\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, mixinProps.name!, schemaKey), e);\r\n }\r\n }\r\n\r\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\r\n try {\r\n const entity = await this.getSchemaItem(entityKey, EntityClass);\r\n const mixin = await this.getSchemaItem(mixinKey, Mixin);\r\n (entity as MutableEntityClass).addMixin(mixin);\r\n } catch(e: any){\r\n throw new SchemaEditingError(ECEditingStatus.AddMixin, new ClassId(SchemaItemType.EntityClass, entityKey), e);\r\n }\r\n }\r\n\r\n public async createNavigationProperty(mixinKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<void> {\r\n try {\r\n const mixin = await this.getSchemaItem(mixinKey, MutableMixin);\r\n await mixin.createNavigationProperty(name, relationship, direction);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationProperty, new ClassId(SchemaItemType.Mixin, mixinKey), e);\r\n }\r\n }\r\n\r\n /**\r\n * Creates a Navigation Property through a NavigationPropertyProps.\r\n * @param classKey a SchemaItemKey of the Mixin that will house the new property.\r\n * @param navigationProps a json object that will be used to populate the new Navigation Property.\r\n */\r\n public async createNavigationPropertyFromProps(classKey: SchemaItemKey, navigationProps: NavigationPropertyProps): Promise<void> {\r\n try {\r\n const mixin = await this.getSchemaItem(classKey, MutableMixin);\r\n const property = await mixin.createNavigationProperty(navigationProps.name, navigationProps.relationshipName, navigationProps.direction);\r\n await property.fromJSON(navigationProps);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationPropertyFromProps, new ClassId(SchemaItemType.RelationshipClass, classKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,4 +1,4 @@
1
- import { CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty, PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty } from "@itwin/ecschema-metadata";
1
+ import { CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, LazyLoadedECClass, PrimitiveArrayProperty, PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty } from "@itwin/ecschema-metadata";
2
2
  /**
3
3
  * @internal
4
4
  * An abstract class used for schema editing.
@@ -11,6 +11,7 @@ export declare abstract class MutableStructClass extends StructClass {
11
11
  * @internal
12
12
  */
13
13
  export declare abstract class MutableClass extends ECClass {
14
+ abstract setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;
14
15
  abstract addCustomAttribute(customAttribute: CustomAttribute): void;
15
16
  abstract setModifier(modifier: ECClassModifier): void;
16
17
  abstract setName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/MutableClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAGkC;AAElC;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,2BAAO;CA8BjD;AA9BD,oCA8BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport {\r\n CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, PrimitiveArrayProperty,\r\n PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override setDescription(description: string): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableClass.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAGkC;AAElC;;;GAGG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAE3D;AAFD,gDAEC;AAED;;;GAGG;AACH,MAAsB,YAAa,SAAQ,2BAAO;CA+BjD;AA/BD,oCA+BC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport {\r\n CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, LazyLoadedECClass, PrimitiveArrayProperty,\r\n PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableStructClass extends StructClass {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableClass extends ECClass {\r\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override setModifier(modifier: ECClassModifier): void;\r\n public abstract override setName(name: string): void;\r\n public abstract override setDescription(description: string): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\r\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\r\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\r\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\r\n\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\r\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\r\n\r\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\r\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\r\n\r\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\r\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\r\n\r\n public abstract override deleteProperty(name: string): Promise<void>;\r\n public abstract override deletePropertySync(name: string): void;\r\n}\r\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Format, InvertedUnit, Unit } from "@itwin/ecschema-metadata";
2
- import { FormatType, ShowSignOption } from "@itwin/core-quantity";
2
+ import { FormatTraits, FormatType, ScientificType, ShowSignOption } from "@itwin/core-quantity";
3
3
  /**
4
4
  * @internal
5
5
  * An abstract class used for schema editing.
@@ -14,6 +14,13 @@ export declare abstract class MutableFormat extends Format {
14
14
  abstract setThousandSeparator(separator: string): void;
15
15
  abstract setUomSeparator(separator: string): void;
16
16
  abstract setStationSeparator(separator: string): void;
17
+ abstract setMinWidth(minWidth: number): void;
18
+ abstract setStationOffsetSize(stationOffsetSize: number): void;
19
+ abstract setScientificType(scientificType: ScientificType): void;
20
+ abstract setSpacer(spacer: string): void;
21
+ abstract setIncludeZero(includeZero: boolean): void;
22
+ abstract setFormatTraits(formatTraits: FormatTraits): void;
23
+ abstract setUnits(units: Array<[Unit | InvertedUnit, string | undefined]>): void;
17
24
  abstract setDisplayLabel(displayLabel: string): void;
18
25
  }
19
26
  //# sourceMappingURL=MutableFormat.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFormat.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableFormat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAElE;;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BAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aAC7C,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACxC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aAC5C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;aACnC,oBAAoB,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI;aACrD,iBAAiB,CAAC,cAAc,EAAE,cAAc,GAAG,IAAI;aACvD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;aAC/B,cAAc,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI;aAC1C,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;aACjD,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,IAAI,GAAG,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI;aACvE,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableFormat.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableFormat.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsE;AAGtE;;;GAGG;AACH,MAAsB,aAAc,SAAQ,0BAAM;CAWjD;AAXD,sCAWC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Format, InvertedUnit, Unit } from \"@itwin/ecschema-metadata\";\r\nimport { FormatType, ShowSignOption } from \"@itwin/core-quantity\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableFormat extends Format {\r\n public abstract override addUnit(unit: Unit | InvertedUnit, label?: string): void;\r\n public abstract override setPrecision(precision: number): void;\r\n public abstract override setFormatType(formatType: FormatType): void;\r\n public abstract override setRoundFactor(roundFactor: number): void;\r\n public abstract override setShowSignOption(signOption: ShowSignOption): void;\r\n public abstract override setDecimalSeparator(separator: string): void;\r\n public abstract override setThousandSeparator(separator: string): void;\r\n public abstract override setUomSeparator(separator: string): void;\r\n public abstract override setStationSeparator(separator: string): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableFormat.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableFormat.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsE;AAGtE;;;GAGG;AACH,MAAsB,aAAc,SAAQ,0BAAM;CAkBjD;AAlBD,sCAkBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\nimport { Format, InvertedUnit, Unit } from \"@itwin/ecschema-metadata\";\r\nimport { FormatTraits, FormatType, ScientificType, ShowSignOption } from \"@itwin/core-quantity\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableFormat extends Format {\r\n public abstract override addUnit(unit: Unit | InvertedUnit, label?: string): void;\r\n public abstract override setPrecision(precision: number): void;\r\n public abstract override setFormatType(formatType: FormatType): void;\r\n public abstract override setRoundFactor(roundFactor: number): void;\r\n public abstract override setShowSignOption(signOption: ShowSignOption): void;\r\n public abstract override setDecimalSeparator(separator: string): void;\r\n public abstract override setThousandSeparator(separator: string): void;\r\n public abstract override setUomSeparator(separator: string): void;\r\n public abstract override setStationSeparator(separator: string): void;\r\n public abstract override setMinWidth(minWidth: number): void;\r\n public abstract override setStationOffsetSize(stationOffsetSize: number): void;\r\n public abstract override setScientificType(scientificType: ScientificType): void;\r\n public abstract override setSpacer(spacer: string): void;\r\n public abstract override setIncludeZero(includeZero: boolean): void;\r\n public abstract override setFormatTraits(formatTraits: FormatTraits): void;\r\n public abstract override setUnits(units: Array<[Unit | InvertedUnit, string | undefined]>): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Editing
3
3
  */
4
- import { PhenomenonProps, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
4
+ import { Phenomenon, PhenomenonProps, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
5
5
  import { SchemaContextEditor } from "./Editor";
6
6
  import { SchemaItems } from "./SchemaItems";
7
7
  /**
@@ -9,6 +9,7 @@ import { SchemaItems } from "./SchemaItems";
9
9
  * A class allowing you to create schema items of type Phenomenon.
10
10
  */
11
11
  export declare class Phenomena extends SchemaItems {
12
+ protected get itemTypeClass(): typeof Phenomenon;
12
13
  constructor(schemaEditor: SchemaContextEditor);
13
14
  create(schemaKey: SchemaKey, name: string, definition: string, displayLabel?: string): Promise<SchemaItemKey>;
14
15
  createFromProps(schemaKey: SchemaKey, phenomenonProps: PhenomenonProps): Promise<SchemaItemKey>;
@@ -1 +1 @@
1
- {"version":3,"file":"Phenomena.d.ts","sourceRoot":"","sources":["../../../src/Editing/Phenomena.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAc,eAAe,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,SAAU,SAAQ,WAAW;gBACrB,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAe7G,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;CAQ7G"}
1
+ {"version":3,"file":"Phenomena.d.ts","sourceRoot":"","sources":["../../../src/Editing/Phenomena.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjH,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,SAAU,SAAQ,WAAW;IACxC,cAAuB,aAAa,IAAI,OAAO,UAAU,CAExD;gBAEkB,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAe7G,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,aAAa,CAAC;CAQ7G"}
@@ -16,6 +16,9 @@ const SchemaItems_1 = require("./SchemaItems");
16
16
  * A class allowing you to create schema items of type Phenomenon.
17
17
  */
18
18
  class Phenomena extends SchemaItems_1.SchemaItems {
19
+ get itemTypeClass() {
20
+ return ecschema_metadata_1.Phenomenon;
21
+ }
19
22
  constructor(schemaEditor) {
20
23
  super(ecschema_metadata_1.SchemaItemType.Phenomenon, schemaEditor);
21
24
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Phenomena.js","sourceRoot":"","sources":["../../../src/Editing/Phenomena.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAiH;AAGjH,2CAAgF;AAChF,+CAA4C;AAE5C;;;GAGG;AACH,MAAa,SAAU,SAAQ,yBAAW;IACxC,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,UAAU,EAAE,YAAY,CAAC,CAA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A4BC","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 Editing\r\n */\r\n\r\nimport { Phenomenon, PhenomenonProps, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutablePhenomenon } from \"./Mutable/MutablePhenomenon\";\r\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Phenomenon.\r\n */\r\nexport class Phenomena extends SchemaItems {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Phenomenon, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, definition: string, displayLabel?: string): Promise<SchemaItemKey> {\r\n try {\r\n const newPhenomenon = await this.createSchemaItem<Phenomenon>(schemaKey, this.schemaItemType, (schema) => schema.createPhenomenon.bind(schema), name) as MutablePhenomenon;\r\n\r\n if (displayLabel)\r\n newPhenomenon.setDisplayLabel(displayLabel);\r\n\r\n await newPhenomenon.setDefinition(definition);\r\n\r\n return newPhenomenon.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n public async createFromProps(schemaKey: SchemaKey, phenomenonProps: PhenomenonProps): Promise<SchemaItemKey> {\r\n try {\r\n const newPhenomenon = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createPhenomenon.bind(schema), phenomenonProps);\r\n return newPhenomenon.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, phenom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AC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC,CAAC;YAC9J,OAAO,aAAa,CAAC,GAAG,CAAC;QAC3B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACtJ,CAAC;IACH,CAAC;CACF;AAhCD,8BAgCC","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 Editing\r\n */\r\n\r\nimport { Phenomenon, PhenomenonProps, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutablePhenomenon } from \"./Mutable/MutablePhenomenon\";\r\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Phenomenon.\r\n */\r\nexport class Phenomena extends SchemaItems {\r\n protected override get itemTypeClass(): typeof Phenomenon {\r\n return Phenomenon;\r\n }\r\n\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Phenomenon, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, definition: string, displayLabel?: string): Promise<SchemaItemKey> {\r\n try {\r\n const newPhenomenon = await this.createSchemaItem<Phenomenon>(schemaKey, this.schemaItemType, (schema) => schema.createPhenomenon.bind(schema), name) as MutablePhenomenon;\r\n\r\n if (displayLabel)\r\n newPhenomenon.setDisplayLabel(displayLabel);\r\n\r\n await newPhenomenon.setDefinition(definition);\r\n\r\n return newPhenomenon.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n public async createFromProps(schemaKey: SchemaKey, phenomenonProps: PhenomenonProps): Promise<SchemaItemKey> {\r\n try {\r\n const newPhenomenon = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createPhenomenon.bind(schema), phenomenonProps);\r\n return newPhenomenon.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, phenomenonProps.name!, schemaKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -115,10 +115,10 @@ export declare class ArrayProperties extends Properties {
115
115
  declare class PrimitiveOrEnumProperties extends Properties {
116
116
  constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor);
117
117
  /**
118
- * Sets the extendTypeName attribute value.
118
+ * Sets the extendedTypeName attribute value.
119
119
  * @param classKey The SchemaItemKey of the class.
120
120
  * @param propertyName The name of the property.
121
- * @param extendTypeName The extended type name of the property.
121
+ * @param extendedTypeName The extended type name of the property.
122
122
  */
123
123
  setExtendedTypeName(classKey: SchemaItemKey, propertyName: string, extendedTypeName: string): Promise<void>;
124
124
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Properties.d.ts","sourceRoot":"","sources":["../../../src/Editing/Properties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAEnC,aAAa,EAAkC,MAAM,0BAA0B,CAAC;AAEpG,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,kCAAkC,EAAE,MA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SAAS,mBAAmB,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAO/H"}
@@ -10,6 +10,8 @@ const Exception_1 = require("./Exception");
10
10
  * A class allowing editing of attributes of the base Property class.
11
11
  */
12
12
  class Properties {
13
+ ecClassType;
14
+ _schemaEditor;
13
15
  constructor(ecClassType, _schemaEditor) {
14
16
  this.ecClassType = ecClassType;
15
17
  this._schemaEditor = _schemaEditor;
@@ -111,7 +113,7 @@ class Properties {
111
113
  .catch((e) => {
112
114
  throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetCategory, new Exception_1.PropertyId(this.ecClassType, classKey, propertyName), e);
113
115
  });
114
- const category = await this._schemaEditor.lookupSchemaItem(property.class.schema, categoryKey, ecschema_metadata_1.SchemaItemType.PropertyCategory)
116
+ const category = await this._schemaEditor.getSchemaItem(categoryKey, ecschema_metadata_1.PropertyCategory)
115
117
  .catch((e) => {
116
118
  throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetCategory, new Exception_1.PropertyId(this.ecClassType, classKey, propertyName), e);
117
119
  });
@@ -128,7 +130,7 @@ class Properties {
128
130
  .catch((e) => {
129
131
  throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetKindOfQuantity, new Exception_1.PropertyId(this.ecClassType, classKey, propertyName), e);
130
132
  });
131
- const koq = await this._schemaEditor.lookupSchemaItem(property.class.schema, kindOfQuantityKey, ecschema_metadata_1.SchemaItemType.KindOfQuantity)
133
+ const koq = await this._schemaEditor.getSchemaItem(kindOfQuantityKey, ecschema_metadata_1.KindOfQuantity)
132
134
  .catch((e) => {
133
135
  throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetKindOfQuantity, new Exception_1.PropertyId(this.ecClassType, classKey, propertyName), e);
134
136
  });
@@ -266,10 +268,10 @@ class PrimitiveOrEnumProperties extends Properties {
266
268
  super(ecClassType, _schemaEditor);
267
269
  }
268
270
  /**
269
- * Sets the extendTypeName attribute value.
271
+ * Sets the extendedTypeName attribute value.
270
272
  * @param classKey The SchemaItemKey of the class.
271
273
  * @param propertyName The name of the property.
272
- * @param extendTypeName The extended type name of the property.
274
+ * @param extendedTypeName The extended type name of the property.
273
275
  */
274
276
  async setExtendedTypeName(classKey, propertyName, extendedTypeName) {
275
277
  const property = await this.getProperty(classKey, propertyName)
@@ -1 +1 @@
1
- {"version":3,"file":"Properties.js","sourceRoot":"","sources":["../../../src/Editing/Properties.ts"],"names":[],"mappings":";;;AAAA,gEAEoG;AACpG,sDAA6C;AAE7C,+CAA+C;AAQ/C,2CAAsI;AAKtI;;;GAGG;AACH,MAAa,UAAU;IACrB,YAA6B,WAA+B,EAAY,aAAkC;QAA7E,gBAAW,GAAX,WAAW,CAAoB;QAAY,kBAAa,GAAb,aAAa,CAAqB;IAC1G,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,QAAuB,EAAE,YAAoB,EAAE,eAAuB;QACzF,IAAI,OAAe,CAAC;QACpB,IAAI,CAAC;YACH,OAAO,GAAG,IAAI,0BAAM,CAAC,eAAe,CAAC,CAAC;QACxC,CAAC;QAAC,MAAM,CAAC;YACP,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,eAAe,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,CAAC,EACpH,IAAI,8BAAkB,CAAC,2BAAe,CAAC,aAAa,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;QACxH,CAAC;QAED,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,WAAW,CAAkB,QAAQ,EAAE,YAAY,CAAC;aACrF,KAAK,CAAC,CAAC,CAAM,EAAE,EAAE;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,eAAe,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ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,aAAa,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACgB,KAAK,CAAC,WAAW,CAAgC,QAAuB,EAAE,YAAoB;QAC/G,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,CAA4B,QAAQ,EAAE,YAAY,CAAM,CAAC;QACjG,IAAI,CAAC,CAAC,QAAQ,YAAY,sCAAkB,CAAC,EAAC,CAAC;YAC7C,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,mBAAmB,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,4BAAgB,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACnK,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAjBD,oDAiBC;AAED;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,UAAU;IAC9C,YAAmB,WAA+B,EAAE,aAAkC;QACpF,KAAK,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACgB,KAAK,CAAC,WAAW,CAAgC,QAAuB,EAAE,YAAoB;QAC/G,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,WAAW,CAAwB,QAAQ,EAAE,YAAY,CAAM,CAAC;QAC7F,IAAI,CAAC,CAAC,QAAQ,YAAY,kCAAc,CAAC,EAAC,CAAC;YACzC,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,mBAAmB,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,4BAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/J,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAjBD,4CAiBC","sourcesContent":["import { CustomAttribute, CustomAttributeContainerProps, DelayedPromiseWithProps, ECClass, ECName,\r\n EnumerationProperty, KindOfQuantity, NavigationProperty, PrimitiveProperty,\r\n PropertyCategory, SchemaItemKey, SchemaItemType, StructProperty } from \"@itwin/ecschema-metadata\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport * as Rules from \"../Validation/ECRules\";\r\nimport { MutableArrayProperty } from \"./Mutable/MutableArrayProperty\";\r\nimport { MutableProperty } from \"./Mutable/MutableProperty\";\r\nimport { MutablePrimitiveOrEnumPropertyBase } from \"./Mutable/MutablePrimitiveOrEnumProperty\";\r\nimport { MutableClass } from \"./Mutable/MutableClass\";\r\nimport { MutableStructProperty } from \"./Mutable/MutableStructProperty\";\r\nimport { MutableNavigationProperty } from \"./Mutable/MutableNavigationProperty\";\r\nimport { ECClassSchemaItems } from \"./ECClasses\";\r\nimport { ClassId, CustomAttributeId, ECEditingStatus, PropertyId, PropertyTypeName, SchemaEditingError, SchemaId } from \"./Exception\";\r\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\r\n\r\ntype MutablePropertyType = MutableProperty | MutableArrayProperty | MutablePrimitiveOrEnumPropertyBase | MutableNavigationProperty | MutableStructProperty;\r\n\r\n/**\r\n * @alpha\r\n * A class allowing editing of attributes of the base Property class.\r\n */\r\nexport class Properties {\r\n public constructor(protected ecClassType: ECClassSchemaItems, protected _schemaEditor: SchemaContextEditor) {\r\n }\r\n\r\n public async setName(classKey: SchemaItemKey, propertyName: string, newPropertyName: string) {\r\n let newName: ECName;\r\n try {\r\n newName = new ECName(newPropertyName);\r\n } catch {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.InvalidECName, new PropertyId(this.ecClassType, classKey, newPropertyName)));\r\n }\r\n\r\n const existingProperty = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const baseProperty = await existingProperty.class.getProperty(newPropertyName, true) as MutableProperty;\r\n if (baseProperty) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.PropertyAlreadyExists, new PropertyId(this.ecClassType, baseProperty.class.key, newPropertyName)));\r\n }\r\n\r\n // Handle derived classes\r\n const derivedProperties: Array<MutableProperty> = [];\r\n const derivedClasses = await this.findDerivedClasses(existingProperty.class as MutableClass);\r\n for (const derivedClass of derivedClasses) {\r\n if (await derivedClass.getProperty(newPropertyName)) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.PropertyAlreadyExists, new PropertyId(this.ecClassType, derivedClass.key, newPropertyName)));\r\n }\r\n\r\n const propertyOverride = await derivedClass.getProperty(propertyName) as MutableProperty;\r\n // If found the property is overridden in the derived class.\r\n if (propertyOverride)\r\n derivedProperties.push(propertyOverride);\r\n }\r\n\r\n // Re-name the overridden property in all derived classes\r\n derivedProperties.forEach((prop: MutableProperty) => {\r\n prop.setName(newName);\r\n });\r\n\r\n existingProperty.setName(newName);\r\n }\r\n\r\n /**\r\n * Sets the property description.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param description The new description to set.\r\n */\r\n public async setDescription(classKey: SchemaItemKey, propertyName: string, description: string) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetDescription, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setDescription(description);\r\n }\r\n\r\n /**\r\n * Sets the property label.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param label The new label to set.\r\n */\r\n public async setLabel(classKey: SchemaItemKey, propertyName: string, label: string) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetLabel, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setLabel(label);\r\n }\r\n\r\n /**\r\n * Sets the property isReadOnly attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param isReadOnly The new isReadOnly value.\r\n */\r\n public async setIsReadOnly(classKey: SchemaItemKey, propertyName: string, isReadOnly: boolean) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetIsReadOnly, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setIsReadOnly(isReadOnly);\r\n }\r\n\r\n /**\r\n * Sets the property priority.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param priority The new priority.\r\n */\r\n public async setPriority(classKey: SchemaItemKey, propertyName: string, priority: number) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetPriority, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setPriority(priority);\r\n }\r\n\r\n /**\r\n * Sets the property category.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param categoryKey The SchemaItemKey of the property category.\r\n */\r\n public async setCategory(classKey: SchemaItemKey, propertyName: string, categoryKey: SchemaItemKey) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetCategory, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const category = await this._schemaEditor.lookupSchemaItem<PropertyCategory>(property.class.schema, categoryKey, SchemaItemType.PropertyCategory)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetCategory, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n property.setCategory(new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(categoryKey, async () => category));\r\n }\r\n\r\n /**\r\n * Sets the KindOfQuantity of a property.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param kindOfQuantityKey The SchemaItemKey of the KindOfQuantity.\r\n */\r\n public async setKindOfQuantity(classKey: SchemaItemKey, propertyName: string, kindOfQuantityKey: SchemaItemKey) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const koq = await this._schemaEditor.lookupSchemaItem<KindOfQuantity>(property.class.schema, kindOfQuantityKey, SchemaItemType.KindOfQuantity)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const currentKoq = await property.kindOfQuantity;\r\n if(currentKoq && currentKoq.persistenceUnit && koq.persistenceUnit && !currentKoq.persistenceUnit.matchesFullName(koq.persistenceUnit.fullName)) {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), undefined, undefined, \"KindOfQuantity can only be changed if it has the same persistence unit as the property.\");\r\n }\r\n\r\n property.setKindOfQuantity(new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(kindOfQuantityKey, async () => koq));\r\n }\r\n\r\n /**\r\n * Adds a CustomAttribute instance to the Property identified by the given SchemaItemKey and property name.\r\n * @param classKey The SchemaItemKey identifying the class.\r\n * @param propertyName The name of the property.\r\n * @param customAttribute The CustomAttribute instance to add.\r\n */\r\n public async addCustomAttribute(classKey: SchemaItemKey, propertyName: string, customAttribute: CustomAttribute) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToProperty, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n property.addCustomAttribute(customAttribute);\r\n\r\n const diagnosticsIterable = Rules.validateCustomAttributeInstance(property, customAttribute);\r\n\r\n const diagnostics: AnyDiagnostic[] = [];\r\n for await (const diagnostic of diagnosticsIterable) {\r\n diagnostics.push(diagnostic);\r\n }\r\n\r\n if (diagnostics.length > 0) {\r\n this.removeCustomAttribute(property, customAttribute);\r\n throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToProperty, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.RuleViolation, new CustomAttributeId(customAttribute.className, property)));\r\n }\r\n }\r\n\r\n /**\r\n * Removes a CustomAttribute from a property.\r\n * @param container\r\n * @param customAttribute\r\n */\r\n protected removeCustomAttribute(container: CustomAttributeContainerProps, customAttribute: CustomAttribute) {\r\n assert(container.customAttributes !== undefined);\r\n const map = container.customAttributes as Map<string, CustomAttribute>;\r\n map.delete(customAttribute.className);\r\n }\r\n\r\n /**\r\n * Gets the property with the specified name from the class identified by the given key.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property to retrieve.\r\n */\r\n protected async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const mutableClass = await this.getClass(classKey);\r\n\r\n const property = await mutableClass.getProperty(propertyName) as T;\r\n if (property === undefined) {\r\n throw new SchemaEditingError(ECEditingStatus.PropertyNotFound, new PropertyId(mutableClass.schemaItemType as ECClassSchemaItems, classKey, propertyName));\r\n }\r\n\r\n return property;\r\n }\r\n\r\n private async findDerivedClasses(mutableClass: MutableClass): Promise<Array<MutableClass>>{\r\n const derivedClasses: Array<MutableClass> = [];\r\n\r\n for (const schemaItem of this._schemaEditor.schemaContext.getSchemaItems()) {\r\n if(ECClass.isECClass(schemaItem) && await schemaItem.is(mutableClass)) {\r\n if (!mutableClass.key.matches(schemaItem.key)) {\r\n derivedClasses.push(schemaItem as MutableClass);\r\n }\r\n }\r\n }\r\n\r\n return derivedClasses;\r\n }\r\n\r\n private async getClass(classKey: SchemaItemKey): Promise<MutableClass> {\r\n const schema = await this._schemaEditor.getSchema(classKey.schemaKey);\r\n if (schema === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(classKey.schemaKey));\r\n\r\n const ecClass = await schema.getItem(classKey.name);\r\n if (ecClass === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new ClassId(this.ecClassType, classKey));\r\n\r\n if (ecClass.schemaItemType !== this.ecClassType){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidSchemaItemType, new ClassId(this.ecClassType, classKey));\r\n }\r\n\r\n return ecClass as MutableClass;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of attributes of PrimitiveArrayProperty,\r\n * EnumerationArrayProperty and StructArrayProperty.\r\n */\r\nexport class ArrayProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Sets the array property minOccurs attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minOccurs The new minOccurs value.\r\n */\r\n public async setMinOccurs(classKey: SchemaItemKey, propertyName: string, minOccurs: number) {\r\n const property = await this.getProperty<MutableArrayProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinOccurs, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinOccurs(minOccurs);\r\n }\r\n\r\n /**\r\n * Sets the array property maxOccurs attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxOccurs The new maxOccurs value.\r\n */\r\n public async setMaxOccurs(classKey: SchemaItemKey, propertyName: string, maxOccurs: number) {\r\n const property = await this.getProperty<MutableArrayProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxOccurs, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxOccurs(maxOccurs);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is an ArrayProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableArrayProperty>(classKey, propertyName) as T;\r\n if (!property.isArray()){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.ArrayProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of attributes of PrimitiveProperty and EnumerationProperty.\r\n */\r\nclass PrimitiveOrEnumProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Sets the extendTypeName attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param extendTypeName The extended type name of the property.\r\n */\r\n public async setExtendedTypeName(classKey: SchemaItemKey, propertyName: string, extendedTypeName: string) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetExtendedTypeName, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setExtendedTypeName(extendedTypeName);\r\n }\r\n\r\n /**\r\n * Sets the minLength attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minLength The minimum length of the property.\r\n */\r\n public async setMinLength(classKey: SchemaItemKey, propertyName: string, minLength: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinLength, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinLength(minLength);\r\n }\r\n\r\n /**\r\n * Sets the maxLength attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxLength The maximum length of the property.\r\n */\r\n public async setMaxLength(classKey: SchemaItemKey, propertyName: string, maxLength: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxLength, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxLength(maxLength);\r\n }\r\n\r\n /**\r\n * Sets the minValue attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minValue The minimum value of the property.\r\n */\r\n public async setMinValue(classKey: SchemaItemKey, propertyName: string, minValue: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinValue, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinValue(minValue);\r\n }\r\n\r\n /**\r\n * Sets the maxValue attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxValue The maximum value of the property.\r\n */\r\n public async setMaxValue(classKey: SchemaItemKey, propertyName: string, maxValue: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxValue, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxValue(maxValue);\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of PrimitiveProperty attributes.\r\n */\r\nexport class PrimitiveProperties extends PrimitiveOrEnumProperties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a PrimitiveProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName) as T;\r\n if (!(property instanceof PrimitiveProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.PrimitiveProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of EnumerationProperty attributes.\r\n */\r\nexport class EnumerationProperties extends PrimitiveOrEnumProperties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a EnumerationProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName) as T;\r\n if (!(property instanceof EnumerationProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.EnumerationProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of NavigationProperties attributes.\r\n */\r\nexport class NavigationProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a NavigationProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableNavigationProperty>(classKey, propertyName) as T;\r\n if (!(property instanceof NavigationProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.NavigationProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of StructProperty attributes.\r\n */\r\nexport class StructProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a StructProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableStructProperty>(classKey, propertyName) as T;\r\n if (!(property instanceof StructProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.StructProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n"]}
1
+ {"version":3,"file":"Properties.js","sourceRoot":"","sources":["../../../src/Editing/Properties.ts"],"names":[],"mappings":";;;AAAA,gEAEoF;AACpF,sDAA6C;AAE7C,+CAA+C;AAQ/C,2CAAsI;AAKtI;;;GAGG;AACH,MAAa,UAAU;IACQ;IAA2C;IAAxE,YAA6B,WAA+B,EAAY,aAAkC;QAA7E,gBAAW,GAAX,WAAW,CAAoB;QAAY,kBAAa,GAAb,aAAa,CAAqB;IAC1G,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,QAAuB,EAAE,YAAoB,EAAE,eAAuB;QACzF,IAAI,OAAe,CAAC;QACpB,IAAI,CAAC;YACH,OAAO,GAAG,IAAI,0BAAM,CAAC,eAAe,CAAC,CAAC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CAAC,QAAQ,YAAY,kCAAc,CAAC,EAAC,CAAC;YACzC,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,mBAAmB,EAAE,IAAI,sBAAU,CAAC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,4BAAgB,CAAC,cAAc,CAAC,CAAC,CAAC;QAC/J,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAjBD,4CAiBC","sourcesContent":["import { CustomAttribute, CustomAttributeContainerProps, DelayedPromiseWithProps, ECClass, ECName,\r\n EnumerationProperty, KindOfQuantity, NavigationProperty, PrimitiveProperty,\r\n PropertyCategory, SchemaItemKey, StructProperty } from \"@itwin/ecschema-metadata\";\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport * as Rules from \"../Validation/ECRules\";\r\nimport { MutableArrayProperty } from \"./Mutable/MutableArrayProperty\";\r\nimport { MutableProperty } from \"./Mutable/MutableProperty\";\r\nimport { MutablePrimitiveOrEnumPropertyBase } from \"./Mutable/MutablePrimitiveOrEnumProperty\";\r\nimport { MutableClass } from \"./Mutable/MutableClass\";\r\nimport { MutableStructProperty } from \"./Mutable/MutableStructProperty\";\r\nimport { MutableNavigationProperty } from \"./Mutable/MutableNavigationProperty\";\r\nimport { ECClassSchemaItems } from \"./ECClasses\";\r\nimport { ClassId, CustomAttributeId, ECEditingStatus, PropertyId, PropertyTypeName, SchemaEditingError, SchemaId } from \"./Exception\";\r\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\r\n\r\ntype MutablePropertyType = MutableProperty | MutableArrayProperty | MutablePrimitiveOrEnumPropertyBase | MutableNavigationProperty | MutableStructProperty;\r\n\r\n/**\r\n * @alpha\r\n * A class allowing editing of attributes of the base Property class.\r\n */\r\nexport class Properties {\r\n public constructor(protected ecClassType: ECClassSchemaItems, protected _schemaEditor: SchemaContextEditor) {\r\n }\r\n\r\n public async setName(classKey: SchemaItemKey, propertyName: string, newPropertyName: string) {\r\n let newName: ECName;\r\n try {\r\n newName = new ECName(newPropertyName);\r\n } catch {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.InvalidECName, new PropertyId(this.ecClassType, classKey, newPropertyName)));\r\n }\r\n\r\n const existingProperty = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const baseProperty = await existingProperty.class.getProperty(newPropertyName, true) as MutableProperty;\r\n if (baseProperty) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.PropertyAlreadyExists, new PropertyId(this.ecClassType, baseProperty.class.key, newPropertyName)));\r\n }\r\n\r\n // Handle derived classes\r\n const derivedProperties: Array<MutableProperty> = [];\r\n const derivedClasses = await this.findDerivedClasses(existingProperty.class as MutableClass);\r\n for (const derivedClass of derivedClasses) {\r\n if (await derivedClass.getProperty(newPropertyName)) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyName, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.PropertyAlreadyExists, new PropertyId(this.ecClassType, derivedClass.key, newPropertyName)));\r\n }\r\n\r\n const propertyOverride = await derivedClass.getProperty(propertyName) as MutableProperty;\r\n // If found the property is overridden in the derived class.\r\n if (propertyOverride)\r\n derivedProperties.push(propertyOverride);\r\n }\r\n\r\n // Re-name the overridden property in all derived classes\r\n derivedProperties.forEach((prop: MutableProperty) => {\r\n prop.setName(newName);\r\n });\r\n\r\n existingProperty.setName(newName);\r\n }\r\n\r\n /**\r\n * Sets the property description.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param description The new description to set.\r\n */\r\n public async setDescription(classKey: SchemaItemKey, propertyName: string, description: string) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetDescription, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setDescription(description);\r\n }\r\n\r\n /**\r\n * Sets the property label.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param label The new label to set.\r\n */\r\n public async setLabel(classKey: SchemaItemKey, propertyName: string, label: string) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetLabel, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setLabel(label);\r\n }\r\n\r\n /**\r\n * Sets the property isReadOnly attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param isReadOnly The new isReadOnly value.\r\n */\r\n public async setIsReadOnly(classKey: SchemaItemKey, propertyName: string, isReadOnly: boolean) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetIsReadOnly, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setIsReadOnly(isReadOnly);\r\n }\r\n\r\n /**\r\n * Sets the property priority.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param priority The new priority.\r\n */\r\n public async setPriority(classKey: SchemaItemKey, propertyName: string, priority: number) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetPriority, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setPriority(priority);\r\n }\r\n\r\n /**\r\n * Sets the property category.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param categoryKey The SchemaItemKey of the property category.\r\n */\r\n public async setCategory(classKey: SchemaItemKey, propertyName: string, categoryKey: SchemaItemKey) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetCategory, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const category = await this._schemaEditor.getSchemaItem(categoryKey, PropertyCategory)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetCategory, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n property.setCategory(new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(categoryKey, async () => category));\r\n }\r\n\r\n /**\r\n * Sets the KindOfQuantity of a property.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param kindOfQuantityKey The SchemaItemKey of the KindOfQuantity.\r\n */\r\n public async setKindOfQuantity(classKey: SchemaItemKey, propertyName: string, kindOfQuantityKey: SchemaItemKey) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const koq = await this._schemaEditor.getSchemaItem(kindOfQuantityKey, KindOfQuantity)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n const currentKoq = await property.kindOfQuantity;\r\n if(currentKoq && currentKoq.persistenceUnit && koq.persistenceUnit && !currentKoq.persistenceUnit.matchesFullName(koq.persistenceUnit.fullName)) {\r\n throw new SchemaEditingError(ECEditingStatus.SetKindOfQuantity, new PropertyId(this.ecClassType, classKey, propertyName), undefined, undefined, \"KindOfQuantity can only be changed if it has the same persistence unit as the property.\");\r\n }\r\n\r\n property.setKindOfQuantity(new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(kindOfQuantityKey, async () => koq));\r\n }\r\n\r\n /**\r\n * Adds a CustomAttribute instance to the Property identified by the given SchemaItemKey and property name.\r\n * @param classKey The SchemaItemKey identifying the class.\r\n * @param propertyName The name of the property.\r\n * @param customAttribute The CustomAttribute instance to add.\r\n */\r\n public async addCustomAttribute(classKey: SchemaItemKey, propertyName: string, customAttribute: CustomAttribute) {\r\n const property = await this.getProperty<MutableProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToProperty, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n\r\n property.addCustomAttribute(customAttribute);\r\n\r\n const diagnosticsIterable = Rules.validateCustomAttributeInstance(property, customAttribute);\r\n\r\n const diagnostics: AnyDiagnostic[] = [];\r\n for await (const diagnostic of diagnosticsIterable) {\r\n diagnostics.push(diagnostic);\r\n }\r\n\r\n if (diagnostics.length > 0) {\r\n this.removeCustomAttribute(property, customAttribute);\r\n throw new SchemaEditingError(ECEditingStatus.AddCustomAttributeToProperty, new PropertyId(this.ecClassType, classKey, propertyName),\r\n new SchemaEditingError(ECEditingStatus.RuleViolation, new CustomAttributeId(customAttribute.className, property)));\r\n }\r\n }\r\n\r\n /**\r\n * Removes a CustomAttribute from a property.\r\n * @param container\r\n * @param customAttribute\r\n */\r\n protected removeCustomAttribute(container: CustomAttributeContainerProps, customAttribute: CustomAttribute) {\r\n assert(container.customAttributes !== undefined);\r\n const map = container.customAttributes as Map<string, CustomAttribute>;\r\n map.delete(customAttribute.className);\r\n }\r\n\r\n /**\r\n * Gets the property with the specified name from the class identified by the given key.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property to retrieve.\r\n */\r\n protected async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const mutableClass = await this.getClass(classKey);\r\n\r\n const property = await mutableClass.getProperty(propertyName) as T;\r\n if (property === undefined) {\r\n throw new SchemaEditingError(ECEditingStatus.PropertyNotFound, new PropertyId(mutableClass.schemaItemType as ECClassSchemaItems, classKey, propertyName));\r\n }\r\n\r\n return property;\r\n }\r\n\r\n private async findDerivedClasses(mutableClass: MutableClass): Promise<Array<MutableClass>>{\r\n const derivedClasses: Array<MutableClass> = [];\r\n\r\n for (const schemaItem of this._schemaEditor.schemaContext.getSchemaItems()) {\r\n if(ECClass.isECClass(schemaItem) && await schemaItem.is(mutableClass)) {\r\n if (!mutableClass.key.matches(schemaItem.key)) {\r\n derivedClasses.push(schemaItem as MutableClass);\r\n }\r\n }\r\n }\r\n\r\n return derivedClasses;\r\n }\r\n\r\n private async getClass(classKey: SchemaItemKey): Promise<MutableClass> {\r\n const schema = await this._schemaEditor.getSchema(classKey.schemaKey);\r\n if (schema === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.SchemaNotFound, new SchemaId(classKey.schemaKey));\r\n\r\n const ecClass = await schema.getItem(classKey.name);\r\n if (ecClass === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new ClassId(this.ecClassType, classKey));\r\n\r\n if (ecClass.schemaItemType !== this.ecClassType){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidSchemaItemType, new ClassId(this.ecClassType, classKey));\r\n }\r\n\r\n return ecClass as MutableClass;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of attributes of PrimitiveArrayProperty,\r\n * EnumerationArrayProperty and StructArrayProperty.\r\n */\r\nexport class ArrayProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Sets the array property minOccurs attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minOccurs The new minOccurs value.\r\n */\r\n public async setMinOccurs(classKey: SchemaItemKey, propertyName: string, minOccurs: number) {\r\n const property = await this.getProperty<MutableArrayProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinOccurs, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinOccurs(minOccurs);\r\n }\r\n\r\n /**\r\n * Sets the array property maxOccurs attribute.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxOccurs The new maxOccurs value.\r\n */\r\n public async setMaxOccurs(classKey: SchemaItemKey, propertyName: string, maxOccurs: number) {\r\n const property = await this.getProperty<MutableArrayProperty>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxOccurs, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxOccurs(maxOccurs);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is an ArrayProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableArrayProperty>(classKey, propertyName) as T;\r\n if (!property.isArray()){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.ArrayProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of attributes of PrimitiveProperty and EnumerationProperty.\r\n */\r\nclass PrimitiveOrEnumProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Sets the extendedTypeName attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param extendedTypeName The extended type name of the property.\r\n */\r\n public async setExtendedTypeName(classKey: SchemaItemKey, propertyName: string, extendedTypeName: string) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetExtendedTypeName, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setExtendedTypeName(extendedTypeName);\r\n }\r\n\r\n /**\r\n * Sets the minLength attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minLength The minimum length of the property.\r\n */\r\n public async setMinLength(classKey: SchemaItemKey, propertyName: string, minLength: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinLength, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinLength(minLength);\r\n }\r\n\r\n /**\r\n * Sets the maxLength attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxLength The maximum length of the property.\r\n */\r\n public async setMaxLength(classKey: SchemaItemKey, propertyName: string, maxLength: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxLength, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxLength(maxLength);\r\n }\r\n\r\n /**\r\n * Sets the minValue attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param minValue The minimum value of the property.\r\n */\r\n public async setMinValue(classKey: SchemaItemKey, propertyName: string, minValue: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMinValue, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMinValue(minValue);\r\n }\r\n\r\n /**\r\n * Sets the maxValue attribute value.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n * @param maxValue The maximum value of the property.\r\n */\r\n public async setMaxValue(classKey: SchemaItemKey, propertyName: string, maxValue: number) {\r\n const property = await this.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName)\r\n .catch((e: any) => {\r\n throw new SchemaEditingError(ECEditingStatus.SetMaxValue, new PropertyId(this.ecClassType, classKey, propertyName), e);\r\n });\r\n property.setMaxValue(maxValue);\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of PrimitiveProperty attributes.\r\n */\r\nexport class PrimitiveProperties extends PrimitiveOrEnumProperties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a PrimitiveProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName) as T;\r\n if (!(property instanceof PrimitiveProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.PrimitiveProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of EnumerationProperty attributes.\r\n */\r\nexport class EnumerationProperties extends PrimitiveOrEnumProperties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a EnumerationProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutablePrimitiveOrEnumPropertyBase>(classKey, propertyName) as T;\r\n if (!(property instanceof EnumerationProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.EnumerationProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of NavigationProperties attributes.\r\n */\r\nexport class NavigationProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a NavigationProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableNavigationProperty>(classKey, propertyName) as T;\r\n if (!(property instanceof NavigationProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.NavigationProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n/**\r\n * @alpha\r\n * A class extending Properties allowing editing of StructProperty attributes.\r\n */\r\nexport class StructProperties extends Properties {\r\n public constructor(ecClassType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor) {\r\n super(ecClassType, _schemaEditor);\r\n }\r\n\r\n /**\r\n * Override to validate that the found property is a StructProperty.\r\n * @param classKey The SchemaItemKey of the class.\r\n * @param propertyName The name of the property.\r\n */\r\n protected override async getProperty<T extends MutablePropertyType>(classKey: SchemaItemKey, propertyName: string): Promise<T> {\r\n const property = await super.getProperty<MutableStructProperty>(classKey, propertyName) as T;\r\n if (!(property instanceof StructProperty)){\r\n throw new SchemaEditingError(ECEditingStatus.InvalidPropertyType, new PropertyId(this.ecClassType, classKey, propertyName, PropertyTypeName.StructProperty));\r\n }\r\n return property;\r\n }\r\n}\r\n\r\n"]}
@@ -1,7 +1,7 @@
1
1
  /** @packageDocumentation
2
2
  * @module Editing
3
3
  */
4
- import { PropertyCategoryProps, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
4
+ import { PropertyCategory, PropertyCategoryProps, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
5
5
  import { SchemaContextEditor } from "./Editor";
6
6
  import { SchemaItems } from "./SchemaItems";
7
7
  /**
@@ -9,6 +9,7 @@ import { SchemaItems } from "./SchemaItems";
9
9
  * A class allowing you to create schema items of type Property Category.
10
10
  */
11
11
  export declare class PropertyCategories extends SchemaItems {
12
+ protected get itemTypeClass(): typeof PropertyCategory;
12
13
  constructor(schemaEditor: SchemaContextEditor);
13
14
  create(schemaKey: SchemaKey, name: string, priority: number, displayLabel?: string): Promise<SchemaItemKey>;
14
15
  createFromProps(schemaKey: SchemaKey, propertyCategoryProps: PropertyCategoryProps): Promise<SchemaItemKey>;
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategories.d.ts","sourceRoot":"","sources":["../../../src/Editing/PropertyCategories.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAoB,qBAAqB,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;gBAC9B,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAa3G,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAS3G,WAAW,CAAC,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ1F"}
1
+ {"version":3,"file":"PropertyCategories.d.ts","sourceRoot":"","sources":["../../../src/Editing/PropertyCategories.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC7H,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,cAAuB,aAAa,IAAI,OAAO,gBAAgB,CAE9D;gBAEkB,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAa3G,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,qBAAqB,EAAE,qBAAqB,GAAG,OAAO,CAAC,aAAa,CAAC;IAS3G,WAAW,CAAC,eAAe,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ1F"}
@@ -9,6 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.PropertyCategories = void 0;
11
11
  const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
12
+ const MutablePropertyCategory_1 = require("./Mutable/MutablePropertyCategory");
12
13
  const Exception_1 = require("./Exception");
13
14
  const SchemaItems_1 = require("./SchemaItems");
14
15
  /**
@@ -16,6 +17,9 @@ const SchemaItems_1 = require("./SchemaItems");
16
17
  * A class allowing you to create schema items of type Property Category.
17
18
  */
18
19
  class PropertyCategories extends SchemaItems_1.SchemaItems {
20
+ get itemTypeClass() {
21
+ return ecschema_metadata_1.PropertyCategory;
22
+ }
19
23
  constructor(schemaEditor) {
20
24
  super(ecschema_metadata_1.SchemaItemType.PropertyCategory, schemaEditor);
21
25
  }
@@ -42,7 +46,7 @@ class PropertyCategories extends SchemaItems_1.SchemaItems {
42
46
  }
43
47
  async setPriority(propCategoryKey, priority) {
44
48
  try {
45
- const propertyCategory = await this.getSchemaItem(propCategoryKey);
49
+ const propertyCategory = await this.getSchemaItem(propCategoryKey, MutablePropertyCategory_1.MutablePropertyCategory);
46
50
  propertyCategory.setPriority(priority);
47
51
  }
48
52
  catch (e) {
@@ -1 +1 @@
1
- {"version":3,"file":"PropertyCategories.js","sourceRoot":"","sources":["../../../src/Editing/PropertyCategories.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAA6H;AAG7H,2CAAgF;AAChF,+CAA4C;AAE5C;;;GAGG;AACH,MAAa,kBAAmB,SAAQ,yBAAW;IACjD,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,QAAgB,EAAE,YAAqB;QAC7F,IAAI,CAAC;YACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAmB,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAA4B,CAAC;YAC/L,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YACtC,IAAI,YAAY;gBACd,eAAe,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAEhD,OAAO,eAAe,CAAC,GAAG,CAAC;QAC7B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,sBAAsB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAClI,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,qBAA4C;QAC7F,IAAI,CAAC;YACH,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC,CAAC;YAC5K,OAAO,eAAe,CAAC,GAAG,CAAC;QAC7B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,qBAAqB,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5J,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAA8B,EAAE,QAAgB;QACvE,IAAI,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,aAAa,CAA0B,eAAe,CAAC,CAAC;YAC5F,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,2BAA2B,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QACvI,CAAC;IACH,CAAC;CACF;AAnCD,gDAmCC","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 Editing\r\n */\r\n\r\nimport { PropertyCategory, PropertyCategoryProps, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutablePropertyCategory } from \"./Mutable/MutablePropertyCategory\";\r\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Property Category.\r\n */\r\nexport class PropertyCategories extends SchemaItems {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.PropertyCategory, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, priority: number, displayLabel?: string): Promise<SchemaItemKey> {\r\n try {\r\n const newPropCategory = await this.createSchemaItem<PropertyCategory>(schemaKey, this.schemaItemType, (schema) => schema.createPropertyCategory.bind(schema), name) as MutablePropertyCategory;\r\n newPropCategory.setPriority(priority);\r\n if (displayLabel)\r\n newPropCategory.setDisplayLabel(displayLabel);\r\n\r\n return newPropCategory.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n public async createFromProps(schemaKey: SchemaKey, propertyCategoryProps: PropertyCategoryProps): Promise<SchemaItemKey> {\r\n try {\r\n const newPropCategory = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createPropertyCategory.bind(schema), propertyCategoryProps);\r\n return newPropCategory.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, propertyCategoryProps.name!, schemaKey), e);\r\n }\r\n }\r\n\r\n public async setPriority(propCategoryKey: SchemaItemKey, priority: number): Promise<void> {\r\n try {\r\n const propertyCategory = await this.getSchemaItem<MutablePropertyCategory>(propCategoryKey);\r\n propertyCategory.setPriority(priority);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyCategoryPriority, new SchemaItemId(this.schemaItemType, propCategoryKey), e);\r\n }\r\n }\r\n}\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E,EAAE,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,qBAAqB,CAAC,CAAC;YAC5K,OAAO,eAAe,CAAC,GAAG,CAAC;QAC7B,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,qBAAqB,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5J,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,WAAW,CAAC,eAA8B,EAAE,QAAgB;QACvE,IAAI,CAAC;YACH,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,iDAAuB,CAAC,CAAC;YAC5F,gBAAgB,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,2BAA2B,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QACvI,CAAC;IACH,CAAC;CACF;AAvCD,gDAuCC","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 Editing\r\n */\r\n\r\nimport { PropertyCategory, PropertyCategoryProps, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutablePropertyCategory } from \"./Mutable/MutablePropertyCategory\";\r\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Property Category.\r\n */\r\nexport class PropertyCategories extends SchemaItems {\r\n protected override get itemTypeClass(): typeof PropertyCategory {\r\n return PropertyCategory;\r\n }\r\n\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.PropertyCategory, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, priority: number, displayLabel?: string): Promise<SchemaItemKey> {\r\n try {\r\n const newPropCategory = await this.createSchemaItem<PropertyCategory>(schemaKey, this.schemaItemType, (schema) => schema.createPropertyCategory.bind(schema), name) as MutablePropertyCategory;\r\n newPropCategory.setPriority(priority);\r\n if (displayLabel)\r\n newPropCategory.setDisplayLabel(displayLabel);\r\n\r\n return newPropCategory.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n }\r\n\r\n public async createFromProps(schemaKey: SchemaKey, propertyCategoryProps: PropertyCategoryProps): Promise<SchemaItemKey> {\r\n try {\r\n const newPropCategory = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createPropertyCategory.bind(schema), propertyCategoryProps);\r\n return newPropCategory.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, propertyCategoryProps.name!, schemaKey), e);\r\n }\r\n }\r\n\r\n public async setPriority(propCategoryKey: SchemaItemKey, priority: number): Promise<void> {\r\n try {\r\n const propertyCategory = await this.getSchemaItem(propCategoryKey, MutablePropertyCategory);\r\n propertyCategory.setPriority(priority);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.SetPropertyCategoryPriority, new SchemaItemId(this.schemaItemType, propCategoryKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -10,6 +10,7 @@ import { NavigationProperties } from "./Properties";
10
10
  * A class extending ECClasses allowing you to create schema items of type RelationshipClass.
11
11
  */
12
12
  export declare class RelationshipClasses extends ECClasses {
13
+ protected get itemTypeClass(): typeof RelationshipClass;
13
14
  constructor(schemaEditor: SchemaContextEditor);
14
15
  /**
15
16
  * Allows access for editing of NavigationProperty attributes.
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipClasses.d.ts","sourceRoot":"","sources":["../../../src/Editing/RelationshipClasses.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,eAAe,EAA2B,eAAe,EAAE,WAAW,EAAyC,KAAK,EAAE,uBAAuB,EAC7I,iBAAiB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,eAAe,EAAE,wBAAwB,EAAE,aAAa,EAC3H,SAAS,EAAE,iBAAiB,EAAE,YAAY,EAC3C,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAGpD;;;GAGG;AACH,qBAAa,mBAAoB,SAAQ,SAAS;gBAC7B,YAAY,EAAE,mBAAmB;IAIpD;;OAEG;IACH,SAAgB,oBAAoB,uBAAoE;IAExG;;;;;;;;OAQG;IACU,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,eAAe,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,iBAAiB,EAAE,YAAY,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAa9L;;;;OAIG;IACU,mBAAmB,CAAC,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/G;;;;OAIG;IACU,mBAAmB,CAAC,eAAe,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/G;;;;OAIG;IACU,eAAe,CAAC,SAAS,E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