@itwin/ecschema-editing 4.10.0-dev.9 → 4.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +26 -1
- package/lib/cjs/Differencing/Errors.d.ts +3 -3
- package/lib/cjs/Differencing/Errors.d.ts.map +1 -1
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts +17 -15
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +1 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +3 -2
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +30 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +16 -5
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +3 -2
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -2
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +37 -44
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +2 -0
- package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
- package/lib/cjs/Differencing/Utils.js +21 -22
- 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.d.ts.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.d.ts +1 -2
- package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
- package/lib/cjs/Editing/KindOfQuantities.js +2 -4
- 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.d.ts.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 +2 -2
- 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 +1 -2
- package/lib/cjs/Merging/ClassMerger.js.map +1 -1
- package/lib/cjs/Merging/ConstantMerger.js +2 -3
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeClassMerger.js +2 -3
- package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js +4 -5
- 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.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/SkipEditHandler.js +6 -6
- package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
- package/lib/cjs/Merging/EntityClassMerger.js +3 -4
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +2 -3
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js +2 -3
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +7 -2
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +38 -17
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +2 -3
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +2 -3
- package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyCategoryMerger.js +2 -3
- package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/PropertyMerger.js +9 -29
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js +4 -5
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +6 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +9 -0
- package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingWalker.js +1 -0
- package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
- package/lib/cjs/Merging/SchemaReferenceMerger.js +2 -3
- package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
- package/lib/cjs/Merging/StructClassMerger.js +2 -3
- package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
- package/lib/cjs/Merging/UnitSystemMerger.js +2 -3
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.d.ts +6 -1
- package/lib/cjs/Merging/Utils.d.ts.map +1 -1
- package/lib/cjs/Merging/Utils.js +26 -4
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.d.ts +2 -2
- package/lib/cjs/Validation/Diagnostic.d.ts.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +9 -9
- package/lib/cjs/Validation/Diagnostic.js.map +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js +1 -1
- package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/ECRules.js +19 -19
- package/lib/cjs/Validation/ECRules.js.map +1 -1
- package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.d.ts +2 -2
- package/lib/cjs/Validation/RuleSuppressionSet.d.ts.map +1 -1
- package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
- package/lib/cjs/Validation/Rules.d.ts +1 -1
- package/lib/cjs/Validation/Rules.d.ts.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 +6 -6
- 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.d.ts.map +1 -1
- package/lib/cjs/ecschema-editing.js +0 -1
- package/lib/cjs/ecschema-editing.js.map +1 -1
- package/package.json +13 -13
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Units.js","sourceRoot":"","sources":["../../../src/Editing/Units.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAgK;AAGhK,2CAAgF;AAChF,+CAA4C;AAE5C;;;GAGG;AACH,MAAa,KAAM,SAAQ,yBAAW;IACpC,6CAA6C;IAC7C,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;IAC3C,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,IAAY,EAAE,UAAkB,EAAE,UAAyB,EAAE,UAAyB,EAAE,YAAqB;QACrJ,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAO,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,CAAgB,CAAC;YAEnJ,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAa,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,EAAE,kCAAc,CAAC,UAAU,CAAC,CAAC;YAChI,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,2CAAuB,CAA4B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;YAE5H,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAa,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,EAAE,kCAAc,CAAC,UAAU,CAAC,CAAC;YAChI,MAAM,OAAO,CAAC,aAAa,CAAC,IAAI,2CAAuB,CAA4B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;YAE5H,MAAM,OAAO,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAExC,IAAI,YAAY;gBACd,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;YAExC,OAAO,OAAO,CAAC,GAAG,CAAC;QACrB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,sBAAsB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,IAAI,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAClI,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,eAAe,CAAC,SAAoB,EAAE,SAA8B;QAC/E,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;YAC5I,OAAO,OAAO,CAAC,GAAG,CAAC;QACrB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAChJ,CAAC;IACH,CAAC;CACF;AAnCD,sBAmCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"Units.js","sourceRoot":"","sources":["../../../src/Editing/Units.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,gEAAgK;AAGhK,2CAAgF;AAChF,+CAA4C;AAE5C;;;GAGG;AACH,MAAa,KAAM,SAAQ,yBAAW;IACpC,6CAA6C;IAC7C,YAAmB,YAAiC;QAClD,KAAK,CAAC,kCAAc,CAAC,IAAI,EAAE,YAAY,CAAC,CAA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AC,eAAe,CAAC,SAAoB,EAAE,SAA8B;QAC/E,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC,CAAC;YAC5I,OAAO,OAAO,CAAC,GAAG,CAAC;QACrB,CAAC;QAAC,OAAO,CAAM,EAAE,CAAC;YAChB,MAAM,IAAI,8BAAkB,CAAC,2BAAe,CAAC,yBAAyB,EAAE,IAAI,wBAAY,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,IAAK,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;QAChJ,CAAC;IACH,CAAC;CACF;AAnCD,sBAmCC","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 { DelayedPromiseWithProps, Phenomenon, SchemaItemKey, SchemaItemType, SchemaItemUnitProps, SchemaKey, Unit, UnitSystem } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"./Editor\";\nimport { MutableUnit } from \"./Mutable/MutableUnit\";\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 Unit.\n */\nexport class Units extends SchemaItems {\n // TODO: Add more setters for all attributes.\n public constructor(schemaEditor: SchemaContextEditor) {\n super(SchemaItemType.Unit, schemaEditor);\n }\n\n public async create(schemaKey: SchemaKey, name: string, definition: string, phenomenon: SchemaItemKey, unitSystem: SchemaItemKey, displayLabel?: string): Promise<SchemaItemKey> {\n try {\n const newUnit = await this.createSchemaItem<Unit>(schemaKey, this.schemaItemType, (schema) => schema.createUnit.bind(schema), name) as MutableUnit;\n\n const phenomenonItem = await this.lookupSchemaItem<Phenomenon>(newUnit.schema.schemaKey, phenomenon, SchemaItemType.Phenomenon);\n await newUnit.setPhenomenon(new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(phenomenon, async () => phenomenonItem));\n\n const unitSystemItem = await this.lookupSchemaItem<UnitSystem>(newUnit.schema.schemaKey, unitSystem, SchemaItemType.UnitSystem);\n await newUnit.setUnitSystem(new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystem, async () => unitSystemItem));\n\n await newUnit.setDefinition(definition);\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, unitProps: SchemaItemUnitProps): Promise<SchemaItemKey> {\n try {\n const newUnit = await this.createSchemaItemFromProps(schemaKey, this.schemaItemType, (schema) => schema.createUnit.bind(schema), unitProps);\n return newUnit.key;\n } catch (e: any) {\n throw new SchemaEditingError(ECEditingStatus.CreateSchemaItemFromProps, new SchemaItemId(this.schemaItemType, unitProps.name!, schemaKey), e);\n }\n }\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.modifyClass =
|
|
3
|
+
exports.modifyClass = modifyClass;
|
|
4
4
|
const Utils_1 = require("./Utils");
|
|
5
5
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
6
6
|
const PropertyMerger_1 = require("./PropertyMerger");
|
|
@@ -36,7 +36,6 @@ async function modifyClass(context, change, itemKey, item) {
|
|
|
36
36
|
}
|
|
37
37
|
return (0, PropertyMerger_1.mergeClassProperties)(context, change, itemKey);
|
|
38
38
|
}
|
|
39
|
-
exports.modifyClass = modifyClass;
|
|
40
39
|
async function setBaseClass(context, item, baseClass, isInitial) {
|
|
41
40
|
if (!isInitial && (item.baseClass === undefined))
|
|
42
41
|
throw new Error(`Changing the class '${item.key.name}' baseClass is not supported.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/ClassMerger.ts"],"names":[],"mappings":";;AAgBA,kCA+BC;AAzCD,mCAA8C;AAE9C,gEAAwI;AACxI,qDAAwD;AACxD,mEAAgE;AAEhE;;;GAGG;AACI,KAAK,UAAU,WAAW,CAAC,OAA2B,EAAE,MAA8B,EAAE,OAAsB,EAAE,IAAa;IAClI,MAAM,YAAY,GAAG,IAAoB,CAAC;IAC1C,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC1C,YAAY,CAAC,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;QAChD,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAC7D,CAAC;IAED,IAAI,MAAM,CAAC,UAAU,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,CAAC;QAClD,2FAA2F;QAC3F,8EAA8E;QAC9E,qDAAqD;QACrD,IAAG,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;YAC7C,MAAM,IAAI,KAAK,CAAC,uBAAuB,IAAI,CAAC,GAAG,CAAC,IAAI,+BAA+B,CAAC,CAAC;QACvF,CAAC;QACD,MAAM,YAAY,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,MAAM,CAAC,UAAU,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,CAAC,CAAC;AACJ,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*--------------------------------------------------------------------------------------------*/\nimport { type SchemaMergeContext } from \"./SchemaMerger\";\nimport { AnyClassItemDifference } from \"../Differencing/SchemaDifference\";\nimport { updateSchemaItemKey } from \"./Utils\";\nimport { type MutableClass } from \"../Editing/Mutable/MutableClass\";\nimport { CustomAttribute, ECClass, ECClassModifier, parseClassModifier, SchemaItemKey, SchemaItemType } from \"@itwin/ecschema-metadata\";\nimport { mergeClassProperties } from \"./PropertyMerger\";\nimport { applyCustomAttributes } from \"./CustomAttributeMerger\";\n\n/**\n * Shared modify merger of all ECClass based items.\n * @internal\n */\nexport async function modifyClass(context: SchemaMergeContext, change: AnyClassItemDifference, itemKey: SchemaItemKey, item: ECClass): Promise<void> {\n const mutableClass = item as MutableClass;\n if (change.difference.label !== undefined) {\n mutableClass.setDisplayLabel(change.difference.label);\n }\n\n if (change.difference.description !== undefined) {\n mutableClass.setDescription(change.difference.description);\n }\n\n if (change.difference.hasOwnProperty(\"baseClass\")) {\n // If the entry difference have a property baseClass and it is explicitly set to undefined,\n // it is expected to remove the base class, which is not allowed in this case.\n // TODO: We should consider using null for this case.\n if(change.difference.baseClass === undefined) {\n throw new Error(`Changing the class '${item.key.name}' baseClass is not supported.`);\n }\n await setBaseClass(context, item, change.difference.baseClass, change.changeType === \"add\");\n }\n\n if (change.difference.modifier !== undefined) {\n await setClassModifier(mutableClass, change.difference.modifier);\n }\n\n if (change.difference.customAttributes !== undefined) {\n await applyCustomAttributes(context, change.difference.customAttributes as CustomAttribute[], async (ca) => {\n await context.editor.entities.addCustomAttribute(itemKey, ca);\n });\n }\n\n return mergeClassProperties(context, change, itemKey);\n}\n\nasync function setBaseClass(context: SchemaMergeContext, item: ECClass, baseClass: string, isInitial: boolean): Promise<void> {\n if (!isInitial && (item.baseClass === undefined))\n throw new Error(`Changing the class '${item.key.name}' baseClass is not supported.`);\n\n const baseClassKey = await updateSchemaItemKey(context, baseClass);\n const baseClassSetter = getBaseClassSetter(context, item);\n\n await baseClassSetter(item.key, baseClassKey);\n}\n\nasync function setClassModifier(item: MutableClass, modifierValue: string): Promise<void> {\n const modifier = parseClassModifier(modifierValue);\n if (modifier === undefined) {\n throw new Error(\"An invalid class modifier has been provided.\");\n }\n if (item.modifier === undefined || item.modifier === modifier || modifier === ECClassModifier.None) {\n item.setModifier(modifier);\n return;\n }\n throw new Error(`Changing the class '${item.name}' modifier is not supported.`);\n}\n\nfunction getBaseClassSetter(context: SchemaMergeContext, item: ECClass) {\n return async (itemKey: SchemaItemKey, baseClassKey: SchemaItemKey) => {\n switch (item.schemaItemType) {\n case SchemaItemType.CustomAttributeClass: return context.editor.customAttributes.setBaseClass(itemKey, baseClassKey);\n case SchemaItemType.EntityClass: return context.editor.entities.setBaseClass(itemKey, baseClassKey);\n case SchemaItemType.Mixin: return context.editor.mixins.setBaseClass(itemKey, baseClassKey);\n case SchemaItemType.RelationshipClass: return context.editor.relationships.setBaseClass(itemKey, baseClassKey);\n case SchemaItemType.StructClass: return context.editor.structs.setBaseClass(itemKey, baseClassKey);\n }\n throw new Error(`Changing the base class '${item.name}' is not supported.`);\n };\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addConstant = addConstant;
|
|
4
|
+
exports.modifyConstant = modifyConstant;
|
|
4
5
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
5
6
|
const Utils_1 = require("./Utils");
|
|
6
7
|
/**
|
|
@@ -24,7 +25,6 @@ async function addConstant(context, change) {
|
|
|
24
25
|
definition: change.difference.definition,
|
|
25
26
|
});
|
|
26
27
|
}
|
|
27
|
-
exports.addConstant = addConstant;
|
|
28
28
|
/**
|
|
29
29
|
* Merges differences to an existing Constant in the target schema.
|
|
30
30
|
* @internal
|
|
@@ -65,5 +65,4 @@ async function modifyConstant(context, change, itemKey) {
|
|
|
65
65
|
constant.setPhenomenon(new ecschema_metadata_1.DelayedPromiseWithProps(phenomenon.key, async () => phenomenon));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
exports.modifyConstant = modifyConstant;
|
|
69
68
|
//# sourceMappingURL=ConstantMerger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantMerger.js","sourceRoot":"","sources":["../../../src/Merging/ConstantMerger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConstantMerger.js","sourceRoot":"","sources":["../../../src/Merging/ConstantMerger.ts"],"names":[],"mappings":";;AAcA,kCAkBC;AAMD,wCAqCC;AApED,gEAA+H;AAC/H,mCAAwE;AAExE;;;GAGG;AACI,KAAK,UAAU,WAAW,CAAC,OAA2B,EAAE,MAA0B;IACvF,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,8DAA8D;IAC9D,MAAM,CAAC,UAAU,CAAC,UAAU,GAAG,MAAM,IAAA,gCAAwB,EAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAErG,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;QACtE,GAAG,MAAM,CAAC,UAAU;QACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,UAAU,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU;QACxC,UAA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ACtF,MAAM,IAAI,KAAK,CAAC,oDAAoD,MAAM,CAAC,UAAU,CAAC,WAAW,OAAO,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QAClI,CAAC;QACD,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IACzD,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC9C,IAAI,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,SAAS,KAAK,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC;YAChF,MAAM,IAAI,KAAK,CAAC,kDAAkD,MAAM,CAAC,UAAU,CAAC,SAAS,OAAO,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC;QAC5H,CAAC;QACD,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,MAAM,CAAC,UAAU,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;QACnF,MAAM,UAAU,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,aAAa,CAAa,SAAS,CAAC,CAAC;QAC3F,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,6BAA6B,SAAS,CAAC,QAAQ,yBAAyB,CAAC,CAAC;QAC5F,CAAC;QAED,QAAQ,CAAC,aAAa,CAAC,IAAI,2CAAuB,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9F,CAAC;AACH,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*--------------------------------------------------------------------------------------------*/\nimport type { ConstantDifference } from \"../Differencing/SchemaDifference\";\nimport type{ MutableConstant } from \"../Editing/Mutable/MutableConstant\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport { DelayedPromiseWithProps, ECObjectsError, ECObjectsStatus, Phenomenon, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { updateSchemaItemFullName, updateSchemaItemKey } from \"./Utils\";\n\n/**\n * Merges a new Constant into the target schema.\n * @internal\n */\nexport async function addConstant(context: SchemaMergeContext, change: ConstantDifference) {\n if (change.difference.phenomenon === undefined) {\n throw new Error(\"Constant must define phenomenon\");\n }\n if (change.difference.definition === undefined) {\n throw new Error(\"Constant must define definition\");\n }\n\n // Needs to update the reference from source to target schema.\n change.difference.phenomenon = await updateSchemaItemFullName(context, change.difference.phenomenon);\n\n await context.editor.constants.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n phenomenon: change.difference.phenomenon,\n definition: change.difference.definition,\n });\n}\n\n/**\n * Merges differences to an existing Constant in the target schema.\n * @internal\n */\nexport async function modifyConstant(context: SchemaMergeContext, change: ConstantDifference, itemKey: SchemaItemKey) {\n const constant = await context.targetSchema.lookupItem(itemKey) as MutableConstant;\n if (change.difference.label !== undefined) {\n await context.editor.constants.setDisplayLabel(itemKey, change.difference.label);\n }\n if (change.difference.description !== undefined) {\n await context.editor.constants.setDescription(itemKey, change.difference.description);\n }\n\n // Note: There are no editor methods to modify a constant.\n if (change.difference.definition !== undefined) {\n if (change.difference.definition !== \"\" && constant.definition.toLowerCase() !== change.difference.definition.toLowerCase()) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${itemKey.name} has an invalid 'definition' attribute.`);\n }\n constant.setDefinition(change.difference.definition);\n }\n if (change.difference.denominator !== undefined) {\n if (constant.hasDenominator && constant.denominator !== change.difference.denominator) {\n throw new Error(`Failed to merged, constant denominator conflict: ${change.difference.denominator} -> ${constant.denominator}`);\n }\n constant.setDenominator(change.difference.denominator);\n }\n if (change.difference.numerator !== undefined) {\n if (constant.hasNumerator && constant.numerator !== change.difference.numerator) {\n throw new Error(`Failed to merged, constant numerator conflict: ${change.difference.numerator} -> ${constant.numerator}`);\n }\n constant.setNumerator(change.difference.numerator);\n }\n if (change.difference.phenomenon !== undefined) {\n const lookupKey = await updateSchemaItemKey(context, change.difference.phenomenon);\n const phenomenon = await context.editor.schemaContext.getSchemaItem<Phenomenon>(lookupKey);\n if (phenomenon === undefined) {\n throw new Error(`Could not find phenomenon ${lookupKey.fullName} in the current context`);\n }\n\n constant.setPhenomenon(new DelayedPromiseWithProps(phenomenon.key, async () => phenomenon));\n }\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addCustomAttributeClass = addCustomAttributeClass;
|
|
4
|
+
exports.modifyCustomAttributeClass = modifyCustomAttributeClass;
|
|
4
5
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
5
6
|
const ClassMerger_1 = require("./ClassMerger");
|
|
6
7
|
/**
|
|
@@ -18,7 +19,6 @@ async function addCustomAttributeClass(context, change) {
|
|
|
18
19
|
appliesTo: change.difference.appliesTo,
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
exports.addCustomAttributeClass = addCustomAttributeClass;
|
|
22
22
|
/**
|
|
23
23
|
* Merges differences to an existing CustomAttribute in the target schema.
|
|
24
24
|
* @internal
|
|
@@ -37,5 +37,4 @@ async function modifyCustomAttributeClass(context, change, itemKey) {
|
|
|
37
37
|
}
|
|
38
38
|
return (0, ClassMerger_1.modifyClass)(context, change, itemKey, item);
|
|
39
39
|
}
|
|
40
|
-
exports.modifyCustomAttributeClass = modifyCustomAttributeClass;
|
|
41
40
|
//# sourceMappingURL=CustomAttributeClassMerger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAttributeClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeClassMerger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomAttributeClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeClassMerger.ts"],"names":[],"mappings":";;AAcA,0DAWC;AAMD,gEAaC;AArCD,gEAAmH;AACnH,+CAA4C;AAE5C;;;GAGG;AACI,KAAK,UAAU,uBAAuB,CAAC,OAA2B,EAAE,MAAsC;IAC/G,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,8EAA8E,CAAC,CAAC;IAClG,CAAC;IAED,MAAM,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;QAC7E,GAAG,MAAM,CAAC,UAAU;QACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;QACrB,cAAc,EAAE,MAAM,CAAC,UAAU;QACjC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;KACvC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,0BAA0B,CAAC,OAA2B,EAAE,MAAsC,EAAE,OAAsB;IAC1I,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,OAAO,CAAmB,CAAC;IAC9E,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,YAAY,GAAG,IAAA,yCAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAI,YAAY,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;YACxE,MAAM,aAAa,GAAG,IAAA,qDAAiC,EAAC,GAAG,YAAY,KAAK,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;YAC3G,IAAI,aAAa,KAAK,SAAS,EAAE,CAAC;gBAChC,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;YACxF,CAAC;YACD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IACD,OAAO,IAAA,yBAAW,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACrD,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*--------------------------------------------------------------------------------------------*/\nimport type { CustomAttributeClassDifference } from \"../Differencing/SchemaDifference\";\nimport type { MutableCAClass } from \"../Editing/Mutable/MutableCAClass\";\nimport type { SchemaMergeContext } from \"./SchemaMerger\";\nimport { containerTypeToString, parseCustomAttributeContainerType, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { modifyClass } from \"./ClassMerger\";\n\n/**\n * Merges a new CustomAttribute into the target schema.\n * @internal\n */\nexport async function addCustomAttributeClass(context: SchemaMergeContext, change: CustomAttributeClassDifference) {\n if (change.difference.appliesTo === undefined) {\n throw new Error(\"appliesTo is a required property of a CustomAttributeClass but it is not set\");\n }\n\n await context.editor.customAttributes.createFromProps(context.targetSchemaKey, {\n ...change.difference,\n name: change.itemName,\n schemaItemType: change.schemaType,\n appliesTo: change.difference.appliesTo,\n });\n}\n\n/**\n * Merges differences to an existing CustomAttribute in the target schema.\n * @internal\n */\nexport async function modifyCustomAttributeClass(context: SchemaMergeContext, change: CustomAttributeClassDifference, itemKey: SchemaItemKey) {\n const item = await context.targetSchema.lookupItem(itemKey) as MutableCAClass;\n if (change.difference.appliesTo !== undefined) {\n const currentValue = containerTypeToString(item.appliesTo);\n if (currentValue !== \"\" && change.difference.appliesTo !== currentValue) {\n const containerType = parseCustomAttributeContainerType(`${currentValue}, ${change.difference.appliesTo}`);\n if (containerType === undefined) {\n throw new Error(\"An invalid custom attribute class containerType has been provided.\");\n }\n item.setAppliesTo(containerType);\n }\n }\n return modifyClass(context, change, itemKey, item);\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAttributeMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAA0D,MAAM,0BAA0B,CAAC;AACnH,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAGlF,KAAK,qBAAqB,GAAG,CAAC,eAAe,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjF;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"CustomAttributeMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAA0D,MAAM,0BAA0B,CAAC;AACnH,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAGlF,KAAK,qBAAqB,GAAG,CAAC,eAAe,EAAE,eAAe,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAEjF;;;GAGG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0CtH;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,eAAe,EAAE,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3J;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,eAAe,EAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAGvJ"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addCustomAttribute = addCustomAttribute;
|
|
4
|
+
exports.applyCustomAttributes = applyCustomAttributes;
|
|
5
|
+
exports.applyCustomAttribute = applyCustomAttribute;
|
|
4
6
|
/*---------------------------------------------------------------------------------------------
|
|
5
7
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
8
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -29,12 +31,14 @@ async function addCustomAttribute(context, change) {
|
|
|
29
31
|
}
|
|
30
32
|
if (change.appliedTo === "SchemaItem") {
|
|
31
33
|
const itemKey = new ecschema_metadata_1.SchemaItemKey(change.itemName, context.targetSchemaKey);
|
|
32
|
-
await
|
|
34
|
+
const editor = await (0, Utils_1.getClassEditor)(context, itemKey);
|
|
35
|
+
await editor.addCustomAttribute(itemKey, caInstance);
|
|
33
36
|
}
|
|
34
37
|
if (change.appliedTo === "Property") {
|
|
35
38
|
const itemKey = new ecschema_metadata_1.SchemaItemKey(change.itemName, context.targetSchemaKey);
|
|
36
39
|
const [propertyName] = change.path.split(".");
|
|
37
|
-
await
|
|
40
|
+
const editor = await (0, Utils_1.getClassEditor)(context, itemKey);
|
|
41
|
+
await editor.properties.addCustomAttribute(itemKey, propertyName, caInstance);
|
|
38
42
|
}
|
|
39
43
|
if (change.appliedTo === "RelationshipConstraint") {
|
|
40
44
|
const itemKey = new ecschema_metadata_1.SchemaItemKey(change.itemName, context.targetSchemaKey);
|
|
@@ -48,7 +52,6 @@ async function addCustomAttribute(context, change) {
|
|
|
48
52
|
return context.editor.relationships.addCustomAttributeToConstraint(constraint, caInstance);
|
|
49
53
|
}
|
|
50
54
|
}
|
|
51
|
-
exports.addCustomAttribute = addCustomAttribute;
|
|
52
55
|
/**
|
|
53
56
|
* @internal
|
|
54
57
|
*/
|
|
@@ -57,7 +60,6 @@ async function applyCustomAttributes(context, customAttributes, handler) {
|
|
|
57
60
|
await applyCustomAttribute(context, customAttribute, handler);
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
|
-
exports.applyCustomAttributes = applyCustomAttributes;
|
|
61
63
|
/**
|
|
62
64
|
* @internal
|
|
63
65
|
*/
|
|
@@ -65,5 +67,4 @@ async function applyCustomAttribute(context, customAttribute, handler) {
|
|
|
65
67
|
customAttribute.className = await (0, Utils_1.updateSchemaItemFullName)(context, customAttribute.className);
|
|
66
68
|
return handler(customAttribute);
|
|
67
69
|
}
|
|
68
|
-
exports.applyCustomAttribute = applyCustomAttribute;
|
|
69
70
|
//# sourceMappingURL=CustomAttributeMerger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAttributeMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CustomAttributeMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":";;AAeA,gDA0CC;AAKD,sDAIC;AAKD,oDAGC;AA1ED;;;+FAG+F;AAC/F,gEAAmH;AAGnH,mCAAwF;AAIxF;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CAAC,OAA2B,EAAE,MAAiC;IACrG,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IACD,MAAM,aAAa,GAAG,MAAM,IAAA,2BAAmB,EAAC,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IAEtF,MAAM,0BAA0B,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,SAAS,KAAK,wBAAwB,EAAE,CAAC;QAClD,MAAM,OAAO,GAAG,IAAI,iCAAa,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAoB,OAAO,CAAC,CAAC;QAC5F,IAAI,iBAAiB,KAAK,SAAS,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,2CAA2C,OAAO,CAAC,IAAI,wBAAwB,CAAC,CAAC;QACnG,CAAC;QACD,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,KAAK,SAAS;YAC1C,CAAC,CAAC,iBAAiB,CAAC,MAAM;YAC1B,CAAC,CAAC,iBAAiB,CAAC,MAAM,CAAC;QAE7B,OAAO,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,8BAA8B,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;IAC7F,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,qBAAqB,CAAC,OAA2B,EAAE,gBAAmC,EAAE,OAA8B;IAC1I,KAAK,MAAM,eAAe,IAAI,gBAAgB,EAAE,CAAC;QAC/C,MAAM,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,oBAAoB,CAAC,OAA2B,EAAE,eAAgC,EAAE,OAA8B;IACtI,eAAe,CAAC,SAAS,GAAG,MAAM,IAAA,gCAAwB,EAAC,OAAO,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;IAC/F,OAAO,OAAO,CAAC,eAAe,CAAC,CAAC;AAClC,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*--------------------------------------------------------------------------------------------*/\nimport { CustomAttribute, CustomAttributeClass, RelationshipClass, SchemaItemKey } from \"@itwin/ecschema-metadata\";\nimport { type SchemaMergeContext } from \"./SchemaMerger\";\nimport { type CustomAttributeDifference } from \"../Differencing/SchemaDifference\";\nimport { getClassEditor, updateSchemaItemFullName, updateSchemaItemKey } from \"./Utils\";\n\ntype CustomAttributeSetter = (customAttribute: CustomAttribute) => Promise<void>;\n\n/**\n * Merges a new CustomAttributes from Schema, items or properties into the target schema.\n * @internal\n */\nexport async function addCustomAttribute(context: SchemaMergeContext, change: CustomAttributeDifference): Promise<void> {\n if (change.difference.className === undefined) {\n throw new Error(\"CustomAttribute instance must specify className\");\n }\n const schemaItemKey = await updateSchemaItemKey(context, change.difference.className);\n\n const targetCustomAttributeClass = await context.targetSchema.lookupItem<CustomAttributeClass>(schemaItemKey);\n if (targetCustomAttributeClass === undefined) {\n throw new Error(`Unable to locate the custom attribute class ${schemaItemKey.name} in the merged schema.`);\n }\n\n const caInstance: CustomAttribute = {\n ...change.difference,\n className: schemaItemKey.fullName,\n };\n\n if (change.appliedTo === \"Schema\") {\n await context.editor.addCustomAttribute(context.targetSchemaKey, caInstance);\n }\n if (change.appliedTo === \"SchemaItem\") {\n const itemKey = new SchemaItemKey(change.itemName, context.targetSchemaKey);\n const editor = await getClassEditor(context, itemKey);\n await editor.addCustomAttribute(itemKey, caInstance);\n }\n if (change.appliedTo === \"Property\") {\n const itemKey = new SchemaItemKey(change.itemName, context.targetSchemaKey);\n const [propertyName] = change.path.split(\".\");\n const editor = await getClassEditor(context, itemKey);\n await editor.properties.addCustomAttribute(itemKey, propertyName, caInstance);\n }\n if (change.appliedTo === \"RelationshipConstraint\") {\n const itemKey = new SchemaItemKey(change.itemName, context.targetSchemaKey);\n const relationshipClass = await context.targetSchema.lookupItem<RelationshipClass>(itemKey);\n if (relationshipClass === undefined) {\n throw new Error(`Unable to locate the relationship class ${itemKey.name} in the merged schema.`);\n }\n const constraint = change.path === \"$source\"\n ? relationshipClass.source\n : relationshipClass.target;\n\n return context.editor.relationships.addCustomAttributeToConstraint(constraint, caInstance);\n }\n}\n\n/**\n * @internal\n */\nexport async function applyCustomAttributes(context: SchemaMergeContext, customAttributes: CustomAttribute[], handler: CustomAttributeSetter): Promise<void> {\n for (const customAttribute of customAttributes) {\n await applyCustomAttribute(context, customAttribute, handler);\n }\n}\n\n/**\n * @internal\n */\nexport async function applyCustomAttribute(context: SchemaMergeContext, customAttribute: CustomAttribute, handler: CustomAttributeSetter): Promise<void> {\n customAttribute.className = await updateSchemaItemFullName(context, customAttribute.className);\n return handler(customAttribute);\n}\n"]}
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
* @module Merging
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.applyRenamePropertyEdit = applyRenamePropertyEdit;
|
|
11
|
+
exports.applyRenameSchemaItemEdit = applyRenameSchemaItemEdit;
|
|
11
12
|
const SchemaDifference_1 = require("../../Differencing/SchemaDifference");
|
|
12
13
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
13
14
|
const Utils = require("../../Differencing/Utils");
|
|
@@ -28,13 +29,12 @@ function applyRenamePropertyEdit(result, edit) {
|
|
|
28
29
|
}
|
|
29
30
|
propertyDifference.path = edit.value;
|
|
30
31
|
if (result.conflicts) {
|
|
31
|
-
const conflictIndex = result.conflicts.findIndex((entry) => entry.
|
|
32
|
+
const conflictIndex = result.conflicts.findIndex((entry) => entry.difference === propertyDifference);
|
|
32
33
|
if (conflictIndex > -1) {
|
|
33
34
|
result.conflicts.splice(conflictIndex, 1);
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
exports.applyRenamePropertyEdit = applyRenamePropertyEdit;
|
|
38
38
|
/**
|
|
39
39
|
* @internal
|
|
40
40
|
*/
|
|
@@ -52,7 +52,7 @@ function applyRenameSchemaItemEdit(result, edit, postProcessing) {
|
|
|
52
52
|
}
|
|
53
53
|
renameName(itemDifference, itemName, edit.value);
|
|
54
54
|
if (result.conflicts) {
|
|
55
|
-
const conflictIndex = result.conflicts.findIndex((entry) => entry.
|
|
55
|
+
const conflictIndex = result.conflicts.findIndex((entry) => entry.difference === itemDifference);
|
|
56
56
|
if (conflictIndex > -1) {
|
|
57
57
|
result.conflicts.splice(conflictIndex, 1);
|
|
58
58
|
}
|
|
@@ -61,7 +61,6 @@ function applyRenameSchemaItemEdit(result, edit, postProcessing) {
|
|
|
61
61
|
renameSchemaItem(result, edit, itemDifference.schemaType);
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
exports.applyRenameSchemaItemEdit = applyRenameSchemaItemEdit;
|
|
65
64
|
function renameSchemaItem(result, edit, schemaType) {
|
|
66
65
|
const schemaKey = ecschema_metadata_1.SchemaKey.parseString(result.sourceSchemaName);
|
|
67
66
|
const [_schemaName, itemName] = ecschema_metadata_1.SchemaItem.parseFullName(edit.key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameEditHandler.js","sourceRoot":"","sources":["../../../../src/Merging/Edits/RenameEditHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,0EAAyP;AACzP,gEAA0P;AAC1P,kDAAkD;AAMlD;;GAEG;AACH,SAAgB,uBAAuB,CAAC,MAA8B,EAAE,IAAwB;IAC9F,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAA6B,CAAC;IACrF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QACnD,OAAO,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,QAAQ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AAE,CAAC;gBACjD,IAAI,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAChD,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,uCAAuC,CAAC,KAAK,CAAC,EAAE,CAAC;YACvG,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;AACH,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 Merging\r\n */\r\n\r\nimport type { RenamePropertyEdit, RenameSchemaItemEdit } from \"./SchemaEdits\";\r\nimport { AnyClassItemDifference, AnySchemaItemDifference, ClassPropertyDifference, RelationshipClassDifference, RelationshipConstraintClassDifference, SchemaDifferenceResult, SchemaOtherTypes, SchemaType } from \"../../Differencing/SchemaDifference\";\r\nimport { NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, RelationshipConstraintProps, SchemaItem, SchemaItemKey, SchemaItemType, SchemaKey, StructArrayPropertyProps, StructPropertyProps } from \"@itwin/ecschema-metadata\";\r\nimport * as Utils from \"../../Differencing/Utils\";\r\n\r\ntype Editable<T extends object> = {\r\n -readonly [P in keyof T]: T[P];\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function applyRenamePropertyEdit(result: SchemaDifferenceResult, edit: RenamePropertyEdit) {\r\n const [schemaName, itemName, path] = edit.key.split(\".\") as [string, string, string];\r\n if (!result.sourceSchemaName.startsWith(schemaName)) {\r\n return;\r\n }\r\n\r\n const difference = result.differences.find((entry) => {\r\n return Utils.isClassPropertyDifference(entry) && entry.changeType === \"add\" && entry.itemName === itemName && entry.path === path;\r\n });\r\n\r\n const propertyDifference = difference as Editable<ClassPropertyDifference>;\r\n if (propertyDifference === undefined) {\r\n return;\r\n }\r\n\r\n propertyDifference.path = edit.value;\r\n\r\n if (result.conflicts) {\r\n const conflictIndex = result.conflicts.findIndex((entry) => entry.itemName === itemName && entry.path === path);\r\n if (conflictIndex > -1) {\r\n result.conflicts.splice(conflictIndex, 1);\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport function applyRenameSchemaItemEdit(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit, postProcessing: (cb: () => void) => void) {\r\n const [schemaName, itemName] = SchemaItem.parseFullName(edit.key);\r\n if (!result.sourceSchemaName.startsWith(schemaName)) {\r\n return;\r\n }\r\n\r\n const difference = result.differences.find((entry) => {\r\n return Utils.isSchemaItemDifference(entry) && entry.changeType === \"add\" && entry.itemName === itemName;\r\n });\r\n\r\n const itemDifference = difference as AnySchemaItemDifference;\r\n if (itemDifference === undefined) {\r\n return;\r\n }\r\n\r\n renameName(itemDifference, itemName, edit.value);\r\n\r\n if (result.conflicts) {\r\n const conflictIndex = result.conflicts.findIndex((entry) => entry.itemName === itemName && entry.path === undefined);\r\n if (conflictIndex > -1) {\r\n result.conflicts.splice(conflictIndex, 1);\r\n }\r\n }\r\n\r\n postProcessing(() => {\r\n renameSchemaItem(result, edit, itemDifference.schemaType);\r\n });\r\n}\r\n\r\nfunction renameSchemaItem(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit, schemaType: SchemaType) {\r\n const schemaKey = SchemaKey.parseString(result.sourceSchemaName);\r\n const [_schemaName, itemName] = SchemaItem.parseFullName(edit.key);\r\n const oldKey = new SchemaItemKey(itemName, schemaKey);\r\n const newKey = new SchemaItemKey(edit.value, schemaKey);\r\n\r\n switch (schemaType) {\r\n case SchemaItemType.CustomAttributeClass:\r\n renameCustomAttributeClassName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.EntityClass:\r\n renameEntityClassName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.Enumeration:\r\n renameEnumerationName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.Format:\r\n break;\r\n case SchemaItemType.InvertedUnit:\r\n break;\r\n case SchemaItemType.KindOfQuantity:\r\n renameKindOfQuantityName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.Mixin:\r\n renameMixinName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.Phenomenon:\r\n renamePhenomenonName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.PropertyCategory:\r\n renamePropertyCategoryName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.RelationshipClass:\r\n renameRelationshipClassName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.StructClass:\r\n renameStructClassName(result, oldKey, newKey);\r\n break;\r\n case SchemaItemType.Unit:\r\n break;\r\n case SchemaItemType.UnitSystem:\r\n break;\r\n }\r\n}\r\n\r\nfunction renameBaseClass(difference: AnyClassItemDifference[\"difference\"], oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n if (difference.baseClass && oldKey.matchesFullName(difference.baseClass)) {\r\n difference.baseClass = newKey.fullName;\r\n }\r\n}\r\n\r\nfunction renameName(change: AnySchemaItemDifference, oldName: string, newName: string) {\r\n if (change.itemName === oldName) {\r\n const schemaItemDifference = change as Editable<AnySchemaItemDifference>;\r\n schemaItemDifference.itemName = newName;\r\n }\r\n}\r\n\r\nfunction renameRelationshipConstraint(change: RelationshipClassDifference | RelationshipConstraintClassDifference, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n if (change.schemaType === SchemaItemType.RelationshipClass) {\r\n const constraintProps = [change.difference.source, change.difference.target] as Editable<RelationshipConstraintProps>[];\r\n for (const props of constraintProps) {\r\n if (props) {\r\n if (props.abstractConstraint && oldKey.matchesFullName(props.abstractConstraint)) {\r\n props.abstractConstraint = newKey.fullName;\r\n }\r\n if (props.constraintClasses !== undefined) {\r\n for (let i = 0; i < props.constraintClasses.length; i++) {\r\n if (oldKey.matchesFullName(props.constraintClasses[i]))\r\n props.constraintClasses[i] = newKey.fullName;\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n for (let i = 0; i < change.difference.length; i++) {\r\n if (oldKey.matchesFullName(change.difference[i]))\r\n change.difference[i] = newKey.fullName;\r\n }\r\n }\r\n}\r\n\r\nfunction renamePropertyCategoryName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const entry of differences) {\r\n if (entry.schemaType === SchemaItemType.PropertyCategory) {\r\n renameName(entry, oldKey.name, newKey.name);\r\n }\r\n\r\n if (Utils.isClassDifference(entry) && entry.difference.properties) {\r\n for (const property of entry.difference.properties) {\r\n if (property.category && oldKey.matchesFullName(property.category)) {\r\n const props = property as Editable<typeof property>;\r\n props.category = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (entry.schemaType === SchemaOtherTypes.Property) {\r\n if (entry.difference.category && oldKey.matchesFullName(entry.difference.category)) {\r\n entry.difference.category = newKey.fullName;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction renameKindOfQuantityName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const entry of differences) {\r\n if (Utils.isClassDifference(entry) && entry.difference.properties) {\r\n for (const property of entry.difference.properties) {\r\n if (property.kindOfQuantity && oldKey.matchesFullName(property.kindOfQuantity)) {\r\n const props = property as Editable<typeof property>;\r\n props.kindOfQuantity = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (entry.schemaType === SchemaOtherTypes.Property) {\r\n if (entry.difference.kindOfQuantity && oldKey.matchesFullName(entry.difference.kindOfQuantity)) {\r\n entry.difference.kindOfQuantity = newKey.fullName;\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction renameEnumerationName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const change of differences) {\r\n if (Utils.isClassDifference(change) && change.difference.properties) {\r\n for (const property of change.difference.properties) {\r\n if (property.type === \"PrimitiveProperty\" || property.type === \"PrimitiveArrayProperty\") {\r\n const props = property as Editable<PrimitivePropertyProps | PrimitiveArrayPropertyProps>;\r\n if (props.typeName && oldKey.matchesFullName(props.typeName))\r\n props.typeName = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (change.schemaType === SchemaOtherTypes.Property && (\r\n change.difference.type === \"PrimitiveProperty\" || change.difference.type === \"PrimitiveArrayProperty\"\r\n )) {\r\n const props = change.difference as Editable<PrimitivePropertyProps | PrimitiveArrayPropertyProps>;\r\n if (props.typeName && oldKey.matchesFullName(props.typeName))\r\n props.typeName = newKey.fullName;\r\n }\r\n }\r\n}\r\n\r\nfunction renamePhenomenonName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const entry of differences) {\r\n if (entry.schemaType === SchemaItemType.Constant || entry.schemaType === SchemaItemType.Unit) {\r\n if (entry.difference.phenomenon && oldKey.matchesFullName(entry.difference.phenomenon))\r\n entry.difference.phenomenon = newKey.fullName;\r\n }\r\n }\r\n}\r\n\r\nfunction renameStructClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const change of differences) {\r\n if (change.schemaType === SchemaItemType.StructClass) {\r\n renameBaseClass(change.difference, oldKey, newKey);\r\n }\r\n\r\n if (Utils.isClassDifference(change) && change.difference.properties) {\r\n for (const property of change.difference.properties) {\r\n if (property.type === \"StructProperty\" || property.type === \"StructArrayProperty\") {\r\n const props = property as Editable<StructPropertyProps | StructArrayPropertyProps>;;\r\n if (props.typeName && oldKey.matchesFullName(props.typeName))\r\n props.typeName = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (change.schemaType === SchemaOtherTypes.Property && (\r\n change.difference.type === \"StructProperty\" || change.difference.type === \"StructArrayProperty\"\r\n )) {\r\n const props = change.difference as Editable<StructPropertyProps | StructArrayPropertyProps>;\r\n if (props.typeName && oldKey.matchesFullName(props.typeName))\r\n props.typeName = newKey.fullName;\r\n }\r\n }\r\n}\r\n\r\nfunction renameCustomAttributeClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const change of differences) {\r\n if (change.schemaType === SchemaItemType.CustomAttributeClass) {\r\n renameBaseClass(change.difference, oldKey, newKey);\r\n }\r\n\r\n if (change.schemaType === SchemaOtherTypes.CustomAttributeInstance) {\r\n if (change.difference.className && oldKey.matchesFullName(change.difference.className)) {\r\n change.difference.className = newKey.fullName;\r\n }\r\n }\r\n\r\n if (change.schemaType === SchemaOtherTypes.Property || Utils.isClassDifference(change)) {\r\n if (change.difference.customAttributes) {\r\n for (const customAttribute of change.difference.customAttributes) {\r\n if (oldKey.matchesFullName(customAttribute.className))\r\n customAttribute.className = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (Utils.isClassDifference(change) && change.difference.properties) {\r\n for (const property of change.difference.properties) {\r\n if (property.customAttributes) {\r\n for (const customAttribute of property.customAttributes) {\r\n if (oldKey.matchesFullName(customAttribute.className))\r\n customAttribute.className = newKey.fullName;\r\n }\r\n }\r\n }\r\n }\r\n // https://github.com/iTwin/itwinjs-core/issues/7020\r\n /* if (change.schemaType === SchemaItemType.RelationshipClass) {\r\n const constraintProps = [change.difference.source, change.difference.target] as Editable<RelationshipConstraintProps>[];\r\n for (const props of constraintProps) {\r\n if (props.customAttributes !== undefined) {\r\n for (const customAttribute of props.customAttributes) {\r\n if (oldKey.matchesFullName(customAttribute.className))\r\n customAttribute.className = newKey.fullName;\r\n }\r\n }\r\n }\r\n } */\r\n }\r\n}\r\n\r\nfunction renameRelationshipClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const change of differences) {\r\n if (change.schemaType === SchemaItemType.RelationshipClass) {\r\n renameBaseClass(change.difference, oldKey, newKey);\r\n }\r\n\r\n if (change.schemaType === SchemaOtherTypes.Property && change.difference.type === \"NavigationProperty\") {\r\n const props = change.difference as Editable<NavigationPropertyProps>;\r\n if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))\r\n props.relationshipName = newKey.fullName;\r\n }\r\n\r\n if (Utils.isClassDifference(change) && change.difference.properties) {\r\n for (const property of change.difference.properties) {\r\n if (property.type === \"NavigationProperty\") {\r\n const props = property as Editable<NavigationPropertyProps>;\r\n if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))\r\n props.relationshipName = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (change.schemaType === SchemaItemType.RelationshipClass || change.schemaType === SchemaOtherTypes.RelationshipConstraintClass) {\r\n renameRelationshipConstraint(change, oldKey, newKey);\r\n }\r\n }\r\n}\r\n\r\nfunction renameEntityClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const entry of differences) {\r\n if (entry.schemaType === SchemaItemType.EntityClass) {\r\n renameName(entry, oldKey.name, newKey.name);\r\n renameBaseClass(entry.difference, oldKey, newKey);\r\n }\r\n\r\n if (entry.schemaType === SchemaItemType.Mixin) {\r\n if (entry.difference.appliesTo && oldKey.matchesFullName(entry.difference.appliesTo))\r\n entry.difference.appliesTo = newKey.fullName;\r\n }\r\n\r\n if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {\r\n renameRelationshipConstraint(entry, oldKey, newKey);\r\n }\r\n }\r\n}\r\n\r\nfunction renameMixinName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\r\n for (const entry of differences) {\r\n if (entry.schemaType === SchemaItemType.Mixin) {\r\n renameBaseClass(entry.difference, oldKey, newKey);\r\n }\r\n\r\n if (entry.schemaType === SchemaOtherTypes.EntityClassMixin) {\r\n for (let i = 0; i < entry.difference.length; i++) {\r\n if (oldKey.matchesFullName(entry.difference[i])) {\r\n entry.difference[i] = newKey.fullName;\r\n }\r\n }\r\n }\r\n\r\n if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {\r\n renameRelationshipConstraint(entry, oldKey, newKey);\r\n }\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"RenameEditHandler.js","sourceRoot":"","sources":["../../../../src/Merging/Edits/RenameEditHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAcH,0DAuBC;AAKD,8DA2BC;AAlED,0EAAyP;AACzP,gEAA0P;AAC1P,kDAAkD;AAMlD;;GAEG;AACH,SAAgB,uBAAuB,CAAC,MAA8B,EAAE,IAAwB;IAC9F,MAAM,CAAC,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAA6B,CAAC;IACrF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QACpD,OAAO;IACT,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE;QACnD,OAAO,KAAK,CAAC,yBAAyB,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,KAAK,KAAK,IAAI,KAAK,CAAC,QAAQ,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC;IACpI,CAAC,CAAC,CAAC;IAEH,MAAM,kBAAkB,GAAG,UAA+C,CAAC;IAC3E,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IAED,kBAAkB,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;IAErC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,aAAa,GAAG,MAAM,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,KAAK,kB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F,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,MAAM,CAAC,QAAQ,CAAC;QACjD,CAAC;QAED,IAAI,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,uCAAuC,CAAC,KAAK,CAAC,EAAE,CAAC;YACvG,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,WAAW,EAA0B,EAAE,MAAqB,EAAE,MAAqB;IAC5G,KAAK,MAAM,KAAK,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,UAAU,KAAK,kCAAc,CAAC,KAAK,EAAE,CAAC;YAC9C,eAAe,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACpD,CAAC;QAED,IAAI,KAAK,CAAC,UAAU,KAAK,mCAAgB,CAAC,gBAAgB,EAAE,CAAC;YAC3D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACjD,IAAI,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAChD,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,CAAC;gBACxC,CAAC;YACH,CAAC;QACH,CAAC;QAED,IAAI,KAAK,CAAC,6BAA6B,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,uCAAuC,CAAC,KAAK,CAAC,EAAE,CAAC;YACvG,4BAA4B,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;AACH,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 Merging\n */\n\nimport type { RenamePropertyEdit, RenameSchemaItemEdit } from \"./SchemaEdits\";\nimport { AnyClassItemDifference, AnySchemaItemDifference, ClassPropertyDifference, RelationshipClassDifference, RelationshipConstraintClassDifference, SchemaDifferenceResult, SchemaOtherTypes, SchemaType } from \"../../Differencing/SchemaDifference\";\nimport { NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, RelationshipConstraintProps, SchemaItem, SchemaItemKey, SchemaItemType, SchemaKey, StructArrayPropertyProps, StructPropertyProps } from \"@itwin/ecschema-metadata\";\nimport * as Utils from \"../../Differencing/Utils\";\n\ntype Editable<T extends object> = {\n -readonly [P in keyof T]: T[P];\n};\n\n/**\n * @internal\n */\nexport function applyRenamePropertyEdit(result: SchemaDifferenceResult, edit: RenamePropertyEdit) {\n const [schemaName, itemName, path] = edit.key.split(\".\") as [string, string, string];\n if (!result.sourceSchemaName.startsWith(schemaName)) {\n return;\n }\n\n const difference = result.differences.find((entry) => {\n return Utils.isClassPropertyDifference(entry) && entry.changeType === \"add\" && entry.itemName === itemName && entry.path === path;\n });\n\n const propertyDifference = difference as Editable<ClassPropertyDifference>;\n if (propertyDifference === undefined) {\n return;\n }\n\n propertyDifference.path = edit.value;\n\n if (result.conflicts) {\n const conflictIndex = result.conflicts.findIndex((entry) => entry.difference === propertyDifference);\n if (conflictIndex > -1) {\n result.conflicts.splice(conflictIndex, 1);\n }\n }\n}\n\n/**\n * @internal\n */\nexport function applyRenameSchemaItemEdit(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit, postProcessing: (cb: () => void) => void) {\n const [schemaName, itemName] = SchemaItem.parseFullName(edit.key);\n if (!result.sourceSchemaName.startsWith(schemaName)) {\n return;\n }\n\n const difference = result.differences.find((entry) => {\n return Utils.isSchemaItemDifference(entry) && entry.changeType === \"add\" && entry.itemName === itemName;\n });\n\n const itemDifference = difference as AnySchemaItemDifference;\n if (itemDifference === undefined) {\n return;\n }\n\n renameName(itemDifference, itemName, edit.value);\n\n if (result.conflicts) {\n const conflictIndex = result.conflicts.findIndex((entry) => entry.difference === itemDifference);\n if (conflictIndex > -1) {\n result.conflicts.splice(conflictIndex, 1);\n }\n }\n\n postProcessing(() => {\n renameSchemaItem(result, edit, itemDifference.schemaType);\n });\n}\n\nfunction renameSchemaItem(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit, schemaType: SchemaType) {\n const schemaKey = SchemaKey.parseString(result.sourceSchemaName);\n const [_schemaName, itemName] = SchemaItem.parseFullName(edit.key);\n const oldKey = new SchemaItemKey(itemName, schemaKey);\n const newKey = new SchemaItemKey(edit.value, schemaKey);\n\n switch (schemaType) {\n case SchemaItemType.CustomAttributeClass:\n renameCustomAttributeClassName(result, oldKey, newKey);\n break;\n case SchemaItemType.EntityClass:\n renameEntityClassName(result, oldKey, newKey);\n break;\n case SchemaItemType.Enumeration:\n renameEnumerationName(result, oldKey, newKey);\n break;\n case SchemaItemType.Format:\n break;\n case SchemaItemType.InvertedUnit:\n break;\n case SchemaItemType.KindOfQuantity:\n renameKindOfQuantityName(result, oldKey, newKey);\n break;\n case SchemaItemType.Mixin:\n renameMixinName(result, oldKey, newKey);\n break;\n case SchemaItemType.Phenomenon:\n renamePhenomenonName(result, oldKey, newKey);\n break;\n case SchemaItemType.PropertyCategory:\n renamePropertyCategoryName(result, oldKey, newKey);\n break;\n case SchemaItemType.RelationshipClass:\n renameRelationshipClassName(result, oldKey, newKey);\n break;\n case SchemaItemType.StructClass:\n renameStructClassName(result, oldKey, newKey);\n break;\n case SchemaItemType.Unit:\n break;\n case SchemaItemType.UnitSystem:\n break;\n }\n}\n\nfunction renameBaseClass(difference: AnyClassItemDifference[\"difference\"], oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n if (difference.baseClass && oldKey.matchesFullName(difference.baseClass)) {\n difference.baseClass = newKey.fullName;\n }\n}\n\nfunction renameName(change: AnySchemaItemDifference, oldName: string, newName: string) {\n if (change.itemName === oldName) {\n const schemaItemDifference = change as Editable<AnySchemaItemDifference>;\n schemaItemDifference.itemName = newName;\n }\n}\n\nfunction renameRelationshipConstraint(change: RelationshipClassDifference | RelationshipConstraintClassDifference, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n if (change.schemaType === SchemaItemType.RelationshipClass) {\n const constraintProps = [change.difference.source, change.difference.target] as Editable<RelationshipConstraintProps>[];\n for (const props of constraintProps) {\n if (props) {\n if (props.abstractConstraint && oldKey.matchesFullName(props.abstractConstraint)) {\n props.abstractConstraint = newKey.fullName;\n }\n if (props.constraintClasses !== undefined) {\n for (let i = 0; i < props.constraintClasses.length; i++) {\n if (oldKey.matchesFullName(props.constraintClasses[i]))\n props.constraintClasses[i] = newKey.fullName;\n }\n }\n }\n }\n } else {\n for (let i = 0; i < change.difference.length; i++) {\n if (oldKey.matchesFullName(change.difference[i]))\n change.difference[i] = newKey.fullName;\n }\n }\n}\n\nfunction renamePropertyCategoryName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const entry of differences) {\n if (entry.schemaType === SchemaItemType.PropertyCategory) {\n renameName(entry, oldKey.name, newKey.name);\n }\n\n if (Utils.isClassDifference(entry) && entry.difference.properties) {\n for (const property of entry.difference.properties) {\n if (property.category && oldKey.matchesFullName(property.category)) {\n const props = property as Editable<typeof property>;\n props.category = newKey.fullName;\n }\n }\n }\n\n if (entry.schemaType === SchemaOtherTypes.Property) {\n if (entry.difference.category && oldKey.matchesFullName(entry.difference.category)) {\n entry.difference.category = newKey.fullName;\n }\n }\n }\n}\n\nfunction renameKindOfQuantityName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const entry of differences) {\n if (Utils.isClassDifference(entry) && entry.difference.properties) {\n for (const property of entry.difference.properties) {\n if (property.kindOfQuantity && oldKey.matchesFullName(property.kindOfQuantity)) {\n const props = property as Editable<typeof property>;\n props.kindOfQuantity = newKey.fullName;\n }\n }\n }\n\n if (entry.schemaType === SchemaOtherTypes.Property) {\n if (entry.difference.kindOfQuantity && oldKey.matchesFullName(entry.difference.kindOfQuantity)) {\n entry.difference.kindOfQuantity = newKey.fullName;\n }\n }\n }\n}\n\nfunction renameEnumerationName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const change of differences) {\n if (Utils.isClassDifference(change) && change.difference.properties) {\n for (const property of change.difference.properties) {\n if (property.type === \"PrimitiveProperty\" || property.type === \"PrimitiveArrayProperty\") {\n const props = property as Editable<PrimitivePropertyProps | PrimitiveArrayPropertyProps>;\n if (props.typeName && oldKey.matchesFullName(props.typeName))\n props.typeName = newKey.fullName;\n }\n }\n }\n\n if (change.schemaType === SchemaOtherTypes.Property && (\n change.difference.type === \"PrimitiveProperty\" || change.difference.type === \"PrimitiveArrayProperty\"\n )) {\n const props = change.difference as Editable<PrimitivePropertyProps | PrimitiveArrayPropertyProps>;\n if (props.typeName && oldKey.matchesFullName(props.typeName))\n props.typeName = newKey.fullName;\n }\n }\n}\n\nfunction renamePhenomenonName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const entry of differences) {\n if (entry.schemaType === SchemaItemType.Constant || entry.schemaType === SchemaItemType.Unit) {\n if (entry.difference.phenomenon && oldKey.matchesFullName(entry.difference.phenomenon))\n entry.difference.phenomenon = newKey.fullName;\n }\n }\n}\n\nfunction renameStructClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const change of differences) {\n if (change.schemaType === SchemaItemType.StructClass) {\n renameBaseClass(change.difference, oldKey, newKey);\n }\n\n if (Utils.isClassDifference(change) && change.difference.properties) {\n for (const property of change.difference.properties) {\n if (property.type === \"StructProperty\" || property.type === \"StructArrayProperty\") {\n const props = property as Editable<StructPropertyProps | StructArrayPropertyProps>;;\n if (props.typeName && oldKey.matchesFullName(props.typeName))\n props.typeName = newKey.fullName;\n }\n }\n }\n\n if (change.schemaType === SchemaOtherTypes.Property && (\n change.difference.type === \"StructProperty\" || change.difference.type === \"StructArrayProperty\"\n )) {\n const props = change.difference as Editable<StructPropertyProps | StructArrayPropertyProps>;\n if (props.typeName && oldKey.matchesFullName(props.typeName))\n props.typeName = newKey.fullName;\n }\n }\n}\n\nfunction renameCustomAttributeClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const change of differences) {\n if (change.schemaType === SchemaItemType.CustomAttributeClass) {\n renameBaseClass(change.difference, oldKey, newKey);\n }\n\n if (change.schemaType === SchemaOtherTypes.CustomAttributeInstance) {\n if (change.difference.className && oldKey.matchesFullName(change.difference.className)) {\n change.difference.className = newKey.fullName;\n }\n }\n\n if (change.schemaType === SchemaOtherTypes.Property || Utils.isClassDifference(change)) {\n if (change.difference.customAttributes) {\n for (const customAttribute of change.difference.customAttributes) {\n if (oldKey.matchesFullName(customAttribute.className))\n customAttribute.className = newKey.fullName;\n }\n }\n }\n\n if (Utils.isClassDifference(change) && change.difference.properties) {\n for (const property of change.difference.properties) {\n if (property.customAttributes) {\n for (const customAttribute of property.customAttributes) {\n if (oldKey.matchesFullName(customAttribute.className))\n customAttribute.className = newKey.fullName;\n }\n }\n }\n }\n // https://github.com/iTwin/itwinjs-core/issues/7020\n /* if (change.schemaType === SchemaItemType.RelationshipClass) {\n const constraintProps = [change.difference.source, change.difference.target] as Editable<RelationshipConstraintProps>[];\n for (const props of constraintProps) {\n if (props.customAttributes !== undefined) {\n for (const customAttribute of props.customAttributes) {\n if (oldKey.matchesFullName(customAttribute.className))\n customAttribute.className = newKey.fullName;\n }\n }\n }\n } */\n }\n}\n\nfunction renameRelationshipClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const change of differences) {\n if (change.schemaType === SchemaItemType.RelationshipClass) {\n renameBaseClass(change.difference, oldKey, newKey);\n }\n\n if (change.schemaType === SchemaOtherTypes.Property && change.difference.type === \"NavigationProperty\") {\n const props = change.difference as Editable<NavigationPropertyProps>;\n if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))\n props.relationshipName = newKey.fullName;\n }\n\n if (Utils.isClassDifference(change) && change.difference.properties) {\n for (const property of change.difference.properties) {\n if (property.type === \"NavigationProperty\") {\n const props = property as Editable<NavigationPropertyProps>;\n if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))\n props.relationshipName = newKey.fullName;\n }\n }\n }\n\n if (change.schemaType === SchemaItemType.RelationshipClass || change.schemaType === SchemaOtherTypes.RelationshipConstraintClass) {\n renameRelationshipConstraint(change, oldKey, newKey);\n }\n }\n}\n\nfunction renameEntityClassName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const entry of differences) {\n if (entry.schemaType === SchemaItemType.EntityClass) {\n renameName(entry, oldKey.name, newKey.name);\n renameBaseClass(entry.difference, oldKey, newKey);\n }\n\n if (entry.schemaType === SchemaItemType.Mixin) {\n if (entry.difference.appliesTo && oldKey.matchesFullName(entry.difference.appliesTo))\n entry.difference.appliesTo = newKey.fullName;\n }\n\n if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {\n renameRelationshipConstraint(entry, oldKey, newKey);\n }\n }\n}\n\nfunction renameMixinName({ differences }: SchemaDifferenceResult, oldKey: SchemaItemKey, newKey: SchemaItemKey) {\n for (const entry of differences) {\n if (entry.schemaType === SchemaItemType.Mixin) {\n renameBaseClass(entry.difference, oldKey, newKey);\n }\n\n if (entry.schemaType === SchemaOtherTypes.EntityClassMixin) {\n for (let i = 0; i < entry.difference.length; i++) {\n if (oldKey.matchesFullName(entry.difference[i])) {\n entry.difference[i] = newKey.fullName;\n }\n }\n }\n\n if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {\n renameRelationshipConstraint(entry, oldKey, newKey);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-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cAAc,CAAC,CAAC,CAAC;YACpG,CAAC;YACD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,cAAc,EAAE,CAAC;gBACtD,IAAA,2CAAuB,EAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;YACxD,CAAC;YACD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;gBAC5C,IAAA,+BAAa,EAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,cAAc,EAAE,CAAC;YACtC,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AA7CD,kCA6CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
1
|
+
{"version":3,"file":"SchemaEdits.js","sourceRoot":"","sources":["../../../../src/Merging/Edits/SchemaEdits.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,2DAAyF;AACzF,uDAAkD;AAElD;;;GAGG;AACH,IAAY,cAIX;AAJD,WAAY,cAAc;IACxB,uDAAqC,CAAA;IACrC,mDAAiC,CAAA;IACjC,+BAAa,CAAA;AACf,CAAC,EAJW,cAAc,8BAAd,cAAc,QAIzB;AAwCD,MAAe,MAAM;IAGnB,YAAY,KAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAES,GAAG,CAAC,IAAoB;QAChC,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE;YACpD,OAAO,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,GAAG,KAAK,IAAI,CAAC,GAAG,CAAC;QAC5D,CAAC,CAAC,CAAC;QAEH,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE,CAAC;YACvB,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CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,CAAC;QAClC,CAAC;QAED,IAAI,CAAC,KAAK,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,IAAI,CAAC,UAAU,GAAG,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,OAAO,CAAC,gBAAwC;QAC3D,MAAM,cAAc,GAAsB,EAAE,CAAC;QAC7C,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACrC,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,EAAE,CAAC;gBACxD,IAAA,6CAAyB,EAAC,gBAAgB,EAAE,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;YACpG,CAAC;YACD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,cAAc,EAAE,CAAC;gBACtD,IAAA,2CAAuB,EAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;YACxD,CAAC;YACD,IAAI,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,IAAI,EAAE,CAAC;gBAC5C,IAAA,+BAAa,EAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;YAC9C,CAAC;QACH,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,cAAc,EAAE,CAAC;YACtC,QAAQ,EAAE,CAAC;QACb,CAAC;IACH,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AA7CD,kCA6CC","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 Merging\n */\n\nimport type { SchemaDifferenceResult } from \"../../Differencing/SchemaDifference\";\nimport { applyRenamePropertyEdit, applyRenameSchemaItemEdit } from \"./RenameEditHandler\";\nimport { applySkipEdit } from \"./SkipEditHandler\";\n\n/**\n * An enumeration that has all the schema edit names.\n * @alpha\n */\nexport enum SchemaEditType {\n RenameSchemaItem = \"RenameSchemaItem\",\n RenameProperty = \"RenameProperty\",\n Skip = \"Skip\",\n}\n\n/**\n * Schema edit entry to rename a schema item.\n * @alpha\n */\nexport interface RenameSchemaItemEdit {\n type: SchemaEditType.RenameSchemaItem;\n key: string;\n value: string;\n}\n\n/**\n * Schema edit entry to rename a property of a class.\n * @alpha\n */\nexport interface RenamePropertyEdit {\n type: SchemaEditType.RenameProperty;\n key: string;\n value: string;\n}\n\n/**\n * Schema edit entry to skip a certain schema element matching the given key.\n * @alpha\n */\nexport interface SkipEdit {\n type: SchemaEditType.Skip;\n key: string;\n}\n\n/**\n * Union for all supported edits that can be applied to a schema.\n * @alpha\n */\nexport type AnySchemaEdits =\n SkipEdit |\n RenameSchemaItemEdit |\n RenamePropertyEdit;\n\nabstract class Editor {\n private readonly _edits: Array<AnySchemaEdits>;\n\n constructor(edits: Array<AnySchemaEdits>) {\n this._edits = edits;\n }\n\n protected add(edit: AnySchemaEdits) {\n const overrideEntry = this._edits.findIndex((entry) => {\n return entry.type === edit.type && entry.key === edit.key;\n });\n\n if (overrideEntry > -1) {\n this._edits[overrideEntry] = edit;\n } else {\n this._edits.push(edit);\n }\n }\n}\n\nclass PropertyEditor extends Editor {\n\n public rename(schemaName: string, className: string, propertyName: string, newName: string) {\n this.add({\n type: SchemaEditType.RenameProperty,\n key: `${schemaName}.${className}.${propertyName}`,\n value: newName,\n });\n }\n\n public skip(schemaName: string, className: string, propertyName: string) {\n this.add({\n type: SchemaEditType.Skip,\n key: `${schemaName}.${className}.${propertyName}`,\n });\n }\n}\n\nclass ItemEditor extends Editor {\n public rename(schemaName: string, itemName: string, newName: string) {\n this.add({\n type: SchemaEditType.RenameSchemaItem,\n key: `${schemaName}.${itemName}`,\n value: newName,\n });\n }\n\n public skip(schemaName: string, itemName: string) {\n this.add({\n type: SchemaEditType.Skip,\n key: `${schemaName}.${itemName}`,\n });\n }\n}\n\n/**\n * Defines a set of edits of a schema that can be applied to a schema during merging. The intention of this class\n * is to support saving of edits and load them again if needed.\n * @alpha\n */\nexport class SchemaEdits {\n private readonly _edits: Array<AnySchemaEdits>;\n\n public readonly properties: PropertyEditor;\n public readonly items: ItemEditor;\n\n /**\n * @alpha\n */\n constructor(initialize?: ReadonlyArray<AnySchemaEdits>) {\n this._edits = [];\n\n if (initialize) {\n this._edits.push(...initialize);\n }\n\n this.items = new ItemEditor(this._edits);\n this.properties = new PropertyEditor(this._edits);\n }\n\n /**\n * @internal\n */\n public async applyTo(differenceResult: SchemaDifferenceResult): Promise<void> {\n const postProcessing: Array<() => void> = [];\n for (const schemaEdit of this._edits) {\n if (schemaEdit.type === SchemaEditType.RenameSchemaItem) {\n applyRenameSchemaItemEdit(differenceResult, schemaEdit, postProcessing.push.bind(postProcessing));\n }\n if (schemaEdit.type === SchemaEditType.RenameProperty) {\n applyRenamePropertyEdit(differenceResult, schemaEdit);\n }\n if (schemaEdit.type === SchemaEditType.Skip) {\n applySkipEdit(differenceResult, schemaEdit);\n }\n }\n\n for (const callback of postProcessing) {\n callback();\n }\n }\n\n public toJSON(): ReadonlyArray<AnySchemaEdits> {\n return this._edits;\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkipEditHandler.d.ts","sourceRoot":"","sources":["../../../../src/Merging/Edits/SkipEditHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"SkipEditHandler.d.ts","sourceRoot":"","sources":["../../../../src/Merging/Edits/SkipEditHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAuB,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAEvG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,QAAQ,QAkB3E"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @module Merging
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.applySkipEdit =
|
|
10
|
+
exports.applySkipEdit = applySkipEdit;
|
|
11
11
|
/**
|
|
12
12
|
* Applies a skip edit to the schema differences. It basically removes all entries that
|
|
13
13
|
* that are associated with the item to skip.
|
|
@@ -23,18 +23,18 @@ function applySkipEdit(result, edit) {
|
|
|
23
23
|
const foundIndices = pathName !== undefined
|
|
24
24
|
? findRelatedItemEntries(result, itemName, pathName)
|
|
25
25
|
: findItemEntries(result, itemName);
|
|
26
|
+
const skippedDifferences = [];
|
|
26
27
|
for (const index of foundIndices.reverse()) {
|
|
27
|
-
result.differences.splice(index, 1);
|
|
28
|
+
skippedDifferences.push(...result.differences.splice(index, 1));
|
|
28
29
|
}
|
|
29
30
|
if (result.conflicts) {
|
|
30
|
-
removeRelatedConflicts(result.conflicts,
|
|
31
|
+
removeRelatedConflicts(result.conflicts, skippedDifferences);
|
|
31
32
|
}
|
|
32
33
|
}
|
|
33
|
-
|
|
34
|
-
function removeRelatedConflicts(conflicts, itemName, path) {
|
|
34
|
+
function removeRelatedConflicts(conflicts, skippedDifferences) {
|
|
35
35
|
const indices = [];
|
|
36
36
|
conflicts.forEach((conflict, index) => {
|
|
37
|
-
if (
|
|
37
|
+
if (skippedDifferences.includes(conflict.difference)) {
|
|
38
38
|
indices.push(index);
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SkipEditHandler.js","sourceRoot":"","sources":["../../../../src/Merging/Edits/SkipEditHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG
|
|
1
|
+
{"version":3,"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C;IACH,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,KAAK,IAAI,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC;QACtC,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7B,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,WAAW,EAA0B,EAAE,QAAgB;IAChF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;QACxC,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACjE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,sBAAsB,CAAC,EAAE,WAAW,EAA0B,EAAE,QAAgB,EAAE,QAAgB;IACzG,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,WAAW,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;QACxC,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,CAAC,QAAQ,KAAK,QAAQ,IAAI,MAAM,IAAI,UAAU,IAAI,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YACzH,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,KAAK,CAAC;AACf,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 Merging\n */\n\nimport type { AnySchemaDifference, SchemaDifferenceResult } from \"../../Differencing/SchemaDifference\";\nimport type { AnySchemaDifferenceConflict } from \"../../Differencing/SchemaConflicts\";\nimport type { SkipEdit } from \"./SchemaEdits\";\n\n/**\n * Applies a skip edit to the schema differences. It basically removes all entries that\n * that are associated with the item to skip.\n * @param result The result of a schema differencing run\n * @param edit The skip edit to be applied.\n * @internal\n */\nexport function applySkipEdit(result: SchemaDifferenceResult, edit: SkipEdit) {\n const [schemaName, itemName, pathName] = edit.key.split(\".\") as [string, string, string | undefined];\n if (!result.sourceSchemaName.startsWith(schemaName)) {\n return;\n }\n\n const foundIndices = pathName !== undefined\n ? findRelatedItemEntries(result, itemName, pathName)\n : findItemEntries(result, itemName);\n\n const skippedDifferences: AnySchemaDifference[] = [];\n for (const index of foundIndices.reverse()) {\n skippedDifferences.push(...result.differences.splice(index, 1));\n }\n\n if (result.conflicts) {\n removeRelatedConflicts(result.conflicts, skippedDifferences);\n }\n}\n\nfunction removeRelatedConflicts(conflicts: AnySchemaDifferenceConflict[], skippedDifferences: AnySchemaDifference[]) {\n const indices: number[] = [];\n conflicts.forEach((conflict, index) => {\n if (skippedDifferences.includes(conflict.difference)) {\n indices.push(index);\n }\n });\n\n for (const index of indices.reverse()) {\n conflicts.splice(index, 1);\n }\n}\n\nfunction findItemEntries({ differences }: SchemaDifferenceResult, itemName: string): number[] {\n const found: number[] = [];\n differences.forEach((difference, index) => {\n if (\"itemName\" in difference && difference.itemName === itemName) {\n found.push(index);\n }\n });\n return found;\n}\n\nfunction findRelatedItemEntries({ differences }: SchemaDifferenceResult, itemName: string, pathName: string): number[] {\n const found: number[] = [];\n differences.forEach((difference, index) => {\n if (\"itemName\" in difference && difference.itemName === itemName && \"path\" in difference && difference.path === pathName) {\n found.push(index);\n }\n });\n return found;\n}\n\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addEntityClass = addEntityClass;
|
|
4
|
+
exports.modifyEntityClass = modifyEntityClass;
|
|
5
|
+
exports.addClassMixins = addClassMixins;
|
|
4
6
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
5
7
|
const ClassMerger_1 = require("./ClassMerger");
|
|
6
8
|
const Utils_1 = require("./Utils");
|
|
@@ -15,7 +17,6 @@ async function addEntityClass(context, change) {
|
|
|
15
17
|
...change.difference,
|
|
16
18
|
});
|
|
17
19
|
}
|
|
18
|
-
exports.addEntityClass = addEntityClass;
|
|
19
20
|
/**
|
|
20
21
|
* Merges differences to an existing EntityClass in the target schema.
|
|
21
22
|
* @internal
|
|
@@ -30,7 +31,6 @@ async function modifyEntityClass(context, change, itemKey) {
|
|
|
30
31
|
}
|
|
31
32
|
return (0, ClassMerger_1.modifyClass)(context, change, itemKey, item);
|
|
32
33
|
}
|
|
33
|
-
exports.modifyEntityClass = modifyEntityClass;
|
|
34
34
|
/**
|
|
35
35
|
* Merges Mixins to Entity Class schema items.
|
|
36
36
|
* @internal
|
|
@@ -42,5 +42,4 @@ async function addClassMixins(context, change) {
|
|
|
42
42
|
await context.editor.entities.addMixin(entityKey, mixinKey);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
exports.addClassMixins = addClassMixins;
|
|
46
45
|
//# sourceMappingURL=EntityClassMerger.js.map
|