@itwin/ecschema-editing 3.0.0-dev.72

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 (197) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/LICENSE.md +9 -0
  3. package/README.md +11 -0
  4. package/lib/Editing/Constants.d.ts +21 -0
  5. package/lib/Editing/Constants.d.ts.map +1 -0
  6. package/lib/Editing/Constants.js +65 -0
  7. package/lib/Editing/Constants.js.map +1 -0
  8. package/lib/Editing/CustomAttributes.d.ts +21 -0
  9. package/lib/Editing/CustomAttributes.d.ts.map +1 -0
  10. package/lib/Editing/CustomAttributes.js +59 -0
  11. package/lib/Editing/CustomAttributes.js.map +1 -0
  12. package/lib/Editing/ECClasses.d.ts +33 -0
  13. package/lib/Editing/ECClasses.d.ts.map +1 -0
  14. package/lib/Editing/ECClasses.js +186 -0
  15. package/lib/Editing/ECClasses.js.map +1 -0
  16. package/lib/Editing/Editor.d.ts +105 -0
  17. package/lib/Editing/Editor.d.ts.map +1 -0
  18. package/lib/Editing/Editor.js +175 -0
  19. package/lib/Editing/Editor.js.map +1 -0
  20. package/lib/Editing/Entities.d.ts +23 -0
  21. package/lib/Editing/Entities.d.ts.map +1 -0
  22. package/lib/Editing/Entities.js +89 -0
  23. package/lib/Editing/Entities.js.map +1 -0
  24. package/lib/Editing/Enumerations.d.ts +22 -0
  25. package/lib/Editing/Enumerations.d.ts.map +1 -0
  26. package/lib/Editing/Enumerations.js +71 -0
  27. package/lib/Editing/Enumerations.js.map +1 -0
  28. package/lib/Editing/Formats.d.ts +21 -0
  29. package/lib/Editing/Formats.d.ts.map +1 -0
  30. package/lib/Editing/Formats.js +61 -0
  31. package/lib/Editing/Formats.js.map +1 -0
  32. package/lib/Editing/InvertedUnits.d.ts +18 -0
  33. package/lib/Editing/InvertedUnits.d.ts.map +1 -0
  34. package/lib/Editing/InvertedUnits.js +86 -0
  35. package/lib/Editing/InvertedUnits.js.map +1 -0
  36. package/lib/Editing/KindOfQuantities.d.ts +29 -0
  37. package/lib/Editing/KindOfQuantities.d.ts.map +1 -0
  38. package/lib/Editing/KindOfQuantities.js +80 -0
  39. package/lib/Editing/KindOfQuantities.js.map +1 -0
  40. package/lib/Editing/Mixins.d.ts +23 -0
  41. package/lib/Editing/Mixins.d.ts.map +1 -0
  42. package/lib/Editing/Mixins.js +89 -0
  43. package/lib/Editing/Mixins.js.map +1 -0
  44. package/lib/Editing/Mutable/MutableCAClass.d.ts +10 -0
  45. package/lib/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
  46. package/lib/Editing/Mutable/MutableCAClass.js +16 -0
  47. package/lib/Editing/Mutable/MutableCAClass.js.map +1 -0
  48. package/lib/Editing/Mutable/MutableClass.d.ts +35 -0
  49. package/lib/Editing/Mutable/MutableClass.d.ts.map +1 -0
  50. package/lib/Editing/Mutable/MutableClass.js +23 -0
  51. package/lib/Editing/Mutable/MutableClass.js.map +1 -0
  52. package/lib/Editing/Mutable/MutableConstant.d.ts +13 -0
  53. package/lib/Editing/Mutable/MutableConstant.d.ts.map +1 -0
  54. package/lib/Editing/Mutable/MutableConstant.js +16 -0
  55. package/lib/Editing/Mutable/MutableConstant.js.map +1 -0
  56. package/lib/Editing/Mutable/MutableEntityClass.d.ts +16 -0
  57. package/lib/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
  58. package/lib/Editing/Mutable/MutableEntityClass.js +60 -0
  59. package/lib/Editing/Mutable/MutableEntityClass.js.map +1 -0
  60. package/lib/Editing/Mutable/MutableEnumeration.d.ts +10 -0
  61. package/lib/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
  62. package/lib/Editing/Mutable/MutableEnumeration.js +15 -0
  63. package/lib/Editing/Mutable/MutableEnumeration.js.map +1 -0
  64. package/lib/Editing/Mutable/MutableFormat.d.ts +18 -0
  65. package/lib/Editing/Mutable/MutableFormat.d.ts.map +1 -0
  66. package/lib/Editing/Mutable/MutableFormat.js +16 -0
  67. package/lib/Editing/Mutable/MutableFormat.js.map +1 -0
  68. package/lib/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
  69. package/lib/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
  70. package/lib/Editing/Mutable/MutableInvertedUnit.js +16 -0
  71. package/lib/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
  72. package/lib/Editing/Mutable/MutableKindOfQuantity.d.ts +11 -0
  73. package/lib/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
  74. package/lib/Editing/Mutable/MutableKindOfQuantity.js +16 -0
  75. package/lib/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
  76. package/lib/Editing/Mutable/MutableMixin.d.ts +12 -0
  77. package/lib/Editing/Mutable/MutableMixin.d.ts.map +1 -0
  78. package/lib/Editing/Mutable/MutableMixin.js +16 -0
  79. package/lib/Editing/Mutable/MutableMixin.js.map +1 -0
  80. package/lib/Editing/Mutable/MutablePhenomenon.d.ts +10 -0
  81. package/lib/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
  82. package/lib/Editing/Mutable/MutablePhenomenon.js +16 -0
  83. package/lib/Editing/Mutable/MutablePhenomenon.js.map +1 -0
  84. package/lib/Editing/Mutable/MutableProperty.d.ts +9 -0
  85. package/lib/Editing/Mutable/MutableProperty.d.ts.map +1 -0
  86. package/lib/Editing/Mutable/MutableProperty.js +16 -0
  87. package/lib/Editing/Mutable/MutableProperty.js.map +1 -0
  88. package/lib/Editing/Mutable/MutablePropertyCategory.d.ts +10 -0
  89. package/lib/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
  90. package/lib/Editing/Mutable/MutablePropertyCategory.js +16 -0
  91. package/lib/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
  92. package/lib/Editing/Mutable/MutableRelationshipClass.d.ts +22 -0
  93. package/lib/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
  94. package/lib/Editing/Mutable/MutableRelationshipClass.js +25 -0
  95. package/lib/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
  96. package/lib/Editing/Mutable/MutableSchema.d.ts +46 -0
  97. package/lib/Editing/Mutable/MutableSchema.d.ts.map +1 -0
  98. package/lib/Editing/Mutable/MutableSchema.js +18 -0
  99. package/lib/Editing/Mutable/MutableSchema.js.map +1 -0
  100. package/lib/Editing/Mutable/MutableUnit.d.ts +12 -0
  101. package/lib/Editing/Mutable/MutableUnit.d.ts.map +1 -0
  102. package/lib/Editing/Mutable/MutableUnit.js +16 -0
  103. package/lib/Editing/Mutable/MutableUnit.js.map +1 -0
  104. package/lib/Editing/Mutable/MutableUnitSystem.d.ts +9 -0
  105. package/lib/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
  106. package/lib/Editing/Mutable/MutableUnitSystem.js +16 -0
  107. package/lib/Editing/Mutable/MutableUnitSystem.js.map +1 -0
  108. package/lib/Editing/Phenomena.d.ts +16 -0
  109. package/lib/Editing/Phenomena.d.ts.map +1 -0
  110. package/lib/Editing/Phenomena.js +48 -0
  111. package/lib/Editing/Phenomena.js.map +1 -0
  112. package/lib/Editing/PropertyCategories.d.ts +17 -0
  113. package/lib/Editing/PropertyCategories.d.ts.map +1 -0
  114. package/lib/Editing/PropertyCategories.js +54 -0
  115. package/lib/Editing/PropertyCategories.js.map +1 -0
  116. package/lib/Editing/RelationshipClasses.d.ts +22 -0
  117. package/lib/Editing/RelationshipClasses.d.ts.map +1 -0
  118. package/lib/Editing/RelationshipClasses.js +70 -0
  119. package/lib/Editing/RelationshipClasses.js.map +1 -0
  120. package/lib/Editing/Structs.d.ts +20 -0
  121. package/lib/Editing/Structs.d.ts.map +1 -0
  122. package/lib/Editing/Structs.js +57 -0
  123. package/lib/Editing/Structs.js.map +1 -0
  124. package/lib/Editing/UnitSystems.d.ts +16 -0
  125. package/lib/Editing/UnitSystems.d.ts.map +1 -0
  126. package/lib/Editing/UnitSystems.js +44 -0
  127. package/lib/Editing/UnitSystems.js.map +1 -0
  128. package/lib/Editing/Units.d.ts +16 -0
  129. package/lib/Editing/Units.d.ts.map +1 -0
  130. package/lib/Editing/Units.js +62 -0
  131. package/lib/Editing/Units.js.map +1 -0
  132. package/lib/Validation/Diagnostic.d.ts +322 -0
  133. package/lib/Validation/Diagnostic.d.ts.map +1 -0
  134. package/lib/Validation/Diagnostic.js +311 -0
  135. package/lib/Validation/Diagnostic.js.map +1 -0
  136. package/lib/Validation/DiagnosticReporter.d.ts +97 -0
  137. package/lib/Validation/DiagnosticReporter.d.ts.map +1 -0
  138. package/lib/Validation/DiagnosticReporter.js +107 -0
  139. package/lib/Validation/DiagnosticReporter.js.map +1 -0
  140. package/lib/Validation/ECRules.d.ts +439 -0
  141. package/lib/Validation/ECRules.d.ts.map +1 -0
  142. package/lib/Validation/ECRules.js +679 -0
  143. package/lib/Validation/ECRules.js.map +1 -0
  144. package/lib/Validation/LoggingDiagnosticReporter.d.ts +14 -0
  145. package/lib/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
  146. package/lib/Validation/LoggingDiagnosticReporter.js +41 -0
  147. package/lib/Validation/LoggingDiagnosticReporter.js.map +1 -0
  148. package/lib/Validation/RuleSuppressionSet.d.ts +59 -0
  149. package/lib/Validation/RuleSuppressionSet.d.ts.map +1 -0
  150. package/lib/Validation/RuleSuppressionSet.js +10 -0
  151. package/lib/Validation/RuleSuppressionSet.js.map +1 -0
  152. package/lib/Validation/Rules.d.ts +65 -0
  153. package/lib/Validation/Rules.d.ts.map +1 -0
  154. package/lib/Validation/Rules.js +10 -0
  155. package/lib/Validation/Rules.js.map +1 -0
  156. package/lib/Validation/SchemaChanges.d.ts +608 -0
  157. package/lib/Validation/SchemaChanges.d.ts.map +1 -0
  158. package/lib/Validation/SchemaChanges.js +1136 -0
  159. package/lib/Validation/SchemaChanges.js.map +1 -0
  160. package/lib/Validation/SchemaCompareDiagnostics.d.ts +423 -0
  161. package/lib/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
  162. package/lib/Validation/SchemaCompareDiagnostics.js +112 -0
  163. package/lib/Validation/SchemaCompareDiagnostics.js.map +1 -0
  164. package/lib/Validation/SchemaCompareReporter.d.ts +12 -0
  165. package/lib/Validation/SchemaCompareReporter.d.ts.map +1 -0
  166. package/lib/Validation/SchemaCompareReporter.js +10 -0
  167. package/lib/Validation/SchemaCompareReporter.js.map +1 -0
  168. package/lib/Validation/SchemaCompareResultDelegate.d.ts +237 -0
  169. package/lib/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
  170. package/lib/Validation/SchemaCompareResultDelegate.js +349 -0
  171. package/lib/Validation/SchemaCompareResultDelegate.js.map +1 -0
  172. package/lib/Validation/SchemaCompareVisitor.d.ts +120 -0
  173. package/lib/Validation/SchemaCompareVisitor.d.ts.map +1 -0
  174. package/lib/Validation/SchemaCompareVisitor.js +207 -0
  175. package/lib/Validation/SchemaCompareVisitor.js.map +1 -0
  176. package/lib/Validation/SchemaComparer.d.ts +172 -0
  177. package/lib/Validation/SchemaComparer.d.ts.map +1 -0
  178. package/lib/Validation/SchemaComparer.js +666 -0
  179. package/lib/Validation/SchemaComparer.js.map +1 -0
  180. package/lib/Validation/SchemaValidater.d.ts +20 -0
  181. package/lib/Validation/SchemaValidater.d.ts.map +1 -0
  182. package/lib/Validation/SchemaValidater.js +62 -0
  183. package/lib/Validation/SchemaValidater.js.map +1 -0
  184. package/lib/Validation/SchemaValidationVisitor.d.ts +171 -0
  185. package/lib/Validation/SchemaValidationVisitor.d.ts.map +1 -0
  186. package/lib/Validation/SchemaValidationVisitor.js +729 -0
  187. package/lib/Validation/SchemaValidationVisitor.js.map +1 -0
  188. package/lib/Validation/SchemaWalker.d.ts +23 -0
  189. package/lib/Validation/SchemaWalker.d.ts.map +1 -0
  190. package/lib/Validation/SchemaWalker.js +52 -0
  191. package/lib/Validation/SchemaWalker.js.map +1 -0
  192. package/lib/ecschema-editing.d.ts +34 -0
  193. package/lib/ecschema-editing.d.ts.map +1 -0
  194. package/lib/ecschema-editing.js +55 -0
  195. package/lib/ecschema-editing.js.map +1 -0
  196. package/package.json +85 -0
  197. package/public/locales/en/ECSchemaEditing.json +27 -0
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ /*---------------------------------------------------------------------------------------------
3
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
4
+ * See LICENSE.md in the project root for license terms and full copyright notice.
5
+ *--------------------------------------------------------------------------------------------*/
6
+ /** @packageDocumentation
7
+ * @module Comparison
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SchemaCompareVisitor = void 0;
11
+ const ecschema_metadata_1 = require("@itwin/ecschema-metadata");
12
+ /**
13
+ * An ISchemaPartVisitor interface implementation that is used to compare to Schemas.
14
+ * @internal
15
+ */
16
+ class SchemaCompareVisitor {
17
+ /**
18
+ * Initializes a new SchemaCompareVisitor instance.
19
+ * @param schemaComparer The [[SchemaComparer]] to use to compare each item of the schema.
20
+ * @param schemaToCompare The second or 'B' schema to compare against the schema being traversed (Schema A).
21
+ */
22
+ constructor(schemaComparer, schemaToCompare) {
23
+ this._schemaComparer = schemaComparer;
24
+ this._schemaB = schemaToCompare;
25
+ }
26
+ /**
27
+ * Called before schema traversal.
28
+ * @param schema a Schema object.
29
+ */
30
+ async visitFullSchema(schemaA) {
31
+ this._schemaComparer.compareSchemaProps(schemaA, this._schemaB);
32
+ }
33
+ /**
34
+ * Called for each [[SchemaItem]] instance found during schema traversal.
35
+ * @param schemaItem a SchemaItem object.
36
+ */
37
+ async visitSchemaItem(schemaItemA) {
38
+ const schemaItemB = await this._schemaB.lookupItem(schemaItemA.key);
39
+ this._schemaComparer.compareSchemaItems(schemaItemA, schemaItemB);
40
+ }
41
+ /**
42
+ * Called for each [[AnyClass]] instance found during schema traversal.
43
+ * @param ecClass an ECClass object.
44
+ */
45
+ async visitClass(classA) {
46
+ const classB = await this._schemaB.lookupItem(classA.key);
47
+ this._schemaComparer.compareClasses(classA, classB);
48
+ }
49
+ /**
50
+ * Called for each [[AnyProperty]] instance of an ECClass.
51
+ * @param property an AnyProperty object.
52
+ */
53
+ async visitProperty(propertyA) {
54
+ let propertyB;
55
+ const classB = await this._schemaB.lookupItem(propertyA.class.key);
56
+ if (classB)
57
+ propertyB = await classB.getProperty(propertyA.name);
58
+ this._schemaComparer.compareProperties(propertyA, propertyB);
59
+ }
60
+ /**
61
+ * Called for each [[EntityClass]] instance found during schema traversal.
62
+ * @param entityClass an EntityClass object.
63
+ */
64
+ async visitEntityClass(entityA) {
65
+ const entityB = await this._schemaB.lookupItem(entityA.key);
66
+ this._schemaComparer.compareEntityClasses(entityA, entityB);
67
+ }
68
+ /**
69
+ * Called for each [[StructClass]] instance found during schema traversal.
70
+ * @param structClass a StructClass object.
71
+ */
72
+ async visitStructClass(_structA) {
73
+ // No comparison to make specifically on StructClasses
74
+ }
75
+ /**
76
+ * Called for each [[Mixin]] instance found during schema traversal.
77
+ * @param mixin a Mixin object.
78
+ */
79
+ async visitMixin(mixinA) {
80
+ const mixinB = await this._schemaB.lookupItem(mixinA.key);
81
+ this._schemaComparer.compareMixins(mixinA, mixinB);
82
+ }
83
+ /**
84
+ * Called for each [[RelationshipClass]] instance found during schema traversal.
85
+ * @param relationshipClass a RelationshipClass object.
86
+ */
87
+ async visitRelationshipClass(relationshipA) {
88
+ const relationshipB = await this._schemaB.lookupItem(relationshipA.key);
89
+ this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);
90
+ }
91
+ /**
92
+ * Called for each [[RelationshipConstraint]] of each RelationshipClass found during schema traversal.
93
+ * @param relationshipConstraint a RelationshipConstraint object.
94
+ */
95
+ async visitRelationshipConstraint(constraintA) {
96
+ let constraintB;
97
+ const relationshipB = await this._schemaB.lookupItem(constraintA.relationshipClass.key);
98
+ if (relationshipB)
99
+ constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;
100
+ this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);
101
+ }
102
+ /**
103
+ * Called for each [[CustomAttributeClass]] instance found during schema traversal.
104
+ * @param customAttributeClass a CustomAttributeClass object.
105
+ */
106
+ async visitCustomAttributeClass(customAttributeA) {
107
+ const customAttributeB = await this._schemaB.lookupItem(customAttributeA.key);
108
+ this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);
109
+ }
110
+ /**
111
+ * Called for each [[CustomAttribute]] container in the schema.
112
+ * @param customAttributeContainer a [[CustomAttributeContainerProps]] object.
113
+ */
114
+ async visitCustomAttributeContainer(containerA) {
115
+ const nameParts = containerA.fullName.split(".");
116
+ const shortName = nameParts.length === 1 ? nameParts[0] : nameParts[1];
117
+ let containerB;
118
+ if (ecschema_metadata_1.Schema.isSchema(containerA)) {
119
+ containerB = this._schemaB;
120
+ }
121
+ else if (ecschema_metadata_1.ECClass.isECClass(containerA)) {
122
+ containerB = await this._schemaB.lookupItem(shortName);
123
+ }
124
+ else if (ecschema_metadata_1.Property.isProperty(containerA)) {
125
+ const parent = await this._schemaB.lookupItem(containerA.class.key);
126
+ containerB = parent ? await parent.getProperty(shortName) : undefined;
127
+ }
128
+ else if (ecschema_metadata_1.RelationshipConstraint.isRelationshipConstraint(containerA)) {
129
+ const parent = await this._schemaB.lookupItem(containerA.relationshipClass.key);
130
+ containerB = parent ? await parent.getProperty(shortName) : undefined;
131
+ }
132
+ this._schemaComparer.compareCustomAttributeContainers(containerA, containerB);
133
+ }
134
+ /**
135
+ * Called for each [[Enumeration]] instance found during schema traversal.
136
+ * @param enumeration an Enumeration object.
137
+ */
138
+ async visitEnumeration(enumA) {
139
+ const enumB = await this._schemaB.lookupItem(enumA.key);
140
+ this._schemaComparer.compareEnumerations(enumA, enumB);
141
+ }
142
+ /**
143
+ * Called for each [[KindOfQuantity]] instance found during schema traversal.
144
+ * @param koq a KindOfQuantity object.
145
+ */
146
+ async visitKindOfQuantity(koqA) {
147
+ const koqB = await this._schemaB.lookupItem(koqA.key);
148
+ this._schemaComparer.compareKindOfQuantities(koqA, koqB);
149
+ }
150
+ /**
151
+ * Called for each [[PropertyCategory]] instance found during schema traversal.
152
+ * @param category a PropertyCategory object.
153
+ */
154
+ async visitPropertyCategory(categoryA) {
155
+ const categoryB = await this._schemaB.lookupItem(categoryA.key);
156
+ this._schemaComparer.comparePropertyCategories(categoryA, categoryB);
157
+ }
158
+ /**
159
+ * Called for each [[Format]] instance found during schema traversal.
160
+ * @param format a Format object.
161
+ */
162
+ async visitFormat(formatA) {
163
+ const formatB = await this._schemaB.lookupItem(formatA.key);
164
+ this._schemaComparer.compareFormats(formatA, formatB);
165
+ }
166
+ /**
167
+ * Called for each [[Unit]] instance found during schema traversal.
168
+ * @param unit a Unit object.
169
+ */
170
+ async visitUnit(unitA) {
171
+ const unitB = await this._schemaB.lookupItem(unitA.key);
172
+ this._schemaComparer.compareUnits(unitA, unitB);
173
+ }
174
+ /**
175
+ * Called for each [[InvertedUnit]] instance found during schema traversal.
176
+ * @param invertedUnit an InvertedUnit object.
177
+ */
178
+ async visitInvertedUnit(invertedUnitA) {
179
+ const invertedUnitB = await this._schemaB.lookupItem(invertedUnitA.key);
180
+ this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);
181
+ }
182
+ /**
183
+ * Called for each [[UnitSystem]] instance found during schema traversal.
184
+ * @param unitSystem a UnitSystem object.
185
+ */
186
+ async visitUnitSystem(_unitSystemA) {
187
+ // No comparison to make specifically on unitSystem
188
+ }
189
+ /**
190
+ * Called for each [[Phenomenon]] instance found during schema traversal.
191
+ * @param phenomena a Phenomenon object.
192
+ */
193
+ async visitPhenomenon(phenomenonA) {
194
+ const phenomenonB = await this._schemaB.lookupItem(phenomenonA.key);
195
+ this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);
196
+ }
197
+ /**
198
+ * Called for each [[Constant]] instance found during schema traversal.
199
+ * @param constant a Constant object.
200
+ */
201
+ async visitConstant(constantA) {
202
+ const constantB = await this._schemaB.lookupItem(constantA.key);
203
+ this._schemaComparer.compareConstants(constantA, constantB);
204
+ }
205
+ }
206
+ exports.SchemaCompareVisitor = SchemaCompareVisitor;
207
+ //# sourceMappingURL=SchemaComp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;IACxD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,SAAS,CAAC,KAAW;QAChC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAO,KAAK,CAAC,GAAG,CAAC,CAAC;QAC9D,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,iBAAiB,CAAC,aAA2B;QACxD,MAAM,aAAa,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAe,aAAa,CAAC,GAAG,CAAC,CAAC;QACtF,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;IAC1E,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,YAAwB;QACnD,mDAAmD;IACrD,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,eAAe,CAAC,WAAuB;QAClD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAa,WAAW,CAAC,GAAG,CAAC,CAAC;QAChF,IAAI,CAAC,eAAe,CAAC,kBAAkB,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,aAAa,CAAC,SAAmB;QAC5C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAW,SAAS,CAAC,GAAG,CAAC,CAAC;QAC1E,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAC9D,CAAC;CACF;AArND,oDAqNC","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 Comparison\n */\n\nimport { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps,\n ECClass, EntityClass, Enumeration, Format, InvertedUnit, ISchemaPartVisitor, KindOfQuantity, Mixin,\n Phenomenon, Property, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem,\n StructClass, Unit, UnitSystem,\n} from \"@itwin/ecschema-metadata\";\nimport { ISchemaComparer } from \"./SchemaComparer\";\n\n/**\n * An ISchemaPartVisitor interface implementation that is used to compare to Schemas.\n * @internal\n */\nexport class SchemaCompareVisitor implements ISchemaPartVisitor {\n private _schemaB: Schema;\n private _schemaComparer: ISchemaComparer;\n\n /**\n * Initializes a new SchemaCompareVisitor instance.\n * @param schemaComparer The [[SchemaComparer]] to use to compare each item of the schema.\n * @param schemaToCompare The second or 'B' schema to compare against the schema being traversed (Schema A).\n */\n constructor(schemaComparer: ISchemaComparer, schemaToCompare: Schema) {\n this._schemaComparer = schemaComparer;\n this._schemaB = schemaToCompare;\n }\n\n /**\n * Called before schema traversal.\n * @param schema a Schema object.\n */\n public async visitFullSchema(schemaA: Schema) {\n this._schemaComparer.compareSchemaProps(schemaA, this._schemaB);\n }\n\n /**\n * Called for each [[SchemaItem]] instance found during schema traversal.\n * @param schemaItem a SchemaItem object.\n */\n public async visitSchemaItem(schemaItemA: SchemaItem) {\n const schemaItemB = await this._schemaB.lookupItem(schemaItemA.key);\n this._schemaComparer.compareSchemaItems(schemaItemA, schemaItemB);\n }\n\n /**\n * Called for each [[AnyClass]] instance found during schema traversal.\n * @param ecClass an ECClass object.\n */\n public async visitClass(classA: AnyClass): Promise<void> {\n const classB = await this._schemaB.lookupItem<AnyClass>(classA.key);\n this._schemaComparer.compareClasses(classA, classB);\n }\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n public async visitProperty(propertyA: AnyProperty): Promise<void> {\n let propertyB: AnyProperty | undefined;\n\n const classB = await this._schemaB.lookupItem<ECClass>(propertyA.class.key);\n if (classB)\n propertyB = await classB.getProperty(propertyA.name) as AnyProperty;\n\n this._schemaComparer.compareProperties(propertyA, propertyB);\n }\n\n /**\n * Called for each [[EntityClass]] instance found during schema traversal.\n * @param entityClass an EntityClass object.\n */\n public async visitEntityClass(entityA: EntityClass): Promise<void> {\n const entityB = await this._schemaB.lookupItem<EntityClass>(entityA.key);\n this._schemaComparer.compareEntityClasses(entityA, entityB);\n }\n\n /**\n * Called for each [[StructClass]] instance found during schema traversal.\n * @param structClass a StructClass object.\n */\n public async visitStructClass(_structA: StructClass): Promise<void> {\n // No comparison to make specifically on StructClasses\n }\n\n /**\n * Called for each [[Mixin]] instance found during schema traversal.\n * @param mixin a Mixin object.\n */\n public async visitMixin(mixinA: Mixin): Promise<void> {\n const mixinB = await this._schemaB.lookupItem<Mixin>(mixinA.key);\n this._schemaComparer.compareMixins(mixinA, mixinB);\n }\n\n /**\n * Called for each [[RelationshipClass]] instance found during schema traversal.\n * @param relationshipClass a RelationshipClass object.\n */\n public async visitRelationshipClass(relationshipA: RelationshipClass): Promise<void> {\n const relationshipB = await this._schemaB.lookupItem<RelationshipClass>(relationshipA.key);\n this._schemaComparer.compareRelationshipClasses(relationshipA, relationshipB);\n }\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass found during schema traversal.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n public async visitRelationshipConstraint(constraintA: RelationshipConstraint): Promise<void> {\n let constraintB: RelationshipConstraint | undefined;\n const relationshipB = await this._schemaB.lookupItem<RelationshipClass>(constraintA.relationshipClass.key);\n if (relationshipB)\n constraintB = constraintA.isSource ? relationshipB.source : relationshipB.target;\n this._schemaComparer.compareRelationshipConstraints(constraintA, constraintB);\n }\n\n /**\n * Called for each [[CustomAttributeClass]] instance found during schema traversal.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n public async visitCustomAttributeClass(customAttributeA: CustomAttributeClass): Promise<void> {\n const customAttributeB = await this._schemaB.lookupItem<CustomAttributeClass>(customAttributeA.key);\n this._schemaComparer.compareCustomAttributeClasses(customAttributeA, customAttributeB);\n }\n\n /**\n * Called for each [[CustomAttribute]] container in the schema.\n * @param customAttributeContainer a [[CustomAttributeContainerProps]] object.\n */\n public async visitCustomAttributeContainer(containerA: CustomAttributeContainerProps): Promise<void> {\n const nameParts = containerA.fullName.split(\".\");\n const shortName = nameParts.length === 1 ? nameParts[0] : nameParts[1];\n let containerB: CustomAttributeContainerProps | undefined;\n\n if (Schema.isSchema(containerA)) {\n containerB = this._schemaB;\n } else if (ECClass.isECClass(containerA)) {\n containerB = await this._schemaB.lookupItem(shortName);\n } else if (Property.isProperty(containerA)) {\n const parent = await this._schemaB.lookupItem<ECClass>(containerA.class.key);\n containerB = parent ? await parent.getProperty(shortName) : undefined;\n } else if (RelationshipConstraint.isRelationshipConstraint(containerA)) {\n const parent = await this._schemaB.lookupItem<RelationshipClass>(containerA.relationshipClass.key);\n containerB = parent ? await parent.getProperty(shortName) : undefined;\n }\n\n this._schemaComparer.compareCustomAttributeContainers(containerA, containerB);\n }\n\n /**\n * Called for each [[Enumeration]] instance found during schema traversal.\n * @param enumeration an Enumeration object.\n */\n public async visitEnumeration(enumA: Enumeration) {\n const enumB = await this._schemaB.lookupItem<Enumeration>(enumA.key);\n this._schemaComparer.compareEnumerations(enumA, enumB);\n }\n\n /**\n * Called for each [[KindOfQuantity]] instance found during schema traversal.\n * @param koq a KindOfQuantity object.\n */\n public async visitKindOfQuantity(koqA: KindOfQuantity) {\n const koqB = await this._schemaB.lookupItem<KindOfQuantity>(koqA.key);\n this._schemaComparer.compareKindOfQuantities(koqA, koqB);\n }\n\n /**\n * Called for each [[PropertyCategory]] instance found during schema traversal.\n * @param category a PropertyCategory object.\n */\n public async visitPropertyCategory(categoryA: PropertyCategory) {\n const categoryB = await this._schemaB.lookupItem<PropertyCategory>(categoryA.key);\n this._schemaComparer.comparePropertyCategories(categoryA, categoryB);\n }\n\n /**\n * Called for each [[Format]] instance found during schema traversal.\n * @param format a Format object.\n */\n public async visitFormat(formatA: Format): Promise<void> {\n const formatB = await this._schemaB.lookupItem<Format>(formatA.key);\n this._schemaComparer.compareFormats(formatA, formatB);\n }\n\n /**\n * Called for each [[Unit]] instance found during schema traversal.\n * @param unit a Unit object.\n */\n public async visitUnit(unitA: Unit): Promise<void> {\n const unitB = await this._schemaB.lookupItem<Unit>(unitA.key);\n this._schemaComparer.compareUnits(unitA, unitB);\n }\n\n /**\n * Called for each [[InvertedUnit]] instance found during schema traversal.\n * @param invertedUnit an InvertedUnit object.\n */\n public async visitInvertedUnit(invertedUnitA: InvertedUnit): Promise<void> {\n const invertedUnitB = await this._schemaB.lookupItem<InvertedUnit>(invertedUnitA.key);\n this._schemaComparer.compareInvertedUnits(invertedUnitA, invertedUnitB);\n }\n\n /**\n * Called for each [[UnitSystem]] instance found during schema traversal.\n * @param unitSystem a UnitSystem object.\n */\n public async visitUnitSystem(_unitSystemA: UnitSystem): Promise<void> {\n // No comparison to make specifically on unitSystem\n }\n\n /**\n * Called for each [[Phenomenon]] instance found during schema traversal.\n * @param phenomena a Phenomenon object.\n */\n public async visitPhenomenon(phenomenonA: Phenomenon): Promise<void> {\n const phenomenonB = await this._schemaB.lookupItem<Phenomenon>(phenomenonA.key);\n this._schemaComparer.comparePhenomenons(phenomenonA, phenomenonB);\n }\n\n /**\n * Called for each [[Constant]] instance found during schema traversal.\n * @param constant a Constant object.\n */\n public async visitConstant(constantA: Constant): Promise<void> {\n const constantB = await this._schemaB.lookupItem<Constant>(constantA.key);\n this._schemaComparer.compareConstants(constantA, constantB);\n }\n}\n"]}
@@ -0,0 +1,172 @@
1
+ /** @packageDocumentation
2
+ * @module Comparison
3
+ */
4
+ import { AnyClass, AnyProperty, Constant, CustomAttributeClass, CustomAttributeContainerProps, EntityClass, Enumeration, Format, InvertedUnit, KindOfQuantity, Mixin, Phenomenon, PropertyCategory, RelationshipClass, RelationshipConstraint, Schema, SchemaItem, Unit } from "@itwin/ecschema-metadata";
5
+ import { ISchemaCompareReporter } from "./SchemaCompareReporter";
6
+ /**
7
+ * Enum that identifies if Schema A is being iterated (Forward) or
8
+ * Schema B is being iterated (Backward);
9
+ * @alpha
10
+ */
11
+ export declare enum SchemaCompareDirection {
12
+ Forward = 0,
13
+ Backward = 1
14
+ }
15
+ /**
16
+ * Interface for comparing EC Schemas.
17
+ * @alpha
18
+ */
19
+ export interface ISchemaComparer {
20
+ compareSchemas(schemaA: Schema, schemaB: Schema): void;
21
+ compareSchemaProps(schemaA: Schema, schemaB: Schema): void;
22
+ compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): void;
23
+ compareClasses(classA: AnyClass, classB: AnyClass | undefined): void;
24
+ compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): void;
25
+ compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): void;
26
+ compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): void;
27
+ compareRelationshipClasses(relationshipClassA: RelationshipClass, relationshipClassB: RelationshipClass | undefined): void;
28
+ compareRelationshipConstraints(relationshipConstraintA: RelationshipConstraint, relationshipConstraintB: RelationshipConstraint | undefined): void;
29
+ compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): void;
30
+ compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): void;
31
+ compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): void;
32
+ compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): void;
33
+ comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): void;
34
+ compareFormats(formatA: Format, formatB: Format | undefined): void;
35
+ compareUnits(unitA: Unit, unitB: Unit | undefined): void;
36
+ compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): void;
37
+ comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): void;
38
+ compareConstants(constantA: Constant, constantB: Constant | undefined): void;
39
+ }
40
+ /**
41
+ * Compares EC Schemas and reports differences using the [[IDiagnosticReporter]] objects
42
+ * specified.
43
+ * @alpha
44
+ */
45
+ export declare class SchemaComparer {
46
+ private _compareDirection;
47
+ private _reporter;
48
+ private _reporters;
49
+ /**
50
+ * Initializes a new SchemaComparer instance.
51
+ * @param reporters The [[IDiagnosticReporter]] object(s) to use to report the results.
52
+ */
53
+ constructor(...reporters: ISchemaCompareReporter[]);
54
+ /**
55
+ * Compares two schemas to identify differences.
56
+ * @param schemaA The first Schema.
57
+ * @param schemaB The second Schema.
58
+ */
59
+ compareSchemas(schemaA: Schema, schemaB: Schema): Promise<void>;
60
+ /**
61
+ * Compares two schemas to identify differences between property values.
62
+ * @param schemaA The first Schema.
63
+ * @param schemaB The second Schema.
64
+ */
65
+ compareSchemaProps(schemaA: Schema, schemaB: Schema): Promise<void>;
66
+ /**
67
+ * Compares two SchemaItems to identify differences between property values.
68
+ * @param schemaItemA The first SchemaItem.
69
+ * @param schemaItemB The second SchemaItem.
70
+ */
71
+ compareSchemaItems(schemaItemA: SchemaItem, schemaItemB: SchemaItem | undefined): Promise<void>;
72
+ /**
73
+ * Compares two ECClasses to identify differences between property values.
74
+ * @param classA The first ECClass.
75
+ * @param classB The second ECClass.
76
+ */
77
+ compareClasses(classA: AnyClass, classB: AnyClass | undefined): Promise<void>;
78
+ /**
79
+ * Compares two ECProperties to identify differences between property values.
80
+ * @param propertyA The first ECProperty.
81
+ * @param propertyB The second ECProperty.
82
+ */
83
+ compareProperties(propertyA: AnyProperty, propertyB: AnyProperty | undefined): Promise<void>;
84
+ /**
85
+ * Compares two EntityClass objects to identify differences between property values.
86
+ * @param entityA
87
+ * @param entityB
88
+ */
89
+ compareEntityClasses(entityA: EntityClass, entityB: EntityClass | undefined): Promise<void>;
90
+ /**
91
+ * Compares two Mixin objects to identify differences between property values.
92
+ * @param mixinA
93
+ * @param mixinB
94
+ */
95
+ compareMixins(mixinA: Mixin, mixinB: Mixin | undefined): Promise<void>;
96
+ /**
97
+ * Compares two RelationshipClass objects to identify differences between property values.
98
+ * @param relationshipA
99
+ * @param relationshipB
100
+ */
101
+ compareRelationshipClasses(relationshipA: RelationshipClass, relationshipB: RelationshipClass | undefined): Promise<void>;
102
+ /**
103
+ * Compares two RelationshipConstraint objects to identify differences between property values.
104
+ * @param relationshipConstraintA
105
+ * @param relationshipConstraintB
106
+ */
107
+ compareRelationshipConstraints(constraintA: RelationshipConstraint, constraintB: RelationshipConstraint | undefined): Promise<void>;
108
+ /**
109
+ * Compares two CustomAttributeClass objects to identify differences between property values.
110
+ * @param customAttributeClassA
111
+ * @param customAttributeClassB
112
+ */
113
+ compareCustomAttributeClasses(customAttributeClassA: CustomAttributeClass, customAttributeClassB: CustomAttributeClass | undefined): Promise<void>;
114
+ /**
115
+ * Compares two CustomAttributeContainerProps objects to identify differences between property values.
116
+ * @param containerA
117
+ * @param containerB
118
+ */
119
+ compareCustomAttributeContainers(containerA: CustomAttributeContainerProps, containerB: CustomAttributeContainerProps | undefined): Promise<void>;
120
+ /**
121
+ * Compares two Enumeration objects to identify differences between property values.
122
+ * @param enumA
123
+ * @param enumB
124
+ */
125
+ compareEnumerations(enumA: Enumeration, enumB: Enumeration | undefined): Promise<void>;
126
+ /**
127
+ * Compares two KindOfQuantity objects to identify differences between property values.
128
+ * @param koqA
129
+ * @param koqB
130
+ */
131
+ compareKindOfQuantities(koqA: KindOfQuantity, koqB: KindOfQuantity | undefined): Promise<void>;
132
+ /**
133
+ * Compares two PropertyCategory objects to identify differences between property values.
134
+ * @param categoryA
135
+ * @param categoryB
136
+ */
137
+ comparePropertyCategories(categoryA: PropertyCategory, categoryB: PropertyCategory | undefined): Promise<void>;
138
+ /**
139
+ * Compares two Format objects to identify differences between property values.
140
+ * @param formatA
141
+ * @param formatB
142
+ */
143
+ compareFormats(formatA: Format, formatB: Format | undefined): Promise<void>;
144
+ /**
145
+ * Compares two Unit objects to identify differences between property values.
146
+ * @param unitA
147
+ * @param unitB
148
+ */
149
+ compareUnits(unitA: Unit, unitB: Unit | undefined): Promise<void>;
150
+ /**
151
+ * Compares two InvertedUnit objects to identify differences between property values.
152
+ * @param invertedUnitA
153
+ * @param invertedUnitB
154
+ */
155
+ compareInvertedUnits(invertedUnitA: InvertedUnit, invertedUnitB: InvertedUnit | undefined): Promise<void>;
156
+ /**
157
+ * Compares two Phenomenon objects to identify differences between property values.
158
+ * @param phenomenonA
159
+ * @param phenomenonB
160
+ */
161
+ comparePhenomenons(phenomenonA: Phenomenon, phenomenonB: Phenomenon | undefined): Promise<void>;
162
+ /**
163
+ * Compares two Constant objects to identify differences between property values.
164
+ * @param constantA
165
+ * @param constantB
166
+ */
167
+ compareConstants(constantA: Constant, constantB: Constant | undefined): Promise<void>;
168
+ private comparePropertyType;
169
+ private compareEnumerators;
170
+ private compareFormatUnits;
171
+ }
172
+ //# sourceMappingURL=SchemaComparer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaComparer.d.ts","sourceRoot":"","sources":["../../src/Validation/SchemaComparer.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EACL,QAAQ,EAAiB,WAAW,EAAyB,QAAQ,EAC9C,oBAAoB,EAAE,6BAA6B,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,EACxF,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,UAAU,EAAyB,gBAAgB,EAAwB,iBAAiB,EACrJ,sBAAsB,EAAE,MAAM,EAAE,UAAU,EACR,IAAI,EACvC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAKjE;;;;GAIG;AACH,oBAAY,sBAAsB;IAChC,OAAO,IAAI;IACX,QAAQ,IAAI;CACb;AACD;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,G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