@itwin/ecschema-editing 5.5.0-dev.1 → 5.5.0-dev.2
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/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Differencing/Utils.js.map +1 -1
- package/lib/cjs/Editing/Constants.js.map +1 -1
- package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.js.map +1 -1
- package/lib/cjs/Editing/Entities.js.map +1 -1
- package/lib/cjs/Editing/Enumerations.js.map +1 -1
- package/lib/cjs/Editing/Exception.js.map +1 -1
- package/lib/cjs/Editing/Formats.js.map +1 -1
- package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
- package/lib/cjs/Editing/Mixins.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
- package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
- package/lib/cjs/Editing/Phenomena.js.map +1 -1
- package/lib/cjs/Editing/Properties.js.map +1 -1
- package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
- package/lib/cjs/Editing/SchemaItems.js.map +1 -1
- package/lib/cjs/Editing/Structs.js.map +1 -1
- package/lib/cjs/Editing/UnitSystems.js.map +1 -1
- package/lib/cjs/Editing/Units.js.map +1 -1
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
- package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.js.map +1 -1
- package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/cjs/Validation/Rules.js.map +1 -1
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
- package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/lib/esm/Differencing/Errors.js.map +1 -1
- package/lib/esm/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/esm/Differencing/SchemaDifference.js.map +1 -1
- package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/esm/Differencing/Utils.js.map +1 -1
- package/lib/esm/Editing/Constants.js.map +1 -1
- package/lib/esm/Editing/CustomAttributes.js.map +1 -1
- package/lib/esm/Editing/ECClasses.js.map +1 -1
- package/lib/esm/Editing/Editor.js.map +1 -1
- package/lib/esm/Editing/Entities.js.map +1 -1
- package/lib/esm/Editing/Enumerations.js.map +1 -1
- package/lib/esm/Editing/Exception.js.map +1 -1
- package/lib/esm/Editing/Formats.js.map +1 -1
- package/lib/esm/Editing/InvertedUnits.js.map +1 -1
- package/lib/esm/Editing/KindOfQuantities.js.map +1 -1
- package/lib/esm/Editing/Mixins.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -1
- package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -1
- package/lib/esm/Editing/Phenomena.js.map +1 -1
- package/lib/esm/Editing/Properties.js.map +1 -1
- package/lib/esm/Editing/PropertyCategories.js.map +1 -1
- package/lib/esm/Editing/RelationshipClasses.js.map +1 -1
- package/lib/esm/Editing/SchemaItems.js.map +1 -1
- package/lib/esm/Editing/Structs.js.map +1 -1
- package/lib/esm/Editing/UnitSystems.js.map +1 -1
- package/lib/esm/Editing/Units.js.map +1 -1
- package/lib/esm/Merging/ClassMerger.js.map +1 -1
- package/lib/esm/Merging/ConstantMerger.js.map +1 -1
- package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/esm/Merging/Edits/NameMapping.js.map +1 -1
- package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -1
- package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/esm/Merging/EntityClassMerger.js.map +1 -1
- package/lib/esm/Merging/EnumerationMerger.js.map +1 -1
- package/lib/esm/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/esm/Merging/FormatMerger.js.map +1 -1
- package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -1
- package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/esm/Merging/MixinMerger.js.map +1 -1
- package/lib/esm/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/esm/Merging/PropertyMerger.js.map +1 -1
- package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/esm/Merging/SchemaMerger.js.map +1 -1
- package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/esm/Merging/StructClassMerger.js.map +1 -1
- package/lib/esm/Merging/UnitMerger.js.map +1 -1
- package/lib/esm/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/esm/Merging/Utils.js.map +1 -1
- package/lib/esm/Validation/Diagnostic.js.map +1 -1
- package/lib/esm/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/esm/Validation/ECRules.js.map +1 -1
- package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/esm/Validation/Rules.js.map +1 -1
- package/lib/esm/Validation/SchemaChanges.js.map +1 -1
- package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/esm/Validation/SchemaComparer.js.map +1 -1
- package/lib/esm/Validation/SchemaValidater.js.map +1 -1
- package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -1
- package/lib/esm/Validation/SchemaWalker.js.map +1 -1
- package/lib/esm/ecschema-editing.js.map +1 -1
- package/package.json +9 -9
- 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,OAAO,EACY,WAAW,EAC5B,KAAK,EAA6D,cA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vE,MAAM,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACvE,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,wBAAwB,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACtI,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,iCAAiC,CAAC,QAAuB,EAAE,eAAwC;QAC9G,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YACtE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YAC1I,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,iCAAiC,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACxI,CAAC;IACH,CAAC;CACF","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 protected override get itemTypeClass(): typeof EntityClass {\r\n return EntityClass;\r\n }\r\n\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, EntityClass);\r\n if (!(await (baseClass).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, EntityClass);\r\n if (!(await (baseClass).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, EntityClass);\r\n if (!(await (baseClass).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(entityKey, MutableEntityClass);\r\n const mixin = await this.getSchemaItem(mixinKey, 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(entityKey, MutableEntityClass);\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(classKey, MutableEntityClass);\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"]}
|
|
1
|
+
{"version":3,"file":"Entities.js","sourceRoot":"","sources":["../../../src/Editing/Entities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,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AAC,SAAS,EAAE,kBAAkB,CAAC,CAAC;YACvE,MAAM,MAAM,CAAC,wBAAwB,CAAC,IAAI,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;QACvE,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,wBAAwB,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QACtI,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,iCAAiC,CAAC,QAAuB,EAAE,eAAwC;QAC9G,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC;YACtE,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,wBAAwB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YAC1I,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,iCAAiC,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QACxI,CAAC;IACH,CAAC;CACF","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 ECClassModifier, EntityClass, EntityClassProps,\n Mixin, NavigationPropertyProps, RelationshipClass, SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\n} from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { ECClasses } from \"./ECClasses\";\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\nimport { NavigationProperties } from \"./Properties\";\nimport { ClassId, ECEditingStatus, SchemaEditingError } from \"./Exception\";\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 protected override get itemTypeClass(): typeof EntityClass {\n return EntityClass;\n }\n\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(SchemaItemType.EntityClass, this.schemaEditor);\n\n public async createElement(schemaKey: SchemaKey, name: string, modifier: ECClassModifier, baseClassKey: SchemaItemKey, displayLabel?: string, mixins?: Mixin[]): Promise<SchemaItemKey> {\n try {\n const baseClass = await this.getSchemaItem(baseClassKey, EntityClass);\n if (!(await (baseClass).is(\"Element\", \"BisCore\"))) {\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElement, new ClassId(this.schemaItemType, baseClassKey));\n }\n } catch(e: any){\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\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<SchemaItemKey> {\n try {\n const baseClass = await this.getSchemaItem(baseClassKey, EntityClass);\n if (!(await (baseClass).is(\"ElementUniqueAspect\", \"BisCore\"))) {\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElementUniqueAspect, new ClassId(this.schemaItemType, baseClassKey));\n }\n } catch(e: any){\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\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<SchemaItemKey> {\n try {\n const baseClass = await this.getSchemaItem(baseClassKey, EntityClass);\n if (!(await (baseClass).is(\"ElementMultiAspect\", \"BisCore\"))) {\n throw new SchemaEditingError(ECEditingStatus.BaseClassIsNotElementMultiAspect, new ClassId(this.schemaItemType, baseClassKey));\n }\n } catch(e: any){\n throw new SchemaEditingError(ECEditingStatus.CreateElement, new ClassId(this.schemaItemType, name, schemaKey), e);\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<SchemaItemKey> {\n try {\n const newClass = await this.createClass<EntityClass>(schemaKey, this.schemaItemType, (schema) => schema.createEntityClass.bind(schema), name, baseClassKey, modifier) as MutableEntityClass;\n\n if (mixins !== undefined)\n mixins.forEach((m) => newClass.addMixin(m));\n\n if (displayLabel)\n newClass.setDisplayLabel(displayLabel);\n\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);\n }\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<SchemaItemKey> {\n try {\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createEntityClass.bind(schema), entityProps);\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, entityProps.name!, schemaKey), e);\n }\n }\n\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\n try {\n const entity = await this.getSchemaItem(entityKey, MutableEntityClass);\n const mixin = await this.getSchemaItem(mixinKey, Mixin);\n entity.addMixin(mixin);\n } catch(e: any){\n throw new SchemaEditingError(ECEditingStatus.AddMixin, new ClassId(SchemaItemType.EntityClass, entityKey), e);\n }\n }\n\n public async createNavigationProperty(entityKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<void> {\n try {\n const entity = await this.getSchemaItem(entityKey, MutableEntityClass);\n await entity.createNavigationProperty(name, relationship, direction);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationProperty, new ClassId(SchemaItemType.RelationshipClass, entityKey), e);\n }\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<void> {\n try {\n const entity = await this.getSchemaItem(classKey, MutableEntityClass);\n const property = await entity.createNavigationProperty(navigationProps.name, navigationProps.relationshipName, navigationProps.direction);\n await property.fromJSON(navigationProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationPropertyFromProps, new ClassId(SchemaItemType.EntityClass, classKey), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Enumerations.js","sourceRoot":"","sources":["../../../src/Editing/Enumerations.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAiB,WAAW,EAAkD,cAAc,EAAa,MAAM,0BAA0B,CAAC;AAGjJ,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C;;;GAGG;AACH,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,IAAuB,aAAa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,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;YAE1E,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YACnE,IAAI,UAAU,KAAK,SAAS;gBAC1B,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,sBAAsB,EAAE,IAAI,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;YAErH,UAAgC,CAAC,KAAK,GAAG,KAAK,CAAC;QAClD,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,kBAAkB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,wBAAwB,CAAC,cAA6B,EAAE,cAAsB,EAAE,WAA+B;QAC1H,IAAI,CAAC;YACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;YAE1E,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC;YACnE,IAAI,UAAU,KAAK,SAAS;gBAC1B,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,sBAAsB,EAAE,IAAI,YAAY,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC;YAErH,UAAgC,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9D,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,kBAAkB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Enumerations.js","sourceRoot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WAAW,CAAC,CAAC,CAAC;YAErH,UAAgC,CAAC,WAAW,GAAG,WAAW,CAAC;QAC9D,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,kBAAkB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7H,CAAC;IACH,CAAC;CACF","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, Enumeration, EnumerationProps, PrimitiveType, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableEnumeration } from \"./Mutable/MutableEnumeration\";\nimport { ECEditingStatus, EnumeratorId, SchemaEditingError, SchemaItemId } from \"./Exception\";\nimport { SchemaItems } from \"./SchemaItems\";\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 extends SchemaItems {\n protected override get itemTypeClass(): typeof Enumeration {\n return Enumeration;\n }\n\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.Enumeration, schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, type: PrimitiveType.Integer | PrimitiveType.String, displayLabel?: string, isStrict?: boolean, enumerators?: AnyEnumerator[]): Promise<SchemaItemKey> {\n try {\n const newEnum = await this.createSchemaItem<Enumeration>(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), name, type) as MutableEnumeration;\n\n if (undefined !== isStrict)\n newEnum.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.setDisplayLabel(displayLabel);\n\n return newEnum.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\n }\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<SchemaItemKey> {\n try {\n const newEnum = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createEnumeration.bind(schema), enumProps);\n return newEnum.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, enumProps.name!, schemaKey), e);\n }\n }\n\n public async addEnumerator(enumerationKey: SchemaItemKey, enumerator: AnyEnumerator): Promise<void> {\n try {\n const enumeration = await this.getSchemaItem(enumerationKey, Enumeration);\n\n if (enumeration.isInt && typeof (enumerator.value) !== \"number\")\n throw new SchemaEditingError(ECEditingStatus.InvalidEnumeratorType, new EnumeratorId(enumerator, enumeration));\n\n if (enumeration.isString && typeof (enumerator.value) !== \"string\")\n throw new SchemaEditingError(ECEditingStatus.InvalidEnumeratorType, new EnumeratorId(enumerator, enumeration));\n\n (enumeration as MutableEnumeration).addEnumerator(enumerator);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.AddEnumerator, new SchemaItemId(this.schemaItemType, enumerationKey), e);\n }\n }\n\n public async setEnumeratorLabel(enumerationKey: SchemaItemKey, enumeratorName: string, label: string | undefined): Promise<void> {\n try {\n const enumeration = await this.getSchemaItem(enumerationKey, Enumeration);\n\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\n if (enumerator === undefined)\n throw new SchemaEditingError(ECEditingStatus.EnumeratorDoesNotExist, new EnumeratorId(enumeratorName, enumeration));\n\n (enumerator as MutableEnumerator).label = label;\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.SetEnumeratorLabel, new SchemaItemId(this.schemaItemType, enumerationKey), e);\n }\n }\n\n public async setEnumeratorDescription(enumerationKey: SchemaItemKey, enumeratorName: string, description: string | undefined): Promise<void> {\n try {\n const enumeration = await this.getSchemaItem(enumerationKey, Enumeration);\n\n const enumerator = enumeration.getEnumeratorByName(enumeratorName);\n if (enumerator === undefined)\n throw new SchemaEditingError(ECEditingStatus.EnumeratorDoesNotExist, new EnumeratorId(enumeratorName, enumeration));\n\n (enumerator as MutableEnumerator).description = description;\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.SetEnumeratorLabel, new SchemaItemId(this.schemaItemType, enumerationKey), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/Editing/Exception.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA6D,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAA0B,aAAa,EAA6B,MAAM,0BAA0B,CAAC;AAEvN,aAAa;AACb,MAAM,CAAN,IAAY,eAmFX;AAnFD,WAAY,eAAe;IACzB,4FAA+B,CAAA;IAC/B,2DAAW,CAAA;IACX,4EAAyC,CAAA;IACzC,8EAAc,CAAA;IACd,sFAAkB,CAAA;IAClB,wGAA2B,CAAA;IAC3B,4FAAqB,CAAA;IACrB,kFAAgB,CAAA;IAChB,wFAAmB,CAAA;IACnB,4FAAqB,CAAA;IACrB,oHAAiC,CAAA;IACjC,kHAAgC,CAAA;IAChC,sGAA0B,CAAA;IAC1B,4FAAqB,CAAA;IACrB,wGAA2B,CAAA;IAC3B,4FAAqB,CAAA;IACrB,kFAAgB,CAAA;IAChB,8FAAsB,CAAA;IACtB,4EAAa,CAAA;IACb,sFAAkB,CAAA;IAClB,wGAA2B,CAAA;IAC3B,kGAAwB,CAAA;IACxB,eAA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AAC,UAAU,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,GAAG,CAAC;YAC7J,KAAK,qBAAqB,CAAC,kBAAkB;gBAC3C,OAAO,0BAA0B,eAAe,CAAC,IAAI,CAAC,WAAW,CAAC,+BAA+B,IAAI,CAAC,UAAU,CAAC,cAAc,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,CAAC;YACjK;gBACE,MAAM,IAAI,KAAK,CAAE,qBAAqB,CAAC,CAAC;QAC5C,CAAC;IACH,CAAC;IAEO,sBAAsB,CAAC,UAAyB;QACtD,IAAI,UAAU,CAAC,cAAc,KAAK,qBAAqB,CAAC,oBAAoB;YAC1E,UAAU,CAAC,cAAc,KAAK,qBAAqB,CAAC,eAAe;YACnE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,WAAwB,EAAE,UAAkC;IACrF,IAAI,OAAM,CAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC/E,CAAC;IAED,OAAO,OAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AAClE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Editing\r\n */\r\n\r\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\r\nimport { AnyEnumerator, CustomAttributeContainerProps, Enumeration, PrimitiveType, primitiveTypeToString, Property, RelationshipConstraint, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\n\r\n/** @alpha */\r\nexport enum ECEditingStatus {\r\n EC_EDITING_ERROR_BASE = 0x30000,\r\n Unknown = 0,\r\n RuleViolation = EC_EDITING_ERROR_BASE + 1,\r\n SchemaNotFound,\r\n SchemaItemNotFound,\r\n SchemaItemNotFoundInContext,\r\n PropertyAlreadyExists,\r\n PropertyNotFound,\r\n InvalidPropertyType,\r\n BaseClassIsNotElement,\r\n BaseClassIsNotElementUniqueAspect,\r\n BaseClassIsNotElementMultiAspect,\r\n SchemaItemNameNotSpecified,\r\n InvalidSchemaItemType,\r\n SchemaItemNameAlreadyExists,\r\n InvalidEnumeratorType,\r\n InvalidBaseClass,\r\n EnumeratorDoesNotExist,\r\n InvalidECName,\r\n InvalidSchemaAlias,\r\n InvalidFormatUnitsSpecified,\r\n SchemaAliasAlreadyExists,\r\n // Outer Errors\r\n CreateSchemaItemFailed,\r\n CreateSchemaItemFromProps,\r\n CreateElement,\r\n CreateElementUniqueAspect,\r\n CreateElementMultiAspect,\r\n SetBaseClass,\r\n SetSourceConstraint,\r\n SetTargetConstraint,\r\n AddConstraintClass,\r\n RemoveConstraintClass,\r\n SetAbstractConstraint,\r\n AddCustomAttributeToConstraint,\r\n AddCustomAttributeToProperty,\r\n AddCustomAttributeToClass,\r\n CreateNavigationProperty,\r\n CreateNavigationPropertyFromProps,\r\n SetInvertsUnit,\r\n SetUnitSystem,\r\n SetDescription,\r\n SetLabel,\r\n SetIsReadOnly,\r\n SetPriority,\r\n SetCategory,\r\n SetKindOfQuantity,\r\n SetMinOccurs,\r\n SetMaxOccurs,\r\n SetExtendedTypeName,\r\n SetMinLength,\r\n SetMaxLength,\r\n SetMinValue,\r\n SetMaxValue,\r\n SetPropertyName,\r\n AddMixin,\r\n AddEnumerator,\r\n SetEnumeratorLabel,\r\n SetEnumeratorDescription,\r\n AddPresentationUnit,\r\n AddPresentationOverride,\r\n CreateFormatOverride,\r\n SetPropertyCategoryPriority,\r\n CreatePrimitiveProperty,\r\n CreatePrimitivePropertyFromProps,\r\n CreateEnumerationProperty,\r\n CreateEnumerationPropertyFromProps,\r\n CreatePrimitiveArrayProperty,\r\n CreatePrimitiveArrayPropertyFromProps,\r\n CreateEnumerationArrayProperty,\r\n CreateEnumerationArrayPropertyFromProps,\r\n CreateStructProperty,\r\n CreateStructPropertyFromProps,\r\n CreateStructArrayProperty,\r\n CreateStructArrayPropertyFromProps,\r\n DeleteProperty,\r\n DeleteClass,\r\n SetClassName,\r\n AddSchemaReference,\r\n SetSchemaVersion,\r\n IncrementSchemaMinorVersion,\r\n SetSchemaAlias\r\n}\r\n\r\n/**\r\n * A type that constrains the possible error types handled by SchemaEditingError\r\n * @alpha\r\n */\r\nexport type AnyEditingError = SchemaEditingError | Error;\r\n\r\n/**\r\n * Defines the possible property type names.\r\n * @alpha\r\n */\r\nexport enum PropertyTypeName {\r\n ArrayProperty = \"ArrayProperty\",\r\n PrimitiveProperty = \"PrimitiveProperty\",\r\n EnumerationProperty = \"EnumerationProperty\",\r\n NavigationProperty = \"NavigationProperty\",\r\n StructProperty = \"StructProperty\"\r\n}\r\n\r\n/**\r\n * Defines the possible schema type identifiers.\r\n * @alpha\r\n */\r\nexport enum SchemaTypeIdentifiers {\r\n SchemaIdentifier = \"Schema\",\r\n SchemaItemIdentifier = \"SchemaItem\",\r\n ClassIdentifier = \"Class\",\r\n PropertyIdentifier = \"Property\",\r\n EnumeratorIdentifier = \"Enumerator\",\r\n CustomAttributeIdentifier = \"CustomAttribute\",\r\n RelationshipConstraintIdentifier = \"RelationshipConstraint\"\r\n}\r\n\r\n/**\r\n * Type that constrains SchemaItemType enum to those used by EC Class types.\r\n * @alpha\r\n */\r\nexport type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;\r\n\r\n/**\r\n * Type that defines the possible SchemaTypeIdentifiers for SchemaItemId classes.\r\n * @alpha\r\n */\r\nexport type AnySchemaItemTypeIdentifier = SchemaTypeIdentifiers.SchemaItemIdentifier | SchemaTypeIdentifiers.ClassIdentifier;\r\n\r\n/**\r\n * Type that encompasses all ISchemaTypeIdentifier interfaces\r\n * @alpha\r\n */\r\nexport type AnyIdentifier = ISchemaIdentifier | ISchemaItemIdentifier | IClassIdentifier | IPropertyIdentifier | ICustomAttributeIdentifier | IRelationshipConstraintIdentifier | IEnumeratorIdentifier;\r\n\r\n/**\r\n * A base interface that defines what is needed to identity any schema type.\r\n * @alpha\r\n */\r\nexport interface ISchemaTypeIdentifier {\r\n readonly name: string;\r\n readonly schemaKey: SchemaKey;\r\n readonly typeIdentifier: SchemaTypeIdentifiers;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify a Schema.\r\n * @alpha\r\n */\r\nexport interface ISchemaIdentifier extends ISchemaTypeIdentifier {\r\n readonly typeIdentifier: SchemaTypeIdentifiers.SchemaIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify a SchemaItem.\r\n * @alpha\r\n */\r\nexport interface ISchemaItemIdentifier extends ISchemaTypeIdentifier {\r\n readonly schemaItemType: SchemaItemType;\r\n readonly schemaItemKey: SchemaItemKey;\r\n readonly typeIdentifier: AnySchemaItemTypeIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify an EC Class.\r\n * @alpha\r\n */\r\nexport interface IClassIdentifier extends ISchemaTypeIdentifier {\r\n readonly schemaItemType: ECClassSchemaItems;\r\n readonly schemaItemKey: SchemaItemKey;\r\n readonly typeIdentifier: SchemaTypeIdentifiers.ClassIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify an EC Property.\r\n * @alpha\r\n */\r\nexport interface IPropertyIdentifier extends ISchemaTypeIdentifier {\r\n readonly fullName: string;\r\n readonly ecClass: ClassId;\r\n readonly typeName?: PropertyTypeName;\r\n readonly typeIdentifier: SchemaTypeIdentifiers.PropertyIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify an Enumerator.\r\n * @alpha\r\n */\r\ninterface IEnumeratorIdentifier extends ISchemaTypeIdentifier {\r\n readonly enumeratorType: string;\r\n readonly enumeration: SchemaItemKey;\r\n readonly enumerationType: string;\r\n readonly typeIdentifier: SchemaTypeIdentifiers.EnumeratorIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify a CustomAttribute.\r\n * @alpha\r\n */\r\nexport interface ICustomAttributeIdentifier extends ISchemaTypeIdentifier {\r\n readonly containerFullName: string;\r\n readonly typeIdentifier: SchemaTypeIdentifiers.CustomAttributeIdentifier;\r\n}\r\n\r\n/**\r\n * Interface that defines the data needed to identify a RelationshipConstraint.\r\n * @alpha\r\n */\r\nexport interface IRelationshipConstraintIdentifier extends ISchemaTypeIdentifier {\r\n readonly relationshipKey: SchemaItemKey;\r\n readonly typeIdentifier: SchemaTypeIdentifiers.RelationshipConstraintIdentifier;\r\n}\r\n\r\n/**\r\n * An ISchemaIdentifier implementation to identify Schemas\r\n * @alpha\r\n */\r\nexport class SchemaId implements ISchemaIdentifier {\r\n public readonly typeIdentifier = SchemaTypeIdentifiers.SchemaIdentifier;\r\n public readonly name: string;\r\n public readonly schemaKey: SchemaKey;\r\n constructor(schemaKey: SchemaKey) {\r\n this.name = schemaKey.name;\r\n this.schemaKey = schemaKey;\r\n }\r\n}\r\n\r\n/**\r\n * An ISchemItemIdentifier implementation to identify SchemaItems\r\n * @alpha\r\n */\r\nexport class SchemaItemId implements ISchemaItemIdentifier {\r\n public readonly typeIdentifier: AnySchemaItemTypeIdentifier;\r\n public readonly name: string;\r\n public readonly schemaKey: SchemaKey;\r\n public readonly schemaItemType: SchemaItemType;\r\n public readonly schemaItemKey: SchemaItemKey;\r\n\r\n constructor(schemaItemType: SchemaItemType, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey) {\r\n if (typeof(schemaItemKeyOrName) === \"string\") {\r\n if (!schemaKey)\r\n throw new Error(\"schemaKey if required if the specified schemaItem the name of the schema item.\");\r\n\r\n this.schemaKey = schemaKey!;\r\n this.schemaItemKey = new SchemaItemKey(schemaItemKeyOrName, schemaKey);\r\n } else {\r\n this.schemaKey = schemaItemKeyOrName.schemaKey;\r\n this.schemaItemKey = schemaItemKeyOrName;\r\n }\r\n\r\n this.schemaItemType = schemaItemType;\r\n this.name = this.schemaItemKey.fullName;\r\n this.typeIdentifier = SchemaTypeIdentifiers.SchemaItemIdentifier;\r\n }\r\n}\r\n\r\n/**\r\n * An IClassIdentifier implementation to identify Class instances.\r\n * @alpha\r\n */\r\nexport class ClassId extends SchemaItemId implements IClassIdentifier {\r\n public override readonly typeIdentifier = SchemaTypeIdentifiers.ClassIdentifier;\r\n public override readonly schemaItemType: ECClassSchemaItems;\r\n constructor(schemaItemType: ECClassSchemaItems, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey) {\r\n super(schemaItemType, schemaItemKeyOrName, schemaKey);\r\n this.schemaItemType = schemaItemType;\r\n }\r\n}\r\n\r\n/**\r\n * An IPropertyIdentifier implementation to identify Property instances.\r\n * @alpha\r\n */\r\nexport class PropertyId implements IPropertyIdentifier {\r\n public readonly typeIdentifier = SchemaTypeIdentifiers.PropertyIdentifier;\r\n public readonly name: string;\r\n public readonly fullName: string;\r\n public readonly ecClass: ClassId;\r\n public readonly schemaKey: SchemaKey;\r\n public readonly typeName?: PropertyTypeName;\r\n\r\n constructor(schemaItemType: ECClassSchemaItems, classKey: SchemaItemKey, property: Property | string, typeName?: PropertyTypeName) {\r\n this.name = property instanceof Property ? property.name : property;\r\n this.fullName = property instanceof Property ? property.fullName : `${classKey.name}.${property}`;\r\n this.ecClass = new ClassId(schemaItemType, classKey);\r\n this.schemaKey = classKey.schemaKey;\r\n this.typeName = typeName;\r\n }\r\n}\r\n\r\n/**\r\n * An IEnumeratorIdentifier implementation to identify Enumerator instances.\r\n * @alpha\r\n */\r\nexport class EnumeratorId implements IEnumeratorIdentifier{\r\n public readonly typeIdentifier = SchemaTypeIdentifiers.EnumeratorIdentifier;\r\n public readonly enumeration: SchemaItemKey;\r\n public readonly enumerationType: string;\r\n public readonly enumeratorType: string;\r\n public readonly name: string;\r\n public readonly schemaKey: SchemaKey;\r\n\r\n constructor(enumerator: AnyEnumerator | string, enumeration: Enumeration) {\r\n this.enumeration = enumeration.key;\r\n this.enumerationType = enumeration.type ? primitiveTypeToString(enumeration.type): \"string\";\r\n this.enumeratorType = getEnumeratorType(enumeration ?? PrimitiveType.String, enumerator);\r\n this.name = typeof(enumerator) === \"string\" ? enumerator : enumerator.name;\r\n this.schemaKey = enumeration.schema.schemaKey;\r\n }\r\n}\r\n\r\n/**\r\n * An ICustomAttributeIdentifier implementation to identify CustomAttribute instances.\r\n * @alpha\r\n */\r\nexport class CustomAttributeId implements ICustomAttributeIdentifier {\r\n public readonly typeIdentifier = SchemaTypeIdentifiers.CustomAttributeIdentifier;\r\n public readonly name: string;\r\n public readonly schemaKey: SchemaKey;\r\n public readonly containerFullName: string;\r\n constructor(name: string, container: CustomAttributeContainerProps) {\r\n this.name = name;\r\n this.schemaKey = container.schema.schemaKey;\r\n this.containerFullName = container.fullName;\r\n }\r\n}\r\n\r\n/**\r\n * An IRelationshipConstraintIdentifier implementation to identify RelationshipConstraints.\r\n * @alpha\r\n */\r\nexport class RelationshipConstraintId implements IRelationshipConstraintIdentifier {\r\n public readonly typeIdentifier = SchemaTypeIdentifiers.RelationshipConstraintIdentifier;\r\n public readonly name: string;\r\n public readonly relationshipKey: SchemaItemKey;\r\n public readonly schemaKey: SchemaKey;\r\n constructor(constraint: RelationshipConstraint) {\r\n this.name = constraint.isSource ? \"Source\" : \"Target\";\r\n this.relationshipKey = constraint.relationshipClass.key;\r\n this.schemaKey = this.relationshipKey.schemaKey;\r\n }\r\n}\r\n\r\n/**\r\n * An exception class for the ecschema-editing API. Contains identifiers for schema types involved in the\r\n * exception. An example being SchemaItemId which contains the name of the SchemaItem, SchemaItemKey, SchemaItemType, etc.\r\n * Typically will contain an innerError of type SchemaEditingError containing the identifier of the schema item that\r\n * caused the exception. The containing error instance will identify the method called (identified by the errorNumber)\r\n * and the identifier of the schema item being modified/created.\r\n * @alpha\r\n */\r\nexport class SchemaEditingError extends Error {\r\n private _ruleViolations?: AnyDiagnostic[];\r\n private _schemaKey: SchemaKey;\r\n\r\n /**\r\n * Constructs a new SchemaEditingError instance.\r\n * @param errorNumber The unique ECEditingStatus code identifying the error.\r\n * @param identifier The identifier instance containing information about the EC object involved with the exception.\r\n * @param innerError The SchemaEditingError containing the identifier of the EC object that caused the initial exception.\r\n * @param ruleViolations Will contain EC rule violations of type [[AnyDiagnostic]] for exceptions with the error code ECEditingStatus.RuleViolation.\r\n * @param message Optional error message. Most messages on automatically generated by this class based on the ECEditingStatus code.\r\n */\r\n public constructor(public readonly errorNumber: ECEditingStatus, public readonly identifier: AnyIdentifier, public readonly innerError?: AnyEditingError, ruleViolations?: AnyDiagnostic[], message?: string) {\r\n super(message);\r\n this._ruleViolations = ruleViolations;\r\n this._schemaKey = identifier.schemaKey,\r\n this.generateMessage();\r\n }\r\n\r\n /**\r\n * Gets the SchemaId instance.\r\n * @throws Error if the identifier is not an instance of SchemaId.\r\n */\r\n private get _schemaId(): SchemaId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.SchemaIdentifier)\r\n throw new Error(\"identifier is not a SchemaId.\");\r\n return this.identifier as SchemaId;\r\n }\r\n\r\n /**\r\n * Gets the SchemaItemId instance.\r\n * @throws Error if the identifier is not an instance of SchemaItemId.\r\n */\r\n private get _schemaItemId(): SchemaItemId {\r\n if (this.isSchemaItemIdentifier(this.identifier))\r\n throw new Error(\"identifier is not a SchemaItemId.\");\r\n return this.identifier as SchemaItemId;\r\n }\r\n\r\n /**\r\n * Gets the ClassId instance.\r\n * @throws Error if the identifier is not an instance of ClassId.\r\n */\r\n private get _classId(): ClassId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.ClassIdentifier)\r\n throw new Error(\"identifier is not a ClassId.\");\r\n return this.identifier as ClassId;\r\n }\r\n\r\n /**\r\n * Gets the PropertyId instance.\r\n * @throws Error if the identifier is not an instance of PropertyId.\r\n */\r\n private get _propertyId(): PropertyId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.PropertyIdentifier)\r\n throw new Error(\"identifier is not a PropertyId.\");\r\n return this.identifier;\r\n }\r\n\r\n /**\r\n * Gets the EnumeratorId instance.\r\n * @throws Error if the identifier is not an instance of EnumeratorId.\r\n */\r\n private get _enumeratorId(): EnumeratorId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.EnumeratorIdentifier)\r\n throw new Error(\"identifier is not a EnumerationId.\");\r\n return this.identifier as EnumeratorId;\r\n }\r\n\r\n /**\r\n * Gets the CustomAttributeId instance.\r\n * @throws Error if the identifier is not an instance of CustomAttributeId.\r\n */\r\n private get _customAttributeId(): CustomAttributeId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.CustomAttributeIdentifier)\r\n throw new Error(\"identifier is not a CustomAttributeId.\");\r\n return this.identifier;\r\n }\r\n\r\n /**\r\n * Gets the RelationshipConstraintId instance.\r\n * @throws Error if the identifier is not an instance of RelationshipConstraintId.\r\n */\r\n private get _relationshipConstraintId(): RelationshipConstraintId {\r\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.RelationshipConstraintIdentifier)\r\n throw new Error(\"identifier is not a RelationshipConstraintId.\");\r\n return this.identifier;\r\n }\r\n\r\n /** Gets rule violations that were reported during validation. Returns an array of [[AnyDiagnostic]] if\r\n * the errorNumber is ECEditingStatus.RuleViolation, otherwise undefined.\r\n */\r\n public get ruleViolations(): AnyDiagnostic[] | undefined {\r\n return this._ruleViolations;\r\n }\r\n\r\n /**\r\n * Returns a readable string containing the ECEditingStatus along with the error message. Any\r\n * innerError will also be appended.\r\n * @returns\r\n */\r\n public toDebugString(): string {\r\n let innerMessage = \"\";\r\n if (this.innerError) {\r\n if (this.innerError instanceof SchemaEditingError)\r\n innerMessage = ` Inner error: ${this.innerError.toDebugString()}`;\r\n else\r\n innerMessage = ` Inner error: ${this.innerError.message}`;\r\n }\r\n return this._appendMessage(`ECEditingStatus.${ECEditingStatus[this.errorNumber]}`) + innerMessage;\r\n }\r\n\r\n private generateMessage() {\r\n if (this.message)\r\n return;\r\n\r\n switch(this.errorNumber) {\r\n case ECEditingStatus.SchemaNotFound:\r\n this.message = `Schema Key ${this._schemaKey.toString(true)} could not be found in the context.`;\r\n return;\r\n case ECEditingStatus.SchemaItemNotFound:\r\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} could not be found in the schema ${this._schemaKey.name}.`;\r\n return;\r\n case ECEditingStatus.SchemaItemNotFoundInContext:\r\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} could not be found in the schema context.`;\r\n return;\r\n case ECEditingStatus.InvalidSchemaItemType:\r\n this.message = `Expected ${this._schemaItemId.name} to be of type ${this._schemaItemId.schemaItemType}.`;\r\n return;\r\n case ECEditingStatus.SchemaItemNameNotSpecified:\r\n this.message = `Could not create a new ${this._schemaItemId.schemaItemType} in schema ${this._schemaKey.name}. No name was supplied within props.`;\r\n return;\r\n case ECEditingStatus.SchemaItemNameAlreadyExists:\r\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} already exists in the schema ${this._schemaKey.name}.`;\r\n return;\r\n case ECEditingStatus.RuleViolation:\r\n this.message = this._getRuleViolationMessage();\r\n return;\r\n case ECEditingStatus.PropertyNotFound:\r\n this.message = `An ECProperty with the name ${this._propertyId.name} could not be found in the class ${this._propertyId.ecClass.name}.`;\r\n return;\r\n case ECEditingStatus.PropertyAlreadyExists:\r\n this.message = `An ECProperty with the name ${this._propertyId.name} already exists in the class ${this._propertyId.ecClass.name}.`;\r\n return;\r\n case ECEditingStatus.InvalidPropertyType:\r\n this.message = `Expected property ${this._propertyId.name} to be of type ${this._propertyId.typeName}.`;\r\n return;\r\n case ECEditingStatus.BaseClassIsNotElement:\r\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.Element.`;\r\n return;\r\n case ECEditingStatus.BaseClassIsNotElementUniqueAspect:\r\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.ElementUniqueAspect.`;\r\n return;\r\n case ECEditingStatus.BaseClassIsNotElementMultiAspect:\r\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.ElementMultiAspect.`;\r\n return;\r\n case ECEditingStatus.InvalidFormatUnitsSpecified:\r\n this.message = `The specified Format unit ${this._schemaItemId.name} is not of type Unit or InvertedUnit`;\r\n return;\r\n case ECEditingStatus.InvalidEnumeratorType:\r\n this.message = `The Enumeration ${this._enumeratorId.enumeration.fullName} has type ${this._enumeratorId.enumerationType}, while Enumerator ${this._enumeratorId.name} has type ${this._enumeratorId.enumeratorType}.`;\r\n return;\r\n case ECEditingStatus.EnumeratorDoesNotExist:\r\n this.message = `Enumerator ${this._enumeratorId.name} does not exists in Enumeration ${this._enumeratorId.enumeration.name}.`;\r\n return;\r\n case ECEditingStatus.InvalidECName:\r\n this.message = `Could not rename class ${this._schemaItemId.name} because the specified name is not a valid ECName.`;\r\n return;\r\n case ECEditingStatus.InvalidSchemaAlias:\r\n this.message = `Could not set the alias for schema ${this._schemaKey.name} because the specified alias is not a valid ECName.`;\r\n return;\r\n default:\r\n this.message = this._createTaskErrorMessage();\r\n }\r\n }\r\n\r\n private _appendMessage(e: string) {\r\n return this.message ? `${e}: ${this.message}` : e;\r\n }\r\n\r\n private _getRuleViolationMessage(): string {\r\n if (!this._ruleViolations)\r\n return \"\";\r\n\r\n let violations = \"\";\r\n for (const diagnostic of this._ruleViolations) {\r\n violations += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\r\n }\r\n\r\n switch (this.identifier.typeIdentifier) {\r\n case SchemaTypeIdentifiers.SchemaIdentifier:\r\n return `Rule violations occurred from Schema ${this._schemaId.name}: ${violations}`;\r\n case SchemaTypeIdentifiers.SchemaItemIdentifier:\r\n return `Rule violations occurred from ${this._schemaItemId.schemaItemType} ${this._schemaItemId.name}: ${violations}`;\r\n case SchemaTypeIdentifiers.ClassIdentifier:\r\n return `Rule violations occurred from ${this._schemaItemId.schemaItemType} ${this._schemaItemId.name}: ${violations}`;\r\n case SchemaTypeIdentifiers.CustomAttributeIdentifier:\r\n return `Rule violations occurred from CustomAttribute ${this._customAttributeId.name}, container ${this._customAttributeId.containerFullName}: ${violations}`;\r\n case SchemaTypeIdentifiers.RelationshipConstraintIdentifier:\r\n return `Rule violations occurred from ${this._relationshipConstraintId.name} constraint of RelationshipClass ${this._relationshipConstraintId.relationshipKey.fullName}: ${violations}`;\r\n default:\r\n throw new Error (\"Invalid identifier.\");\r\n }\r\n }\r\n\r\n private _createTaskErrorMessage() {\r\n // Make sure we have an inner error or else it is not a task error\r\n if (!this.innerError)\r\n return \"\";\r\n\r\n switch (this.identifier.typeIdentifier) {\r\n case SchemaTypeIdentifiers.SchemaIdentifier:\r\n case SchemaTypeIdentifiers.SchemaItemIdentifier:\r\n case SchemaTypeIdentifiers.ClassIdentifier:\r\n case SchemaTypeIdentifiers.RelationshipConstraintIdentifier:\r\n return `While performing task '${ECEditingStatus[this.errorNumber]}' an error occurred editing ${this.identifier.typeIdentifier} ${this.identifier.name}.`;\r\n case SchemaTypeIdentifiers.PropertyIdentifier:\r\n return `While performing task '${ECEditingStatus[this.errorNumber]}' an error occurred editing ${this.identifier.typeIdentifier} ${this.identifier.fullName}.`;\r\n default:\r\n throw new Error (\"Invalid identifier.\");\r\n }\r\n }\r\n\r\n private isSchemaItemIdentifier(identifier: AnyIdentifier) {\r\n if (identifier.typeIdentifier !== SchemaTypeIdentifiers.SchemaItemIdentifier &&\r\n identifier.typeIdentifier !== SchemaTypeIdentifiers.ClassIdentifier)\r\n return true;\r\n\r\n return false;\r\n }\r\n}\r\n\r\nfunction getEnumeratorType(enumeration: Enumeration, enumerator: AnyEnumerator | string) {\r\n if (typeof(enumerator) === \"string\") {\r\n return enumeration.type ? primitiveTypeToString(enumeration.type) : \"string\";\r\n }\r\n\r\n return typeof(enumerator.value) === \"string\" ? \"string\" : \"int\";\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Exception.js","sourceRoot":"","sources":["../../../src/Editing/Exception.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAA6D,aAAa,EAAE,qBAAqB,EAAE,QAAQ,EAA0B,aAAa,EAA6B,MAAM,0BAA0B,CAAC;AAEvN,aAAa;AACb,MAAM,CAAN,IAAY,eAmFX;AAnFD,WAAY,eAAe;IACzB,4FAA+B,CAAA;IAC/B,2DAAW,CAAA;IACX,4EAAyC,CAAA;IACzC,8EAAc,CAAA;IACd,sFAAkB,CAAA;IAClB,wGAA2B,CAAA;IAC3B,4FAAqB,CAAA;IACrB,kFAAgB,CAAA;IAChB,wFAAmB,CAAA;IACnB,4FAAqB,CAAA;IACrB,oHAAiC,CAAA;IACjC,kHAAgC,CAAA;IAChC,sGAA0B,CAAA;IAC1B,4FAAqB,CAAA;IACrB,wGAA2B,CAAA;IAC3B,4FAAqB,CAAA;IACrB,kFAAgB,CAAA;IAChB,8FAAsB,CAAA;IACtB,4EAAa,CAAA;IACb,sFAAkB,CAAA;IAClB,wGAA2B,CAAA;IAC3B,kGAAwB,CAAA;IACxB,eAAe;IACf,8FAAsB,CAAA;IACtB,oGAAyB,CAAA;IACzB,4EAAa,CAAA;IACb,oGAAyB,CAAA;IACzB,kGAAwB,CAAA;IACxB,0EAAY,CAAA;IACZ,wFAAmB,CAAA;IACnB,wFAAmB,CAAA;IACnB,sFAAkB,CAAA;IAClB,4FAAqB,CAAA;IACrB,4FAAqB,CAAA;IACrB,8GAA8B,CAAA;IAC9B,0GAA4B,CAAA;IAC5B,oGAAyB,CAAA;IACzB,kGAAwB,CAAA;IACxB,oHAAiC,CAAA;IACjC,8EAAc,CAAA;IACd,4EAAa,CAAA;IACb,8EAAc,CAAA;IACd,kEAAQ,CAAA;IACR,4EAAa,CAAA;IACb,wEAAW,CAAA;IAC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cAAc,KAAK,qBAAqB,CAAC,eAAe;YACnE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,SAAS,iBAAiB,CAAC,WAAwB,EAAE,UAAkC;IACrF,IAAI,OAAM,CAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,qBAAqB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC/E,CAAC;IAED,OAAO,OAAM,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;AAClE,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Editing\n */\n\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { AnyEnumerator, CustomAttributeContainerProps, Enumeration, PrimitiveType, primitiveTypeToString, Property, RelationshipConstraint, SchemaItemKey, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\n\n/** @alpha */\nexport enum ECEditingStatus {\n EC_EDITING_ERROR_BASE = 0x30000,\n Unknown = 0,\n RuleViolation = EC_EDITING_ERROR_BASE + 1,\n SchemaNotFound,\n SchemaItemNotFound,\n SchemaItemNotFoundInContext,\n PropertyAlreadyExists,\n PropertyNotFound,\n InvalidPropertyType,\n BaseClassIsNotElement,\n BaseClassIsNotElementUniqueAspect,\n BaseClassIsNotElementMultiAspect,\n SchemaItemNameNotSpecified,\n InvalidSchemaItemType,\n SchemaItemNameAlreadyExists,\n InvalidEnumeratorType,\n InvalidBaseClass,\n EnumeratorDoesNotExist,\n InvalidECName,\n InvalidSchemaAlias,\n InvalidFormatUnitsSpecified,\n SchemaAliasAlreadyExists,\n // Outer Errors\n CreateSchemaItemFailed,\n CreateSchemaItemFromProps,\n CreateElement,\n CreateElementUniqueAspect,\n CreateElementMultiAspect,\n SetBaseClass,\n SetSourceConstraint,\n SetTargetConstraint,\n AddConstraintClass,\n RemoveConstraintClass,\n SetAbstractConstraint,\n AddCustomAttributeToConstraint,\n AddCustomAttributeToProperty,\n AddCustomAttributeToClass,\n CreateNavigationProperty,\n CreateNavigationPropertyFromProps,\n SetInvertsUnit,\n SetUnitSystem,\n SetDescription,\n SetLabel,\n SetIsReadOnly,\n SetPriority,\n SetCategory,\n SetKindOfQuantity,\n SetMinOccurs,\n SetMaxOccurs,\n SetExtendedTypeName,\n SetMinLength,\n SetMaxLength,\n SetMinValue,\n SetMaxValue,\n SetPropertyName,\n AddMixin,\n AddEnumerator,\n SetEnumeratorLabel,\n SetEnumeratorDescription,\n AddPresentationUnit,\n AddPresentationOverride,\n CreateFormatOverride,\n SetPropertyCategoryPriority,\n CreatePrimitiveProperty,\n CreatePrimitivePropertyFromProps,\n CreateEnumerationProperty,\n CreateEnumerationPropertyFromProps,\n CreatePrimitiveArrayProperty,\n CreatePrimitiveArrayPropertyFromProps,\n CreateEnumerationArrayProperty,\n CreateEnumerationArrayPropertyFromProps,\n CreateStructProperty,\n CreateStructPropertyFromProps,\n CreateStructArrayProperty,\n CreateStructArrayPropertyFromProps,\n DeleteProperty,\n DeleteClass,\n SetClassName,\n AddSchemaReference,\n SetSchemaVersion,\n IncrementSchemaMinorVersion,\n SetSchemaAlias\n}\n\n/**\n * A type that constrains the possible error types handled by SchemaEditingError\n * @alpha\n */\nexport type AnyEditingError = SchemaEditingError | Error;\n\n/**\n * Defines the possible property type names.\n * @alpha\n */\nexport enum PropertyTypeName {\n ArrayProperty = \"ArrayProperty\",\n PrimitiveProperty = \"PrimitiveProperty\",\n EnumerationProperty = \"EnumerationProperty\",\n NavigationProperty = \"NavigationProperty\",\n StructProperty = \"StructProperty\"\n}\n\n/**\n * Defines the possible schema type identifiers.\n * @alpha\n */\nexport enum SchemaTypeIdentifiers {\n SchemaIdentifier = \"Schema\",\n SchemaItemIdentifier = \"SchemaItem\",\n ClassIdentifier = \"Class\",\n PropertyIdentifier = \"Property\",\n EnumeratorIdentifier = \"Enumerator\",\n CustomAttributeIdentifier = \"CustomAttribute\",\n RelationshipConstraintIdentifier = \"RelationshipConstraint\"\n}\n\n/**\n * Type that constrains SchemaItemType enum to those used by EC Class types.\n * @alpha\n */\nexport type ECClassSchemaItems = SchemaItemType.EntityClass | SchemaItemType.StructClass | SchemaItemType.RelationshipClass | SchemaItemType.Mixin | SchemaItemType.CustomAttributeClass;\n\n/**\n * Type that defines the possible SchemaTypeIdentifiers for SchemaItemId classes.\n * @alpha\n */\nexport type AnySchemaItemTypeIdentifier = SchemaTypeIdentifiers.SchemaItemIdentifier | SchemaTypeIdentifiers.ClassIdentifier;\n\n/**\n * Type that encompasses all ISchemaTypeIdentifier interfaces\n * @alpha\n */\nexport type AnyIdentifier = ISchemaIdentifier | ISchemaItemIdentifier | IClassIdentifier | IPropertyIdentifier | ICustomAttributeIdentifier | IRelationshipConstraintIdentifier | IEnumeratorIdentifier;\n\n/**\n * A base interface that defines what is needed to identity any schema type.\n * @alpha\n */\nexport interface ISchemaTypeIdentifier {\n readonly name: string;\n readonly schemaKey: SchemaKey;\n readonly typeIdentifier: SchemaTypeIdentifiers;\n}\n\n/**\n * Interface that defines the data needed to identify a Schema.\n * @alpha\n */\nexport interface ISchemaIdentifier extends ISchemaTypeIdentifier {\n readonly typeIdentifier: SchemaTypeIdentifiers.SchemaIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify a SchemaItem.\n * @alpha\n */\nexport interface ISchemaItemIdentifier extends ISchemaTypeIdentifier {\n readonly schemaItemType: SchemaItemType;\n readonly schemaItemKey: SchemaItemKey;\n readonly typeIdentifier: AnySchemaItemTypeIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify an EC Class.\n * @alpha\n */\nexport interface IClassIdentifier extends ISchemaTypeIdentifier {\n readonly schemaItemType: ECClassSchemaItems;\n readonly schemaItemKey: SchemaItemKey;\n readonly typeIdentifier: SchemaTypeIdentifiers.ClassIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify an EC Property.\n * @alpha\n */\nexport interface IPropertyIdentifier extends ISchemaTypeIdentifier {\n readonly fullName: string;\n readonly ecClass: ClassId;\n readonly typeName?: PropertyTypeName;\n readonly typeIdentifier: SchemaTypeIdentifiers.PropertyIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify an Enumerator.\n * @alpha\n */\ninterface IEnumeratorIdentifier extends ISchemaTypeIdentifier {\n readonly enumeratorType: string;\n readonly enumeration: SchemaItemKey;\n readonly enumerationType: string;\n readonly typeIdentifier: SchemaTypeIdentifiers.EnumeratorIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify a CustomAttribute.\n * @alpha\n */\nexport interface ICustomAttributeIdentifier extends ISchemaTypeIdentifier {\n readonly containerFullName: string;\n readonly typeIdentifier: SchemaTypeIdentifiers.CustomAttributeIdentifier;\n}\n\n/**\n * Interface that defines the data needed to identify a RelationshipConstraint.\n * @alpha\n */\nexport interface IRelationshipConstraintIdentifier extends ISchemaTypeIdentifier {\n readonly relationshipKey: SchemaItemKey;\n readonly typeIdentifier: SchemaTypeIdentifiers.RelationshipConstraintIdentifier;\n}\n\n/**\n * An ISchemaIdentifier implementation to identify Schemas\n * @alpha\n */\nexport class SchemaId implements ISchemaIdentifier {\n public readonly typeIdentifier = SchemaTypeIdentifiers.SchemaIdentifier;\n public readonly name: string;\n public readonly schemaKey: SchemaKey;\n constructor(schemaKey: SchemaKey) {\n this.name = schemaKey.name;\n this.schemaKey = schemaKey;\n }\n}\n\n/**\n * An ISchemItemIdentifier implementation to identify SchemaItems\n * @alpha\n */\nexport class SchemaItemId implements ISchemaItemIdentifier {\n public readonly typeIdentifier: AnySchemaItemTypeIdentifier;\n public readonly name: string;\n public readonly schemaKey: SchemaKey;\n public readonly schemaItemType: SchemaItemType;\n public readonly schemaItemKey: SchemaItemKey;\n\n constructor(schemaItemType: SchemaItemType, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey) {\n if (typeof(schemaItemKeyOrName) === \"string\") {\n if (!schemaKey)\n throw new Error(\"schemaKey if required if the specified schemaItem the name of the schema item.\");\n\n this.schemaKey = schemaKey!;\n this.schemaItemKey = new SchemaItemKey(schemaItemKeyOrName, schemaKey);\n } else {\n this.schemaKey = schemaItemKeyOrName.schemaKey;\n this.schemaItemKey = schemaItemKeyOrName;\n }\n\n this.schemaItemType = schemaItemType;\n this.name = this.schemaItemKey.fullName;\n this.typeIdentifier = SchemaTypeIdentifiers.SchemaItemIdentifier;\n }\n}\n\n/**\n * An IClassIdentifier implementation to identify Class instances.\n * @alpha\n */\nexport class ClassId extends SchemaItemId implements IClassIdentifier {\n public override readonly typeIdentifier = SchemaTypeIdentifiers.ClassIdentifier;\n public override readonly schemaItemType: ECClassSchemaItems;\n constructor(schemaItemType: ECClassSchemaItems, schemaItemKeyOrName: SchemaItemKey | string, schemaKey?: SchemaKey) {\n super(schemaItemType, schemaItemKeyOrName, schemaKey);\n this.schemaItemType = schemaItemType;\n }\n}\n\n/**\n * An IPropertyIdentifier implementation to identify Property instances.\n * @alpha\n */\nexport class PropertyId implements IPropertyIdentifier {\n public readonly typeIdentifier = SchemaTypeIdentifiers.PropertyIdentifier;\n public readonly name: string;\n public readonly fullName: string;\n public readonly ecClass: ClassId;\n public readonly schemaKey: SchemaKey;\n public readonly typeName?: PropertyTypeName;\n\n constructor(schemaItemType: ECClassSchemaItems, classKey: SchemaItemKey, property: Property | string, typeName?: PropertyTypeName) {\n this.name = property instanceof Property ? property.name : property;\n this.fullName = property instanceof Property ? property.fullName : `${classKey.name}.${property}`;\n this.ecClass = new ClassId(schemaItemType, classKey);\n this.schemaKey = classKey.schemaKey;\n this.typeName = typeName;\n }\n}\n\n/**\n * An IEnumeratorIdentifier implementation to identify Enumerator instances.\n * @alpha\n */\nexport class EnumeratorId implements IEnumeratorIdentifier{\n public readonly typeIdentifier = SchemaTypeIdentifiers.EnumeratorIdentifier;\n public readonly enumeration: SchemaItemKey;\n public readonly enumerationType: string;\n public readonly enumeratorType: string;\n public readonly name: string;\n public readonly schemaKey: SchemaKey;\n\n constructor(enumerator: AnyEnumerator | string, enumeration: Enumeration) {\n this.enumeration = enumeration.key;\n this.enumerationType = enumeration.type ? primitiveTypeToString(enumeration.type): \"string\";\n this.enumeratorType = getEnumeratorType(enumeration ?? PrimitiveType.String, enumerator);\n this.name = typeof(enumerator) === \"string\" ? enumerator : enumerator.name;\n this.schemaKey = enumeration.schema.schemaKey;\n }\n}\n\n/**\n * An ICustomAttributeIdentifier implementation to identify CustomAttribute instances.\n * @alpha\n */\nexport class CustomAttributeId implements ICustomAttributeIdentifier {\n public readonly typeIdentifier = SchemaTypeIdentifiers.CustomAttributeIdentifier;\n public readonly name: string;\n public readonly schemaKey: SchemaKey;\n public readonly containerFullName: string;\n constructor(name: string, container: CustomAttributeContainerProps) {\n this.name = name;\n this.schemaKey = container.schema.schemaKey;\n this.containerFullName = container.fullName;\n }\n}\n\n/**\n * An IRelationshipConstraintIdentifier implementation to identify RelationshipConstraints.\n * @alpha\n */\nexport class RelationshipConstraintId implements IRelationshipConstraintIdentifier {\n public readonly typeIdentifier = SchemaTypeIdentifiers.RelationshipConstraintIdentifier;\n public readonly name: string;\n public readonly relationshipKey: SchemaItemKey;\n public readonly schemaKey: SchemaKey;\n constructor(constraint: RelationshipConstraint) {\n this.name = constraint.isSource ? \"Source\" : \"Target\";\n this.relationshipKey = constraint.relationshipClass.key;\n this.schemaKey = this.relationshipKey.schemaKey;\n }\n}\n\n/**\n * An exception class for the ecschema-editing API. Contains identifiers for schema types involved in the\n * exception. An example being SchemaItemId which contains the name of the SchemaItem, SchemaItemKey, SchemaItemType, etc.\n * Typically will contain an innerError of type SchemaEditingError containing the identifier of the schema item that\n * caused the exception. The containing error instance will identify the method called (identified by the errorNumber)\n * and the identifier of the schema item being modified/created.\n * @alpha\n */\nexport class SchemaEditingError extends Error {\n private _ruleViolations?: AnyDiagnostic[];\n private _schemaKey: SchemaKey;\n\n /**\n * Constructs a new SchemaEditingError instance.\n * @param errorNumber The unique ECEditingStatus code identifying the error.\n * @param identifier The identifier instance containing information about the EC object involved with the exception.\n * @param innerError The SchemaEditingError containing the identifier of the EC object that caused the initial exception.\n * @param ruleViolations Will contain EC rule violations of type [[AnyDiagnostic]] for exceptions with the error code ECEditingStatus.RuleViolation.\n * @param message Optional error message. Most messages on automatically generated by this class based on the ECEditingStatus code.\n */\n public constructor(public readonly errorNumber: ECEditingStatus, public readonly identifier: AnyIdentifier, public readonly innerError?: AnyEditingError, ruleViolations?: AnyDiagnostic[], message?: string) {\n super(message);\n this._ruleViolations = ruleViolations;\n this._schemaKey = identifier.schemaKey,\n this.generateMessage();\n }\n\n /**\n * Gets the SchemaId instance.\n * @throws Error if the identifier is not an instance of SchemaId.\n */\n private get _schemaId(): SchemaId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.SchemaIdentifier)\n throw new Error(\"identifier is not a SchemaId.\");\n return this.identifier as SchemaId;\n }\n\n /**\n * Gets the SchemaItemId instance.\n * @throws Error if the identifier is not an instance of SchemaItemId.\n */\n private get _schemaItemId(): SchemaItemId {\n if (this.isSchemaItemIdentifier(this.identifier))\n throw new Error(\"identifier is not a SchemaItemId.\");\n return this.identifier as SchemaItemId;\n }\n\n /**\n * Gets the ClassId instance.\n * @throws Error if the identifier is not an instance of ClassId.\n */\n private get _classId(): ClassId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.ClassIdentifier)\n throw new Error(\"identifier is not a ClassId.\");\n return this.identifier as ClassId;\n }\n\n /**\n * Gets the PropertyId instance.\n * @throws Error if the identifier is not an instance of PropertyId.\n */\n private get _propertyId(): PropertyId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.PropertyIdentifier)\n throw new Error(\"identifier is not a PropertyId.\");\n return this.identifier;\n }\n\n /**\n * Gets the EnumeratorId instance.\n * @throws Error if the identifier is not an instance of EnumeratorId.\n */\n private get _enumeratorId(): EnumeratorId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.EnumeratorIdentifier)\n throw new Error(\"identifier is not a EnumerationId.\");\n return this.identifier as EnumeratorId;\n }\n\n /**\n * Gets the CustomAttributeId instance.\n * @throws Error if the identifier is not an instance of CustomAttributeId.\n */\n private get _customAttributeId(): CustomAttributeId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.CustomAttributeIdentifier)\n throw new Error(\"identifier is not a CustomAttributeId.\");\n return this.identifier;\n }\n\n /**\n * Gets the RelationshipConstraintId instance.\n * @throws Error if the identifier is not an instance of RelationshipConstraintId.\n */\n private get _relationshipConstraintId(): RelationshipConstraintId {\n if (this.identifier.typeIdentifier !== SchemaTypeIdentifiers.RelationshipConstraintIdentifier)\n throw new Error(\"identifier is not a RelationshipConstraintId.\");\n return this.identifier;\n }\n\n /** Gets rule violations that were reported during validation. Returns an array of [[AnyDiagnostic]] if\n * the errorNumber is ECEditingStatus.RuleViolation, otherwise undefined.\n */\n public get ruleViolations(): AnyDiagnostic[] | undefined {\n return this._ruleViolations;\n }\n\n /**\n * Returns a readable string containing the ECEditingStatus along with the error message. Any\n * innerError will also be appended.\n * @returns\n */\n public toDebugString(): string {\n let innerMessage = \"\";\n if (this.innerError) {\n if (this.innerError instanceof SchemaEditingError)\n innerMessage = ` Inner error: ${this.innerError.toDebugString()}`;\n else\n innerMessage = ` Inner error: ${this.innerError.message}`;\n }\n return this._appendMessage(`ECEditingStatus.${ECEditingStatus[this.errorNumber]}`) + innerMessage;\n }\n\n private generateMessage() {\n if (this.message)\n return;\n\n switch(this.errorNumber) {\n case ECEditingStatus.SchemaNotFound:\n this.message = `Schema Key ${this._schemaKey.toString(true)} could not be found in the context.`;\n return;\n case ECEditingStatus.SchemaItemNotFound:\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} could not be found in the schema ${this._schemaKey.name}.`;\n return;\n case ECEditingStatus.SchemaItemNotFoundInContext:\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} could not be found in the schema context.`;\n return;\n case ECEditingStatus.InvalidSchemaItemType:\n this.message = `Expected ${this._schemaItemId.name} to be of type ${this._schemaItemId.schemaItemType}.`;\n return;\n case ECEditingStatus.SchemaItemNameNotSpecified:\n this.message = `Could not create a new ${this._schemaItemId.schemaItemType} in schema ${this._schemaKey.name}. No name was supplied within props.`;\n return;\n case ECEditingStatus.SchemaItemNameAlreadyExists:\n this.message = `${this._schemaItemId.schemaItemType} ${this._schemaItemId.name} already exists in the schema ${this._schemaKey.name}.`;\n return;\n case ECEditingStatus.RuleViolation:\n this.message = this._getRuleViolationMessage();\n return;\n case ECEditingStatus.PropertyNotFound:\n this.message = `An ECProperty with the name ${this._propertyId.name} could not be found in the class ${this._propertyId.ecClass.name}.`;\n return;\n case ECEditingStatus.PropertyAlreadyExists:\n this.message = `An ECProperty with the name ${this._propertyId.name} already exists in the class ${this._propertyId.ecClass.name}.`;\n return;\n case ECEditingStatus.InvalidPropertyType:\n this.message = `Expected property ${this._propertyId.name} to be of type ${this._propertyId.typeName}.`;\n return;\n case ECEditingStatus.BaseClassIsNotElement:\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.Element.`;\n return;\n case ECEditingStatus.BaseClassIsNotElementUniqueAspect:\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.ElementUniqueAspect.`;\n return;\n case ECEditingStatus.BaseClassIsNotElementMultiAspect:\n this.message = `Expected base class ${this._schemaItemId.name} to derive from BisCore.ElementMultiAspect.`;\n return;\n case ECEditingStatus.InvalidFormatUnitsSpecified:\n this.message = `The specified Format unit ${this._schemaItemId.name} is not of type Unit or InvertedUnit`;\n return;\n case ECEditingStatus.InvalidEnumeratorType:\n this.message = `The Enumeration ${this._enumeratorId.enumeration.fullName} has type ${this._enumeratorId.enumerationType}, while Enumerator ${this._enumeratorId.name} has type ${this._enumeratorId.enumeratorType}.`;\n return;\n case ECEditingStatus.EnumeratorDoesNotExist:\n this.message = `Enumerator ${this._enumeratorId.name} does not exists in Enumeration ${this._enumeratorId.enumeration.name}.`;\n return;\n case ECEditingStatus.InvalidECName:\n this.message = `Could not rename class ${this._schemaItemId.name} because the specified name is not a valid ECName.`;\n return;\n case ECEditingStatus.InvalidSchemaAlias:\n this.message = `Could not set the alias for schema ${this._schemaKey.name} because the specified alias is not a valid ECName.`;\n return;\n default:\n this.message = this._createTaskErrorMessage();\n }\n }\n\n private _appendMessage(e: string) {\n return this.message ? `${e}: ${this.message}` : e;\n }\n\n private _getRuleViolationMessage(): string {\n if (!this._ruleViolations)\n return \"\";\n\n let violations = \"\";\n for (const diagnostic of this._ruleViolations) {\n violations += `${diagnostic.code}: ${diagnostic.messageText}\\r\\n`;\n }\n\n switch (this.identifier.typeIdentifier) {\n case SchemaTypeIdentifiers.SchemaIdentifier:\n return `Rule violations occurred from Schema ${this._schemaId.name}: ${violations}`;\n case SchemaTypeIdentifiers.SchemaItemIdentifier:\n return `Rule violations occurred from ${this._schemaItemId.schemaItemType} ${this._schemaItemId.name}: ${violations}`;\n case SchemaTypeIdentifiers.ClassIdentifier:\n return `Rule violations occurred from ${this._schemaItemId.schemaItemType} ${this._schemaItemId.name}: ${violations}`;\n case SchemaTypeIdentifiers.CustomAttributeIdentifier:\n return `Rule violations occurred from CustomAttribute ${this._customAttributeId.name}, container ${this._customAttributeId.containerFullName}: ${violations}`;\n case SchemaTypeIdentifiers.RelationshipConstraintIdentifier:\n return `Rule violations occurred from ${this._relationshipConstraintId.name} constraint of RelationshipClass ${this._relationshipConstraintId.relationshipKey.fullName}: ${violations}`;\n default:\n throw new Error (\"Invalid identifier.\");\n }\n }\n\n private _createTaskErrorMessage() {\n // Make sure we have an inner error or else it is not a task error\n if (!this.innerError)\n return \"\";\n\n switch (this.identifier.typeIdentifier) {\n case SchemaTypeIdentifiers.SchemaIdentifier:\n case SchemaTypeIdentifiers.SchemaItemIdentifier:\n case SchemaTypeIdentifiers.ClassIdentifier:\n case SchemaTypeIdentifiers.RelationshipConstraintIdentifier:\n return `While performing task '${ECEditingStatus[this.errorNumber]}' an error occurred editing ${this.identifier.typeIdentifier} ${this.identifier.name}.`;\n case SchemaTypeIdentifiers.PropertyIdentifier:\n return `While performing task '${ECEditingStatus[this.errorNumber]}' an error occurred editing ${this.identifier.typeIdentifier} ${this.identifier.fullName}.`;\n default:\n throw new Error (\"Invalid identifier.\");\n }\n }\n\n private isSchemaItemIdentifier(identifier: AnyIdentifier) {\n if (identifier.typeIdentifier !== SchemaTypeIdentifiers.SchemaItemIdentifier &&\n identifier.typeIdentifier !== SchemaTypeIdentifiers.ClassIdentifier)\n return true;\n\n return false;\n }\n}\n\nfunction getEnumeratorType(enumeration: Enumeration, enumerator: AnyEnumerator | string) {\n if (typeof(enumerator) === \"string\") {\n return enumeration.type ? primitiveTypeToString(enumeration.type) : \"string\";\n }\n\n return typeof(enumerator.value) === \"string\" ? \"string\" : \"int\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Formats.js","sourceRoot":"","sources":["../../../src/Editing/Formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,YAAY,EAAwC,cAAc,EAAa,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIhK,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,OAAQ,SAAQ,WAAW;IACtC,IAAuB,aAAa;QAClC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAC7C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,S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C;YAED,IAAI,YAAY;gBACd,SAAS,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAE1C,iEAAiE;YACjE,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YACpC,OAAO,SAAS,CAAC,GAAG,CAAC;QACvB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,sBAAsB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAClI,CAAC;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,WAAkC;QACnF,IAAI,CAAC;YACH,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC,CAAC;YAClJ,OAAO,SAAS,CAAC,GAAG,CAAC;QACvB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,yBAAyB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,WAAW,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAClJ,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Formats.js","sourceRoot":"","sources":["../../../src/Editing/Formats.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,EAAE,YAAY,EAAwC,cAAc,EAAa,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAIhK,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,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":["/*---------------------------------------------------------------------------------------------\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 { DelayedPromiseWithProps, Format, InvertedUnit, SchemaItemFormatProps, SchemaItemKey, SchemaItemType, SchemaKey, Unit } from \"@itwin/ecschema-metadata\";\nimport { FormatType } from \"@itwin/core-quantity\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableFormat } from \"./Mutable/MutableFormat\";\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\nimport { SchemaItems } from \"./SchemaItems\";\n\n/**\n * @alpha\n * A class allowing you to create schema items of type Format.\n */\nexport class Formats extends SchemaItems {\n protected override get itemTypeClass(): typeof Format {\n return Format;\n }\n\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.Format, schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, formatType: FormatType, displayLabel?: string, units?: SchemaItemKey[]): Promise<SchemaItemKey> {\n try {\n const newFormat = await this.createSchemaItem<Format>(schemaKey, this.schemaItemType, (schema) => schema.createFormat.bind(schema), name) as MutableFormat;\n\n if (units !== undefined) {\n for (const unit of units) {\n const unitItem = await this.schemaEditor.schemaContext.getSchemaItem(unit);\n if (!unitItem) {\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFoundInContext, new SchemaItemId(SchemaItemType.Unit, unit));\n }\n\n if (Unit.isUnit(unitItem) ) {\n newFormat.addUnit(new DelayedPromiseWithProps(unitItem.key, async () => unitItem));\n } else if (InvertedUnit.isInvertedUnit(unitItem) ) {\n newFormat.addUnit(new DelayedPromiseWithProps(unitItem.key, async () => unitItem));\n } else {\n throw new SchemaEditingError(ECEditingStatus.InvalidFormatUnitsSpecified, new SchemaItemId(unitItem.schemaItemType, unitItem.key));\n }\n }\n }\n\n if (displayLabel)\n newFormat.setDisplayLabel(displayLabel);\n\n // TODO: Handle the setting of format traits, separators, etc....\n newFormat.setFormatType(formatType);\n return newFormat.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n /**\n * Creates a format through a SchemaItemFormatProps.\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, formatProps: SchemaItemFormatProps): Promise<SchemaItemKey> {\n try {\n const newFormat = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createFormat.bind(schema), formatProps);\n return newFormat.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, formatProps.name!, schemaKey), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvertedUnits.js","sourceRoot":"","sources":["../../../src/Editing/InvertedUnits.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,uBAAuB,EAAE,YAAY,EACrC,cAAc,EAAa,IAAI,EAAE,UAAU,GAC5C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C,IAAuB,aAAa;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACnD,CAAC;IACM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,cAA6B,EAAE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AAC,aAAa,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QACzH,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"InvertedUnits.js","sourceRoot":"","sources":["../../../src/Editing/InvertedUnits.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,uBAAuB,EAAE,YAAY,EACrC,cAAc,EAAa,IAAI,EAAE,UAAU,GAC5C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C,IAAuB,aAAa;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;IACnD,CAAC;IACM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,cAA6B,EAAE,aAA4B,EAAE,YAAqB;QACxI,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAe,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAwB,CAAC;YAE3K,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;YACnE,OAAO,CAAC,cAAc,CAAC,IAAI,uBAAuB,CAAsB,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,W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AAM,WAAW,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC;YACpE,YAAY,CAAC,cAAc,CAAC,IAAI,uBAAuB,CAAsB,cAAc,EAAE,KAAK,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;QACzH,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,cAAc,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1H,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,aAAa,CAAC,eAA8B,EAAE,aAA4B;QACrF,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,eAAe,EAAE,mBAAmB,CAAC,CAAC;YACpF,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,UAAU,CAAC,CAAC;YACvE,YAAY,CAAC,aAAa,CAAC,IAAI,uBAAuB,CAA4B,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;QAC5H,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC;QACzH,CAAC;IACH,CAAC;CACF","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, InvertedUnit, InvertedUnitProps, SchemaItemKey,\n SchemaItemType, SchemaKey, Unit, UnitSystem,\n} from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableInvertedUnit } from \"./Mutable/MutableInvertedUnit\";\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\nimport { SchemaItems } from \"./SchemaItems\";\n\n/**\n * @alpha\n * A class allowing you to create schema items of type Inverted Unit.\n */\nexport class InvertedUnits extends SchemaItems {\n protected override get itemTypeClass(): typeof InvertedUnit {\n return InvertedUnit;\n }\n\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.InvertedUnit, schemaEditor);\n }\n public async create(schemaKey: SchemaKey, name: string, invertsUnitKey: SchemaItemKey, unitSystemKey: SchemaItemKey, displayLabel?: string): Promise<SchemaItemKey> {\n try {\n const newUnit = await this.createSchemaItem<InvertedUnit>(schemaKey, this.schemaItemType, (schema) => schema.createInvertedUnit.bind(schema), name) as MutableInvertedUnit;\n\n const invertsUnit = await this.getSchemaItem(invertsUnitKey, Unit);\n newUnit.setInvertsUnit(new DelayedPromiseWithProps<SchemaItemKey, Unit>(invertsUnitKey, async () => invertsUnit));\n\n const unitSystem = await this.getSchemaItem(unitSystemKey, UnitSystem);\n newUnit.setUnitSystem(new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystemKey, async () => unitSystem));\n\n if (displayLabel)\n newUnit.setDisplayLabel(displayLabel);\n\n return newUnit.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n public async createFromProps(schemaKey: SchemaKey, invertedUnitProps: InvertedUnitProps): Promise<SchemaItemKey> {\n try {\n const newUnit = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createInvertedUnit.bind(schema), invertedUnitProps);\n return newUnit.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, invertedUnitProps.name!, schemaKey), e);\n }\n }\n\n public async setInvertsUnit(invertedUnitKey: SchemaItemKey, invertsUnitKey: SchemaItemKey): Promise<void> {\n try {\n const invertedUnit = await this.getSchemaItem(invertedUnitKey, MutableInvertedUnit);\n const invertsUnit = await this.getSchemaItem(invertedUnitKey, Unit);\n invertedUnit.setInvertsUnit(new DelayedPromiseWithProps<SchemaItemKey, Unit>(invertsUnitKey, async () => invertsUnit));\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.SetInvertsUnit, new SchemaItemId(this.schemaItemType, invertedUnitKey), e);\n }\n }\n\n public async setUnitSystem(invertedUnitKey: SchemaItemKey, unitSystemKey: SchemaItemKey): Promise<void> {\n try {\n const invertedUnit = await this.getSchemaItem(invertedUnitKey, MutableInvertedUnit);\n const unitSystem = await this.getSchemaItem(unitSystemKey, UnitSystem);\n invertedUnit.setUnitSystem(new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystemKey, async () => unitSystem));\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.SetUnitSystem, new SchemaItemId(this.schemaItemType, invertedUnitKey), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindOfQuantities.js","sourceRoot":"","sources":["../../../src/Editing/KindOfQuantities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,uBAAuB,EACvB,MAAM,EAAE,YAAY,EAAE,cAAc,EAA+D,cAAc,EAClG,cAAc,EAAa,IAAI,GAC/C,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C;;;GAGG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAC/C,IAAuB,aAAa;QAClC,OAAO,cAAc,CAAC;IACxB,CAAC;IACD,YAAmB,YAAiC;QAClD,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ACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,mBAAmB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACtH,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,6BAA6B,CAAC,MAAqB,EAAE,cAA8B,EAAE,YAAqB,KAAK;QAC1H,IAAI,CAAC;YACH,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;YAC/E,cAAc,CAAC,qBAAqB,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QAClE,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,uBAAuB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1H,CAAC;IACH,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,oBAAoB,CAAC,MAAqB,EAAE,SAAkB,EAAE,kBAAyF;QACpK,IAAI,CAAC;YACH,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC9D,OAAO,IAAI,cAAc,CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;QACzE,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,oBAAoB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACvH,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"KindOfQuantities.js","sourceRoot":"","sources":["../../../src/Editing/KindOfQuantities.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,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CAAC,YAAY,EAAE,SAAS,EAAE,kBAAkB,CAAC,CAAC;QACzE,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,oBAAoB,EAAE,IAAI,YAAY,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QACvH,CAAC;IACH,CAAC;CACF","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,\n Format, InvertedUnit, KindOfQuantity, KindOfQuantityProps, LazyLoadedInvertedUnit, LazyLoadedUnit, OverrideFormat,\n SchemaItemKey, SchemaItemType, SchemaKey, Unit,\n} from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableKindOfQuantity } from \"./Mutable/MutableKindOfQuantity\";\nimport { ECEditingStatus, SchemaEditingError, SchemaItemId } from \"./Exception\";\nimport { SchemaItems } from \"./SchemaItems\";\n\n/**\n * @alpha\n * A class allowing you to create schema items of type KindOfQuantity.\n */\nexport class KindOfQuantities extends SchemaItems {\n protected override get itemTypeClass(): typeof KindOfQuantity {\n return KindOfQuantity;\n }\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.KindOfQuantity, schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, persistenceUnitKey: SchemaItemKey, displayLabel?: string): Promise<SchemaItemKey> {\n try {\n const koqItem = await this.createSchemaItem<KindOfQuantity>(schemaKey, this.schemaItemType, (schema) => schema.createKindOfQuantity.bind(schema), name) as MutableKindOfQuantity;\n const persistenceUnit = await koqItem.schema.lookupItem(persistenceUnitKey);\n if (persistenceUnit === undefined || (!Unit.isUnit(persistenceUnit) && !InvertedUnit.isInvertedUnit(persistenceUnit)))\n throw new SchemaEditingError(ECEditingStatus.SchemaItemNotFound, new SchemaItemId(SchemaItemType.Unit, persistenceUnitKey));\n\n if (Unit.isUnit(persistenceUnit)) {\n koqItem.setPersistenceUnit(new DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit));\n }\n\n if (InvertedUnit.isInvertedUnit(persistenceUnit)) {\n koqItem.setPersistenceUnit(new DelayedPromiseWithProps(persistenceUnit.key, async () => persistenceUnit));\n }\n\n if (displayLabel !== undefined) {\n koqItem.setDisplayLabel(displayLabel);\n }\n\n return koqItem.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new SchemaItemId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n public async createFromProps(schemaKey: SchemaKey, koqProps: KindOfQuantityProps): Promise<SchemaItemKey> {\n try {\n const koqItem = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createKindOfQuantity.bind(schema), koqProps);\n return koqItem.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, koqProps.name!, schemaKey), e);\n }\n }\n\n /**\n *\n * @param koqKey A schemaItemKey of the editing KindOfQuantity.\n * @param format A schemaItemKey of a Format.\n * @param isDefault .is set to false when not explicitly passed.\n */\n public async addPresentationFormat(koqKey: SchemaItemKey, format: SchemaItemKey, isDefault: boolean = false): Promise<void> {\n try {\n const kindOfQuantity = await this.getSchemaItem(koqKey, MutableKindOfQuantity);\n const presentationFormat = await this.getSchemaItem(format, Format);\n kindOfQuantity.addPresentationFormat(new DelayedPromiseWithProps(presentationFormat.key, async () => presentationFormat), isDefault);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.AddPresentationUnit, new SchemaItemId(this.schemaItemType, koqKey), e);\n }\n }\n\n public async addPresentationOverrideFormat(koqKey: SchemaItemKey, overrideFormat: OverrideFormat, isDefault: boolean = false): Promise<void> {\n try {\n const kindOfQuantity = await this.getSchemaItem(koqKey, MutableKindOfQuantity);\n kindOfQuantity.addPresentationFormat(overrideFormat, isDefault);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.AddPresentationOverride, new SchemaItemId(this.schemaItemType, koqKey), e);\n }\n }\n\n /**\n * @param parent A SchemaItemKey of the parent Format.\n * @param unitLabelOverrides The list of Unit (or InvertedUnit) and label overrides. The length of list should be equal to the number of units in the parent Format.\n */\n public async createFormatOverride(parent: SchemaItemKey, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): Promise<OverrideFormat> {\n try {\n const parentFormat = await this.getSchemaItem(parent, Format);\n return new OverrideFormat(parentFormat, precision, unitLabelOverrides);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateFormatOverride, new SchemaItemId(this.schemaItemType, parent), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,uBAAuB,EAAE,WAAW,EAAE,KAAK,EAC5B,cAAc,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE3E;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAuB,aAAa;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACa,oBAAoB,GAAG,IAAI,oBA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,EAAE,eAAwC;QAC9G,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,wBAAwB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YACzI,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,iCAAiC,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9I,CAAC;IACH,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Mixins.js","sourceRoot":"","sources":["../../../src/Editing/Mixins.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EACL,uBAAuB,EAAE,WAAW,EAAE,KAAK,EAC5B,cAAc,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAE3E;;;GAGG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,IAAuB,aAAa;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,YAAmB,YAAiC;QAClD,KAAK,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IAC5C,CAAC;IAED;;OAEG;IACa,oBAAoB,GAAG,IAAI,oBAAoB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AE,eAAwC;QAC9G,IAAI,CAAC;YACH,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;YAC/D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,wBAAwB,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,gBAAgB,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;YACzI,MAAM,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QAC3C,CAAC;QAAC,OAAM,CAAM,EAAE,CAAC;YACf,MAAM,IAAI,kBAAkB,CAAC,eAAe,CAAC,iCAAiC,EAAE,IAAI,OAAO,CAAC,cAAc,CAAC,iBAAiB,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC;QAC9I,CAAC;IACH,CAAC;CACF","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, EntityClass, Mixin, MixinProps, NavigationPropertyProps, RelationshipClass,\n SchemaItemKey, SchemaItemType, SchemaKey, StrengthDirection,\n} from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { ECClasses } from \"./ECClasses\";\nimport { MutableMixin } from \"./Mutable/MutableMixin\";\nimport { MutableEntityClass } from \"./Mutable/MutableEntityClass\";\nimport { NavigationProperties } from \"./Properties\";\nimport { ClassId, ECEditingStatus, SchemaEditingError } from \"./Exception\";\n\n/**\n * @alpha\n * A class extending ECClasses allowing you to create schema items of type Mixin.\n */\nexport class Mixins extends ECClasses {\n protected override get itemTypeClass(): typeof Mixin {\n return Mixin;\n }\n\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.Mixin, schemaEditor);\n }\n\n /**\n * Allows access for editing of NavigationProperty attributes.\n */\n public readonly navigationProperties = new NavigationProperties(SchemaItemType.Mixin, this.schemaEditor);\n\n public async create(schemaKey: SchemaKey, name: string, appliesTo: SchemaItemKey, displayLabel?: string, baseClassKey?: SchemaItemKey): Promise<SchemaItemKey> {\n try {\n const newClass = await this.createClass<Mixin>(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), name, baseClassKey) as MutableMixin;\n const newAppliesTo = await this.getSchemaItem(appliesTo, EntityClass);\n newClass.setAppliesTo(new DelayedPromiseWithProps<SchemaItemKey, EntityClass>(newAppliesTo.key, async () => newAppliesTo));\n\n if (displayLabel)\n newClass.setDisplayLabel(displayLabel);\n\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFailed, new ClassId(this.schemaItemType, name, schemaKey), e);\n }\n }\n\n /**\n * Creates a MixinClass through a MixinProps.\n * @param schemaKey a SchemaKey of the Schema that will house the new object.\n * @param mixinProps a json object that will be used to populate the new MixinClass. Needs a name value passed in.\n */\n public async createFromProps(schemaKey: SchemaKey, mixinProps: MixinProps): Promise<SchemaItemKey> {\n try {\n const newClass = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createMixinClass.bind(schema), mixinProps);\n return newClass.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new ClassId(this.schemaItemType, mixinProps.name!, schemaKey), e);\n }\n }\n\n public async addMixin(entityKey: SchemaItemKey, mixinKey: SchemaItemKey): Promise<void> {\n try {\n const entity = await this.getSchemaItem(entityKey, EntityClass);\n const mixin = await this.getSchemaItem(mixinKey, Mixin);\n (entity as MutableEntityClass).addMixin(mixin);\n } catch(e: any){\n throw new SchemaEditingError(ECEditingStatus.AddMixin, new ClassId(SchemaItemType.EntityClass, entityKey), e);\n }\n }\n\n public async createNavigationProperty(mixinKey: SchemaItemKey, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<void> {\n try {\n const mixin = await this.getSchemaItem(mixinKey, MutableMixin);\n await mixin.createNavigationProperty(name, relationship, direction);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationProperty, new ClassId(SchemaItemType.Mixin, mixinKey), e);\n }\n }\n\n /**\n * Creates a Navigation Property through a NavigationPropertyProps.\n * @param classKey a SchemaItemKey of the Mixin 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<void> {\n try {\n const mixin = await this.getSchemaItem(classKey, MutableMixin);\n const property = await mixin.createNavigationProperty(navigationProps.name, navigationProps.relationshipName, navigationProps.direction);\n await property.fromJSON(navigationProps);\n } catch(e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateNavigationPropertyFromProps, new ClassId(SchemaItemType.RelationshipClass, classKey), e);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableArrayProperty.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableArrayProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAgB,oBAAqB,SAAQ,aAAa;CAG/D","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableArrayProperty.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableArrayProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD;;;GAGG;AACH,MAAM,OAAgB,oBAAqB,SAAQ,aAAa;CAG/D","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*--------------------------------------------------------------------------------------------*/\nimport { ArrayProperty } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableArrayProperty extends ArrayProperty {\n public abstract override setMinOccurs(minOccurs: number): void;\n public abstract override setMaxOccurs(maxOccurs: number): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableCAClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableCAClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AAE9F;;;GAGG;AACH,MAAM,OAAgB,cAAe,SAAQ,oBAAoB;CAGhE","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableCAClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableCAClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,oBAAoB,EAAgC,MAAM,0BAA0B,CAAC;AAE9F;;;GAGG;AACH,MAAM,OAAgB,cAAe,SAAQ,oBAAoB;CAGhE","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*--------------------------------------------------------------------------------------------*/\nimport { CustomAttributeClass, CustomAttributeContainerType } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for Schema editing.\n */\nexport abstract class MutableCAClass extends CustomAttributeClass {\n public abstract override setAppliesTo(containerType: CustomAttributeContainerType): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACY,OAAO,EACyC,WAAW,GAC7E,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAE3D;AAED;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,OAAO;CA+BjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACY,OAAO,EACyC,WAAW,GAC7E,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAE3D;AAED;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,OAAO;CA+BjD","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*--------------------------------------------------------------------------------------------*/\nimport {\n CustomAttribute, ECClass, ECClassModifier, Enumeration, EnumerationArrayProperty, EnumerationProperty, LazyLoadedECClass, PrimitiveArrayProperty,\n PrimitiveProperty, PrimitiveType, Property, StructArrayProperty, StructClass, StructProperty,\n} from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableStructClass extends StructClass {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableClass extends ECClass {\n public abstract override setBaseClass(baseClass: LazyLoadedECClass | undefined): Promise<void>;\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override setModifier(modifier: ECClassModifier): void;\n public abstract override setName(name: string): void;\n public abstract override setDescription(description: string): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override createPrimitiveProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType: Enumeration): Promise<EnumerationProperty>;\n public abstract override createPrimitiveProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitivePropertySync(name: string, primitiveType: PrimitiveType): PrimitiveProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType: Enumeration): EnumerationProperty;\n public abstract override createPrimitivePropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: PrimitiveType): Promise<PrimitiveArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType: Enumeration): Promise<EnumerationArrayProperty>;\n public abstract override createPrimitiveArrayProperty(name: string, primitiveType?: string | PrimitiveType | Enumeration): Promise<Property>;\n\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: PrimitiveType): PrimitiveArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType: Enumeration): EnumerationArrayProperty;\n public abstract override createPrimitiveArrayPropertySync(name: string, primitiveType?: string | PrimitiveType | Enumeration): Property;\n\n public abstract override createStructProperty(name: string, structType: string | StructClass): Promise<StructProperty>;\n public abstract override createStructPropertySync(name: string, structType: string | StructClass): StructProperty;\n\n public abstract override createStructArrayProperty(name: string, structType: string | StructClass): Promise<StructArrayProperty>;\n public abstract override createStructArrayPropertySync(name: string, structType: string | StructClass): StructArrayProperty;\n\n public abstract override deleteProperty(name: string): Promise<void>;\n public abstract override deletePropertySync(name: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAwB,MAAM,0BAA0B,CAAC;AAE1E;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAOrD","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,QAAQ,EAAwB,MAAM,0BAA0B,CAAC;AAE1E;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAOrD","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*--------------------------------------------------------------------------------------------*/\nimport { Constant, LazyLoadedPhenomenon } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableConstant extends Constant {\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\n public abstract override setDefinition(definition: string): void;\n public abstract override setNumerator(numerator: number): void;\n public abstract override setDenominator(denominator: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override setDescription(description: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableEntityClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEntityClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAK3D","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableEntityClass.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEntityClass.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EACL,WAAW,GAEZ,MAAM,0BAA0B,CAAC;AAElC;;;GAGG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAK3D","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*--------------------------------------------------------------------------------------------*/\nimport {\n EntityClass, Mixin, NavigationProperty,\n RelationshipClass, StrengthDirection,\n} from \"@itwin/ecschema-metadata\";\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableEntityClass extends EntityClass {\n public abstract override addMixin(mixin: Mixin): any;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableEnumeration.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAK3D","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableEnumeration.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAiB,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;GAEG;AACH,MAAM,OAAgB,kBAAmB,SAAQ,WAAW;CAK3D","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*--------------------------------------------------------------------------------------------*/\nimport { AnyEnumerator, Enumeration } from \"@itwin/ecschema-metadata\";\n\n/** @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableEnumeration extends Enumeration {\n public abstract override addEnumerator(enumerator: AnyEnumerator): void;\n public abstract override setIsStrict(isStrict: boolean): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override setDescription(description: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableFormat.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAA0C,MAAM,0BAA0B,CAAC;AAG1F;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,MAAM;CAmBjD","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableFormat.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableFormat.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,MAAM,EAA0C,MAAM,0BAA0B,CAAC;AAG1F;;;GAGG;AACH,MAAM,OAAgB,aAAc,SAAQ,MAAM;CAmBjD","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*--------------------------------------------------------------------------------------------*/\nimport { Format, LazyLoadedInvertedUnit, LazyLoadedUnit } from \"@itwin/ecschema-metadata\";\nimport { FormatTraits, FormatType, ScientificType, ShowSignOption } from \"@itwin/core-quantity\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableFormat extends Format {\n public abstract override addUnit(unit: LazyLoadedUnit | LazyLoadedInvertedUnit, label?: string): void;\n public abstract override setPrecision(precision: number): void;\n public abstract override setFormatType(formatType: FormatType): void;\n public abstract override setRoundFactor(roundFactor: number): void;\n public abstract override setShowSignOption(signOption: ShowSignOption): void;\n public abstract override setDecimalSeparator(separator: string): void;\n public abstract override setThousandSeparator(separator: string): void;\n public abstract override setUomSeparator(separator: string): void;\n public abstract override setStationSeparator(separator: string): void;\n public abstract override setMinWidth(minWidth: number): void;\n public abstract override setStationOffsetSize(stationOffsetSize: number): void;\n public abstract override setStationBaseFactor(stationBaseFactor: number): void;\n public abstract override setScientificType(scientificType: ScientificType): void;\n public abstract override setSpacer(spacer: string): void;\n public abstract override setIncludeZero(includeZero: boolean): void;\n public abstract override setFormatTraits(formatTraits: FormatTraits): void;\n public abstract override setUnits(units: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableInvertedUnit.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableInvertedUnit.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,YAAY,EAAwC,MAAM,0BAA0B,CAAC;AAE9F;;;GAGG;AACH,MAAM,OAAgB,mBAAoB,SAAQ,YAAY;CAI7D","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableInvertedUnit.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableInvertedUnit.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,YAAY,EAAwC,MAAM,0BAA0B,CAAC;AAE9F;;;GAGG;AACH,MAAM,OAAgB,mBAAoB,SAAQ,YAAY;CAI7D","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*--------------------------------------------------------------------------------------------*/\nimport { InvertedUnit, LazyLoadedUnit, LazyLoadedUnitSystem } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableInvertedUnit extends InvertedUnit {\n public abstract override setInvertsUnit(invertsUnit: LazyLoadedUnit): void;\n public abstract override setUnitSystem(unitSystem: LazyLoadedUnitSystem): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableKindOfQuantity.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAU,cAAc,EAA4E,MAAM,0BAA0B,CAAC;AAE5I;;;GAGG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,cAAc;CAOjE","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableKindOfQuantity.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAU,cAAc,EAA4E,MAAM,0BAA0B,CAAC;AAE5I;;;GAGG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,cAAc;CAOjE","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*--------------------------------------------------------------------------------------------*/\nimport { Format, KindOfQuantity, LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit, OverrideFormat } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\n public abstract override addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override setDescription(description: string): void;\n public abstract override setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;\n public abstract override setRelativeError(relativeError: number): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableMixin.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableMixin.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAyB,KAAK,EAA4D,MAAM,0BAA0B,CAAC;AAElI;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;CAK/C","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableMixin.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableMixin.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAyB,KAAK,EAA4D,MAAM,0BAA0B,CAAC;AAElI;;;GAGG;AACH,MAAM,OAAgB,YAAa,SAAQ,KAAK;CAK/C","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { LazyLoadedEntityClass, Mixin, NavigationProperty, RelationshipClass, StrengthDirection } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableMixin extends Mixin {\n public abstract override setAppliesTo(entityClass: LazyLoadedEntityClass): void;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MutableNavigationProperty.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableNavigationProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAgB,yBAA0B,SAAQ,kBAAkB;CACzE","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"MutableNavigationProperty.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableNavigationProperty.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D;;;GAGG;AACH,MAAM,OAAgB,yBAA0B,SAAQ,kBAAkB;CACzE","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*--------------------------------------------------------------------------------------------*/\nimport { NavigationProperty } from \"@itwin/ecschema-metadata\";\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableNavigationProperty extends NavigationProperty {\n}\n"]}
|