@itwin/ecschema-editing 4.7.0-dev.8 → 4.8.0-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Differencing/Errors.d.ts +19 -0
  3. package/lib/cjs/Differencing/Errors.d.ts.map +1 -0
  4. package/lib/cjs/Differencing/Errors.js +24 -0
  5. package/lib/cjs/Differencing/Errors.js.map +1 -0
  6. package/lib/cjs/Differencing/SchemaConflicts.d.ts +0 -14
  7. package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
  8. package/lib/cjs/Differencing/SchemaConflicts.js +1 -14
  9. package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
  10. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -4
  11. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  12. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +31 -31
  13. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  14. package/lib/cjs/Differencing/SchemaDifference.d.ts +1 -1
  15. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  16. package/lib/cjs/Differencing/SchemaDifference.js +6 -6
  17. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  18. package/lib/cjs/Editing/Constants.d.ts +6 -6
  19. package/lib/cjs/Editing/Constants.d.ts.map +1 -1
  20. package/lib/cjs/Editing/Constants.js +26 -31
  21. package/lib/cjs/Editing/Constants.js.map +1 -1
  22. package/lib/cjs/Editing/CustomAttributes.d.ts +3 -3
  23. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  24. package/lib/cjs/Editing/CustomAttributes.js +18 -28
  25. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  26. package/lib/cjs/Editing/ECClasses.d.ts +24 -23
  27. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  28. package/lib/cjs/Editing/ECClasses.js +126 -156
  29. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  30. package/lib/cjs/Editing/Editor.d.ts +10 -31
  31. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  32. package/lib/cjs/Editing/Editor.js +59 -43
  33. package/lib/cjs/Editing/Editor.js.map +1 -1
  34. package/lib/cjs/Editing/Entities.d.ts +9 -9
  35. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  36. package/lib/cjs/Editing/Entities.js +65 -85
  37. package/lib/cjs/Editing/Entities.js.map +1 -1
  38. package/lib/cjs/Editing/Enumerations.d.ts +6 -6
  39. package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
  40. package/lib/cjs/Editing/Enumerations.js +57 -55
  41. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  42. package/lib/cjs/Editing/Exception.d.ts +257 -0
  43. package/lib/cjs/Editing/Exception.d.ts.map +1 -0
  44. package/lib/cjs/Editing/Exception.js +426 -0
  45. package/lib/cjs/Editing/Exception.js.map +1 -0
  46. package/lib/cjs/Editing/Formats.d.ts +6 -6
  47. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  48. package/lib/cjs/Editing/Formats.js +28 -33
  49. package/lib/cjs/Editing/Formats.js.map +1 -1
  50. package/lib/cjs/Editing/InvertedUnits.d.ts +6 -6
  51. package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
  52. package/lib/cjs/Editing/InvertedUnits.js +41 -56
  53. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  54. package/lib/cjs/Editing/KindOfQuantities.d.ts +6 -6
  55. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  56. package/lib/cjs/Editing/KindOfQuantities.js +50 -57
  57. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  58. package/lib/cjs/Editing/Mixins.d.ts +5 -5
  59. package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
  60. package/lib/cjs/Editing/Mixins.js +43 -58
  61. package/lib/cjs/Editing/Mixins.js.map +1 -1
  62. package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
  63. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  64. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  65. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  66. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +1 -5
  67. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts.map +1 -1
  68. package/lib/cjs/Editing/Mutable/MutableEntityClass.js +1 -45
  69. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  70. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  71. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  72. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
  73. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  74. package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
  75. package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
  76. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  77. package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
  78. package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
  79. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  80. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  81. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  82. package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
  83. package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
  84. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  85. package/lib/cjs/Editing/Phenomena.d.ts +7 -7
  86. package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
  87. package/lib/cjs/Editing/Phenomena.js +23 -23
  88. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  89. package/lib/cjs/Editing/Properties.d.ts +7 -6
  90. package/lib/cjs/Editing/Properties.d.ts.map +1 -1
  91. package/lib/cjs/Editing/Properties.js +99 -46
  92. package/lib/cjs/Editing/Properties.js.map +1 -1
  93. package/lib/cjs/Editing/PropertyCategories.d.ts +6 -6
  94. package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
  95. package/lib/cjs/Editing/PropertyCategories.js +29 -27
  96. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  97. package/lib/cjs/Editing/RelationshipClasses.d.ts +15 -17
  98. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  99. package/lib/cjs/Editing/RelationshipClasses.js +97 -101
  100. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  101. package/lib/cjs/Editing/SchemaItems.d.ts +13 -5
  102. package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
  103. package/lib/cjs/Editing/SchemaItems.js +58 -6
  104. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  105. package/lib/cjs/Editing/Structs.d.ts +3 -3
  106. package/lib/cjs/Editing/Structs.d.ts.map +1 -1
  107. package/lib/cjs/Editing/Structs.js +17 -27
  108. package/lib/cjs/Editing/Structs.js.map +1 -1
  109. package/lib/cjs/Editing/UnitSystems.d.ts +7 -7
  110. package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
  111. package/lib/cjs/Editing/UnitSystems.js +22 -20
  112. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  113. package/lib/cjs/Editing/Units.d.ts +6 -6
  114. package/lib/cjs/Editing/Units.d.ts.map +1 -1
  115. package/lib/cjs/Editing/Units.js +26 -35
  116. package/lib/cjs/Editing/Units.js.map +1 -1
  117. package/lib/cjs/Merging/CAClassMerger.js +2 -2
  118. package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
  119. package/lib/cjs/Merging/ClassMerger.d.ts +1 -2
  120. package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
  121. package/lib/cjs/Merging/ClassMerger.js +15 -39
  122. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  123. package/lib/cjs/Merging/ConstantMerger.d.ts.map +1 -1
  124. package/lib/cjs/Merging/ConstantMerger.js +2 -3
  125. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  126. package/lib/cjs/Merging/CustomAttributeMerger.d.ts +4 -5
  127. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  128. package/lib/cjs/Merging/CustomAttributeMerger.js +8 -18
  129. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  130. package/lib/cjs/Merging/EntityClassMerger.d.ts +1 -2
  131. package/lib/cjs/Merging/EntityClassMerger.d.ts.map +1 -1
  132. package/lib/cjs/Merging/EntityClassMerger.js +3 -10
  133. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  134. package/lib/cjs/Merging/EnumerationMerger.d.ts.map +1 -1
  135. package/lib/cjs/Merging/EnumerationMerger.js +8 -10
  136. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  137. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
  138. package/lib/cjs/Merging/KindOfQuantityMerger.js +2 -3
  139. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  140. package/lib/cjs/Merging/MixinMerger.js +2 -2
  141. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  142. package/lib/cjs/Merging/PhenomenonMerger.d.ts.map +1 -1
  143. package/lib/cjs/Merging/PhenomenonMerger.js +1 -2
  144. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
  145. package/lib/cjs/Merging/PropertyCategoryMerger.d.ts.map +1 -1
  146. package/lib/cjs/Merging/PropertyCategoryMerger.js +1 -2
  147. package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
  148. package/lib/cjs/Merging/PropertyMerger.d.ts +2 -3
  149. package/lib/cjs/Merging/PropertyMerger.d.ts.map +1 -1
  150. package/lib/cjs/Merging/PropertyMerger.js +21 -42
  151. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  152. package/lib/cjs/Merging/RelationshipClassMerger.d.ts +5 -3
  153. package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
  154. package/lib/cjs/Merging/RelationshipClassMerger.js +35 -33
  155. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  156. package/lib/cjs/Merging/SchemaItemMerger.d.ts +3 -4
  157. package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
  158. package/lib/cjs/Merging/SchemaItemMerger.js +3 -2
  159. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  160. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  161. package/lib/cjs/Merging/SchemaMerger.js +8 -14
  162. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  163. package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
  164. package/lib/cjs/Merging/UnitSystemMerger.d.ts.map +1 -1
  165. package/lib/cjs/Merging/UnitSystemMerger.js +1 -2
  166. package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
  167. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  168. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  169. package/lib/cjs/Validation/ECRules.js.map +1 -1
  170. package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
  171. package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
  172. package/lib/cjs/Validation/Rules.js.map +1 -1
  173. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  174. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  175. package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
  176. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  177. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  178. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  179. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  180. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  181. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  182. package/lib/cjs/ecschema-editing.d.ts +1 -0
  183. package/lib/cjs/ecschema-editing.d.ts.map +1 -1
  184. package/lib/cjs/ecschema-editing.js +1 -0
  185. package/lib/cjs/ecschema-editing.js.map +1 -1
  186. package/package.json +9 -9
  187. package/public/locales/en/ECSchemaEditing.json +26 -26
@@ -1 +1 @@
1
- {"version":3,"file":"Entities.js","sourceRoot":"","sources":["../../../src/Editing/Entities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AAExC,6CAAoD;AAEpD;;;GAGG;AACH,MAAa,QAAS,SAAQ,qBAAS;IACrC,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAGlD;;WAEG;QACa,yBAAoB,GAAG,IAAI,iCAAoB,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IALzG,CAAC;IAOM,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,IAAY,EAAE,QAAyB,EAAE,YAA2B,EAAE,YAAqB,EAAE,MAAgB;QAC5J,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QACrF,IAAI,CAAC,SAAS;YACZ,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,0DAA0D,YAAY,CAAC,QAAQ,sBAAsB,CAAC,CAAC;QAE1I,IAAI,SAAS,EAAE,cAAc,KAAK,kCAAc,CAAC,WAAW;YAC1D,MAAM,IAAI,KAAK,CAAC,aAAa,IAAI,0DAA0D,YAAY,CAAC,QAAQ,yBAAyB,CAAC,CAAC;QAE7I,IAAI,CAAC,CAAC,MAAO,SAAyB,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E,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,gBAAgB,QAAQ,CAAC,QAAQ,+BAA+B,EAAC,CAAC;QAElJ,IAAI,MAAM,CAAC,cAAc,KAAK,kCAAc,CAAC,WAAW;YACtD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,QAAQ,CAAC,QAAQ,6BAA6B,EAAE,CAAC;QAE7I,MAAM,kBAAkB,GAAI,MAAM,MAAM,CAAC,wBAAwB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;QACrJ,MAAM,kBAAkB,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAEnD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC;IACnE,CAAC;CACF;AApKD,4BAoKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport {\n DelayedPromiseWithProps, ECClassModifier, ECObjectsError, ECObjectsStatus, EntityClass, EntityClassProps,\n Mixin, NavigationPropertyProps, RelationshipClass, SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\n} from \"@itwin/ecschema-metadata\";\nimport { PropertyEditResults, SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\nimport { ECClasses } from \"./ECClasses\";\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\nimport { NavigationProperties } from \"./Properties\";\n\n/**\n * @alpha\n * A class extending ECClasses allowing you to create schema items of type EntityClass.\n */\nexport class Entities extends ECClasses {\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.EntityClass, schemaEditor);\n }\n\n /**\n * Allows access for editing of NavigationProperty attributes.\n */\n public readonly navigationProperties = new NavigationProperties(this.schemaItemType, this._schemaEditor);\n\n public async createElement(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemEditResults> {\n const baseClass = await this._schemaEditor.schemaContext.getSchemaItem(baseClassKey);\n if (!baseClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} could not be found.`);\n\n if (baseClass?.schemaItemType !== SchemaItemType.EntityClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an EntityClass.`);\n\n if (!(await (baseClass as EntityClass).is(\"Element\", \"BisCore\"))) {\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an Element.`);\n }\n\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\n }\n\n public async createElementUniqueAspect(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemEditResults> {\n const baseClass = await this._schemaEditor.schemaContext.getSchemaItem(baseClassKey);\n if (!baseClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} could not be found.`);\n\n if (baseClass?.schemaItemType !== SchemaItemType.EntityClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an EntityClass.`);\n\n if (!(await (baseClass as EntityClass).is(\"ElementUniqueAspect\", \"BisCore\"))) {\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an ElementUniqueAspect.`);\n }\n\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\n }\n\n public async createElementMultiAspect(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemEditResults> {\n const baseClass = await this._schemaEditor.schemaContext.getSchemaItem(baseClassKey);\n if (!baseClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} could be found.`);\n\n if (baseClass?.schemaItemType !== SchemaItemType.EntityClass)\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an EntityClass.`);\n\n if (!(await (baseClass as EntityClass).is(\"ElementMultiAspect\", \"BisCore\"))) {\n throw new Error(`The class ${name} could not be created because the specified base class ${baseClassKey.fullName} is not an ElementMultiAspect.`);\n }\n\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\n }\n\n public async create(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, displayLabel?: string, baseClassKey?: SchemaItemKey, mixins?: Mixin[]): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n const newClass = (await schema.createEntityClass(name, modifier)) as MutableEntityClass;\n if (newClass === undefined)\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\n\n // Add a deserializing method.\n if (baseClassKey !== undefined) {\n const baseClassSchema = !baseClassKey.schemaKey.matches(schema.schemaKey) ? await this._schemaEditor.getSchema(baseClassKey.schemaKey) : schema;\n if (baseClassSchema === undefined) {\n return { errorMessage: `Schema Key ${baseClassKey.schemaKey.toString(true)} not found in context` };\n }\n\n const baseClassItem = await baseClassSchema.lookupItem<EntityClass>(baseClassKey);\n if (baseClassItem === undefined)\n return { errorMessage: `Unable to locate base class ${baseClassKey.fullName} in schema ${baseClassSchema.fullName}.` };\n\n if (baseClassItem.schemaItemType !== SchemaItemType.EntityClass)\n return { errorMessage: `${baseClassItem.fullName} is not of type Entity Class.` };\n\n newClass.baseClass = new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(baseClassKey, async () => baseClassItem);\n }\n\n if (mixins !== undefined)\n mixins.forEach((m) => newClass.addMixin(m));\n\n if (displayLabel)\n newClass.setDisplayLabel(displayLabel);\n\n return { itemKey: newClass.key };\n }\n\n /**\n * Creates an EntityClass through an EntityClassProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param entityProps a json object that will be used to populate the new EntityClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, entityProps: EntityClassProps): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n if (entityProps.name === undefined)\n return { errorMessage: `No name was supplied within props.` };\n\n const newClass = (await schema.createEntityClass(entityProps.name)) as MutableEntityClass;\n if (newClass === undefined)\n return { errorMessage: `Failed to create class ${entityProps.name} in schema ${schemaKey.toString(true)}.` };\n\n await newClass.fromJSON(entityProps);\n\n return { itemKey: newClass.key };\n }\n\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<SchemaItemEditResults> {\n const entity = (await this._schemaEditor.schemaContext.getSchemaItem<MutableEntityClass>(entityKey));\n if (entity === undefined) {\n return { errorMessage: `Entity Class ${entityKey.fullName} not found in schema context.` };\n }\n if (entity.schemaItemType !== SchemaItemType.EntityClass) {\n return { errorMessage: `Expected ${entityKey.fullName} to be of type Entity Class.` };\n }\n\n const mixin = (await this._schemaEditor.schemaContext.getSchemaItem<Mixin>(mixinKey));\n if (mixin === undefined) {\n return { errorMessage: `Mixin Class ${mixinKey.fullName} not found in schema context.` };\n }\n if (mixin.schemaItemType !== SchemaItemType.Mixin) {\n return { errorMessage: `Expected ${mixinKey.fullName} to be of type Mixin.`};\n }\n\n entity.addMixin(mixin);\n return { itemKey: entityKey };\n }\n\n public async createNavigationProperty(entityKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<PropertyEditResults> {\n const entity = await this._schemaEditor.schemaContext.getSchemaItem<MutableEntityClass>(entityKey);\n\n if (entity === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Entity Class ${entityKey.fullName} not found in schema context.`);\n\n if (entity.schemaItemType !== SchemaItemType.EntityClass)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaItemType, `Expected ${entityKey.fullName} to be of type Entity Class.`);\n\n await entity.createNavigationProperty(name, relationship, direction);\n return { itemKey: entityKey, propertyName: name };\n }\n\n /**\n * Creates a Navigation Property through a NavigationPropertyProps.\n * @param classKey a SchemaItemKey of the Entity Class that will house the new property.\n * @param navigationProps a json object that will be used to populate the new Navigation Property.\n */\n public async createNavigationPropertyFromProps(classKey: SchemaItemKey, navigationProps: NavigationPropertyProps): Promise<PropertyEditResults> {\n const entity = await this._schemaEditor.schemaContext.getSchemaItem<MutableEntityClass>(classKey);\n if (entity === undefined)\n return { itemKey: classKey, propertyName: navigationProps.name, errorMessage: `Entity Class ${classKey.fullName} not found in schema context.`};\n\n if (entity.schemaItemType !== SchemaItemType.EntityClass)\n return { itemKey: classKey, propertyName: navigationProps.name, errorMessage: `Expected ${classKey.fullName} to be of type EntityClass.` };\n\n const navigationProperty = await entity.createNavigationProperty(navigationProps.name, navigationProps.relationshipName, navigationProps.direction);\n await navigationProperty.fromJSON(navigationProps);\n\n return { itemKey: classKey, propertyName: navigationProps.name };\n }\n}\n"]}
1
+ {"version":3,"file":"Entities.js","sourceRoot":"","sources":["../../../src/Editing/Entities.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAGkC;AAElC,2CAAwC;AAExC,6CAAoD;AACpD,2CAA2E;AAE3E;;;GAGG;AACH,MAAa,QAAS,SAAQ,qBAAS;IACrC,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;QAGlD;;WAEG;QACa,yBAAoB,GAAG,IAAI,iCAAoB,CAAC,kCAAc,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAL/G,CAAC;IAOM,KAAK,CAAC,aAAa,CAAC,SAAoB,EAAE,IAAY,EAAE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EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,iCAAiC,EAAE,IAAI,mBAAO,CAAC,kCAAc,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACxI,CAAC;IACH,CAAC;CACF;AAhHD,4BAgHC","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 ECClassModifier, EntityClass, EntityClassProps,\r\n Mixin, NavigationPropertyProps, RelationshipClass, SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\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 EntityClass.\r\n */\r\nexport class Entities extends ECClasses {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.EntityClass, 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.EntityClass, this.schemaEditor);\r\n\r\n public async createElement(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemKey> {\r\n try {\r\n const baseClass = await this.getSchemaItem(baseClassKey);\r\n if (!(await (baseClass as EntityClass).is(\"Element\", \"BisCore\"))) {\r\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElement, new ClassId(this.schemaItemType, baseClassKey));\r\n }\r\n } catch(e: any){\r\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n\r\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\r\n }\r\n\r\n public async createElementUniqueAspect(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemKey> {\r\n try {\r\n const baseClass = await this.getSchemaItem(baseClassKey);\r\n if (!(await (baseClass as EntityClass).is(\"ElementUniqueAspect\", \"BisCore\"))) {\r\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElementUniqueAspect, new ClassId(this.schemaItemType, baseClassKey));\r\n }\r\n } catch(e: any){\r\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n\r\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\r\n }\r\n\r\n public async createElementMultiAspect(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemKey> {\r\n try {\r\n const baseClass = await this.getSchemaItem(baseClassKey);\r\n if (!(await (baseClass as EntityClass).is(\"ElementMultiAspect\", \"BisCore\"))) {\r\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElementMultiAspect, new ClassId(this.schemaItemType, baseClassKey));\r\n }\r\n } catch(e: any){\r\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\r\n }\r\n\r\n return this.create(schemaKey, name, modifier, displayLabel, baseClassKey, mixins);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, displayLabel?: string, baseClassKey?: SchemaItemKey, mixins?: Mixin[]): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createClass<EntityClass>(schemaKey, this.schemaItemType, (schema) => schema.createEntityClass.bind(schema), name, baseClassKey, modifier) as MutableEntityClass;\r\n\r\n if (mixins !== undefined)\r\n mixins.forEach((m) => newClass.addMixin(m));\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 an EntityClass through an EntityClassProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param entityProps a json object that will be used to populate the new EntityClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, entityProps: EntityClassProps): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createEntityClass.bind(schema), entityProps);\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, entityProps.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);\r\n const mixin = await this.getSchemaItem<Mixin>(mixinKey, SchemaItemType.Mixin);\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(entityKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<void> {\r\n try {\r\n const entity = await this.getSchemaItem<MutableEntityClass>(entityKey);\r\n await entity.createNavigationProperty(name, relationship, direction);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationProperty, new ClassId(SchemaItemType.RelationshipClass, entityKey), 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 Entity Class 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 entity = await this.getSchemaItem<MutableEntityClass>(classKey);\r\n const property = await entity.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.EntityClass, classKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -2,21 +2,21 @@
2
2
  * @module Editing
3
3
  */
4
4
  import { AnyEnumerator, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
5
- import { SchemaContextEditor, SchemaItemEditResults } from "./Editor";
5
+ import { SchemaContextEditor } from "./Editor";
6
+ import { SchemaItems } from "./SchemaItems";
6
7
  /**
7
8
  * @alpha
8
9
  * A class allowing you to create schema items of type Enumeration.
9
10
  */
10
- export declare class Enumerations {
11
- protected _schemaEditor: SchemaContextEditor;
12
- constructor(_schemaEditor: SchemaContextEditor);
13
- create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemEditResults>;
11
+ export declare class Enumerations extends SchemaItems {
12
+ constructor(schemaEditor: SchemaContextEditor);
13
+ create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemKey>;
14
14
  /**
15
15
  * Creates an Enumeration through an EnumeratorProps.
16
16
  * @param schemaKey a SchemaKey of the Schema that will house the new object.
17
17
  * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.
18
18
  */
19
- createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemEditResults>;
19
+ createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemKey>;
20
20
  addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void>;
21
21
  setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void>;
22
22
  setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"Enumerations.d.ts","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAgD,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClL,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAOtE;;;GAGG;AACH,qBAAa,YAAY;IACJ,SAAS,CAAC,aAAa,EAAE,mBAAmB;gBAAlC,aAAa,EAAE,mBAAmB;IAElD,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,CAAC,OAAO,GAAG,aAAa,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAsBrN;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAgBlG,aAAa,CAAC,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAkBtF,kBAAkB,CAAC,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG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GAAG,OAAO,CAAC,IAAI,CAAC;CAa7I"}
@@ -9,29 +9,31 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Enumerations = void 0;
11
11
  const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
12
+ const Exception_1 = require("./Exception");
13
+ const SchemaItems_1 = require("./SchemaItems");
12
14
  /**
13
15
  * @alpha
14
16
  * A class allowing you to create schema items of type Enumeration.
15
17
  */
16
- class Enumerations {
17
- constructor(_schemaEditor) {
18
- this._schemaEditor = _schemaEditor;
18
+ class Enumerations extends SchemaItems_1.SchemaItems {
19
+ constructor(schemaEditor) {
20
+ super(ecschema_metadata_1.SchemaItemType.Enumeration, schemaEditor);
19
21
  }
20
22
  async create(schemaKey, name, type, displayLabel, isStrict, enumerators) {
21
- const schema = await this._schemaEditor.getSchema(schemaKey);
22
- if (schema === undefined)
23
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
24
- const newEnum = (await schema.createEnumeration(name, type));
25
- if (newEnum === undefined)
26
- return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };
27
- if (undefined !== isStrict)
28
- newEnum.setIsStrict(isStrict);
29
- if (undefined !== enumerators)
30
- for (const enumerator of enumerators)
31
- await this.addEnumerator(newEnum.key, enumerator);
32
- if (displayLabel)
33
- newEnum.setDisplayLabel(displayLabel);
34
- return { itemKey: newEnum.key };
23
+ try {
24
+ const newEnum = await this.createSchemaItem(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), name, type);
25
+ if (undefined !== isStrict)
26
+ newEnum.setIsStrict(isStrict);
27
+ if (undefined !== enumerators)
28
+ for (const enumerator of enumerators)
29
+ await this.addEnumerator(newEnum.key, enumerator);
30
+ if (displayLabel)
31
+ newEnum.setDisplayLabel(displayLabel);
32
+ return newEnum.key;
33
+ }
34
+ catch (e) {
35
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFailed, new Exception_1.SchemaItemId(this.schemaItemType, name, schemaKey), e);
36
+ }
35
37
  }
36
38
  /**
37
39
  * Creates an Enumeration through an EnumeratorProps.
@@ -39,50 +41,50 @@ class Enumerations {
39
41
  * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.
40
42
  */
41
43
  async createFromProps(schemaKey, enumProps) {
42
- const schema = await this._schemaEditor.getSchema(schemaKey);
43
- if (schema === undefined)
44
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
45
- if (enumProps.name === undefined)
46
- return { errorMessage: `No name was supplied within props.` };
47
- const newEnum = (await schema.createEnumeration(enumProps.name));
48
- if (newEnum === undefined)
49
- return { errorMessage: `Failed to create class ${enumProps.name} in schema ${schemaKey.toString(true)}.` };
50
- await newEnum.fromJSON(enumProps);
51
- return { itemKey: newEnum.key };
44
+ try {
45
+ const newEnum = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), enumProps);
46
+ return newEnum.key;
47
+ }
48
+ catch (e) {
49
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFromProps, new Exception_1.SchemaItemId(this.schemaItemType, enumProps.name, schemaKey), e);
50
+ }
52
51
  }
53
52
  async addEnumerator(enumerationKey, enumerator) {
54
- const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem(enumerationKey));
55
- if (enumeration === undefined)
56
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);
57
- if (enumeration.schemaItemType !== ecschema_metadata_1.SchemaItemType.Enumeration)
58
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);
59
- if (enumeration.isInt && typeof (enumerator.value) !== "number")
60
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type integer, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);
61
- if (enumeration.isString && typeof (enumerator.value) !== "string")
62
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type string, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);
63
- enumeration.addEnumerator(enumerator);
53
+ try {
54
+ const enumeration = await this.getSchemaItem(enumerationKey, ecschema_metadata_1.SchemaItemType.Enumeration);
55
+ if (enumeration.isInt && typeof (enumerator.value) !== "number")
56
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.InvalidEnumeratorType, new Exception_1.EnumerationId(enumeration, enumerator));
57
+ if (enumeration.isString && typeof (enumerator.value) !== "string")
58
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.InvalidEnumeratorType, new Exception_1.EnumerationId(enumeration, enumerator));
59
+ enumeration.addEnumerator(enumerator);
60
+ }
61
+ catch (e) {
62
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.AddEnumerator, new Exception_1.SchemaItemId(this.schemaItemType, enumerationKey), e);
63
+ }
64
64
  }
65
65
  async setEnumeratorLabel(enumerationKey, enumeratorName, label) {
66
- const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem(enumerationKey));
67
- if (enumeration === undefined)
68
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);
69
- if (enumeration.schemaItemType !== ecschema_metadata_1.SchemaItemType.Enumeration)
70
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);
71
- const enumerator = enumeration.getEnumeratorByName(enumeratorName);
72
- if (enumerator === undefined)
73
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);
74
- enumerator.label = label;
66
+ try {
67
+ const enumeration = await this.getSchemaItem(enumerationKey, ecschema_metadata_1.SchemaItemType.Enumeration);
68
+ const enumerator = enumeration.getEnumeratorByName(enumeratorName);
69
+ if (enumerator === undefined)
70
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.EnumeratorDoesNotExist, new Exception_1.EnumerationId(enumeration, enumeratorName));
71
+ enumerator.label = label;
72
+ }
73
+ catch (e) {
74
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetEnumeratorLabel, new Exception_1.SchemaItemId(this.schemaItemType, enumerationKey), e);
75
+ }
75
76
  }
76
77
  async setEnumeratorDescription(enumerationKey, enumeratorName, description) {
77
- const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem(enumerationKey));
78
- if (enumeration === undefined)
79
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);
80
- if (enumeration.schemaItemType !== ecschema_metadata_1.SchemaItemType.Enumeration)
81
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);
82
- const enumerator = enumeration.getEnumeratorByName(enumeratorName);
83
- if (enumerator === undefined)
84
- throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);
85
- enumerator.description = description;
78
+ try {
79
+ const enumeration = await this.getSchemaItem(enumerationKey, ecschema_metadata_1.SchemaItemType.Enumeration);
80
+ const enumerator = enumeration.getEnumeratorByName(enumeratorName);
81
+ if (enumerator === undefined)
82
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.EnumeratorDoesNotExist, new Exception_1.EnumerationId(enumeration, enumeratorName));
83
+ enumerator.description = description;
84
+ }
85
+ catch (e) {
86
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.SetEnumeratorLabel, new Exception_1.SchemaItemId(this.schemaItemType, enumerationKey), e);
87
+ }
86
88
  }
87
89
  }
88
90
  exports.Enumerations = Enumerations;
@@ -1 +1 @@
1
- {"version":3,"file":"Enumerations.js","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAkL;AAQlL;;;GAGG;AACH,MAAa,YAAY;IACvB,YAA6B,aAAkC;QAAlC,kBAAa,GAAb,aAAa,CAAqB;IAAI,CAAC;IAE7D,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,IAAkD,EAAE,YAAqB,EAAE,QAAkB,EAAE,WAA6B;QAClL,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;QAC7D,IAAI,MAAM,KAAK,SAAS;YACtB,OAAO,EAAE,YAAY,EAAE,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC;QAEzF,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QAC7D,IAAI,OAAO,KAAK,SAAS;YACvB,OAAO,EAAE,YAAY,EAAE,0BAA0B,IAAI,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAEnG,IAAI,SAAS,KAAK,QAAQ;YACvB,OAA8B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAExD,IAAI,SAAS,KAAK,WAAW;YAC3B,KAAK,MAAM,UAAU,IAAI,WAAW;gBAClC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;QAEtD,IAAI,YAAY;YACb,OAA8B,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEhE,OAAO,EAA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AAc,cAAc,mCAAmC,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEjJ,UAAgC,CAAC,KAAK,GAAG,KAAK,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,cAA6B,EAAE,cAAsB,EAAE,WAA+B;QAC1H,MAAM,WAAW,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAc,cAAc,CAAC,CAAC,CAAC;QAExG,IAAI,WAAW,KAAK,SAAS;YAC3B,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,sCAAsC,cAAc,CAAC,QAAQ,GAAG,CAAC,CAAC;QAE5H,IAAI,WAAW,CAAC,cAAc,KAAK,kCAAc,CAAC,WAAW;YAC3D,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,WAAW,EAAE,GAAG,WAAW,CAAC,QAAQ,mCAAmC,CAAC,CAAC;QAEpH,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;QACnE,IAAI,UAAU,KAAK,SAAS;YAC1B,MAAM,IAAI,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,cAAc,cAAc,mCAAmC,WAAW,CAAC,QAAQ,GAAG,CAAC,CAAC;QAEjJ,UAAgC,CAAC,WAAW,GAAG,WAAW,CAAC;IAC9D,CAAC;CACF;AA/FD,oCA+FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { AnyEnumerator, ECObjectsError, ECObjectsStatus, Enumeration, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\nimport { MutableEnumeration } from \"./Mutable/MutableEnumeration\";\n\ntype MutableEnumerator = {\n -readonly [P in keyof AnyEnumerator]: AnyEnumerator[P]\n};\n\n/**\n * @alpha\n * A class allowing you to create schema items of type Enumeration.\n */\nexport class Enumerations {\n public constructor(protected _schemaEditor: SchemaContextEditor) { }\n\n public async create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n const newEnum = (await schema.createEnumeration(name, type));\n if (newEnum === undefined)\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\n\n if (undefined !== isStrict)\n (newEnum as MutableEnumeration).setIsStrict(isStrict);\n\n if (undefined !== enumerators)\n for (const enumerator of enumerators)\n await this.addEnumerator(newEnum.key, enumerator);\n\n if (displayLabel)\n (newEnum as MutableEnumeration).setDisplayLabel(displayLabel);\n\n return { itemKey: newEnum.key };\n }\n\n /**\n * Creates an Enumeration through an EnumeratorProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemEditResults> {\n const schema = await this._schemaEditor.getSchema(schemaKey);\n if (schema === undefined)\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\n\n if (enumProps.name === undefined)\n return { errorMessage: `No name was supplied within props.` };\n\n const newEnum = (await schema.createEnumeration(enumProps.name));\n if (newEnum === undefined)\n return { errorMessage: `Failed to create class ${enumProps.name} in schema ${schemaKey.toString(true)}.` };\n\n await newEnum.fromJSON(enumProps);\n return { itemKey: newEnum.key };\n }\n\n public async addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void> {\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\n\n if (enumeration === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\n\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\n\n if (enumeration.isInt && typeof (enumerator.value) !== \"number\")\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type integer, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\n\n if (enumeration.isString && typeof (enumerator.value) !== \"string\")\n throw new ECObjectsError(ECObjectsStatus.InvalidPrimitiveType, `The Enumeration ${enumeration.name} has type string, while ${enumerator.name} has type ${typeof (enumerator.value)}.`);\n\n (enumeration as MutableEnumeration).addEnumerator(enumerator);\n }\n\n public async setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void> {\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\n\n if (enumeration === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\n\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\n\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\n if (enumerator === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);\n\n (enumerator as MutableEnumerator).label = label;\n }\n\n public async setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void> {\n const enumeration = (await this._schemaEditor.schemaContext.getSchemaItem<Enumeration>(enumerationKey));\n\n if (enumeration === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Unable to locate Enumeration class ${enumerationKey.fullName}.`);\n\n if (enumeration.schemaItemType !== SchemaItemType.Enumeration)\n throw new ECObjectsError(ECObjectsStatus.InvalidType, `${enumeration.fullName} is not of type Enumerator class.`);\n\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\n if (enumerator === undefined)\n throw new ECObjectsError(ECObjectsStatus.ClassNotFound, `Enumerator ${enumeratorName} does not exists in Enumeration ${enumeration.fullName}.`);\n\n (enumerator as MutableEnumerator).description = description;\n }\n}\n"]}
1
+ {"version":3,"file":"Enumerations.js","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAiJ;AAGjJ,2CAA+F;AAC/F,+CAA4C;AAM5C;;;GAGG;AACH,MAAa,YAAa,SAAQ,yBAAW;IAC3C,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;IAClD,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,IAAkD,EAAE,YAAqB,EAAE,QAAkB,EAAE,WAA6B;QAClL,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAc,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,CAAuB,CAAC;YAE9K,IAAI,SAAS,KAAK,QAAQ;gBACxB,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAEhC,IAAI,SAAS,KAAK,WAAW;gBAC3B,KAAK,MAAM,UAAU,IAAI,WAAW;oBAClC,MAAM,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;YAEtD,IAAI,YAAY;gBACd,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAExC,O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,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YACnE,IAAI,UAAU,KAAK,SAAS;gBAC1B,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,sBAAsB,EAAE,IAAI,yBAAa,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,CAAC;YAEtH,UAAgC,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9D,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,kBAAkB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;CACF;AAlFD,oCAkFC","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 { AnyEnumerator, Enumeration, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutableEnumeration } from \"./Mutable/MutableEnumeration\";\r\nimport { ECEditingStatus, EnumerationId, SchemaEditingError, SchemaItemId } from \"./Exception\";\r\nimport { SchemaItems } from \"./SchemaItems\";\r\n\r\ntype MutableEnumerator = {\r\n -readonly [P in keyof AnyEnumerator]: AnyEnumerator[P]\r\n};\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Enumeration.\r\n */\r\nexport class Enumerations extends SchemaItems {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Enumeration, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemKey> {\r\n try {\r\n const newEnum = await this.createSchemaItem<Enumeration>(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), name, type) as MutableEnumeration;\r\n\r\n if (undefined !== isStrict)\r\n newEnum.setIsStrict(isStrict);\r\n\r\n if (undefined !== enumerators)\r\n for (const enumerator of enumerators)\r\n await this.addEnumerator(newEnum.key, enumerator);\r\n\r\n if (displayLabel)\r\n newEnum.setDisplayLabel(displayLabel);\r\n\r\n return newEnum.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 /**\r\n * Creates an Enumeration through an EnumeratorProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, enumProps: EnumerationProps): Promise<SchemaItemKey> {\r\n try {\r\n const newEnum = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), enumProps);\r\n return newEnum.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, enumProps.name!, schemaKey), e);\r\n }\r\n }\r\n\r\n public async addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void> {\r\n try {\r\n const enumeration = await this.getSchemaItem<Enumeration>(enumerationKey, SchemaItemType.Enumeration);\r\n\r\n if (enumeration.isInt && typeof (enumerator.value) !== \"number\")\r\n throw new SchemaEditingError(ECEditingStatus.InvalidEnumeratorType, new EnumerationId(enumeration, enumerator));\r\n\r\n if (enumeration.isString && typeof (enumerator.value) !== \"string\")\r\n throw new SchemaEditingError(ECEditingStatus.InvalidEnumeratorType, new EnumerationId(enumeration, enumerator));\r\n\r\n (enumeration as MutableEnumeration).addEnumerator(enumerator);\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.AddEnumerator, new SchemaItemId(this.schemaItemType, enumerationKey), e);\r\n }\r\n }\r\n\r\n public async setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void> {\r\n try {\r\n const enumeration = await this.getSchemaItem<Enumeration>(enumerationKey, SchemaItemType.Enumeration);\r\n\r\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\r\n if (enumerator === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.EnumeratorDoesNotExist, new EnumerationId(enumeration, enumeratorName));\r\n\r\n (enumerator as MutableEnumerator).label = label;\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.SetEnumeratorLabel, new SchemaItemId(this.schemaItemType, enumerationKey), e);\r\n }\r\n }\r\n\r\n public async setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void> {\r\n try {\r\n const enumeration = await this.getSchemaItem<Enumeration>(enumerationKey, SchemaItemType.Enumeration);\r\n\r\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\r\n if (enumerator === undefined)\r\n throw new SchemaEditingError(ECEditingStatus.EnumeratorDoesNotExist, new EnumerationId(enumeration, enumeratorName));\r\n\r\n (enumerator as MutableEnumerator).description = description;\r\n } catch(e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.SetEnumeratorLabel, new SchemaItemId(this.schemaItemType, enumerationKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -0,0 +1,257 @@
1
+ /** @packageDocumentation
2
+ * @module Editing
3
+ */
4
+ import { BentleyError } from "@itwin/core-bentley";
5
+ import { AnyDiagnostic } from "../Validation/Diagnostic";
6
+ import { AnyEnumerator, CustomAttributeContainerProps, Enumeration, Property, RelationshipConstraint, SchemaItemKey, SchemaItemType, SchemaKey } from "@itwin/ecschema-metadata";
7
+ /** @alpha */
8
+ export declare enum ECEditingStatus {
9
+ EC_EDITING_ERROR_BASE = 196608,
10
+ Unknown = 0,
11
+ RuleViolation = 196609,
12
+ SchemaNotFound = 196610,
13
+ SchemaItemNotFound = 196611,
14
+ SchemaItemNotFoundInContext = 196612,
15
+ PropertyAlreadyExists = 196613,
16
+ PropertyNotFound = 196614,
17
+ InvalidPropertyType = 196615,
18
+ BaseClassIsNotElement = 196616,
19
+ BaseClassIsNotElementUniqueAspect = 196617,
20
+ BaseClassIsNotElementMultiAspect = 196618,
21
+ SchemaItemNameNotSpecified = 196619,
22
+ InvalidSchemaItemType = 196620,
23
+ SchemaItemNameAlreadyExists = 196621,
24
+ InvalidEnumeratorType = 196622,
25
+ InvalidBaseClass = 196623,
26
+ EnumeratorDoesNotExist = 196624,
27
+ InvalidStrengthDirection = 196625,
28
+ InvalidECName = 196626,
29
+ InvalidFormatUnitsSpecified = 196627,
30
+ CreateSchemaItemFailed = 196628,
31
+ CreateSchemaItemFromProps = 196629,
32
+ CreateElement = 196630,
33
+ CreateElementUniqueAspect = 196631,
34
+ CreateElementMultiAspect = 196632,
35
+ SetBaseClass = 196633,
36
+ SetSourceConstraint = 196634,
37
+ SetTargetConstraint = 196635,
38
+ AddConstraintClass = 196636,
39
+ RemoveConstraintClass = 196637,
40
+ SetAbstractConstraint = 196638,
41
+ AddCustomAttributeToConstraint = 196639,
42
+ AddCustomAttributeToProperty = 196640,
43
+ AddCustomAttributeToClass = 196641,
44
+ CreateNavigationProperty = 196642,
45
+ CreateNavigationPropertyFromProps = 196643,
46
+ SetInvertsUnit = 196644,
47
+ SetUnitSystem = 196645,
48
+ SetDescription = 196646,
49
+ SetLabel = 196647,
50
+ SetIsReadOnly = 196648,
51
+ SetPriority = 196649,
52
+ SetCategory = 196650,
53
+ SetMinOccurs = 196651,
54
+ SetMaxOccurs = 196652,
55
+ SetExtendedTypeName = 196653,
56
+ SetMinLength = 196654,
57
+ SetMaxLength = 196655,
58
+ SetMinValue = 196656,
59
+ SetMaxValue = 196657,
60
+ SetPropertyName = 196658,
61
+ AddMixin = 196659,
62
+ AddEnumerator = 196660,
63
+ SetEnumeratorLabel = 196661,
64
+ SetEnumeratorDescription = 196662,
65
+ AddPresentationUnit = 196663,
66
+ AddPresentationOverride = 196664,
67
+ CreateFormatOverride = 196665,
68
+ SetPropertyCategoryPriority = 196666,
69
+ CreatePrimitiveProperty = 196667,
70
+ CreatePrimitivePropertyFromProps = 196668,
71
+ CreateEnumerationProperty = 196669,
72
+ CreateEnumerationPropertyFromProps = 196670,
73
+ CreatePrimitiveArrayProperty = 196671,
74
+ CreatePrimitiveArrayPropertyFromProps = 196672,
75
+ CreateEnumerationArrayProperty = 196673,
76
+ CreateEnumerationArrayPropertyFromProps = 196674,
77
+ CreateStructProperty = 196675,
78
+ CreateStructPropertyFromProps = 196676,
79
+ CreateStructArrayProperty = 196677,
80
+ CreateStructArrayPropertyFromProps = 196678,
81
+ DeleteProperty = 196679,
82
+ DeleteClass = 196680,
83
+ SetClassName = 196681,
84
+ AddSchemaReference = 196682,
85
+ SetSchemaVersion = 196683,
86
+ IncrementSchemaMinorVersion = 196684
87
+ }
88
+ export type AnyEditingError = SchemaEditingError | Error;
89
+ export declare enum TaskType {
90
+ Add = 0,
91
+ Create = 1,
92
+ Update = 2,
93
+ Change = 3,
94
+ Delete = 4
95
+ }
96
+ export declare enum PropertyTypeName {
97
+ ArrayProperty = "ArrayProperty",
98
+ PrimitiveProperty = "PrimitiveProperty",
99
+ EnumerationProperty = "EnumerationProperty",
100
+ NavigationProperty = "NavigationProperty",
101
+ StructProperty = "StructProperty"
102
+ }
103
+ type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;
104
+ export interface SchemaTypeIdentifier {
105
+ name: string;
106
+ }
107
+ export declare class SchemaId implements SchemaTypeIdentifier {
108
+ readonly name: string;
109
+ readonly schemaKey: SchemaKey;
110
+ constructor(schemaKey: SchemaKey);
111
+ }
112
+ export declare class SchemaItemId implements SchemaTypeIdentifier {
113
+ readonly name: string;
114
+ readonly type: SchemaItemType;
115
+ readonly schemaKey: SchemaKey;
116
+ readonly schemaItemKey: SchemaItemKey;
117
+ constructor(schemaItemType: SchemaItemType, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey);
118
+ }
119
+ export declare class ClassId extends SchemaItemId {
120
+ constructor(schemaItemType: ECClassSchemaItems, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey);
121
+ }
122
+ export declare class PropertyId implements SchemaTypeIdentifier {
123
+ readonly name: string;
124
+ readonly fullName: string;
125
+ readonly ecClass: ClassId;
126
+ readonly schemaKey: SchemaKey;
127
+ readonly typeName?: PropertyTypeName;
128
+ constructor(schemaItemType: ECClassSchemaItems, classKey: SchemaItemKey, property: Property | string, typeName?: PropertyTypeName);
129
+ }
130
+ export declare class EnumerationId extends SchemaItemId {
131
+ readonly enumerationType: string;
132
+ readonly enumeratorName: string;
133
+ readonly enumeratorType: string;
134
+ constructor(enumeration: Enumeration, enumerator: AnyEnumerator | string);
135
+ private getEnumeratorType;
136
+ }
137
+ export declare class CustomAttributeId implements SchemaTypeIdentifier {
138
+ readonly name: string;
139
+ readonly schemaKey: SchemaKey;
140
+ readonly containerFullName: string;
141
+ constructor(name: string, container: CustomAttributeContainerProps);
142
+ }
143
+ export declare class RelationshipConstraintId implements SchemaTypeIdentifier {
144
+ readonly name: string;
145
+ readonly relationshipKey: SchemaItemKey;
146
+ readonly schemaKey: SchemaKey;
147
+ constructor(constraint: RelationshipConstraint);
148
+ }
149
+ type AnyIdentifier = SchemaId | PropertyId | CustomAttributeId | RelationshipConstraintId | EnumerationId;
150
+ /**
151
+ * Indicates if the given identifier is a SchemaId instance.
152
+ * @param identifier The identifier to check.
153
+ * @returns true if the identifier is the correct type.
154
+ */
155
+ export declare function isSchemaIdentifier(identifier: AnyIdentifier): identifier is SchemaId;
156
+ /**
157
+ * Indicates if the given identifier is a SchemaId instance.
158
+ * @param identifier The identifier to check.
159
+ * @returns true if the identifier is the correct type.
160
+ */
161
+ export declare function isSchemaItemIdentifier(identifier: AnyIdentifier): identifier is SchemaItemId;
162
+ /**
163
+ * Indicates if the given identifier is a ClassId instance.
164
+ * @param identifier The identifier to check.
165
+ * @returns true if the identifier is the correct type.
166
+ */
167
+ export declare function isClassIdentifier(identifier: AnyIdentifier): identifier is ClassId;
168
+ /**
169
+ * Indicates if the given identifier is a PropertyId instance.
170
+ * @param identifier The identifier to check.
171
+ * @returns true if the identifier is the correct type.
172
+ */
173
+ export declare function isPropertyIdentifier(identifier: AnyIdentifier): identifier is PropertyId;
174
+ /**
175
+ * Indicates if the given identifier is a EnumerationId instance.
176
+ * @param identifier The identifier to check.
177
+ * @returns true if the identifier is the correct type.
178
+ */
179
+ export declare function isEnumerationIdentifier(identifier: AnyIdentifier): identifier is EnumerationId;
180
+ /**
181
+ * Indicates if the given identifier is a CustomAttributeId instance.
182
+ * @param identifier The identifier to check.
183
+ * @returns true if the identifier is the correct type.
184
+ */
185
+ export declare function isCustomAttributeIdentifier(identifier: AnyIdentifier): identifier is CustomAttributeId;
186
+ /**
187
+ * Indicates if the given identifier is a RelationshipConstraintId instance.
188
+ * @param identifier The identifier to check.
189
+ * @returns true if the identifier is the correct type.
190
+ */
191
+ export declare function isRelationshipConstraintIdentifier(identifier: AnyIdentifier): identifier is RelationshipConstraintId;
192
+ /**
193
+ * @internal
194
+ * An exception class for the ecschema-editing API. Contains identifiers for schema types involved in the
195
+ * exception. An example being SchemaItemId which contains the name of the SchemaItem, SchemaItemKey, SchemaItemType, etc.
196
+ * Typically will contain an innerError of type SchemaEditingError containing the identifier of the schema item that
197
+ * caused the exception. The containing error instance will identify the method called (identified by the errorNumber)
198
+ * and the identifier of the schema item being modified/created.
199
+ */
200
+ export declare class SchemaEditingError extends BentleyError {
201
+ readonly errorNumber: number;
202
+ readonly identifier: AnyIdentifier;
203
+ readonly innerError?: AnyEditingError | undefined;
204
+ private _ruleViolations?;
205
+ private _schemaKey;
206
+ /**
207
+ * Constructs a new SchemaEditingError instance.
208
+ * @param errorNumber The unique ECEditingStatus code identifying the error.
209
+ * @param identifier The identifier instance containing information about the EC object involved with the exception.
210
+ * @param innerError The SchemaEditingError containing the identifier of the EC object that caused the initial exception.
211
+ * @param ruleViolations Will contain EC rule violations of type [[AnyDiagnostic]] for exceptions with the error code ECEditingStatus.RuleViolation.
212
+ * @param message Optional error message. Most messages on automatically generated by this class based on the ECEditingStatus code.
213
+ */
214
+ constructor(errorNumber: number, identifier: AnyIdentifier, innerError?: AnyEditingError | undefined, ruleViolations?: AnyDiagnostic[], message?: string);
215
+ /**
216
+ * Gets the SchemaId instance.
217
+ * @throws Error if the identifier is not an instance of SchemaId.
218
+ */
219
+ get schemaId(): SchemaId;
220
+ /**
221
+ * Gets the SchemaItemId instance.
222
+ * @throws Error if the identifier is not an instance of SchemaItemId.
223
+ */
224
+ get schemaItemId(): SchemaItemId;
225
+ /**
226
+ * Gets the ClassId instance.
227
+ * @throws Error if the identifier is not an instance of ClassId.
228
+ */
229
+ get classId(): ClassId;
230
+ /**
231
+ * Gets the PropertyId instance.
232
+ * @throws Error if the identifier is not an instance of PropertyId.
233
+ */
234
+ get propertyId(): PropertyId;
235
+ /**
236
+ * Gets the EnumerationId instance.
237
+ * @throws Error if the identifier is not an instance of EnumerationId.
238
+ */
239
+ get enumerationId(): EnumerationId;
240
+ /**
241
+ * Gets the CustomAttributeId instance.
242
+ * @throws Error if the identifier is not an instance of CustomAttributeId.
243
+ */
244
+ get customAttributeId(): CustomAttributeId;
245
+ /**
246
+ * Gets the RelationshipConstraintId instance.
247
+ * @throws Error if the identifier is not an instance of RelationshipConstraintId.
248
+ */
249
+ get relationshipConstraintId(): RelationshipConstraintId;
250
+ get ruleViolations(): AnyDiagnostic[] | undefined;
251
+ toDebugString(): string;
252
+ private _appendMessage;
253
+ private generateMessage;
254
+ private getRuleViolationMessage;
255
+ }
256
+ export {};
257
+ //# sourceMappingURL=Exception.d.ts.map
@@ -0,0 +1 @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