@itwin/ecschema-editing 4.7.0-dev.9 → 4.8.0-dev.1

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 (131) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Editing/Constants.d.ts +6 -6
  3. package/lib/cjs/Editing/Constants.d.ts.map +1 -1
  4. package/lib/cjs/Editing/Constants.js +26 -31
  5. package/lib/cjs/Editing/Constants.js.map +1 -1
  6. package/lib/cjs/Editing/CustomAttributes.d.ts +3 -3
  7. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  8. package/lib/cjs/Editing/CustomAttributes.js +18 -28
  9. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  10. package/lib/cjs/Editing/ECClasses.d.ts +24 -23
  11. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  12. package/lib/cjs/Editing/ECClasses.js +126 -156
  13. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  14. package/lib/cjs/Editing/Editor.d.ts +10 -31
  15. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  16. package/lib/cjs/Editing/Editor.js +59 -43
  17. package/lib/cjs/Editing/Editor.js.map +1 -1
  18. package/lib/cjs/Editing/Entities.d.ts +9 -9
  19. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  20. package/lib/cjs/Editing/Entities.js +65 -85
  21. package/lib/cjs/Editing/Entities.js.map +1 -1
  22. package/lib/cjs/Editing/Enumerations.d.ts +6 -6
  23. package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
  24. package/lib/cjs/Editing/Enumerations.js +57 -55
  25. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  26. package/lib/cjs/Editing/Exception.d.ts +257 -0
  27. package/lib/cjs/Editing/Exception.d.ts.map +1 -0
  28. package/lib/cjs/Editing/Exception.js +426 -0
  29. package/lib/cjs/Editing/Exception.js.map +1 -0
  30. package/lib/cjs/Editing/Formats.d.ts +6 -6
  31. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  32. package/lib/cjs/Editing/Formats.js +28 -33
  33. package/lib/cjs/Editing/Formats.js.map +1 -1
  34. package/lib/cjs/Editing/InvertedUnits.d.ts +6 -6
  35. package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
  36. package/lib/cjs/Editing/InvertedUnits.js +41 -56
  37. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  38. package/lib/cjs/Editing/KindOfQuantities.d.ts +6 -6
  39. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  40. package/lib/cjs/Editing/KindOfQuantities.js +50 -57
  41. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  42. package/lib/cjs/Editing/Mixins.d.ts +5 -5
  43. package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
  44. package/lib/cjs/Editing/Mixins.js +43 -58
  45. package/lib/cjs/Editing/Mixins.js.map +1 -1
  46. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +1 -5
  47. package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts.map +1 -1
  48. package/lib/cjs/Editing/Mutable/MutableEntityClass.js +1 -45
  49. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  50. package/lib/cjs/Editing/Phenomena.d.ts +7 -7
  51. package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
  52. package/lib/cjs/Editing/Phenomena.js +23 -23
  53. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  54. package/lib/cjs/Editing/Properties.d.ts +7 -6
  55. package/lib/cjs/Editing/Properties.d.ts.map +1 -1
  56. package/lib/cjs/Editing/Properties.js +99 -46
  57. package/lib/cjs/Editing/Properties.js.map +1 -1
  58. package/lib/cjs/Editing/PropertyCategories.d.ts +6 -6
  59. package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
  60. package/lib/cjs/Editing/PropertyCategories.js +29 -27
  61. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  62. package/lib/cjs/Editing/RelationshipClasses.d.ts +15 -17
  63. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  64. package/lib/cjs/Editing/RelationshipClasses.js +97 -101
  65. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  66. package/lib/cjs/Editing/SchemaItems.d.ts +13 -5
  67. package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
  68. package/lib/cjs/Editing/SchemaItems.js +58 -6
  69. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  70. package/lib/cjs/Editing/Structs.d.ts +3 -3
  71. package/lib/cjs/Editing/Structs.d.ts.map +1 -1
  72. package/lib/cjs/Editing/Structs.js +17 -27
  73. package/lib/cjs/Editing/Structs.js.map +1 -1
  74. package/lib/cjs/Editing/UnitSystems.d.ts +7 -7
  75. package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
  76. package/lib/cjs/Editing/UnitSystems.js +22 -20
  77. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  78. package/lib/cjs/Editing/Units.d.ts +6 -6
  79. package/lib/cjs/Editing/Units.d.ts.map +1 -1
  80. package/lib/cjs/Editing/Units.js +26 -35
  81. package/lib/cjs/Editing/Units.js.map +1 -1
  82. package/lib/cjs/Merging/CAClassMerger.js +2 -2
  83. package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
  84. package/lib/cjs/Merging/ClassMerger.d.ts +1 -2
  85. package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
  86. package/lib/cjs/Merging/ClassMerger.js +15 -39
  87. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  88. package/lib/cjs/Merging/ConstantMerger.d.ts.map +1 -1
  89. package/lib/cjs/Merging/ConstantMerger.js +2 -3
  90. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  91. package/lib/cjs/Merging/CustomAttributeMerger.d.ts +4 -5
  92. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  93. package/lib/cjs/Merging/CustomAttributeMerger.js +8 -18
  94. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  95. package/lib/cjs/Merging/EntityClassMerger.d.ts +1 -2
  96. package/lib/cjs/Merging/EntityClassMerger.d.ts.map +1 -1
  97. package/lib/cjs/Merging/EntityClassMerger.js +3 -10
  98. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  99. package/lib/cjs/Merging/EnumerationMerger.d.ts.map +1 -1
  100. package/lib/cjs/Merging/EnumerationMerger.js +8 -10
  101. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  102. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
  103. package/lib/cjs/Merging/KindOfQuantityMerger.js +2 -3
  104. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  105. package/lib/cjs/Merging/MixinMerger.js +2 -2
  106. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  107. package/lib/cjs/Merging/PhenomenonMerger.d.ts.map +1 -1
  108. package/lib/cjs/Merging/PhenomenonMerger.js +1 -2
  109. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
  110. package/lib/cjs/Merging/PropertyCategoryMerger.d.ts.map +1 -1
  111. package/lib/cjs/Merging/PropertyCategoryMerger.js +1 -2
  112. package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
  113. package/lib/cjs/Merging/PropertyMerger.d.ts +2 -3
  114. package/lib/cjs/Merging/PropertyMerger.d.ts.map +1 -1
  115. package/lib/cjs/Merging/PropertyMerger.js +21 -42
  116. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  117. package/lib/cjs/Merging/RelationshipClassMerger.d.ts +5 -3
  118. package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
  119. package/lib/cjs/Merging/RelationshipClassMerger.js +35 -33
  120. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  121. package/lib/cjs/Merging/SchemaItemMerger.d.ts +3 -4
  122. package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
  123. package/lib/cjs/Merging/SchemaItemMerger.js +3 -2
  124. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  125. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  126. package/lib/cjs/Merging/SchemaMerger.js +2 -8
  127. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  128. package/lib/cjs/Merging/UnitSystemMerger.d.ts.map +1 -1
  129. package/lib/cjs/Merging/UnitSystemMerger.js +1 -2
  130. package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
  131. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Change Log - @itwin/ecschema-editing
2
2
 
3
- This log was last generated on Wed, 15 May 2024 21:32:22 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 29 May 2024 14:36:43 GMT and should not be manually modified.
4
+
5
+ ## 4.6.1
6
+ Wed, 29 May 2024 14:35:17 GMT
7
+
8
+ _Version update only_
4
9
 
5
10
  ## 4.6.0
6
11
  Mon, 13 May 2024 20:32:51 GMT
@@ -2,20 +2,20 @@
2
2
  * @module Editing
3
3
  */
4
4
  import { ConstantProps, 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 Constant.
9
10
  */
10
- export declare class Constants {
11
- protected _schemaEditor: SchemaContextEditor;
12
- constructor(_schemaEditor: SchemaContextEditor);
13
- create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemEditResults>;
11
+ export declare class Constants extends SchemaItems {
12
+ constructor(schemaEditor: SchemaContextEditor);
13
+ create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemKey>;
14
14
  /**
15
15
  * Creates a Constant through a ConstantProps.
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, constantProps: ConstantProps): Promise<SchemaItemEditResults>;
19
+ createFromProps(schemaKey: SchemaKey, constantProps: ConstantProps): Promise<SchemaItemKey>;
20
20
  }
21
21
  //# sourceMappingURL=Constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,aAAa,EAAuC,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACxI,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAGtE;;;GAGG;AACH,qBAAa,SAAS;IACD,SAAS,CAAC,aAAa,EAAE,mBAAmB;gBAAlC,aAAa,EAAE,mBAAmB;IAElD,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA6BvM;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAejH"}
1
+ {"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAY,aAAa,EAAuC,aAAa,EAAkB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClJ,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,aAAa,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAwB/L;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;CAQzG"}
@@ -9,35 +9,33 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.Constants = 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 Constant.
15
17
  */
16
- class Constants {
17
- constructor(_schemaEditor) {
18
- this._schemaEditor = _schemaEditor;
18
+ class Constants extends SchemaItems_1.SchemaItems {
19
+ constructor(schemaEditor) {
20
+ super(ecschema_metadata_1.SchemaItemType.Constant, schemaEditor);
19
21
  }
20
22
  async create(schemaKey, name, phenomenon, definition, displayLabel, numerator, denominator) {
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 newConstant = (await schema.createConstant(name));
25
- if (newConstant === undefined) {
26
- return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };
23
+ try {
24
+ const newConstant = await this.createSchemaItem(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), name);
25
+ const newPhenomenon = (await this.getSchemaItem(phenomenon, ecschema_metadata_1.SchemaItemType.Phenomenon));
26
+ newConstant.setPhenomenon(new ecschema_metadata_1.DelayedPromiseWithProps(newPhenomenon.key, async () => newPhenomenon));
27
+ newConstant.setDefinition(definition);
28
+ if (numerator)
29
+ newConstant.setNumerator(numerator);
30
+ if (denominator)
31
+ newConstant.setDenominator(denominator);
32
+ if (displayLabel)
33
+ newConstant.setDisplayLabel(displayLabel);
34
+ return newConstant.key;
27
35
  }
28
- const newPhenomenon = (await this._schemaEditor.schemaContext.getSchemaItem(phenomenon));
29
- if (newPhenomenon === undefined || newPhenomenon.schemaItemType !== ecschema_metadata_1.SchemaItemType.Phenomenon) {
30
- return { errorMessage: `Unable to locate phenomenon ${phenomenon.name}` };
36
+ catch (e) {
37
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFailed, new Exception_1.SchemaItemId(this.schemaItemType, name, schemaKey), e);
31
38
  }
32
- newConstant.setPhenomenon(new ecschema_metadata_1.DelayedPromiseWithProps(newPhenomenon.key, async () => newPhenomenon));
33
- newConstant.setDefinition(definition);
34
- if (numerator)
35
- newConstant.setNumerator(numerator);
36
- if (denominator)
37
- newConstant.setDenominator(denominator);
38
- if (displayLabel)
39
- newConstant.setDisplayLabel(displayLabel);
40
- return { itemKey: newConstant.key };
41
39
  }
42
40
  /**
43
41
  * Creates a Constant through a ConstantProps.
@@ -45,16 +43,13 @@ class Constants {
45
43
  * @param relationshipProps a json object that will be used to populate the new RelationshipClass. Needs a name value passed in.
46
44
  */
47
45
  async createFromProps(schemaKey, constantProps) {
48
- const schema = await this._schemaEditor.getSchema(schemaKey);
49
- if (schema === undefined)
50
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
51
- if (constantProps.name === undefined)
52
- return { errorMessage: `No name was supplied within props.` };
53
- const newConstant = (await schema.createConstant(constantProps.name));
54
- if (newConstant === undefined)
55
- return { errorMessage: `Failed to create class ${constantProps.name} in schema ${schemaKey.toString(true)}.` };
56
- await newConstant.fromJSON(constantProps);
57
- return { itemKey: newConstant.key };
46
+ try {
47
+ const newConstant = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), constantProps);
48
+ return newConstant.key;
49
+ }
50
+ catch (e) {
51
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFromProps, new Exception_1.SchemaItemId(this.schemaItemType, constantProps.name, schemaKey), e);
52
+ }
58
53
  }
59
54
  }
60
55
  exports.Constants = Constants;
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAwI;AAIxI;;;GAGG;AACH,MAAa,SAAS;IACpB,YAA6B,aAAkC;QAAlC,kBAAa,GAAb,aAAa,CAAqB;IAAI,CAAC;IAE7D,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,UAAyB,EAAE,UAAkB,EAAE,YAAqB,EAAE,SAAkB,EAAE,WAAoB;QACpK,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,WAAW,GAAG,CAAC,MAAM,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAoB,CAAC;QAC3E,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,OAAO,EAAE,YAAY,EAAE,0BAA0B,IAAI,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QACnG,CAAC;QAED,MAAM,aAAa,GAAG,CAAC,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,aAAa,CAAa,UAAU,CAAC,CAAC,CAAC;QACrG,IAAI,aAAa,KAAK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W,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;QAC1C,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,CAAC;IACtC,CAAC;CACF;AApDD,8BAoDC","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 { ConstantProps, DelayedPromiseWithProps, Phenomenon, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\r\nimport { MutableConstant } from \"./Mutable/MutableConstant\";\r\n\r\n/**\r\n * @alpha\r\n * A class allowing you to create schema items of type Constant.\r\n */\r\nexport class Constants {\r\n public constructor(protected _schemaEditor: SchemaContextEditor) { }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n const newConstant = (await schema.createConstant(name)) as MutableConstant;\r\n if (newConstant === undefined) {\r\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\r\n }\r\n\r\n const newPhenomenon = (await this._schemaEditor.schemaContext.getSchemaItem<Phenomenon>(phenomenon));\r\n if (newPhenomenon === undefined || newPhenomenon.schemaItemType !== SchemaItemType.Phenomenon) {\r\n return { errorMessage: `Unable to locate phenomenon ${phenomenon.name}` };\r\n }\r\n newConstant.setPhenomenon(new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(newPhenomenon.key, async () => newPhenomenon));\r\n newConstant.setDefinition(definition);\r\n\r\n if (numerator)\r\n newConstant.setNumerator(numerator);\r\n\r\n if (denominator)\r\n newConstant.setDenominator(denominator);\r\n\r\n if (displayLabel)\r\n newConstant.setDisplayLabel(displayLabel);\r\n\r\n return { itemKey: newConstant.key };\r\n }\r\n\r\n /**\r\n * Creates a Constant through a ConstantProps.\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, constantProps: ConstantProps): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n if (constantProps.name === undefined)\r\n return { errorMessage: `No name was supplied within props.` };\r\n\r\n const newConstant = (await schema.createConstant(constantProps.name));\r\n if (newConstant === undefined)\r\n return { errorMessage: `Failed to create class ${constantProps.name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n await newConstant.fromJSON(constantProps);\r\n return { itemKey: newConstant.key };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../../src/Editing/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAkJ;AAGlJ,2CAAgF;AAChF,+CAA4C;AAE5C;;;GAGG;AACH,MAAa,SAAU,SAAQ,yBAAW;IACxC,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,UAAyB,EAAE,UAAkB,EAAE,YAAqB,EAAE,SAAkB,EAAE,WAAoB;QACpK,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAW,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,C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Ac,EAAE,aAAa,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACpJ,CAAC;IACH,CAAC;CACF;AA1CD,8BA0CC","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 { Constant, ConstantProps, DelayedPromiseWithProps, Phenomenon, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { MutableConstant } from \"./Mutable/MutableConstant\";\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 Constant.\r\n */\r\nexport class Constants extends SchemaItems {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.Constant, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, phenomenon: SchemaItemKey, definition: string, displayLabel?: string, numerator?: number, denominator?: number): Promise<SchemaItemKey> {\r\n try {\r\n const newConstant = await this.createSchemaItem<Constant>(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), name) as MutableConstant;\r\n\r\n const newPhenomenon = (await this.getSchemaItem<Phenomenon>(phenomenon, SchemaItemType.Phenomenon));\r\n newConstant.setPhenomenon(new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(newPhenomenon.key, async () => newPhenomenon));\r\n\r\n newConstant.setDefinition(definition);\r\n\r\n if (numerator)\r\n newConstant.setNumerator(numerator);\r\n\r\n if (denominator)\r\n newConstant.setDenominator(denominator);\r\n\r\n if (displayLabel)\r\n newConstant.setDisplayLabel(displayLabel);\r\n\r\n return newConstant.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 a Constant through a ConstantProps.\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, constantProps: ConstantProps): Promise<SchemaItemKey> {\r\n try {\r\n const newConstant = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createConstant.bind(schema), constantProps);\r\n return newConstant.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, constantProps.name!, schemaKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -2,7 +2,7 @@
2
2
  * @module Editing
3
3
  */
4
4
  import { CustomAttributeClassProps, CustomAttributeContainerType, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
5
- import { SchemaContextEditor, SchemaItemEditResults } from "./Editor";
5
+ import { SchemaContextEditor } from "./Editor";
6
6
  import { ECClasses } from "./ECClasses";
7
7
  /**
8
8
  * @alpha
@@ -10,12 +10,12 @@ import { ECClasses } from "./ECClasses";
10
10
  */
11
11
  export declare class CustomAttributes extends ECClasses {
12
12
  constructor(schemaEditor: SchemaContextEditor);
13
- create(schemaKey: SchemaKey, name: string, containerType: CustomAttributeContainerType, displayLabel?: string, baseClass?: SchemaItemKey): Promise<SchemaItemEditResults>;
13
+ create(schemaKey: SchemaKey, name: string, containerType: CustomAttributeContainerType, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey>;
14
14
  /**
15
15
  * Creates a CustomAttributeClass through a CustomAttributeClassProps.
16
16
  * @param schemaKey a SchemaKey of the Schema that will house the new object.
17
17
  * @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.
18
18
  */
19
- createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemEditResults>;
19
+ createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemKey>;
20
20
  }
21
21
  //# sourceMappingURL=CustomAttributes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttributes.d.ts","sourceRoot":"","sources":["../../../src/Editing/CustomAttributes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,yBAAyB,EAAE,4BAA4B,EACvD,aAAa,EAAkB,SAAS,EACzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;gBAC1B,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,4BAA4B,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA4BtL;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAgBvH"}
1
+ {"version":3,"file":"CustomAttributes.d.ts","sourceRoot":"","sources":["../../../src/Editing/CustomAttributes.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAEL,yBAAyB,EAAE,4BAA4B,EACvD,aAAa,EAAkB,SAAS,EACzC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAIxC;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,SAAS;gBAC1B,YAAY,EAAE,mBAAmB;IAIvC,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,4BAA4B,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;IAcjL;;;;OAIG;IACU,eAAe,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,CAAC;CAQ/G"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CustomAttributes = void 0;
11
11
  const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
12
12
  const ECClasses_1 = require("./ECClasses");
13
+ const Exception_1 = require("./Exception");
13
14
  /**
14
15
  * @alpha
15
16
  * A class extending ECClasses allowing you to create schema items of type CustomAttributeClass.
@@ -18,25 +19,17 @@ class CustomAttributes extends ECClasses_1.ECClasses {
18
19
  constructor(schemaEditor) {
19
20
  super(ecschema_metadata_1.SchemaItemType.CustomAttributeClass, schemaEditor);
20
21
  }
21
- async create(schemaKey, name, containerType, displayLabel, baseClass) {
22
- const schema = await this._schemaEditor.getSchema(schemaKey);
23
- if (schema === undefined)
24
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
25
- const newClass = (await schema.createCustomAttributeClass(name));
26
- if (newClass === undefined)
27
- return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };
28
- if (baseClass !== undefined) {
29
- const baseClassItem = await schema.lookupItem(baseClass);
30
- if (baseClassItem === undefined)
31
- return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };
32
- if (baseClassItem.schemaItemType !== ecschema_metadata_1.SchemaItemType.CustomAttributeClass)
33
- return { errorMessage: `${baseClassItem.fullName} is not of type CustomAttribute Class.` };
34
- newClass.baseClass = new ecschema_metadata_1.DelayedPromiseWithProps(baseClass, async () => baseClassItem);
22
+ async create(schemaKey, name, containerType, displayLabel, baseClassKey) {
23
+ try {
24
+ const newClass = await this.createClass(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), name, baseClassKey);
25
+ if (displayLabel)
26
+ newClass.setDisplayLabel(displayLabel);
27
+ newClass.setContainerType(containerType);
28
+ return newClass.key;
29
+ }
30
+ catch (e) {
31
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFailed, new Exception_1.ClassId(this.schemaItemType, name, schemaKey), e);
35
32
  }
36
- if (displayLabel)
37
- newClass.setDisplayLabel(displayLabel);
38
- newClass.setContainerType(containerType);
39
- return { itemKey: newClass.key };
40
33
  }
41
34
  /**
42
35
  * Creates a CustomAttributeClass through a CustomAttributeClassProps.
@@ -44,16 +37,13 @@ class CustomAttributes extends ECClasses_1.ECClasses {
44
37
  * @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.
45
38
  */
46
39
  async createFromProps(schemaKey, caProps) {
47
- const schema = await this._schemaEditor.getSchema(schemaKey);
48
- if (schema === undefined)
49
- return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };
50
- if (caProps.name === undefined)
51
- return { errorMessage: `No name was supplied within props.` };
52
- const newClass = (await schema.createCustomAttributeClass(caProps.name));
53
- if (newClass === undefined)
54
- return { errorMessage: `Failed to create class ${caProps.name} in schema ${schemaKey.toString(true)}.` };
55
- await newClass.fromJSON(caProps);
56
- return { itemKey: newClass.key };
40
+ try {
41
+ const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), caProps);
42
+ return newClass.key;
43
+ }
44
+ catch (e) {
45
+ throw new Exception_1.SchemaEditingError(Exception_1.ECEditingStatus.CreateSchemaItemFromProps, new Exception_1.ClassId(this.schemaItemType, caProps.name, schemaKey), e);
46
+ }
57
47
  }
58
48
  }
59
49
  exports.CustomAttributes = CustomAttributes;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttributes.js","sourceRoot":"","sources":["../../../src/Editing/CustomAttributes.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aAAa,CAAC,CAAC;QACjH,CAAC;QAED,IAAI,YAAY;YACd,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;QAEzC,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;QAEzC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,OAAkC;QACnF,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,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS;YAC5B,OAAO,EAAE,YAAY,EAAE,oCAAoC,EAAE,CAAC;QAEhE,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,OAAO,CAAC,IAAI,CAAC,CAAmB,CAAC;QAC3F,IAAI,QAAQ,KAAK,SAAS;YACxB,OAAO,EAAE,YAAY,EAAE,0BAA0B,OAAO,CAAC,IAAI,cAAc,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;QAE3G,MAAM,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAEjC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,GAAG,EAAE,CAAC;IACnC,CAAC;CACF;AAtDD,4CAsDC","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 CustomAttributeClassProps, CustomAttributeContainerType, DelayedPromiseWithProps, ECClass,\r\n SchemaItemKey, SchemaItemType, SchemaKey,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor, SchemaItemEditResults } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\r\nimport { MutableCAClass } from \"./Mutable/MutableCAClass\";\r\n\r\n/**\r\n * @alpha\r\n * A class extending ECClasses allowing you to create schema items of type CustomAttributeClass.\r\n */\r\nexport class CustomAttributes extends ECClasses {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.CustomAttributeClass, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, containerType: CustomAttributeContainerType, displayLabel?: string, baseClass?: SchemaItemKey): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n const newClass = (await schema.createCustomAttributeClass(name)) as MutableCAClass;\r\n if (newClass === undefined)\r\n return { errorMessage: `Failed to create class ${name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n if (baseClass !== undefined) {\r\n const baseClassItem = await schema.lookupItem<ECClass>(baseClass);\r\n if (baseClassItem === undefined)\r\n return { errorMessage: `Unable to locate base class ${baseClass.fullName} in schema ${schema.fullName}.` };\r\n\r\n if (baseClassItem.schemaItemType !== SchemaItemType.CustomAttributeClass)\r\n return { errorMessage: `${baseClassItem.fullName} is not of type CustomAttribute Class.` };\r\n\r\n newClass.baseClass = new DelayedPromiseWithProps<SchemaItemKey, ECClass>(baseClass, async () => baseClassItem);\r\n }\r\n\r\n if (displayLabel)\r\n newClass.setDisplayLabel(displayLabel);\r\n\r\n newClass.setContainerType(containerType);\r\n\r\n return { itemKey: newClass.key };\r\n }\r\n\r\n /**\r\n * Creates a CustomAttributeClass through a CustomAttributeClassProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemEditResults> {\r\n const schema = await this._schemaEditor.getSchema(schemaKey);\r\n if (schema === undefined)\r\n return { errorMessage: `Schema Key ${schemaKey.toString(true)} not found in context` };\r\n\r\n if (caProps.name === undefined)\r\n return { errorMessage: `No name was supplied within props.` };\r\n\r\n const newClass = (await schema.createCustomAttributeClass(caProps.name)) as MutableCAClass;\r\n if (newClass === undefined)\r\n return { errorMessage: `Failed to create class ${caProps.name} in schema ${schemaKey.toString(true)}.` };\r\n\r\n await newClass.fromJSON(caProps);\r\n\r\n return { itemKey: newClass.key };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CustomAttributes.js","sourceRoot":"","sources":["../../../src/Editing/CustomAttributes.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAIkC;AAElC,2CAAwC;AAExC,2CAA2E;AAE3E;;;GAGG;AACH,MAAa,gBAAiB,SAAQ,qBAAS;IAC7C,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,oBAAoB,EAAE,YAAY,CAAC,CAAC;IAC3D,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,aAA2C,EAAE,YAAqB,EAAE,YAA4B;QACtJ,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAuB,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,YAAY,CAAmB,CAAC;YAEhM,IAAI,YAAY;gBACd,QAAQ,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAEzC,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;YACzC,OAAO,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,sBAAsB,EAAE,IAAI,mBAAO,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,OAAkC;QACnF,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;YAC3J,OAAO,QAAQ,CAAC,GAAG,CAAC;QACtB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,mBAAO,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACzI,CAAC;IACH,CAAC;CACF;AAhCD,4CAgCC","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 CustomAttributeClass,\r\n CustomAttributeClassProps, CustomAttributeContainerType,\r\n SchemaItemKey, SchemaItemType, SchemaKey,\r\n} from \"@itwin/ecschema-metadata\";\r\nimport { SchemaContextEditor } from \"./Editor\";\r\nimport { ECClasses } from \"./ECClasses\";\r\nimport { MutableCAClass } from \"./Mutable/MutableCAClass\";\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 CustomAttributeClass.\r\n */\r\nexport class CustomAttributes extends ECClasses {\r\n public constructor(schemaEditor: SchemaContextEditor) {\r\n super(SchemaItemType.CustomAttributeClass, schemaEditor);\r\n }\r\n\r\n public async create(schemaKey: SchemaKey, name: string, containerType: CustomAttributeContainerType, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createClass<CustomAttributeClass>(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), name, baseClassKey) as MutableCAClass;\r\n\r\n if (displayLabel)\r\n newClass.setDisplayLabel(displayLabel);\r\n\r\n newClass.setContainerType(containerType);\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 CustomAttributeClass through a CustomAttributeClassProps.\r\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\r\n * @param caProps a json object that will be used to populate the new CustomAttributeClass. Needs a name value passed in.\r\n */\r\n public async createFromProps(schemaKey: SchemaKey, caProps: CustomAttributeClassProps): Promise<SchemaItemKey> {\r\n try {\r\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createCustomAttributeClass.bind(schema), caProps);\r\n return newClass.key;\r\n } catch (e: any) {\r\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, caProps.name!, schemaKey), e);\r\n }\r\n }\r\n}\r\n"]}
@@ -1,18 +1,18 @@
1
1
  /** @packageDocumentation
2
2
  * @module Editing
3
3
  */
4
- import { CustomAttribute, CustomAttributeContainerProps, Enumeration, EnumerationPropertyProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PrimitiveType, SchemaItemKey, SchemaItemType, StructArrayPropertyProps, StructClass, StructPropertyProps } from "@itwin/ecschema-metadata";
5
- import { PropertyEditResults, SchemaContextEditor, SchemaItemEditResults } from "./Editor";
4
+ import { CustomAttribute, CustomAttributeContainerProps, ECClass, Enumeration, EnumerationPropertyProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey, StructArrayPropertyProps, StructClass, StructPropertyProps } from "@itwin/ecschema-metadata";
5
+ import { SchemaContextEditor } from "./Editor";
6
6
  import { ArrayProperties, EnumerationProperties, PrimitiveProperties, Properties, StructProperties } from "./Properties";
7
+ import { CreateSchemaItem, SchemaItems } from "./SchemaItems";
7
8
  export type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;
8
9
  /**
9
10
  * @alpha
10
11
  * Acts as a base class for schema class creation. Enables property creation.
11
12
  */
12
- export declare class ECClasses {
13
+ export declare class ECClasses extends SchemaItems {
14
+ protected constructor(schemaItemType: ECClassSchemaItems, schemaEditor: SchemaContextEditor);
13
15
  protected schemaItemType: ECClassSchemaItems;
14
- protected _schemaEditor: SchemaContextEditor;
15
- protected constructor(schemaItemType: ECClassSchemaItems, _schemaEditor: SchemaContextEditor);
16
16
  /**
17
17
  * Allows access for editing of base Property attributes.
18
18
  */
@@ -33,6 +33,7 @@ export declare class ECClasses {
33
33
  * Allows access for editing of StructProperty attributes.
34
34
  */
35
35
  readonly structProperties: StructProperties;
36
+ createClass<T extends ECClass>(schemaKey: SchemaKey, type: SchemaItemType, create: CreateSchemaItem<T>, name: string, baseClassKey?: SchemaItemKey, ...args: any[]): Promise<T>;
36
37
  /**
37
38
  * Creates a property on class identified by the given SchemaItemKey. This method restricts the
38
39
  * property type to primitives of type Double, String, DateTime and Integer.
@@ -40,46 +41,46 @@ export declare class ECClasses {
40
41
  * @param name The name of the new property.
41
42
  * @param type The PrimitiveType assigned to the new property.
42
43
  */
43
- createProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType, prefix: string): Promise<PropertyEditResults>;
44
+ createProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType, prefix: string): Promise<void>;
44
45
  /**
45
46
  * Create a primitive property on class identified by the given SchemaItemKey.
46
47
  * @param classKey The SchemaItemKey of the class.
47
48
  * @param name The name of the new property.
48
49
  * @param type The PrimitiveType assigned to the new property.
49
50
  */
50
- createPrimitiveProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<PropertyEditResults>;
51
- createPrimitivePropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitivePropertyProps): Promise<PropertyEditResults>;
52
- createEnumerationProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<PropertyEditResults>;
53
- createEnumerationPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, enumProps: EnumerationPropertyProps): Promise<PropertyEditResults>;
54
- createPrimitiveArrayProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<PropertyEditResults>;
55
- createPrimitiveArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitiveArrayPropertyProps): Promise<PropertyEditResults>;
56
- createEnumerationArrayProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<PropertyEditResults>;
57
- createEnumerationArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, props: PrimitiveArrayPropertyProps): Promise<PropertyEditResults>;
58
- createStructProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<PropertyEditResults>;
59
- createStructPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructPropertyProps): Promise<PropertyEditResults>;
60
- createStructArrayProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<PropertyEditResults>;
61
- createStructArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructArrayPropertyProps): Promise<PropertyEditResults>;
62
- deleteProperty(classKey: SchemaItemKey, name: string): Promise<PropertyEditResults>;
63
- delete(classKey: SchemaItemKey): Promise<SchemaItemEditResults>;
51
+ createPrimitiveProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void>;
52
+ createPrimitivePropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitivePropertyProps): Promise<void>;
53
+ createEnumerationProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void>;
54
+ createEnumerationPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, enumProps: EnumerationPropertyProps): Promise<void>;
55
+ createPrimitiveArrayProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<void>;
56
+ createPrimitiveArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitiveArrayPropertyProps): Promise<void>;
57
+ createEnumerationArrayProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<void>;
58
+ createEnumerationArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, props: PrimitiveArrayPropertyProps): Promise<void>;
59
+ createStructProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void>;
60
+ createStructPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructPropertyProps): Promise<void>;
61
+ createStructArrayProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<void>;
62
+ createStructArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructArrayPropertyProps): Promise<void>;
63
+ deleteProperty(classKey: SchemaItemKey, name: string): Promise<void>;
64
+ delete(classKey: SchemaItemKey): Promise<void>;
64
65
  /**
65
66
  * Adds a CustomAttribute instance to the Class identified by the given SchemaItemKey
66
67
  * @param classKey The SchemaItemKey identifying the schema.
67
68
  * @param customAttribute The CustomAttribute instance to add.
68
69
  */
69
- addCustomAttribute(classKey: SchemaItemKey, customAttribute: CustomAttribute): Promise<SchemaItemEditResults>;
70
+ addCustomAttribute(classKey: SchemaItemKey, customAttribute: CustomAttribute): Promise<void>;
70
71
  /**
71
72
  * Sets the name of the ECClass.
72
73
  * @param classKey The SchemaItemKey of the class.
73
74
  * @param name The new name of the class.
74
75
  * @throws ECObjectsError if `name` does not meet the criteria for a valid EC name
75
76
  */
76
- setName(classKey: SchemaItemKey, name: string): Promise<SchemaItemEditResults>;
77
+ setName(classKey: SchemaItemKey, name: string): Promise<SchemaItemKey>;
77
78
  /**
78
79
  * Sets the base class of a SchemaItem.
79
80
  * @param itemKey The SchemaItemKey of the Item.
80
81
  * @param baseClassKey The SchemaItemKey of the base class. Specifying 'undefined' removes the base class.
81
82
  */
82
- setBaseClass(itemKey: SchemaItemKey, baseClassKey?: SchemaItemKey): Promise<SchemaItemEditResults>;
83
+ setBaseClass(itemKey: SchemaItemKey, baseClassKey?: SchemaItemKey): Promise<void>;
83
84
  private getClass;
84
85
  protected removeCustomAttribute(container: CustomAttributeContainerProps, customAttribute: CustomAttribute): void;
85
86
  private findDerivedClasses;
@@ -1 +1 @@
1
- {"version":3,"file":"ECClasses.d.ts","sourceRoot":"","sources":["../../../src/Editing/ECClasses.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,6BAA6B,EAEa,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,EAC5G,sBAAsB,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,wBAAwB,EAC9F,WAAW,EAAE,mBAAmB,EACjC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAG3F,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEzH,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,WAAW,GAAG,cAAc,CAAC,WAAW,GAAG,cAAc,CAAC,iBAAiB,GAAG,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,oBAAoB,CAAC;AAEzL;;;GAGG;AACH,qBAAa,SAAS;IAE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