@itwin/ecschema-editing 4.7.0-dev.9 → 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.
- package/CHANGELOG.md +6 -1
- package/lib/cjs/Editing/Constants.d.ts +6 -6
- package/lib/cjs/Editing/Constants.d.ts.map +1 -1
- package/lib/cjs/Editing/Constants.js +26 -31
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.d.ts +3 -3
- package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js +18 -28
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.d.ts +24 -23
- package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +126 -156
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.d.ts +10 -31
- package/lib/cjs/Editing/Editor.d.ts.map +1 -1
- package/lib/cjs/Editing/Editor.js +59 -43
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.d.ts +9 -9
- package/lib/cjs/Editing/Entities.d.ts.map +1 -1
- package/lib/cjs/Editing/Entities.js +65 -85
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.d.ts +6 -6
- package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
- package/lib/cjs/Editing/Enumerations.js +57 -55
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.d.ts +257 -0
- package/lib/cjs/Editing/Exception.d.ts.map +1 -0
- package/lib/cjs/Editing/Exception.js +426 -0
- package/lib/cjs/Editing/Exception.js.map +1 -0
- package/lib/cjs/Editing/Formats.d.ts +6 -6
- package/lib/cjs/Editing/Formats.d.ts.map +1 -1
- package/lib/cjs/Editing/Formats.js +28 -33
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.d.ts +6 -6
- package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js +41 -56
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.d.ts +6 -6
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +50 -57
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- package/lib/cjs/Editing/Mixins.d.ts +5 -5
- package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
- package/lib/cjs/Editing/Mixins.js +43 -58
- package/lib/cjs/Editing/Mixins.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts +1 -5
- package/lib/cjs/Editing/Mutable/MutableEntityClass.d.ts.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js +1 -45
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/cjs/Editing/Phenomena.d.ts +7 -7
- package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
- package/lib/cjs/Editing/Phenomena.js +23 -23
- package/lib/cjs/Editing/Phenomena.js.map +1 -1
- package/lib/cjs/Editing/Properties.d.ts +7 -6
- package/lib/cjs/Editing/Properties.d.ts.map +1 -1
- package/lib/cjs/Editing/Properties.js +99 -46
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.d.ts +6 -6
- package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js +29 -27
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.d.ts +15 -17
- package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js +97 -101
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.d.ts +13 -5
- package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js +58 -6
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.d.ts +3 -3
- package/lib/cjs/Editing/Structs.d.ts.map +1 -1
- package/lib/cjs/Editing/Structs.js +17 -27
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.d.ts +7 -7
- package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js +22 -20
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.d.ts +6 -6
- package/lib/cjs/Editing/Units.d.ts.map +1 -1
- package/lib/cjs/Editing/Units.js +26 -35
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/CAClassMerger.js +2 -2
- package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.d.ts +1 -2
- package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js +15 -39
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +2 -3
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts +4 -5
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js +8 -18
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.d.ts +1 -2
- package/lib/cjs/Merging/EntityClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js +3 -10
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +8 -10
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +2 -3
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +2 -2
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +1 -2
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js +1 -2
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.d.ts +2 -3
- package/lib/cjs/Merging/PropertyMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js +21 -42
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.d.ts +5 -3
- package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js +35 -33
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.d.ts +3 -4
- package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaItemMerger.js +3 -2
- package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +2 -8
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitSystemMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/UnitSystemMerger.js +1 -2
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- 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,
|
|
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
|
|
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
|
-
|
|
12
|
-
|
|
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<
|
|
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,
|
|
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(
|
|
18
|
-
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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,
|
|
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,y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B;QAC7E,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC,CAAC;YACxJ,OAAO,WAAW,CAAC,GAAG,CAAC;QACzB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,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
|
|
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,
|
|
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<
|
|
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,
|
|
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,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
return
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,
|
|
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 {
|
|
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<
|
|
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<
|
|
51
|
-
createPrimitivePropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitivePropertyProps): Promise<
|
|
52
|
-
createEnumerationProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<
|
|
53
|
-
createEnumerationPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, enumProps: EnumerationPropertyProps): Promise<
|
|
54
|
-
createPrimitiveArrayProperty(classKey: SchemaItemKey, name: string, type: PrimitiveType): Promise<
|
|
55
|
-
createPrimitiveArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: PrimitiveType, primitiveProps: PrimitiveArrayPropertyProps): Promise<
|
|
56
|
-
createEnumerationArrayProperty(classKey: SchemaItemKey, name: string, type: Enumeration): Promise<
|
|
57
|
-
createEnumerationArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: Enumeration, props: PrimitiveArrayPropertyProps): Promise<
|
|
58
|
-
createStructProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<
|
|
59
|
-
createStructPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructPropertyProps): Promise<
|
|
60
|
-
createStructArrayProperty(classKey: SchemaItemKey, name: string, type: StructClass): Promise<
|
|
61
|
-
createStructArrayPropertyFromProps(classKey: SchemaItemKey, name: string, type: StructClass, structProps: StructArrayPropertyProps): Promise<
|
|
62
|
-
deleteProperty(classKey: SchemaItemKey, name: string): Promise<
|
|
63
|
-
delete(classKey: SchemaItemKey): Promise<
|
|
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<
|
|
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<
|
|
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<
|
|
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,
|
|
1
|
+
{"version":3,"file":"ECClasses.d.ts","sourceRoot":"","sources":["../../../src/Editing/ECClasses.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,eAAe,EACf,6BAA6B,EAE7B,OAAO,EAAmC,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,EAC5G,sBAAsB,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,SAAS,EAAE,wBAAwB,EACzG,WAAW,EAAE,mBAAmB,EACjC,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAG/C,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,UAAU,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