@itwin/ecschema-editing 5.0.0-dev.5 → 5.0.0-dev.52
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 +36 -1
- package/lib/cjs/Differencing/Errors.js.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
- package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
- package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +53 -11
- package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
- package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifference.js +53 -5
- package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
- package/lib/cjs/Differencing/SchemaDifferenceValidator.js +71 -16
- 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 +4 -0
- 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.d.ts.map +1 -1
- package/lib/cjs/Editing/ECClasses.js +4 -19
- package/lib/cjs/Editing/ECClasses.js.map +1 -1
- package/lib/cjs/Editing/Editor.js +4 -4
- 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.d.ts +2 -1
- package/lib/cjs/Editing/Mutable/MutableClass.d.ts.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.d.ts +8 -1
- package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.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.d.ts +2 -2
- 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.d.ts.map +1 -1
- package/lib/cjs/Editing/RelationshipClasses.js +5 -2
- 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 +3 -3
- package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
- 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 +5 -9
- package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
- package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
- package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
- package/lib/cjs/Merging/Edits/NameMapping.js +51 -0
- package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
- package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
- package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
- package/lib/cjs/Merging/Edits/SchemaEdits.js +15 -14
- 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 +1 -2
- package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js +1 -1
- package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
- package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
- package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
- package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/FormatMerger.js +138 -0
- package/lib/cjs/Merging/FormatMerger.js.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
- package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
- package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
- package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
- package/lib/cjs/Merging/MixinMerger.js +1 -1
- package/lib/cjs/Merging/MixinMerger.js.map +1 -1
- package/lib/cjs/Merging/PhenomenonMerger.js +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 +25 -23
- package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
- package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
- package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMerger.js +35 -5
- package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
- package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
- package/lib/cjs/Merging/SchemaMergingVisitor.js +41 -17
- 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 +2 -0
- 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.d.ts +14 -0
- package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
- package/lib/cjs/Merging/UnitMerger.js +62 -0
- package/lib/cjs/Merging/UnitMerger.js.map +1 -0
- package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
- package/lib/cjs/Merging/Utils.d.ts +11 -0
- package/lib/cjs/Merging/Utils.d.ts.map +1 -1
- package/lib/cjs/Merging/Utils.js +22 -2
- package/lib/cjs/Merging/Utils.js.map +1 -1
- package/lib/cjs/Validation/Diagnostic.js +12 -16
- 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 +1 -1
- package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
- package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js +1 -1
- package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaCompareVisitor.js +21 -23
- package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
- package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaComparer.js +27 -5
- 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/package.json +11 -11
- package/public/locales/en/ECSchemaEditing.json +26 -26
|
@@ -1 +1 @@
|
|
|
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,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Y,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACpG,KAAK,kCAAc,CAAC,KAAK,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC5F,KAAK,kCAAc,CAAC,iBAAiB,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC/G,KAAK,kCAAc,CAAC,WAAW,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,IAAI,qBAAqB,CAAC,CAAC;IAC9E,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\
|
|
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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,iBAAiB,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YAC/G,KAAK,kCAAc,CAAC,WAAW,CAAC,CAAC,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACrG,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,IAAI,CAAC,IAAI,qBAAqB,CAAC,CAAC;IAC9E,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"]}
|
|
@@ -40,19 +40,19 @@ async function modifyConstant(context, change, itemKey) {
|
|
|
40
40
|
// Note: There are no editor methods to modify a constant.
|
|
41
41
|
if (change.difference.definition !== undefined) {
|
|
42
42
|
if (change.difference.definition !== "" && constant.definition.toLowerCase() !== change.difference.definition.toLowerCase()) {
|
|
43
|
-
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidECJson, `The Constant ${
|
|
43
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidECJson, `The Constant ${change.itemName} has an invalid 'definition' attribute.`);
|
|
44
44
|
}
|
|
45
45
|
constant.setDefinition(change.difference.definition);
|
|
46
46
|
}
|
|
47
47
|
if (change.difference.denominator !== undefined) {
|
|
48
48
|
if (constant.hasDenominator && constant.denominator !== change.difference.denominator) {
|
|
49
|
-
throw new
|
|
49
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidECJson, `The Constant ${change.itemName} has an invalid 'denominator' attribute.`);
|
|
50
50
|
}
|
|
51
51
|
constant.setDenominator(change.difference.denominator);
|
|
52
52
|
}
|
|
53
53
|
if (change.difference.numerator !== undefined) {
|
|
54
54
|
if (constant.hasNumerator && constant.numerator !== change.difference.numerator) {
|
|
55
|
-
throw new
|
|
55
|
+
throw new ecschema_metadata_1.ECObjectsError(ecschema_metadata_1.ECObjectsStatus.InvalidECJson, `The Constant ${change.itemName} has an invalid 'numerator' attribute.`);
|
|
56
56
|
}
|
|
57
57
|
constant.setNumerator(change.difference.numerator);
|
|
58
58
|
}
|
|
@@ -1 +1 @@
|
|
|
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,iCA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AAC,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,kCAAc,CAAC,mCAAe,CAAC,aAAa,EAAE,gBAAgB,MAAM,CAAC,QAAQ,wCAAwC,CAAC,CAAC;QACnI,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 ${change.itemName} 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 ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${change.itemName} has an invalid 'denominator' attribute.`);\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 ECObjectsError(ECObjectsStatus.InvalidECJson, `The Constant ${change.itemName} has an invalid 'numerator' attribute.`);\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 +1 @@
|
|
|
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":["/*---------------------------------------------------------------------------------------------\
|
|
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,
|
|
1
|
+
{"version":3,"file":"CustomAttributeMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAA2C,MAAM,0BAA0B,CAAC;AACpG,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,CA2CtH;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"}
|
|
@@ -3,11 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addCustomAttribute = addCustomAttribute;
|
|
4
4
|
exports.applyCustomAttributes = applyCustomAttributes;
|
|
5
5
|
exports.applyCustomAttribute = applyCustomAttribute;
|
|
6
|
-
/*---------------------------------------------------------------------------------------------
|
|
7
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
8
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
9
|
-
*--------------------------------------------------------------------------------------------*/
|
|
10
|
-
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
11
6
|
const Utils_1 = require("./Utils");
|
|
12
7
|
/**
|
|
13
8
|
* Merges a new CustomAttributes from Schema, items or properties into the target schema.
|
|
@@ -30,18 +25,19 @@ async function addCustomAttribute(context, change) {
|
|
|
30
25
|
await context.editor.addCustomAttribute(context.targetSchemaKey, caInstance);
|
|
31
26
|
}
|
|
32
27
|
if (change.appliedTo === "SchemaItem") {
|
|
33
|
-
const itemKey =
|
|
28
|
+
const itemKey = (0, Utils_1.toItemKey)(context, change.itemName);
|
|
34
29
|
const editor = await (0, Utils_1.getClassEditor)(context, itemKey);
|
|
35
30
|
await editor.addCustomAttribute(itemKey, caInstance);
|
|
36
31
|
}
|
|
37
32
|
if (change.appliedTo === "Property") {
|
|
38
|
-
const itemKey =
|
|
33
|
+
const itemKey = (0, Utils_1.toItemKey)(context, change.itemName);
|
|
39
34
|
const [propertyName] = change.path.split(".");
|
|
35
|
+
const propertyKey = (0, Utils_1.toPropertyKey)(context, change.itemName, propertyName);
|
|
40
36
|
const editor = await (0, Utils_1.getClassEditor)(context, itemKey);
|
|
41
|
-
await editor.properties.addCustomAttribute(itemKey, propertyName, caInstance);
|
|
37
|
+
await editor.properties.addCustomAttribute(itemKey, propertyKey.propertyName, caInstance);
|
|
42
38
|
}
|
|
43
39
|
if (change.appliedTo === "RelationshipConstraint") {
|
|
44
|
-
const itemKey =
|
|
40
|
+
const itemKey = (0, Utils_1.toItemKey)(context, change.itemName);
|
|
45
41
|
const relationshipClass = await context.targetSchema.lookupItem(itemKey);
|
|
46
42
|
if (relationshipClass === undefined) {
|
|
47
43
|
throw new Error(`Unable to locate the relationship class ${itemKey.name} in the merged schema.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomAttributeMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"CustomAttributeMerger.js","sourceRoot":"","sources":["../../../src/Merging/CustomAttributeMerger.ts"],"names":[],"mappings":";;AAeA,gDA2CC;AAKD,sDAIC;AAKD,oDAGC;AApED,mCAAkH;AAIlH;;;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,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAuB,aAAa,CAAC,CAAC;IAC9G,IAAI,0BAA0B,KAAK,SAAS,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,+CAA+C,aAAa,CAAC,IAAI,wBAAwB,CAAC,CAAC;IA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,CAAC,CAAC;QACpD,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 } from \"@itwin/ecschema-metadata\";\nimport { type SchemaMergeContext } from \"./SchemaMerger\";\nimport { type CustomAttributeDifference } from \"../Differencing/SchemaDifference\";\nimport { getClassEditor, toItemKey, toPropertyKey, 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 = toItemKey(context, change.itemName);\n const editor = await getClassEditor(context, itemKey);\n await editor.addCustomAttribute(itemKey, caInstance);\n }\n if (change.appliedTo === \"Property\") {\n const itemKey = toItemKey(context, change.itemName); \n const [propertyName] = change.path.split(\".\");\n const propertyKey = toPropertyKey(context, change.itemName, propertyName);\n const editor = await getClassEditor(context, itemKey);\n await editor.properties.addCustomAttribute(itemKey, propertyKey.propertyName, caInstance);\n }\n if (change.appliedTo === \"RelationshipConstraint\") {\n const itemKey = toItemKey(context, change.itemName);\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"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Merging
|
|
3
|
+
*/
|
|
4
|
+
import { SchemaItemKey } from "@itwin/ecschema-metadata";
|
|
5
|
+
export declare class PropertyKey {
|
|
6
|
+
readonly propertyName: string;
|
|
7
|
+
readonly classKey: SchemaItemKey;
|
|
8
|
+
get fullName(): string;
|
|
9
|
+
constructor(propertyName: string, classKey: SchemaItemKey);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export declare class NameMapping {
|
|
15
|
+
private readonly _map;
|
|
16
|
+
constructor();
|
|
17
|
+
addItemMapping(itemKey: string, newName: string): void;
|
|
18
|
+
addPropertyMapping(propertyKey: string, newName: string): void;
|
|
19
|
+
resolveItemKey(itemKey: Readonly<SchemaItemKey>): Readonly<SchemaItemKey>;
|
|
20
|
+
resolvePropertyKey(propertyKey: Readonly<PropertyKey>): Readonly<PropertyKey>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=NameMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NameMapping.d.ts","sourceRoot":"","sources":["../../../../src/Merging/Edits/NameMapping.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD,qBAAa,WAAW;IACtB,SAAgB,YAAY,EAAE,MAAM,CAAC;IACrC,SAAgB,QAAQ,EAAE,aAAa,CAAC;IAExC,IAAW,QAAQ,IAAI,MAAM,CAE5B;gBAEW,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa;CAI1D;AAED;;GAEG;AACH,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA4B;;IAM1C,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAI/C,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAIvD,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,aAAa,CAAC,GAAG,QAAQ,CAAC,aAAa,CAAC;IASzE,kBAAkB,CAAC,WAAW,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,QAAQ,CAAC,WAAW,CAAC;CAQrF"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NameMapping = exports.PropertyKey = void 0;
|
|
4
|
+
/*---------------------------------------------------------------------------------------------
|
|
5
|
+
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
6
|
+
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
7
|
+
*--------------------------------------------------------------------------------------------*/
|
|
8
|
+
/** @packageDocumentation
|
|
9
|
+
* @module Merging
|
|
10
|
+
*/
|
|
11
|
+
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
12
|
+
class PropertyKey {
|
|
13
|
+
get fullName() {
|
|
14
|
+
return `${this.classKey.fullName}.${this.propertyName}`;
|
|
15
|
+
}
|
|
16
|
+
constructor(propertyName, classKey) {
|
|
17
|
+
this.propertyName = propertyName;
|
|
18
|
+
this.classKey = classKey;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.PropertyKey = PropertyKey;
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
class NameMapping {
|
|
26
|
+
constructor() {
|
|
27
|
+
this._map = new Map();
|
|
28
|
+
}
|
|
29
|
+
addItemMapping(itemKey, newName) {
|
|
30
|
+
this._map.set(itemKey, { newName });
|
|
31
|
+
}
|
|
32
|
+
addPropertyMapping(propertyKey, newName) {
|
|
33
|
+
this._map.set(propertyKey, { newName });
|
|
34
|
+
}
|
|
35
|
+
resolveItemKey(itemKey) {
|
|
36
|
+
const entry = this._map.get(itemKey.fullName);
|
|
37
|
+
if (entry === undefined) {
|
|
38
|
+
return itemKey;
|
|
39
|
+
}
|
|
40
|
+
return new ecschema_metadata_1.SchemaItemKey(entry.newName, itemKey.schemaKey);
|
|
41
|
+
}
|
|
42
|
+
resolvePropertyKey(propertyKey) {
|
|
43
|
+
const entry = this._map.get(propertyKey.fullName);
|
|
44
|
+
if (entry === undefined) {
|
|
45
|
+
return propertyKey;
|
|
46
|
+
}
|
|
47
|
+
return new PropertyKey(entry.newName, propertyKey.classKey);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.NameMapping = NameMapping;
|
|
51
|
+
//# sourceMappingURL=NameMapping.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NameMapping.js","sourceRoot":"","sources":["../../../../src/Merging/Edits/NameMapping.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,gEAAyD;AAMzD,MAAa,WAAW;IAItB,IAAW,QAAQ;QACjB,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,IAAI,IAAI,CAAC,YAAY,EAAE,CAAC;IAC1D,CAAC;IAED,YAAY,YAAoB,EAAE,QAAuB;QACvD,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAZD,kCAYC;AAED;;GAEG;AACH,MAAa,WAAW;IAGtB;QACE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAwB,CAAC;IAC9C,CAAC;IAEM,cAAc,CAAC,OAAe,EAAE,OAAe;QACpD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IACtC,CAAC;IAEM,kBAAkB,CAAC,WAAmB,EAAE,OAAe;QAC5D,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;IAC1C,CAAC;IAEM,cAAc,CAAC,OAAgC;QACpD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC9C,IAAG,KAAK,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,iCAAa,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;IAEM,kBAAkB,CAAC,WAAkC;QAC1D,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAG,KAAK,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,WAAW,CAAC;QACrB,CAAC;QAED,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,OAAO,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;IAC9D,CAAC;CACF;AAhCD,kCAgCC","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 */\nimport { SchemaItemKey } from \"@itwin/ecschema-metadata\";\n\ninterface MappingEntry {\n readonly newName: string;\n}\n\nexport class PropertyKey {\n public readonly propertyName: string;\n public readonly classKey: SchemaItemKey;\n\n public get fullName(): string {\n return `${this.classKey.fullName}.${this.propertyName}`;\n }\n\n constructor(propertyName: string, classKey: SchemaItemKey) {\n this.propertyName = propertyName;\n this.classKey = classKey;\n }\n}\n\n/**\n * @internal\n */\nexport class NameMapping {\n private readonly _map: Map<string, MappingEntry>;\n\n constructor() {\n this._map = new Map<string, MappingEntry>();\n }\n\n public addItemMapping(itemKey: string, newName: string) {\n this._map.set(itemKey, { newName });\n }\n\n public addPropertyMapping(propertyKey: string, newName: string) {\n this._map.set(propertyKey, { newName });\n }\n\n public resolveItemKey(itemKey: Readonly<SchemaItemKey>): Readonly<SchemaItemKey> {\n const entry = this._map.get(itemKey.fullName);\n if(entry === undefined) {\n return itemKey;\n }\n\n return new SchemaItemKey(entry.newName, itemKey.schemaKey);\n }\n\n public resolvePropertyKey(propertyKey: Readonly<PropertyKey>): Readonly<PropertyKey> {\n const entry = this._map.get(propertyKey.fullName);\n if(entry === undefined) {\n return propertyKey;\n }\n\n return new PropertyKey(entry.newName, propertyKey.classKey);\n }\n}\n"]}
|
|
@@ -10,5 +10,5 @@ export declare function applyRenamePropertyEdit(result: SchemaDifferenceResult,
|
|
|
10
10
|
/**
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export declare function applyRenameSchemaItemEdit(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit
|
|
13
|
+
export declare function applyRenameSchemaItemEdit(result: SchemaDifferenceResult, edit: RenameSchemaItemEdit): void;
|
|
14
14
|
//# sourceMappingURL=RenameEditHandler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameEditHandler.d.ts","sourceRoot":"","sources":["../../../../src/Merging/Edits/RenameEditHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,
|
|
1
|
+
{"version":3,"file":"RenameEditHandler.d.ts","sourceRoot":"","sources":["../../../../src/Merging/Edits/RenameEditHandler.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAC9E,OAAO,EAAmD,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAQ9H;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,kBAAkB,QAuB/F;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,sBAAsB,EAAE,IAAI,EAAE,oBAAoB,QAuBnG"}
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.applyRenamePropertyEdit = applyRenamePropertyEdit;
|
|
11
11
|
exports.applyRenameSchemaItemEdit = applyRenameSchemaItemEdit;
|
|
12
|
-
const SchemaDifference_1 = require("../../Differencing/SchemaDifference");
|
|
13
12
|
const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
|
|
14
13
|
const Utils = require("../../Differencing/Utils");
|
|
15
14
|
/**
|
|
@@ -38,7 +37,7 @@ function applyRenamePropertyEdit(result, edit) {
|
|
|
38
37
|
/**
|
|
39
38
|
* @internal
|
|
40
39
|
*/
|
|
41
|
-
function applyRenameSchemaItemEdit(result, edit
|
|
40
|
+
function applyRenameSchemaItemEdit(result, edit) {
|
|
42
41
|
const [schemaName, itemName] = ecschema_metadata_1.SchemaItem.parseFullName(edit.key);
|
|
43
42
|
if (!result.sourceSchemaName.startsWith(schemaName)) {
|
|
44
43
|
return;
|
|
@@ -57,57 +56,6 @@ function applyRenameSchemaItemEdit(result, edit, postProcessing) {
|
|
|
57
56
|
result.conflicts.splice(conflictIndex, 1);
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
|
-
postProcessing(() => {
|
|
61
|
-
renameSchemaItem(result, edit, itemDifference.schemaType);
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
function renameSchemaItem(result, edit, schemaType) {
|
|
65
|
-
const schemaKey = ecschema_metadata_1.SchemaKey.parseString(result.sourceSchemaName);
|
|
66
|
-
const [_schemaName, itemName] = ecschema_metadata_1.SchemaItem.parseFullName(edit.key);
|
|
67
|
-
const oldKey = new ecschema_metadata_1.SchemaItemKey(itemName, schemaKey);
|
|
68
|
-
const newKey = new ecschema_metadata_1.SchemaItemKey(edit.value, schemaKey);
|
|
69
|
-
switch (schemaType) {
|
|
70
|
-
case ecschema_metadata_1.SchemaItemType.CustomAttributeClass:
|
|
71
|
-
renameCustomAttributeClassName(result, oldKey, newKey);
|
|
72
|
-
break;
|
|
73
|
-
case ecschema_metadata_1.SchemaItemType.EntityClass:
|
|
74
|
-
renameEntityClassName(result, oldKey, newKey);
|
|
75
|
-
break;
|
|
76
|
-
case ecschema_metadata_1.SchemaItemType.Enumeration:
|
|
77
|
-
renameEnumerationName(result, oldKey, newKey);
|
|
78
|
-
break;
|
|
79
|
-
case ecschema_metadata_1.SchemaItemType.Format:
|
|
80
|
-
break;
|
|
81
|
-
case ecschema_metadata_1.SchemaItemType.InvertedUnit:
|
|
82
|
-
break;
|
|
83
|
-
case ecschema_metadata_1.SchemaItemType.KindOfQuantity:
|
|
84
|
-
renameKindOfQuantityName(result, oldKey, newKey);
|
|
85
|
-
break;
|
|
86
|
-
case ecschema_metadata_1.SchemaItemType.Mixin:
|
|
87
|
-
renameMixinName(result, oldKey, newKey);
|
|
88
|
-
break;
|
|
89
|
-
case ecschema_metadata_1.SchemaItemType.Phenomenon:
|
|
90
|
-
renamePhenomenonName(result, oldKey, newKey);
|
|
91
|
-
break;
|
|
92
|
-
case ecschema_metadata_1.SchemaItemType.PropertyCategory:
|
|
93
|
-
renamePropertyCategoryName(result, oldKey, newKey);
|
|
94
|
-
break;
|
|
95
|
-
case ecschema_metadata_1.SchemaItemType.RelationshipClass:
|
|
96
|
-
renameRelationshipClassName(result, oldKey, newKey);
|
|
97
|
-
break;
|
|
98
|
-
case ecschema_metadata_1.SchemaItemType.StructClass:
|
|
99
|
-
renameStructClassName(result, oldKey, newKey);
|
|
100
|
-
break;
|
|
101
|
-
case ecschema_metadata_1.SchemaItemType.Unit:
|
|
102
|
-
break;
|
|
103
|
-
case ecschema_metadata_1.SchemaItemType.UnitSystem:
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function renameBaseClass(difference, oldKey, newKey) {
|
|
108
|
-
if (difference.baseClass && oldKey.matchesFullName(difference.baseClass)) {
|
|
109
|
-
difference.baseClass = newKey.fullName;
|
|
110
|
-
}
|
|
111
59
|
}
|
|
112
60
|
function renameName(change, oldName, newName) {
|
|
113
61
|
if (change.itemName === oldName) {
|
|
@@ -115,211 +63,4 @@ function renameName(change, oldName, newName) {
|
|
|
115
63
|
schemaItemDifference.itemName = newName;
|
|
116
64
|
}
|
|
117
65
|
}
|
|
118
|
-
function renameRelationshipConstraint(change, oldKey, newKey) {
|
|
119
|
-
if (change.schemaType === ecschema_metadata_1.SchemaItemType.RelationshipClass) {
|
|
120
|
-
const constraintProps = [change.difference.source, change.difference.target];
|
|
121
|
-
for (const props of constraintProps) {
|
|
122
|
-
if (props) {
|
|
123
|
-
if (props.abstractConstraint && oldKey.matchesFullName(props.abstractConstraint)) {
|
|
124
|
-
props.abstractConstraint = newKey.fullName;
|
|
125
|
-
}
|
|
126
|
-
if (props.constraintClasses !== undefined) {
|
|
127
|
-
for (let i = 0; i < props.constraintClasses.length; i++) {
|
|
128
|
-
if (oldKey.matchesFullName(props.constraintClasses[i]))
|
|
129
|
-
props.constraintClasses[i] = newKey.fullName;
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
for (let i = 0; i < change.difference.length; i++) {
|
|
137
|
-
if (oldKey.matchesFullName(change.difference[i]))
|
|
138
|
-
change.difference[i] = newKey.fullName;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
function renamePropertyCategoryName({ differences }, oldKey, newKey) {
|
|
143
|
-
for (const entry of differences) {
|
|
144
|
-
if (entry.schemaType === ecschema_metadata_1.SchemaItemType.PropertyCategory) {
|
|
145
|
-
renameName(entry, oldKey.name, newKey.name);
|
|
146
|
-
}
|
|
147
|
-
if (Utils.isClassDifference(entry) && entry.difference.properties) {
|
|
148
|
-
for (const property of entry.difference.properties) {
|
|
149
|
-
if (property.category && oldKey.matchesFullName(property.category)) {
|
|
150
|
-
const props = property;
|
|
151
|
-
props.category = newKey.fullName;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (entry.schemaType === SchemaDifference_1.SchemaOtherTypes.Property) {
|
|
156
|
-
if (entry.difference.category && oldKey.matchesFullName(entry.difference.category)) {
|
|
157
|
-
entry.difference.category = newKey.fullName;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
function renameKindOfQuantityName({ differences }, oldKey, newKey) {
|
|
163
|
-
for (const entry of differences) {
|
|
164
|
-
if (Utils.isClassDifference(entry) && entry.difference.properties) {
|
|
165
|
-
for (const property of entry.difference.properties) {
|
|
166
|
-
if (property.kindOfQuantity && oldKey.matchesFullName(property.kindOfQuantity)) {
|
|
167
|
-
const props = property;
|
|
168
|
-
props.kindOfQuantity = newKey.fullName;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (entry.schemaType === SchemaDifference_1.SchemaOtherTypes.Property) {
|
|
173
|
-
if (entry.difference.kindOfQuantity && oldKey.matchesFullName(entry.difference.kindOfQuantity)) {
|
|
174
|
-
entry.difference.kindOfQuantity = newKey.fullName;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function renameEnumerationName({ differences }, oldKey, newKey) {
|
|
180
|
-
for (const change of differences) {
|
|
181
|
-
if (Utils.isClassDifference(change) && change.difference.properties) {
|
|
182
|
-
for (const property of change.difference.properties) {
|
|
183
|
-
if (property.type === "PrimitiveProperty" || property.type === "PrimitiveArrayProperty") {
|
|
184
|
-
const props = property;
|
|
185
|
-
if (props.typeName && oldKey.matchesFullName(props.typeName))
|
|
186
|
-
props.typeName = newKey.fullName;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
if (change.schemaType === SchemaDifference_1.SchemaOtherTypes.Property && (change.difference.type === "PrimitiveProperty" || change.difference.type === "PrimitiveArrayProperty")) {
|
|
191
|
-
const props = change.difference;
|
|
192
|
-
if (props.typeName && oldKey.matchesFullName(props.typeName))
|
|
193
|
-
props.typeName = newKey.fullName;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
function renamePhenomenonName({ differences }, oldKey, newKey) {
|
|
198
|
-
for (const entry of differences) {
|
|
199
|
-
if (entry.schemaType === ecschema_metadata_1.SchemaItemType.Constant || entry.schemaType === ecschema_metadata_1.SchemaItemType.Unit) {
|
|
200
|
-
if (entry.difference.phenomenon && oldKey.matchesFullName(entry.difference.phenomenon))
|
|
201
|
-
entry.difference.phenomenon = newKey.fullName;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function renameStructClassName({ differences }, oldKey, newKey) {
|
|
206
|
-
for (const change of differences) {
|
|
207
|
-
if (change.schemaType === ecschema_metadata_1.SchemaItemType.StructClass) {
|
|
208
|
-
renameBaseClass(change.difference, oldKey, newKey);
|
|
209
|
-
}
|
|
210
|
-
if (Utils.isClassDifference(change) && change.difference.properties) {
|
|
211
|
-
for (const property of change.difference.properties) {
|
|
212
|
-
if (property.type === "StructProperty" || property.type === "StructArrayProperty") {
|
|
213
|
-
const props = property;
|
|
214
|
-
;
|
|
215
|
-
if (props.typeName && oldKey.matchesFullName(props.typeName))
|
|
216
|
-
props.typeName = newKey.fullName;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
if (change.schemaType === SchemaDifference_1.SchemaOtherTypes.Property && (change.difference.type === "StructProperty" || change.difference.type === "StructArrayProperty")) {
|
|
221
|
-
const props = change.difference;
|
|
222
|
-
if (props.typeName && oldKey.matchesFullName(props.typeName))
|
|
223
|
-
props.typeName = newKey.fullName;
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
function renameCustomAttributeClassName({ differences }, oldKey, newKey) {
|
|
228
|
-
for (const change of differences) {
|
|
229
|
-
if (change.schemaType === ecschema_metadata_1.SchemaItemType.CustomAttributeClass) {
|
|
230
|
-
renameBaseClass(change.difference, oldKey, newKey);
|
|
231
|
-
}
|
|
232
|
-
if (change.schemaType === SchemaDifference_1.SchemaOtherTypes.CustomAttributeInstance) {
|
|
233
|
-
if (change.difference.className && oldKey.matchesFullName(change.difference.className)) {
|
|
234
|
-
change.difference.className = newKey.fullName;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
if (change.schemaType === SchemaDifference_1.SchemaOtherTypes.Property || Utils.isClassDifference(change)) {
|
|
238
|
-
if (change.difference.customAttributes) {
|
|
239
|
-
for (const customAttribute of change.difference.customAttributes) {
|
|
240
|
-
if (oldKey.matchesFullName(customAttribute.className))
|
|
241
|
-
customAttribute.className = newKey.fullName;
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
if (Utils.isClassDifference(change) && change.difference.properties) {
|
|
246
|
-
for (const property of change.difference.properties) {
|
|
247
|
-
if (property.customAttributes) {
|
|
248
|
-
for (const customAttribute of property.customAttributes) {
|
|
249
|
-
if (oldKey.matchesFullName(customAttribute.className))
|
|
250
|
-
customAttribute.className = newKey.fullName;
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
// https://github.com/iTwin/itwinjs-core/issues/7020
|
|
256
|
-
/* if (change.schemaType === SchemaItemType.RelationshipClass) {
|
|
257
|
-
const constraintProps = [change.difference.source, change.difference.target] as Editable<RelationshipConstraintProps>[];
|
|
258
|
-
for (const props of constraintProps) {
|
|
259
|
-
if (props.customAttributes !== undefined) {
|
|
260
|
-
for (const customAttribute of props.customAttributes) {
|
|
261
|
-
if (oldKey.matchesFullName(customAttribute.className))
|
|
262
|
-
customAttribute.className = newKey.fullName;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
} */
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
function renameRelationshipClassName({ differences }, oldKey, newKey) {
|
|
270
|
-
for (const change of differences) {
|
|
271
|
-
if (change.schemaType === ecschema_metadata_1.SchemaItemType.RelationshipClass) {
|
|
272
|
-
renameBaseClass(change.difference, oldKey, newKey);
|
|
273
|
-
}
|
|
274
|
-
if (change.schemaType === SchemaDifference_1.SchemaOtherTypes.Property && change.difference.type === "NavigationProperty") {
|
|
275
|
-
const props = change.difference;
|
|
276
|
-
if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))
|
|
277
|
-
props.relationshipName = newKey.fullName;
|
|
278
|
-
}
|
|
279
|
-
if (Utils.isClassDifference(change) && change.difference.properties) {
|
|
280
|
-
for (const property of change.difference.properties) {
|
|
281
|
-
if (property.type === "NavigationProperty") {
|
|
282
|
-
const props = property;
|
|
283
|
-
if (props.relationshipName && oldKey.matchesFullName(props.relationshipName))
|
|
284
|
-
props.relationshipName = newKey.fullName;
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
if (change.schemaType === ecschema_metadata_1.SchemaItemType.RelationshipClass || change.schemaType === SchemaDifference_1.SchemaOtherTypes.RelationshipConstraintClass) {
|
|
289
|
-
renameRelationshipConstraint(change, oldKey, newKey);
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
function renameEntityClassName({ differences }, oldKey, newKey) {
|
|
294
|
-
for (const entry of differences) {
|
|
295
|
-
if (entry.schemaType === ecschema_metadata_1.SchemaItemType.EntityClass) {
|
|
296
|
-
renameName(entry, oldKey.name, newKey.name);
|
|
297
|
-
renameBaseClass(entry.difference, oldKey, newKey);
|
|
298
|
-
}
|
|
299
|
-
if (entry.schemaType === ecschema_metadata_1.SchemaItemType.Mixin) {
|
|
300
|
-
if (entry.difference.appliesTo && oldKey.matchesFullName(entry.difference.appliesTo))
|
|
301
|
-
entry.difference.appliesTo = newKey.fullName;
|
|
302
|
-
}
|
|
303
|
-
if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {
|
|
304
|
-
renameRelationshipConstraint(entry, oldKey, newKey);
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
function renameMixinName({ differences }, oldKey, newKey) {
|
|
309
|
-
for (const entry of differences) {
|
|
310
|
-
if (entry.schemaType === ecschema_metadata_1.SchemaItemType.Mixin) {
|
|
311
|
-
renameBaseClass(entry.difference, oldKey, newKey);
|
|
312
|
-
}
|
|
313
|
-
if (entry.schemaType === SchemaDifference_1.SchemaOtherTypes.EntityClassMixin) {
|
|
314
|
-
for (let i = 0; i < entry.difference.length; i++) {
|
|
315
|
-
if (oldKey.matchesFullName(entry.difference[i])) {
|
|
316
|
-
entry.difference[i] = newKey.fullName;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
if (Utils.isRelationshipClassDifference(entry) || Utils.isRelationshipConstraintClassDifference(entry)) {
|
|
321
|
-
renameRelationshipConstraint(entry, oldKey, newKey);
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
66
|
//# sourceMappingURL=RenameEditHandler.js.map
|