@itwin/ecschema-editing 4.6.0-dev.7 → 4.6.0-dev.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/lib/cjs/Differencing/SchemaConflicts.d.ts +2 -2
  2. package/lib/cjs/Differencing/SchemaConflicts.js +1 -1
  3. package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
  4. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +9 -6
  5. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  6. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +213 -161
  7. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  8. package/lib/cjs/Differencing/SchemaDifference.d.ts +354 -78
  9. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  10. package/lib/cjs/Differencing/SchemaDifference.js +184 -11
  11. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  12. package/lib/cjs/Editing/Mutable/MutableConstant.d.ts +1 -0
  13. package/lib/cjs/Editing/Mutable/MutableConstant.d.ts.map +1 -1
  14. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  15. package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts +1 -0
  16. package/lib/cjs/Editing/Mutable/MutableEnumeration.d.ts.map +1 -1
  17. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  18. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts +2 -0
  19. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -1
  20. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  21. package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts +1 -0
  22. package/lib/cjs/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -1
  23. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  24. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts +1 -0
  25. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -1
  26. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  27. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts +2 -0
  28. package/lib/cjs/Editing/Mutable/MutableSchema.d.ts.map +1 -1
  29. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  30. package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts +1 -0
  31. package/lib/cjs/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -1
  32. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  33. package/lib/cjs/Merging/CAClassMerger.d.ts +4 -7
  34. package/lib/cjs/Merging/CAClassMerger.d.ts.map +1 -1
  35. package/lib/cjs/Merging/CAClassMerger.js +26 -23
  36. package/lib/cjs/Merging/CAClassMerger.js.map +1 -1
  37. package/lib/cjs/Merging/ClassMerger.d.ts +10 -18
  38. package/lib/cjs/Merging/ClassMerger.d.ts.map +1 -1
  39. package/lib/cjs/Merging/ClassMerger.js +148 -155
  40. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  41. package/lib/cjs/Merging/ConstantMerger.d.ts +4 -8
  42. package/lib/cjs/Merging/ConstantMerger.d.ts.map +1 -1
  43. package/lib/cjs/Merging/ConstantMerger.js +59 -40
  44. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  45. package/lib/cjs/Merging/CustomAttributeMerger.d.ts +16 -13
  46. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  47. package/lib/cjs/Merging/CustomAttributeMerger.js +66 -34
  48. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  49. package/lib/cjs/Merging/EntityClassMerger.d.ts +10 -7
  50. package/lib/cjs/Merging/EntityClassMerger.d.ts.map +1 -1
  51. package/lib/cjs/Merging/EntityClassMerger.js +41 -29
  52. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  53. package/lib/cjs/Merging/EnumerationMerger.d.ts +9 -9
  54. package/lib/cjs/Merging/EnumerationMerger.d.ts.map +1 -1
  55. package/lib/cjs/Merging/EnumerationMerger.js +77 -48
  56. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  57. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +4 -11
  58. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
  59. package/lib/cjs/Merging/KindOfQuantityMerger.js +57 -53
  60. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  61. package/lib/cjs/Merging/MixinMerger.d.ts +4 -7
  62. package/lib/cjs/Merging/MixinMerger.d.ts.map +1 -1
  63. package/lib/cjs/Merging/MixinMerger.js +24 -25
  64. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  65. package/lib/cjs/Merging/PhenomenonMerger.d.ts +8 -0
  66. package/lib/cjs/Merging/PhenomenonMerger.d.ts.map +1 -0
  67. package/lib/cjs/Merging/PhenomenonMerger.js +37 -0
  68. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -0
  69. package/lib/cjs/Merging/PropertyCategoryMerger.d.ts +8 -0
  70. package/lib/cjs/Merging/PropertyCategoryMerger.d.ts.map +1 -0
  71. package/lib/cjs/Merging/PropertyCategoryMerger.js +34 -0
  72. package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -0
  73. package/lib/cjs/Merging/PropertyMerger.d.ts +6 -14
  74. package/lib/cjs/Merging/PropertyMerger.d.ts.map +1 -1
  75. package/lib/cjs/Merging/PropertyMerger.js +212 -287
  76. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  77. package/lib/cjs/Merging/RelationshipClassMerger.d.ts +16 -10
  78. package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
  79. package/lib/cjs/Merging/RelationshipClassMerger.js +121 -112
  80. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  81. package/lib/cjs/Merging/SchemaItemMerger.d.ts +26 -51
  82. package/lib/cjs/Merging/SchemaItemMerger.d.ts.map +1 -1
  83. package/lib/cjs/Merging/SchemaItemMerger.js +106 -88
  84. package/lib/cjs/Merging/SchemaItemMerger.js.map +1 -1
  85. package/lib/cjs/Merging/SchemaMerger.d.ts +21 -9
  86. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  87. package/lib/cjs/Merging/SchemaMerger.js +74 -88
  88. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  89. package/lib/cjs/Merging/SchemaReferenceMerger.d.ts +5 -5
  90. package/lib/cjs/Merging/SchemaReferenceMerger.d.ts.map +1 -1
  91. package/lib/cjs/Merging/SchemaReferenceMerger.js +33 -15
  92. package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
  93. package/lib/cjs/Merging/UnitSystemMerger.d.ts +8 -0
  94. package/lib/cjs/Merging/UnitSystemMerger.d.ts.map +1 -0
  95. package/lib/cjs/Merging/UnitSystemMerger.js +26 -0
  96. package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -0
  97. package/lib/cjs/Validation/ECRules.js +1 -1
  98. package/lib/cjs/Validation/ECRules.js.map +1 -1
  99. package/lib/cjs/Validation/SchemaChanges.js +1 -1
  100. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  101. package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
  102. package/lib/cjs/Validation/SchemaComparer.js +3 -3
  103. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  104. package/package.json +9 -9
  105. package/lib/cjs/Merging/SchemaItemFactory.d.ts +0 -15
  106. package/lib/cjs/Merging/SchemaItemFactory.d.ts.map +0 -1
  107. package/lib/cjs/Merging/SchemaItemFactory.js +0 -82
  108. package/lib/cjs/Merging/SchemaItemFactory.js.map +0 -1
  109. package/lib/cjs/Merging/StructClassMerger.d.ts +0 -10
  110. package/lib/cjs/Merging/StructClassMerger.d.ts.map +0 -1
  111. package/lib/cjs/Merging/StructClassMerger.js +0 -13
  112. package/lib/cjs/Merging/StructClassMerger.js.map +0 -1
@@ -7,11 +7,27 @@
7
7
  * @module Differencing
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.SchemaDifference = void 0;
10
+ exports.SchemaDifference = exports.SchemaOtherTypes = void 0;
11
11
  const SchemaComparer_1 = require("../Validation/SchemaComparer");
12
12
  const SchemaDiagnosticVisitor_1 = require("./SchemaDiagnosticVisitor");
13
+ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
13
14
  /**
14
- * @internal
15
+ * Defines the SchemaTypes that are not SchemaItems.
16
+ * @alpha
17
+ */
18
+ var SchemaOtherTypes;
19
+ (function (SchemaOtherTypes) {
20
+ SchemaOtherTypes["Schema"] = "Schema";
21
+ SchemaOtherTypes["SchemaReference"] = "SchemaReference";
22
+ SchemaOtherTypes["Property"] = "Property";
23
+ SchemaOtherTypes["Enumerator"] = "Enumerator";
24
+ SchemaOtherTypes["CustomAttributeInstance"] = "CustomAttributeInstance";
25
+ SchemaOtherTypes["RelationshipConstraint"] = "RelationshipConstraint";
26
+ SchemaOtherTypes["RelationshipConstraintClass"] = "RelationshipConstraintClass";
27
+ SchemaOtherTypes["EntityClassMixin"] = "EntityClassMixin";
28
+ })(SchemaOtherTypes = exports.SchemaOtherTypes || (exports.SchemaOtherTypes = {}));
29
+ /**
30
+ * @alpha
15
31
  */
16
32
  var SchemaDifference;
17
33
  (function (SchemaDifference) {
@@ -20,7 +36,7 @@ var SchemaDifference;
20
36
  * @param targetSchema The schema the differences gets merged into.
21
37
  * @param sourceSchema The schema to get merged in the target.
22
38
  * @returns An [[SchemaDifference]] object.
23
- * @internal
39
+ * @alpha
24
40
  */
25
41
  async function fromSchemas(targetSchema, sourceSchema) {
26
42
  const changesList = [];
@@ -37,18 +53,175 @@ var SchemaDifference;
37
53
  * @internal
38
54
  */
39
55
  async function fromSchemaChanges(targetSchema, schemaChanges) {
40
- const schemaDifference = {
41
- sourceSchemaName: schemaChanges.schema.schemaKey.toString(),
42
- targetSchemaName: targetSchema.schemaKey.toString(),
43
- changes: [],
44
- conflicts: [],
45
- };
46
- const visitor = new SchemaDiagnosticVisitor_1.SchemaDiagnosticVisitor(schemaDifference);
56
+ const visitor = new SchemaDiagnosticVisitor_1.SchemaDiagnosticVisitor();
47
57
  for (const diagnostic of schemaChanges.allDiagnostics) {
48
58
  visitor.visit(diagnostic);
49
59
  }
50
- return schemaDifference;
60
+ const changes = [
61
+ ...visitor.schemaChanges,
62
+ ...visitor.schemaItemChanges,
63
+ ...visitor.schemaItemPathChanges,
64
+ ...visitor.customAttributeChanges,
65
+ ];
66
+ return {
67
+ sourceSchemaName: schemaChanges.schema.schemaKey.toString(),
68
+ targetSchemaName: targetSchema.schemaKey.toString(),
69
+ changes: changes.length > 0 ? changes : undefined,
70
+ conflicts: visitor.conflicts.length > 0 ? visitor.conflicts : undefined,
71
+ };
51
72
  }
52
73
  SchemaDifference.fromSchemaChanges = fromSchemaChanges;
74
+ /**
75
+ * Indicates whether the given difference is type of ConstantDifference.
76
+ * @alpha
77
+ */
78
+ function isConstantDifference(difference) {
79
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.Constant;
80
+ }
81
+ SchemaDifference.isConstantDifference = isConstantDifference;
82
+ /**
83
+ * Indicates whether the given difference is type of ClassPropertyDifference.
84
+ * @alpha
85
+ */
86
+ function isClassPropertyDifference(difference) {
87
+ return difference.schemaType === SchemaOtherTypes.Property;
88
+ }
89
+ SchemaDifference.isClassPropertyDifference = isClassPropertyDifference;
90
+ /**
91
+ * Indicates whether the given difference is type of CustomAttributeClassDifference.
92
+ * @alpha
93
+ */
94
+ function isCustomAttributeClassDifference(difference) {
95
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.CustomAttributeClass;
96
+ }
97
+ SchemaDifference.isCustomAttributeClassDifference = isCustomAttributeClassDifference;
98
+ /**
99
+ * Indicates whether the given difference is type of CustomAttributeDifference.
100
+ * @alpha
101
+ */
102
+ function isCustomAttributeDifference(difference) {
103
+ return difference.schemaType === SchemaOtherTypes.CustomAttributeInstance;
104
+ }
105
+ SchemaDifference.isCustomAttributeDifference = isCustomAttributeDifference;
106
+ /**
107
+ * Indicates whether the given difference is type of EntityClassDifference.
108
+ * @alpha
109
+ */
110
+ function isEntityClassDifference(difference) {
111
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.EntityClass;
112
+ }
113
+ SchemaDifference.isEntityClassDifference = isEntityClassDifference;
114
+ /**
115
+ * Indicates whether the given difference is type of EntityClassMixinDifference.
116
+ * @alpha
117
+ */
118
+ function isEntityClassMixinDifference(difference) {
119
+ return difference.schemaType === SchemaOtherTypes.EntityClassMixin;
120
+ }
121
+ SchemaDifference.isEntityClassMixinDifference = isEntityClassMixinDifference;
122
+ /**
123
+ * Indicates whether the given difference is type of EnumerationDifference.
124
+ * @alpha
125
+ */
126
+ function isEnumerationDifference(difference) {
127
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.Enumeration;
128
+ }
129
+ SchemaDifference.isEnumerationDifference = isEnumerationDifference;
130
+ /**
131
+ * Indicates whether the given difference is type of EnumeratorDifference.
132
+ * @alpha
133
+ */
134
+ function isEnumeratorDifference(difference) {
135
+ return difference.schemaType === SchemaOtherTypes.Enumerator;
136
+ }
137
+ SchemaDifference.isEnumeratorDifference = isEnumeratorDifference;
138
+ /**
139
+ * Indicates whether the given difference is type of KindOfQuantityDifference.
140
+ * @alpha
141
+ */
142
+ function isKindOfQuantityDifference(difference) {
143
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.KindOfQuantity;
144
+ }
145
+ SchemaDifference.isKindOfQuantityDifference = isKindOfQuantityDifference;
146
+ /**
147
+ * Indicates whether the given difference is type of MixinClassDifference.
148
+ * @alpha
149
+ */
150
+ function isMixinClassDifference(difference) {
151
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.Mixin;
152
+ }
153
+ SchemaDifference.isMixinClassDifference = isMixinClassDifference;
154
+ /**
155
+ * Indicates whether the given difference is type of PhenomenonDifference.
156
+ * @alpha
157
+ */
158
+ function isPhenomenonDifference(difference) {
159
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.Phenomenon;
160
+ }
161
+ SchemaDifference.isPhenomenonDifference = isPhenomenonDifference;
162
+ /**
163
+ * Indicates whether the given difference is type of PropertyCategoryDifference.
164
+ * @alpha
165
+ */
166
+ function isPropertyCategoryDifference(difference) {
167
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.PropertyCategory;
168
+ }
169
+ SchemaDifference.isPropertyCategoryDifference = isPropertyCategoryDifference;
170
+ /**
171
+ * Indicates whether the given difference is type of SchemaDifference.
172
+ * @alpha
173
+ */
174
+ function isSchemaDifference(difference) {
175
+ return difference.schemaType === SchemaOtherTypes.Schema;
176
+ }
177
+ SchemaDifference.isSchemaDifference = isSchemaDifference;
178
+ /**
179
+ * Indicates whether the given difference is type of SchemaReferenceDifference.
180
+ * @alpha
181
+ */
182
+ function isSchemaReferenceDifference(difference) {
183
+ return difference.schemaType === SchemaOtherTypes.SchemaReference;
184
+ }
185
+ SchemaDifference.isSchemaReferenceDifference = isSchemaReferenceDifference;
186
+ /**
187
+ * Indicates whether the given difference is type of CustomAttributeDifference.
188
+ * @alpha
189
+ */
190
+ function isStructClassDifference(difference) {
191
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.StructClass;
192
+ }
193
+ SchemaDifference.isStructClassDifference = isStructClassDifference;
194
+ /**
195
+ * Indicates whether the given difference is type of UnitSystemDifference.
196
+ * @alpha
197
+ */
198
+ function isUnitSystemDifference(difference) {
199
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.UnitSystem;
200
+ }
201
+ SchemaDifference.isUnitSystemDifference = isUnitSystemDifference;
202
+ /**
203
+ * Indicates whether the given difference is type of RelationshipClassDifference.
204
+ * @alpha
205
+ */
206
+ function isRelationshipClassDifference(difference) {
207
+ return difference.schemaType === ecschema_metadata_1.SchemaItemType.RelationshipClass;
208
+ }
209
+ SchemaDifference.isRelationshipClassDifference = isRelationshipClassDifference;
210
+ /**
211
+ * Indicates whether the given difference is type of RelationshipConstraintDifference.
212
+ * @alpha
213
+ */
214
+ function isRelationshipConstraintDifference(difference) {
215
+ return difference.schemaType === SchemaOtherTypes.RelationshipConstraint;
216
+ }
217
+ SchemaDifference.isRelationshipConstraintDifference = isRelationshipConstraintDifference;
218
+ /**
219
+ * Indicates whether the given difference is type of RelationshipConstraintClassDifference.
220
+ * @alpha
221
+ */
222
+ function isRelationshipConstraintClassDifference(difference) {
223
+ return difference.schemaType === SchemaOtherTypes.RelationshipConstraintClass;
224
+ }
225
+ SchemaDifference.isRelationshipConstraintClassDifference = isRelationshipConstraintClassDifference;
53
226
  })(SchemaDifference = exports.SchemaDifference || (exports.SchemaDifference = {}));
54
227
  //# sourceMappingURL=SchemaDifference.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,iEAA8D;AAE9D,uEAAoE;AAsCpE;;GAEG;AACH,IAAiB,gBAAgB,CAsChC;AAtCD,WAAiB,gBAAgB;IAC/B;;;;;;OAMG;IACI,KAAK,UAAU,WAAW,CAAC,YAAoB,EAAE,YAAoB;QAC1E,MAAM,WAAW,GAAoB,EAAE,CAAC;QACxC,MAAM,cAAc,GAAG,IAAI,+BAAc,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC1F,MAAM,cAAc,CAAC,cAAc,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;QAEhE,OAAO,iBAAiB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,CAAC;IANqB,4BAAW,cAMhC,CAAA;IAED;;;;;;OAMG;IACI,KAAK,UAAU,iBAAiB,CAAC,YAAoB,EAAE,aAA4B;QACxF,MAAM,gBAAgB,GAAsB;YAC1C,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE;YAC3D,gBAAgB,EAAE,YAAY,CAAC,SAAS,CAAC,QAAQ,EAAE;YACnD,OAAO,EAAE,EAAE;YACX,SAAS,EAAE,EAAE;SACd,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,iDAAuB,CAAC,gBAAgB,CAAC,CAAC;QAC9D,KAAI,MAAM,UAAU,IAAI,aAAa,CAAC,cAAc,EAAE;YACpD,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;SAC3B;QAED,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAdqB,kCAAiB,oBActC,CAAA;AACH,CAAC,EAtCgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAsChC","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 Differencing\r\n */\r\n\r\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\r\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\r\nimport { SchemaDifferenceConflict } from \"./SchemaConflicts\";\r\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\r\nimport type {\r\n AnyEnumerator, AnyPropertyProps, AnySchemaItemProps, CustomAttribute, RelationshipConstraintProps, Schema,\r\n SchemaProps, SchemaReferenceProps,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * Defines the type of the difference operation.\r\n * @internal\r\n */\r\nexport type DifferenceType = \"add\" | \"modify\";\r\n\r\n/**\r\n * Defines a set of SchemaItem names.\r\n * @internal\r\n */\r\nexport type SchemaItemTypeName =\r\n \"EntityClass\" |\r\n \"Mixin\" |\r\n \"StructClass\" |\r\n \"CustomAttributeClass\" |\r\n \"RelationshipClass\" |\r\n \"Enumeration\" |\r\n \"KindOfQuantity\" |\r\n \"PropertyCategory\" |\r\n \"Unit\" |\r\n \"InvertedUnit\" |\r\n \"Constant\" |\r\n \"Phenomenon\" |\r\n \"UnitSystem\" |\r\n \"Format\";\r\n\r\n/**\r\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\r\n * @internal\r\n */\r\nexport type SchemaType = \"Schema\" | SchemaItemTypeName | \"Property\" | \"RelationshipConstraint\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport namespace SchemaDifference {\r\n /**\r\n * Creates a [[SchemaDifference]] for two given schemas.\r\n * @param targetSchema The schema the differences gets merged into.\r\n * @param sourceSchema The schema to get merged in the target.\r\n * @returns An [[SchemaDifference]] object.\r\n * @internal\r\n */\r\n export async function fromSchemas(targetSchema: Schema, sourceSchema: Schema): Promise<SchemaDifferences> {\r\n const changesList: SchemaChanges[] = [];\r\n const schemaComparer = new SchemaComparer({ report: changesList.push.bind(changesList) });\r\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\r\n\r\n return fromSchemaChanges(targetSchema, changesList[0]);\r\n }\r\n\r\n /**\r\n * Creates a [[SchemaDifference]] for a given [[SchemaChanges]] report.\r\n * @param targetSchema\r\n * @param schemaChanges A changes report of two schemas.\r\n * @returns An [[SchemaDifference]] object.\r\n * @internal\r\n */\r\n export async function fromSchemaChanges(targetSchema: Schema, schemaChanges: SchemaChanges): Promise<SchemaDifferences> {\r\n const schemaDifference: SchemaDifferences = {\r\n sourceSchemaName: schemaChanges.schema.schemaKey.toString(),\r\n targetSchemaName: targetSchema.schemaKey.toString(),\r\n changes: [],\r\n conflicts: [],\r\n };\r\n\r\n const visitor = new SchemaDiagnosticVisitor(schemaDifference);\r\n for(const diagnostic of schemaChanges.allDiagnostics) {\r\n visitor.visit(diagnostic);\r\n }\r\n\r\n return schemaDifference;\r\n }\r\n}\r\n\r\ntype MutualPartial<T> = {\r\n -readonly [P in keyof T]?: T[P];\r\n};\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaDifferences {\r\n\r\n readonly sourceSchemaName: string;\r\n readonly targetSchemaName: string;\r\n\r\n readonly changes: AnySchemaDifference[];\r\n readonly conflicts: SchemaDifferenceConflict[];\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport type AnySchemaDifference =\r\n SchemaDifference |\r\n SchemaItemDifference |\r\n SchemaPropertyDifference |\r\n SchemaReferenceDifference |\r\n SchemaEnumeratorDifference |\r\n SchemaClassMixinDifference |\r\n SchemaRelationshipConstraintDifference |\r\n SchemaRelationshipConstraintClassDifference |\r\n SchemaCustomAttributeDifference;\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaDifference {\r\n changeType: \"modify\";\r\n schemaType: \"Schema\";\r\n itemName?: undefined;\r\n path?: undefined;\r\n json: MutualPartial<SchemaProps>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaItemDifference<T extends AnySchemaItemProps = AnySchemaItemProps> {\r\n changeType: \"add\" | \"modify\" | \"remove\";\r\n schemaType: SchemaItemTypeName;\r\n itemName: string;\r\n path?: string;\r\n json: MutualPartial<T>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaPropertyDifference<T extends AnyPropertyProps = AnyPropertyProps> {\r\n changeType: \"add\" | \"modify\" | \"remove\";\r\n schemaType: \"Property\";\r\n itemName: string;\r\n path: string;\r\n json: MutualPartial<T>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaReferenceDifference {\r\n changeType: \"add\" | \"modify\" | \"remove\";\r\n schemaType: \"Schema\";\r\n itemName?: undefined;\r\n path: \"$references\";\r\n json: MutualPartial<SchemaReferenceProps>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaEnumeratorDifference {\r\n changeType: \"add\" | \"modify\" | \"remove\";\r\n schemaType: \"Enumeration\";\r\n itemName: string;\r\n path: string;\r\n json: MutualPartial<AnyEnumerator>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaClassMixinDifference {\r\n changeType: \"modify\";\r\n schemaType: \"EntityClass\";\r\n itemName: string;\r\n path: \"$mixins\";\r\n json: string[];\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaRelationshipConstraintDifference {\r\n changeType: \"modify\";\r\n schemaType: \"RelationshipConstraint\";\r\n itemName: string;\r\n path: string;\r\n json: MutualPartial<RelationshipConstraintProps>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaRelationshipConstraintClassDifference {\r\n changeType: \"modify\";\r\n schemaType: \"RelationshipClass\";\r\n itemName: string;\r\n path: string;\r\n json: string[];\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport interface SchemaCustomAttributeDifference {\r\n changeType: \"add\" | \"modify\";\r\n schemaType: \"Schema\" | \"EnitityClass\" | \"Properties\" | \"RelationshipConstraint\";\r\n itemName?: string;\r\n path?: string;\r\n json: MutualPartial<CustomAttribute>;\r\n}\r\n"]}
1
+ {"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,iEAA8D;AAE9D,uEAAoE;AACpE,gEAKkC;AAsBlC;;;GAGG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,uDAAmC,CAAA;IACnC,yCAAqB,CAAA;IACrB,6CAAyB,CAAA;IACzB,uEAAmD,CAAA;IACnD,qEAAiD,CAAA;IACjD,+EAA2D,CAAA;IAC3D,yDAAqC,CAAA;AACvC,CAAC,EATW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAS3B;AAQD;;GAEG;AACH,IAAiB,gBAAgB,CAoMhC;AApMD,WAAiB,gBAAgB;IAC/B;;;;;;OAMG;IACI,KAAK,UAAU,WAAW,CAAC,YAAoB,EAAE,YAAoB;QAC1E,MAAM,WAAW,GAAoB,EAA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ED;;;OAGG;IACH,SAAgB,kCAAkC,CAAC,UAA+B;QAChF,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,sBAAsB,CAAC;IAC3E,CAAC;IAFe,mDAAkC,qCAEjD,CAAA;IAED;;;OAGG;IACH,SAAgB,uCAAuC,CAAC,UAA+B;QACrF,OAAO,UAAU,CAAC,UAAU,KAAK,gBAAgB,CAAC,2BAA2B,CAAC;IAChF,CAAC;IAFe,wDAAuC,0CAEtD,CAAA;AAEH,CAAC,EApMgB,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAoMhC","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 Differencing\r\n */\r\n\r\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\r\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\r\nimport { SchemaDifferenceConflict } from \"./SchemaConflicts\";\r\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\r\nimport {\r\n AnyEnumerator, AnyPropertyProps, ConstantProps, CustomAttribute,\r\n CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\r\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\r\n type Schema, SchemaItemFormatProps, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/** Utility-Type to remove possible readonly flags on the given type. */\r\ntype PartialEditable<T> = {\r\n -readonly [P in keyof T]?: T[P];\r\n};\r\n\r\n/**\r\n * Utility-Type to simplify the expected SchemaItem props by omitting the base properties\r\n * that are not needed for the schema differencing. Also all properties are made mutable\r\n * by removing the readonly flag if present.\r\n */\r\ntype SchemaItemProperties<T extends SchemaItemProps> = {\r\n [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, \"label\" | \"description\" | \"customAttributes\">>>]: T[P]\r\n};\r\n\r\n/**\r\n * Defines the type of the difference operation.\r\n * @alpha\r\n */\r\nexport type DifferenceType = \"add\" | \"modify\";\r\n\r\n/**\r\n * Defines the SchemaTypes that are not SchemaItems.\r\n * @alpha\r\n */\r\nexport enum SchemaOtherTypes {\r\n Schema = \"Schema\",\r\n SchemaReference = \"SchemaReference\",\r\n Property = \"Property\",\r\n Enumerator = \"Enumerator\",\r\n CustomAttributeInstance = \"CustomAttributeInstance\",\r\n RelationshipConstraint = \"RelationshipConstraint\",\r\n RelationshipConstraintClass = \"RelationshipConstraintClass\",\r\n EntityClassMixin = \"EntityClassMixin\",\r\n}\r\n\r\n/**\r\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\r\n * @alpha\r\n */\r\nexport type SchemaType = SchemaOtherTypes | SchemaItemType;\r\n\r\n/**\r\n * @alpha\r\n */\r\nexport namespace SchemaDifference {\r\n /**\r\n * Creates a [[SchemaDifference]] for two given schemas.\r\n * @param targetSchema The schema the differences gets merged into.\r\n * @param sourceSchema The schema to get merged in the target.\r\n * @returns An [[SchemaDifference]] object.\r\n * @alpha\r\n */\r\n export async function fromSchemas(targetSchema: Schema, sourceSchema: Schema): Promise<SchemaDifferences> {\r\n const changesList: SchemaChanges[] = [];\r\n const schemaComparer = new SchemaComparer({ report: changesList.push.bind(changesList) });\r\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\r\n\r\n return fromSchemaChanges(targetSchema, changesList[0]);\r\n }\r\n\r\n /**\r\n * Creates a [[SchemaDifference]] for a given [[SchemaChanges]] report.\r\n * @param targetSchema\r\n * @param schemaChanges A changes report of two schemas.\r\n * @returns An [[SchemaDifference]] object.\r\n * @internal\r\n */\r\n export async function fromSchemaChanges(targetSchema: Schema, schemaChanges: SchemaChanges): Promise<SchemaDifferences> {\r\n const visitor = new SchemaDiagnosticVisitor();\r\n for (const diagnostic of schemaChanges.allDiagnostics) {\r\n visitor.visit(diagnostic);\r\n }\r\n\r\n const changes: AnySchemaDifference[] = [\r\n ...visitor.schemaChanges,\r\n ...visitor.schemaItemChanges,\r\n ...visitor.schemaItemPathChanges,\r\n ...visitor.customAttributeChanges,\r\n ];\r\n\r\n return {\r\n sourceSchemaName: schemaChanges.schema.schemaKey.toString(),\r\n targetSchemaName: targetSchema.schemaKey.toString(),\r\n changes: changes.length > 0 ? changes : undefined,\r\n conflicts: visitor.conflicts.length > 0 ? visitor.conflicts : undefined,\r\n };\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of ConstantDifference.\r\n * @alpha\r\n */\r\n export function isConstantDifference(difference: AnySchemaDifference): difference is ConstantDifference {\r\n return difference.schemaType === SchemaItemType.Constant;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of ClassPropertyDifference.\r\n * @alpha\r\n */\r\n export function isClassPropertyDifference(difference: AnySchemaDifference): difference is ClassPropertyDifference {\r\n return difference.schemaType === SchemaOtherTypes.Property;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of CustomAttributeClassDifference.\r\n * @alpha\r\n */\r\n export function isCustomAttributeClassDifference(difference: AnySchemaDifference): difference is CustomAttributeClassDifference {\r\n return difference.schemaType === SchemaItemType.CustomAttributeClass;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of CustomAttributeDifference.\r\n * @alpha\r\n */\r\n export function isCustomAttributeDifference(difference: AnySchemaDifference): difference is CustomAttributeDifference {\r\n return difference.schemaType === SchemaOtherTypes.CustomAttributeInstance;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of EntityClassDifference.\r\n * @alpha\r\n */\r\n export function isEntityClassDifference(difference: AnySchemaDifference): difference is EntityClassDifference {\r\n return difference.schemaType === SchemaItemType.EntityClass;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of EntityClassMixinDifference.\r\n * @alpha\r\n */\r\n export function isEntityClassMixinDifference(difference: AnySchemaDifference): difference is EntityClassMixinDifference {\r\n return difference.schemaType === SchemaOtherTypes.EntityClassMixin;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of EnumerationDifference.\r\n * @alpha\r\n */\r\n export function isEnumerationDifference(difference: AnySchemaDifference): difference is EnumerationDifference {\r\n return difference.schemaType === SchemaItemType.Enumeration;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of EnumeratorDifference.\r\n * @alpha\r\n */\r\n export function isEnumeratorDifference(difference: AnySchemaDifference): difference is EnumeratorDifference {\r\n return difference.schemaType === SchemaOtherTypes.Enumerator;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of KindOfQuantityDifference.\r\n * @alpha\r\n */\r\n export function isKindOfQuantityDifference(difference: AnySchemaDifference): difference is KindOfQuantityDifference {\r\n return difference.schemaType === SchemaItemType.KindOfQuantity;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of MixinClassDifference.\r\n * @alpha\r\n */\r\n export function isMixinClassDifference(difference: AnySchemaDifference): difference is MixinClassDifference {\r\n return difference.schemaType === SchemaItemType.Mixin;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of PhenomenonDifference.\r\n * @alpha\r\n */\r\n export function isPhenomenonDifference(difference: AnySchemaDifference): difference is PhenomenonDifference {\r\n return difference.schemaType === SchemaItemType.Phenomenon;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of PropertyCategoryDifference.\r\n * @alpha\r\n */\r\n export function isPropertyCategoryDifference(difference: AnySchemaDifference): difference is PropertyCategoryDifference {\r\n return difference.schemaType === SchemaItemType.PropertyCategory;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of SchemaDifference.\r\n * @alpha\r\n */\r\n export function isSchemaDifference(difference: AnySchemaDifference): difference is SchemaDifference {\r\n return difference.schemaType === SchemaOtherTypes.Schema;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of SchemaReferenceDifference.\r\n * @alpha\r\n */\r\n export function isSchemaReferenceDifference(difference: AnySchemaDifference): difference is SchemaReferenceDifference {\r\n return difference.schemaType === SchemaOtherTypes.SchemaReference;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of CustomAttributeDifference.\r\n * @alpha\r\n */\r\n export function isStructClassDifference(difference: AnySchemaDifference): difference is StructClassDifference {\r\n return difference.schemaType === SchemaItemType.StructClass;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of UnitSystemDifference.\r\n * @alpha\r\n */\r\n export function isUnitSystemDifference(difference: AnySchemaDifference): difference is UnitSystemDifference {\r\n return difference.schemaType === SchemaItemType.UnitSystem;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of RelationshipClassDifference.\r\n * @alpha\r\n */\r\n export function isRelationshipClassDifference(difference: AnySchemaDifference): difference is RelationshipClassDifference {\r\n return difference.schemaType === SchemaItemType.RelationshipClass;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of RelationshipConstraintDifference.\r\n * @alpha\r\n */\r\n export function isRelationshipConstraintDifference(difference: AnySchemaDifference): difference is RelationshipConstraintDifference {\r\n return difference.schemaType === SchemaOtherTypes.RelationshipConstraint;\r\n }\r\n\r\n /**\r\n * Indicates whether the given difference is type of RelationshipConstraintClassDifference.\r\n * @alpha\r\n */\r\n export function isRelationshipConstraintClassDifference(difference: AnySchemaDifference): difference is RelationshipConstraintClassDifference {\r\n return difference.schemaType === SchemaOtherTypes.RelationshipConstraintClass;\r\n }\r\n\r\n}\r\n\r\n/**\r\n * Definition of the differences between two Schemas.\r\n * @alpha\r\n */\r\nexport interface SchemaDifferences {\r\n /** Full name of the source schema */\r\n readonly sourceSchemaName: string;\r\n /** Full name of the target schema */\r\n readonly targetSchemaName: string;\r\n\r\n /** List of differences between the compared schemas. */\r\n readonly changes?: AnySchemaDifference[];\r\n /** List of conflicts found while comparing the schemas. */\r\n readonly conflicts?: SchemaDifferenceConflict[];\r\n}\r\n\r\n/**\r\n * Union of all supported schema differencing types.\r\n * @alpha\r\n */\r\nexport type AnySchemaDifference =\r\n SchemaDifference |\r\n SchemaReferenceDifference |\r\n AnySchemaItemDifference |\r\n AnySchemaItemPathDifference |\r\n CustomAttributeDifference;\r\n\r\n/**\r\n * Differencing entry for changes on a Schema.\r\n * @alpha\r\n */\r\nexport interface SchemaDifference {\r\n readonly changeType: \"modify\";\r\n readonly schemaType: SchemaOtherTypes.Schema;\r\n readonly difference: {\r\n label?: string;\r\n description?: string;\r\n };\r\n}\r\n\r\n/**\r\n * Differencing entry for added or changed Schema References of a Schema.\r\n * @alpha\r\n */\r\nexport interface SchemaReferenceDifference {\r\n readonly changeType: \"add\" | \"modify\";\r\n readonly schemaType: SchemaOtherTypes.SchemaReference;\r\n readonly difference: SchemaReferenceProps;\r\n}\r\n\r\n/**\r\n * Union of all supported schema item differencing types.\r\n * @alpha\r\n */\r\nexport type AnySchemaItemDifference =\r\n ClassItemDifference |\r\n ConstantDifference |\r\n EnumerationDifference |\r\n EntityClassMixinDifference |\r\n FormatDifference |\r\n KindOfQuantityDifference |\r\n InvertedUnitDifference |\r\n PhenomenonDifference |\r\n PropertyCategoryDifference |\r\n UnitDifference |\r\n UnitSystemDifference;\r\n\r\n/**\r\n * Union for supported class Schema Items.\r\n * @internal\r\n */\r\nexport type ClassItemDifference =\r\n EntityClassDifference |\r\n MixinClassDifference |\r\n StructClassDifference |\r\n CustomAttributeClassDifference |\r\n RelationshipClassDifference;\r\n\r\n/**\r\n * Union of all differences that have a path pointing inside a schema item.\r\n * @alpha\r\n */\r\nexport type AnySchemaItemPathDifference =\r\n RelationshipConstraintDifference |\r\n RelationshipConstraintClassDifference |\r\n CustomAttributePropertyDifference |\r\n EnumeratorDifference |\r\n ClassPropertyDifference;\r\n\r\n/**\r\n * Internal base class for all Schema Item differencing entries.\r\n * @alpha\r\n */\r\ninterface SchemaItemDifference<T extends SchemaItemProps> {\r\n readonly changeType: \"add\" | \"modify\";\r\n readonly itemName: string;\r\n readonly difference: SchemaItemProperties<T>;\r\n}\r\n\r\n/**\r\n * Differencing entry for Constant Schema Items.\r\n * @alpha\r\n */\r\nexport interface ConstantDifference extends SchemaItemDifference<ConstantProps> {\r\n readonly schemaType: SchemaItemType.Constant;\r\n}\r\n\r\n/**\r\n * Differencing entry for Custom Attribute Class Schema Items.\r\n * @alpha\r\n */\r\nexport interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {\r\n readonly schemaType: SchemaItemType.CustomAttributeClass;\r\n}\r\n\r\n/**\r\n * Differencing entry for Entity Class Schema Items.\r\n * @alpha\r\n */\r\nexport interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {\r\n readonly schemaType: SchemaItemType.EntityClass;\r\n}\r\n\r\n/**\r\n * Differencing entry for Enumerator Schema Items.\r\n * @alpha\r\n */\r\nexport interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {\r\n readonly schemaType: SchemaItemType.Enumeration;\r\n}\r\n\r\n/**\r\n * Differencing entry for Kind-Of-Quantities Schema Items.\r\n * @alpha\r\n */\r\nexport interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {\r\n readonly schemaType: SchemaItemType.KindOfQuantity;\r\n}\r\n\r\n/**\r\n * Differencing entry for Mixin Class Schema Items.\r\n * @alpha\r\n */\r\nexport interface MixinClassDifference extends SchemaItemDifference<MixinProps> {\r\n readonly schemaType: SchemaItemType.Mixin;\r\n}\r\n\r\n/**\r\n * Differencing entry for Phenomenon Schema Items.\r\n * @alpha\r\n */\r\nexport interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {\r\n readonly schemaType: SchemaItemType.Phenomenon;\r\n}\r\n\r\n/**\r\n * Differencing entry for Property Category Schema Items.\r\n * @alpha\r\n */\r\nexport interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {\r\n readonly schemaType: SchemaItemType.PropertyCategory;\r\n}\r\n\r\n/**\r\n * Differencing entry for Relationship Class Schema Items.\r\n * @alpha\r\n */\r\nexport interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {\r\n readonly schemaType: SchemaItemType.RelationshipClass;\r\n}\r\n\r\n/**\r\n * Differencing entry for Struct Class Schema Items.\r\n * @alpha\r\n */\r\nexport interface StructClassDifference extends SchemaItemDifference<StructClassProps> {\r\n readonly schemaType: SchemaItemType.StructClass;\r\n}\r\n\r\n/**\r\n * Differencing entry for Unit System Schema Items.\r\n * @alpha\r\n */\r\nexport interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {\r\n readonly schemaType: SchemaItemType.UnitSystem;\r\n}\r\n\r\n/**\r\n * Differencing entry for Unit Schema Items.\r\n * @alpha\r\n */\r\nexport interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {\r\n readonly schemaType: SchemaItemType.Unit;\r\n}\r\n\r\n/**\r\n * Differencing entry for Inverted Unit Schema Items.\r\n * @alpha\r\n */\r\nexport interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {\r\n readonly schemaType: SchemaItemType.InvertedUnit;\r\n}\r\n/**\r\n * Differencing entry for Format Schema Items.\r\n * @alpha\r\n */\r\nexport interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {\r\n readonly schemaType: SchemaItemType.Format;\r\n}\r\n\r\n/**\r\n * Differencing entry for added or changed Properties.\r\n * @alpha\r\n */\r\nexport interface ClassPropertyDifference {\r\n readonly changeType: \"add\" | \"modify\";\r\n readonly schemaType: SchemaOtherTypes.Property;\r\n readonly itemName: string;\r\n readonly path: string;\r\n readonly difference: PartialEditable<AnyPropertyProps>;\r\n}\r\n\r\n/**\r\n * Union of supported Custom Attribute Differences.\r\n * @alpha\r\n */\r\nexport type CustomAttributeDifference =\r\n CustomAttributeSchemaDifference |\r\n CustomAttributeSchemaItemDifference |\r\n CustomAttributePropertyDifference |\r\n CustomAttributeRelationshipConstraintDifference;\r\n\r\n/**\r\n * Differencing entry for Custom Attributes on Schema.\r\n * @alpha\r\n */\r\nexport interface CustomAttributeSchemaDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\r\n readonly appliedTo: \"Schema\";\r\n readonly difference: PartialEditable<CustomAttribute>;\r\n}\r\n\r\n/**\r\n * Differencing entry for Custom Attributes on Schema Items.\r\n * @alpha\r\n */\r\nexport interface CustomAttributeSchemaItemDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\r\n readonly appliedTo: \"SchemaItem\";\r\n readonly itemName: string;\r\n readonly difference: PartialEditable<CustomAttribute>;\r\n}\r\n\r\n/**\r\n * Differencing entry for Custom Attributes on Properties.\r\n * @alpha\r\n */\r\nexport interface CustomAttributePropertyDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\r\n readonly appliedTo: \"Property\";\r\n readonly itemName: string;\r\n readonly path: string;\r\n readonly difference: PartialEditable<CustomAttribute>;\r\n}\r\n\r\n/**\r\n * Differencing entry for Custom Attributes on Relationship Constraints.\r\n * @alpha\r\n */\r\nexport interface CustomAttributeRelationshipConstraintDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\r\n readonly appliedTo: \"RelationshipConstraint\";\r\n readonly itemName: string;\r\n readonly path: \"$source\" | \"$target\";\r\n readonly difference: PartialEditable<CustomAttribute>;\r\n}\r\n\r\n/**\r\n * Differencing entry for changed mixins on EntityClasses.\r\n * @alpha\r\n */\r\nexport interface EntityClassMixinDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.EntityClassMixin;\r\n readonly itemName: string;\r\n readonly difference: string[];\r\n}\r\n\r\n/**\r\n * Differencing entry for changed Enumerators on Enumerable Schema Items.\r\n * @alpha\r\n */\r\nexport interface EnumeratorDifference {\r\n readonly changeType: \"add\" | \"modify\";\r\n readonly schemaType: SchemaOtherTypes.Enumerator;\r\n readonly itemName: string;\r\n readonly path: string;\r\n readonly difference: PartialEditable<AnyEnumerator>;\r\n}\r\n\r\n/**\r\n * Differencing entry for Relationship Constraints.\r\n * @alpha\r\n */\r\nexport interface RelationshipConstraintDifference {\r\n readonly changeType: \"modify\";\r\n readonly schemaType: SchemaOtherTypes.RelationshipConstraint;\r\n readonly itemName: string;\r\n readonly path: \"$source\" | \"$target\";\r\n readonly difference: PartialEditable<Omit<RelationshipConstraintProps, \"constraintClasses\">>;\r\n}\r\n\r\n/**\r\n * Differencing entry for constraint classes added to Relationship Constrains.\r\n * @alpha\r\n */\r\nexport interface RelationshipConstraintClassDifference {\r\n readonly changeType: \"add\";\r\n readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;\r\n readonly itemName: string;\r\n readonly path: \"$source\" | \"$target\";\r\n readonly difference: string[];\r\n}\r\n"]}
@@ -9,5 +9,6 @@ export declare abstract class MutableConstant extends Constant {
9
9
  abstract setNumerator(numerator: number): void;
10
10
  abstract setDenominator(denominator: number): void;
11
11
  abstract setDisplayLabel(displayLabel: string): void;
12
+ abstract setDescription(description: string): void;
12
13
  }
13
14
  //# sourceMappingURL=MutableConstant.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableConstant.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;GAGG;AACH,8BAAsB,eAAgB,SAAQ,QAAQ;aAC3B,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;aACrD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;aACvC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACrC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;aACzC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
1
+ {"version":3,"file":"MutableConstant.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAE1E;;;GAGG;AACH,8BAAsB,eAAgB,SAAQ,QAAQ;aAC3B,aAAa,CAAC,UAAU,EAAE,oBAAoB,GAAG,IAAI;aACrD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;aACvC,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACrC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;aACzC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA0E;AAE1E;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,4BAAQ;CAMrD;AAND,0CAMC","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\nimport { Constant, LazyLoadedPhenomenon } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableConstant.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableConstant.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA0E;AAE1E;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,4BAAQ;CAOrD;AAPD,0CAOC","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\nimport { Constant, LazyLoadedPhenomenon } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n}\r\n"]}
@@ -6,5 +6,6 @@ export declare abstract class MutableEnumeration extends Enumeration {
6
6
  abstract addEnumerator(enumerator: AnyEnumerator): void;
7
7
  abstract setIsStrict(isStrict: boolean): void;
8
8
  abstract setDisplayLabel(displayLabel: string): void;
9
+ abstract setDescription(description: string): void;
9
10
  }
10
11
  //# sourceMappingURL=MutableEnumeration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableEnumeration.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;GAEG;AACH,8BAAsB,kBAAmB,SAAQ,WAAW;aACjC,aAAa,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI;aAC9C,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;aACpC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
1
+ {"version":3,"file":"MutableEnumeration.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;GAEG;AACH,8BAAsB,kBAAmB,SAAQ,WAAW;aACjC,aAAa,CAAC,UAAU,EAAE,aAAa,GAAG,IAAI;aAC9C,WAAW,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI;aACpC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableEnumeration.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsE;AAEtE;;GAEG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAI3D;AAJD,gDAIC","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\nimport { AnyEnumerator, Enumeration } from \"@itwin/ecschema-metadata\";\r\n\r\n/** @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableEnumeration extends Enumeration {\r\n public abstract override addEnumerator(enumerator: AnyEnumerator): void;\r\n public abstract override setIsStrict(isStrict: boolean): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableEnumeration.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableEnumeration.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsE;AAEtE;;GAEG;AACH,MAAsB,kBAAmB,SAAQ,+BAAW;CAK3D;AALD,gDAKC","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\nimport { AnyEnumerator, Enumeration } from \"@itwin/ecschema-metadata\";\r\n\r\n/** @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableEnumeration extends Enumeration {\r\n public abstract override addEnumerator(enumerator: AnyEnumerator): void;\r\n public abstract override setIsStrict(isStrict: boolean): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n}\r\n"]}
@@ -7,6 +7,8 @@ export declare abstract class MutableKindOfQuantity extends KindOfQuantity {
7
7
  abstract addPresentationFormat(format: Format | OverrideFormat, isDefault: boolean): void;
8
8
  abstract createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[Unit | InvertedUnit, string | undefined]>): OverrideFormat;
9
9
  abstract setDisplayLabel(displayLabel: string): void;
10
+ abstract setDescription(description: string): void;
11
+ abstract setRelativeError(relativeError: number): void;
10
12
  abstract set persistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined);
11
13
  }
12
14
  //# sourceMappingURL=MutableKindOfQuantity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableKindOfQuantity.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE9I;;;GAGG;AACH,8BAAsB,qBAAsB,SAAQ,cAAc;aACvC,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;aAChF,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,GAAG,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,cAAc;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IACpE,aAA6B,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,sBAAsB,GAAG,SAAS,EAAE;CAC1G"}
1
+ {"version":3,"file":"MutableKindOfQuantity.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,sBAAsB,EAAE,cAAc,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAE9I;;;GAGG;AACH,8BAAsB,qBAAsB,SAAQ,cAAc;aACvC,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,SAAS,EAAE,OAAO,GAAG,IAAI;aAChF,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,GAAG,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,GAAG,cAAc;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;aACzC,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IACtE,aAA6B,eAAe,CAAC,KAAK,EAAE,cAAc,GAAG,sBAAsB,GAAG,SAAS,EAAE;CAC1G"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableKindOfQuantity.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA8I;AAE9I;;;GAGG;AACH,MAAsB,qBAAsB,SAAQ,kCAAc;CAKjE;AALD,sDAKC","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\nimport { Format, InvertedUnit, KindOfQuantity, LazyLoadedInvertedUnit, LazyLoadedUnit, OverrideFormat, Unit } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\r\n public abstract override addPresentationFormat(format: Format | OverrideFormat, isDefault: boolean): void;\r\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[Unit | InvertedUnit, string | undefined]>): OverrideFormat;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override set persistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined);\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableKindOfQuantity.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableKindOfQuantity.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA8I;AAE9I;;;GAGG;AACH,MAAsB,qBAAsB,SAAQ,kCAAc;CAOjE;AAPD,sDAOC","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\nimport { Format, InvertedUnit, KindOfQuantity, LazyLoadedInvertedUnit, LazyLoadedUnit, OverrideFormat, Unit } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\r\n public abstract override addPresentationFormat(format: Format | OverrideFormat, isDefault: boolean): void;\r\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[Unit | InvertedUnit, string | undefined]>): OverrideFormat;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n public abstract override setRelativeError(relativeError: number): void;\r\n public abstract override set persistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined);\r\n}\r\n"]}
@@ -6,5 +6,6 @@ import { Phenomenon } from "@itwin/ecschema-metadata";
6
6
  export declare abstract class MutablePhenomenon extends Phenomenon {
7
7
  abstract setDefinition(definition: string): Promise<void>;
8
8
  abstract setDisplayLabel(displayLabel: string): void;
9
+ abstract setDescription(description: string): void;
9
10
  }
10
11
  //# sourceMappingURL=MutablePhenomenon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutablePhenomenon.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePhenomenon.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aAChD,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
1
+ {"version":3,"file":"MutablePhenomenon.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePhenomenon.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aAChD,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutablePhenomenon.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePhenomenon.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsD;AAEtD;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,8BAAU;CAGzD;AAHD,8CAGC","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\nimport { Phenomenon } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePhenomenon extends Phenomenon {\r\n public abstract override setDefinition(definition: string): Promise<void>;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutablePhenomenon.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePhenomenon.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsD;AAEtD;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,8BAAU;CAIzD;AAJD,8CAIC","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\nimport { Phenomenon } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePhenomenon extends Phenomenon {\r\n public abstract override setDefinition(definition: string): Promise<void>;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n}\r\n"]}
@@ -6,5 +6,6 @@ import { PropertyCategory } from "@itwin/ecschema-metadata";
6
6
  export declare abstract class MutablePropertyCategory extends PropertyCategory {
7
7
  abstract setPriority(priority: number): void;
8
8
  abstract setDisplayLabel(displayLabel: string): void;
9
+ abstract setDescription(description: string): void;
9
10
  }
10
11
  //# sourceMappingURL=MutablePropertyCategory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutablePropertyCategory.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePropertyCategory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;GAGG;AACH,8BAAsB,uBAAwB,SAAQ,gBAAgB;aAC3C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;aACnC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
1
+ {"version":3,"file":"MutablePropertyCategory.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePropertyCategory.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAE5D;;;GAGG;AACH,8BAAsB,uBAAwB,SAAQ,gBAAgB;aAC3C,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;aACnC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutablePropertyCategory.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePropertyCategory.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA4D;AAE5D;;;GAGG;AACH,MAAsB,uBAAwB,SAAQ,oCAAgB;CAGrE;AAHD,0DAGC","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\nimport { PropertyCategory } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePropertyCategory extends PropertyCategory {\r\n public abstract override setPriority(priority: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutablePropertyCategory.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutablePropertyCategory.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAA4D;AAE5D;;;GAGG;AACH,MAAsB,uBAAwB,SAAQ,oCAAgB;CAIrE;AAJD,0DAIC","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\nimport { PropertyCategory } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePropertyCategory extends PropertyCategory {\r\n public abstract override setPriority(priority: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n}\r\n"]}
@@ -42,5 +42,7 @@ export declare abstract class MutableSchema extends Schema {
42
42
  abstract setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;
43
43
  abstract deleteClass(name: string): Promise<void>;
44
44
  abstract deleteClassSync(name: string): void;
45
+ abstract setDisplayLabel(displayLabel: string): void;
46
+ abstract setDescription(displayLabel: string): void;
45
47
  }
46
48
  //# sourceMappingURL=MutableSchema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableSchema.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableSchema.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,QAAQ,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,WAAW,EAC1F,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,gBAAgB,EACxF,iBAAiB,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EACpF,MAAM,0BAA0B,CAAC;AAElC;;;;;GAKG;AACH,8BAAsB,aAAc,SAAQ,MAAM;aACvB,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;aAC1D,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAA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OAAO,CAAC,gBAAgB,CAAC;aAC/D,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB;aAC1D,OAAO,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI;aAC5C,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aAC9C,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACzC,UAAU,CAAC,aAAa,EAAE,aAAa,GAAG,IAAI;aAC9C,UAAU,CAAC,WAAW,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI;aACpF,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;aACxC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;aACnC,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableSchema.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableSchema.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAIkC;AAElC;;;;;GAKG;AACH,MAAsB,aAAc,SAAQ,0BAAM;CAqCjD;AArCD,sCAqCC","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\nimport {\r\n Constant, CustomAttribute, CustomAttributeClass, ECClassModifier, EntityClass, Enumeration,\r\n Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PrimitiveType, PropertyCategory,\r\n RelationshipClass, Schema, SchemaContext, SchemaItem, StructClass, Unit, UnitSystem,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\r\n * would prevent this class from extending Schema.\r\n * @internal\r\n */\r\nexport abstract class MutableSchema extends Schema {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\r\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\r\n public abstract override createMixinClass(name: string): Promise<Mixin>;\r\n public abstract override createMixinClassSync(name: string): Mixin;\r\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\r\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\r\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\r\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\r\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\r\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\r\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\r\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\r\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\r\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\r\n public abstract override createUnit(name: string): Promise<Unit>;\r\n public abstract override createUnitSync(name: string): Unit;\r\n public abstract override createConstant(name: string): Promise<Constant>;\r\n public abstract override createConstantSync(name: string): Constant;\r\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\r\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\r\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\r\n public abstract override createPhenomenonSync(name: string): Phenomenon;\r\n public abstract override createFormat(name: string): Promise<Format>;\r\n public abstract override createFormatSync(name: string): Format;\r\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\r\n public abstract override createUnitSystemSync(name: string): UnitSystem;\r\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\r\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\r\n public abstract override addItem<T extends SchemaItem>(item: T): void;\r\n public abstract override addReference(refSchema: Schema): Promise<void>;\r\n public abstract override addReferenceSync(refSchema: Schema): void;\r\n public abstract override setContext(schemaContext: SchemaContext): void;\r\n public abstract override setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;\r\n public abstract override deleteClass(name: string): Promise<void>;\r\n public abstract override deleteClassSync(name: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableSchema.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableSchema.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAIkC;AAElC;;;;;GAKG;AACH,MAAsB,aAAc,SAAQ,0BAAM;CAuCjD;AAvCD,sCAuCC","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\nimport {\r\n Constant, CustomAttribute, CustomAttributeClass, ECClassModifier, EntityClass, Enumeration,\r\n Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PrimitiveType, PropertyCategory,\r\n RelationshipClass, Schema, SchemaContext, SchemaItem, StructClass, Unit, UnitSystem,\r\n} from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\r\n * would prevent this class from extending Schema.\r\n * @internal\r\n */\r\nexport abstract class MutableSchema extends Schema {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\r\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\r\n public abstract override createMixinClass(name: string): Promise<Mixin>;\r\n public abstract override createMixinClassSync(name: string): Mixin;\r\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\r\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\r\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\r\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\r\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\r\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\r\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\r\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\r\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\r\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\r\n public abstract override createUnit(name: string): Promise<Unit>;\r\n public abstract override createUnitSync(name: string): Unit;\r\n public abstract override createConstant(name: string): Promise<Constant>;\r\n public abstract override createConstantSync(name: string): Constant;\r\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\r\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\r\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\r\n public abstract override createPhenomenonSync(name: string): Phenomenon;\r\n public abstract override createFormat(name: string): Promise<Format>;\r\n public abstract override createFormatSync(name: string): Format;\r\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\r\n public abstract override createUnitSystemSync(name: string): UnitSystem;\r\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\r\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\r\n public abstract override addItem<T extends SchemaItem>(item: T): void;\r\n public abstract override addReference(refSchema: Schema): Promise<void>;\r\n public abstract override addReferenceSync(refSchema: Schema): void;\r\n public abstract override setContext(schemaContext: SchemaContext): void;\r\n public abstract override setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void;\r\n public abstract override deleteClass(name: string): Promise<void>;\r\n public abstract override deleteClassSync(name: string): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(displayLabel: string): void;\r\n}\r\n"]}
@@ -5,5 +5,6 @@ import { UnitSystem } from "@itwin/ecschema-metadata";
5
5
  */
6
6
  export declare abstract class MutableUnitSystem extends UnitSystem {
7
7
  abstract setDisplayLabel(displayLabel: string): void;
8
+ abstract setDescription(description: string): void;
8
9
  }
9
10
  //# sourceMappingURL=MutableUnitSystem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"MutableUnitSystem.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableUnitSystem.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
1
+ {"version":3,"file":"MutableUnitSystem.d.ts","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableUnitSystem.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;aAC3C,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI;CACnE"}
@@ -1 +1 @@
1
- {"version":3,"file":"MutableUnitSystem.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableUnitSystem.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsD;AAEtD;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,8BAAU;CAEzD;AAFD,8CAEC","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\nimport { UnitSystem } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * Used for schema editing.\r\n */\r\nexport abstract class MutableUnitSystem extends UnitSystem {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
1
+ {"version":3,"file":"MutableUnitSystem.js","sourceRoot":"","sources":["../../../../src/Editing/Mutable/MutableUnitSystem.ts"],"names":[],"mappings":";;;AAAA;;;+FAG+F;AAC/F,gEAAsD;AAEtD;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,8BAAU;CAGzD;AAHD,8CAGC","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\nimport { UnitSystem } from \"@itwin/ecschema-metadata\";\r\n\r\n/**\r\n * @internal\r\n * Used for schema editing.\r\n */\r\nexport abstract class MutableUnitSystem extends UnitSystem {\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setDescription(description: string): void;\r\n}\r\n"]}
@@ -1,11 +1,8 @@
1
- import { CustomAttributeClass, SchemaKey } from "@itwin/ecschema-metadata";
2
- import { ClassMerger } from "./ClassMerger";
3
- import { SchemaItemEditResults } from "../Editing/Editor";
1
+ import { type CustomAttributeClassDifference } from "../Differencing/SchemaDifference";
2
+ import { type SchemaItemMergerHandler } from "./SchemaItemMerger";
4
3
  /**
4
+ * Defines a merge handler to merge Custom Attribute Class schema items.
5
5
  * @internal
6
6
  */
7
- export default class CAClassMerger extends ClassMerger<CustomAttributeClass> {
8
- protected create(schemaKey: SchemaKey, ecClass: CustomAttributeClass): Promise<SchemaItemEditResults>;
9
- protected mergeAttributes(ecClass: CustomAttributeClass, attributeName: string, attributeNewValue: any, attributeOldValue: any): Promise<SchemaItemEditResults | boolean>;
10
- }
7
+ export declare const customAttributeClassMerger: SchemaItemMergerHandler<CustomAttributeClassDifference>;
11
8
  //# sourceMappingURL=CAClassMerger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CAClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAqC,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC9G,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAG1D;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW,CAAC,oBAAoB,CAAC;cAEjD,MAAM,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;cAI3F,eAAe,CAAC,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,GAAG,EAAE,iBAAiB,EAAE,GAAG,GAAG,OAAO,CAAC,qBAAqB,GAAG,OAAO,CAAC;CAezL"}
1
+ {"version":3,"file":"CAClassMerger.d.ts","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AACvF,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAKlE;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,uBAAuB,CAAC,8BAA8B,CA0B9F,CAAC"}
@@ -1,33 +1,36 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- /*---------------------------------------------------------------------------------------------
4
- * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
5
- * See LICENSE.md in the project root for license terms and full copyright notice.
6
- *--------------------------------------------------------------------------------------------*/
3
+ exports.customAttributeClassMerger = void 0;
7
4
  const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
8
5
  const ClassMerger_1 = require("./ClassMerger");
9
6
  /**
7
+ * Defines a merge handler to merge Custom Attribute Class schema items.
10
8
  * @internal
11
9
  */
12
- class CAClassMerger extends ClassMerger_1.ClassMerger {
13
- async create(schemaKey, ecClass) {
14
- return this.context.editor.customAttributes.create(schemaKey, ecClass.name, ecClass.containerType);
15
- }
16
- async mergeAttributes(ecClass, attributeName, attributeNewValue, attributeOldValue) {
17
- const mutableCAClass = ecClass;
18
- switch (attributeName) {
19
- case "appliesTo":
20
- if (attributeOldValue !== undefined && attributeOldValue !== attributeNewValue) {
21
- const containerType = (0, ecschema_metadata_1.parseCustomAttributeContainerType)(`${attributeOldValue}, ${attributeNewValue}`);
22
- if (containerType === undefined) {
23
- return { errorMessage: "An invalid custom attribute class containerType has been provided." };
24
- }
25
- mutableCAClass.setContainerType(containerType);
10
+ exports.customAttributeClassMerger = {
11
+ async add(context, change) {
12
+ if (change.difference.appliesTo === undefined) {
13
+ return { errorMessage: "appliesTo is a required property of a CustomAttributeClass but it is not set" };
14
+ }
15
+ return context.editor.customAttributes.createFromProps(context.targetSchemaKey, {
16
+ ...change.difference,
17
+ name: change.itemName,
18
+ schemaItemType: change.schemaType,
19
+ appliesTo: change.difference.appliesTo,
20
+ });
21
+ },
22
+ async modify(context, change, itemKey, item) {
23
+ if (change.difference.appliesTo !== undefined) {
24
+ const currentValue = (0, ecschema_metadata_1.containerTypeToString)(item.containerType);
25
+ if (currentValue !== "" && change.difference.appliesTo !== currentValue) {
26
+ const containerType = (0, ecschema_metadata_1.parseCustomAttributeContainerType)(`${currentValue}, ${change.difference.appliesTo}`);
27
+ if (containerType === undefined) {
28
+ return { errorMessage: "An invalid custom attribute class containerType has been provided." };
26
29
  }
27
- return true;
30
+ item.setContainerType(containerType);
31
+ }
28
32
  }
29
- return super.mergeAttributes(ecClass, attributeName, attributeNewValue, attributeOldValue);
30
- }
31
- }
32
- exports.default = CAClassMerger;
33
+ return (0, ClassMerger_1.modifyClass)(context, change, itemKey, item);
34
+ },
35
+ };
33
36
  //# sourceMappingURL=CAClassMerger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CAClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":";;AAAA;;;+FAG+F;AAC/F,gEAA8G;AAC9G,+CAA4C;AAI5C;;GAEG;AACH,MAAqB,aAAc,SAAQ,yBAAiC;IAEvD,KAAK,CAAC,MAAM,CAAC,SAAoB,EAAE,OAA6B;QACjF,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACrG,CAAC;IAEkB,KAAK,CAAC,eAAe,CAAC,OAA6B,EAAE,aAAqB,EAAE,iBAAsB,EAAE,iBAAsB;QAC3I,MAAM,cAAc,GAAG,OAAoC,CAAC;QAC5D,QAAO,aAAa,EAAE;YACpB,KAAK,WAAW;gBACd,IAAI,iBAAiB,KAAK,SAAS,IAAI,iBAAiB,KAAK,iBAAiB,EAAE;oBAC9E,MAAM,aAAa,GAAG,IAAA,qDAAiC,EAAC,GAAG,iBAAiB,KAAK,iBAAiB,EAAE,CAAC,CAAC;oBACtG,IAAI,aAAa,KAAK,SAAS,EAAE;wBAC/B,OAAO,EAAE,YAAY,EAAE,oEAAoE,EAAC,CAAC;qBAC9F;oBACD,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;iBAChD;gBACD,OAAO,IAAI,CAAC;SACf;QACD,OAAO,KAAK,CAAC,eAAe,CAAC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,CAAC,CAAC;IAC7F,CAAC;CACF;AArBD,gCAqBC","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\nimport { CustomAttributeClass, parseCustomAttributeContainerType, SchemaKey } from \"@itwin/ecschema-metadata\";\r\nimport { ClassMerger } from \"./ClassMerger\";\r\nimport { SchemaItemEditResults } from \"../Editing/Editor\";\r\nimport { MutableCAClass } from \"../Editing/Mutable/MutableCAClass\";\r\n\r\n/**\r\n * @internal\r\n */\r\nexport default class CAClassMerger extends ClassMerger<CustomAttributeClass> {\r\n\r\n protected override async create(schemaKey: SchemaKey, ecClass: CustomAttributeClass): Promise<SchemaItemEditResults> {\r\n return this.context.editor.customAttributes.create(schemaKey, ecClass.name, ecClass.containerType);\r\n }\r\n\r\n protected override async mergeAttributes(ecClass: CustomAttributeClass, attributeName: string, attributeNewValue: any, attributeOldValue: any): Promise<SchemaItemEditResults | boolean> {\r\n const mutableCAClass = ecClass as unknown as MutableCAClass;\r\n switch(attributeName) {\r\n case \"appliesTo\":\r\n if (attributeOldValue !== undefined && attributeOldValue !== attributeNewValue) {\r\n const containerType = parseCustomAttributeContainerType(`${attributeOldValue}, ${attributeNewValue}`);\r\n if (containerType === undefined) {\r\n return { errorMessage: \"An invalid custom attribute class containerType has been provided.\"};\r\n }\r\n mutableCAClass.setContainerType(containerType);\r\n }\r\n return true;\r\n }\r\n return super.mergeAttributes(ecClass, attributeName, attributeNewValue, attributeOldValue);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CAClassMerger.js","sourceRoot":"","sources":["../../../src/Merging/CAClassMerger.ts"],"names":[],"mappings":";;;AAOA,gEAAoG;AACpG,+CAA4C;AAE5C;;;GAGG;AACU,QAAA,0BAA0B,GAA4D;IACjG,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM;QACvB,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE;YAC7C,OAAO,EAAE,YAAY,EAAE,8EAA8E,EAAE,CAAC;SACzG;QAED,OAAO,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,eAAe,CAAC,OAAO,CAAC,eAAe,EAAE;YAC9E,GAAG,MAAM,CAAC,UAAU;YACpB,IAAI,EAAE,MAAM,CAAC,QAAQ;YACrB,cAAc,EAAE,MAAM,CAAC,UAAU;YACjC,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS;SACvC,CAAC,CAAC;IACL,CAAC;IACD,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAoB;QACzD,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAAE;YAC7C,MAAM,YAAY,GAAG,IAAA,yCAAqB,EAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC/D,IAAI,YAAY,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,SAAS,KAAK,YAAY,EAAE;gBACvE,MAAM,aAAa,GAAG,IAAA,qDAAiC,EAAC,GAAG,YAAY,KAAK,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;gBAC3G,IAAI,aAAa,KAAK,SAAS,EAAE;oBAC/B,OAAO,EAAE,YAAY,EAAE,oEAAoE,EAAE,CAAC;iBAC/F;gBACD,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;aACtC;SACF;QACD,OAAO,IAAA,yBAAW,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACrD,CAAC;CACF,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\nimport { type CustomAttributeClassDifference } from \"../Differencing/SchemaDifference\";\r\nimport { type SchemaItemMergerHandler } from \"./SchemaItemMerger\";\r\nimport { type MutableCAClass } from \"../Editing/Mutable/MutableCAClass\";\r\nimport { containerTypeToString, parseCustomAttributeContainerType } from \"@itwin/ecschema-metadata\";\r\nimport { modifyClass } from \"./ClassMerger\";\r\n\r\n/**\r\n * Defines a merge handler to merge Custom Attribute Class schema items.\r\n * @internal\r\n */\r\nexport const customAttributeClassMerger: SchemaItemMergerHandler<CustomAttributeClassDifference> = {\r\n async add(context, change) {\r\n if (change.difference.appliesTo === undefined) {\r\n return { errorMessage: \"appliesTo is a required property of a CustomAttributeClass but it is not set\" };\r\n }\r\n\r\n return context.editor.customAttributes.createFromProps(context.targetSchemaKey, {\r\n ...change.difference,\r\n name: change.itemName,\r\n schemaItemType: change.schemaType,\r\n appliesTo: change.difference.appliesTo,\r\n });\r\n },\r\n async modify(context, change, itemKey, item: MutableCAClass) {\r\n if (change.difference.appliesTo !== undefined) {\r\n const currentValue = containerTypeToString(item.containerType);\r\n if (currentValue !== \"\" && change.difference.appliesTo !== currentValue) {\r\n const containerType = parseCustomAttributeContainerType(`${currentValue}, ${change.difference.appliesTo}`);\r\n if (containerType === undefined) {\r\n return { errorMessage: \"An invalid custom attribute class containerType has been provided.\" };\r\n }\r\n item.setContainerType(containerType);\r\n }\r\n }\r\n return modifyClass(context, change, itemKey, item);\r\n },\r\n};\r\n"]}