@itwin/ecschema-editing 5.0.0-dev.9 → 5.0.0-dev.92

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 (589) hide show
  1. package/CHANGELOG.md +51 -1
  2. package/lib/cjs/Differencing/Errors.js +6 -0
  3. package/lib/cjs/Differencing/Errors.js.map +1 -1
  4. package/lib/cjs/Differencing/SchemaConflicts.d.ts +3 -1
  5. package/lib/cjs/Differencing/SchemaConflicts.d.ts.map +1 -1
  6. package/lib/cjs/Differencing/SchemaConflicts.js +2 -0
  7. package/lib/cjs/Differencing/SchemaConflicts.js.map +1 -1
  8. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts +4 -3
  9. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -1
  10. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js +57 -11
  11. package/lib/cjs/Differencing/SchemaDiagnosticVisitor.js.map +1 -1
  12. package/lib/cjs/Differencing/SchemaDifference.d.ts +33 -4
  13. package/lib/cjs/Differencing/SchemaDifference.d.ts.map +1 -1
  14. package/lib/cjs/Differencing/SchemaDifference.js +55 -5
  15. package/lib/cjs/Differencing/SchemaDifference.js.map +1 -1
  16. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts +2 -1
  17. package/lib/cjs/Differencing/SchemaDifferenceValidator.d.ts.map +1 -1
  18. package/lib/cjs/Differencing/SchemaDifferenceValidator.js +78 -19
  19. package/lib/cjs/Differencing/SchemaDifferenceValidator.js.map +1 -1
  20. package/lib/cjs/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -1
  21. package/lib/cjs/Differencing/SchemaDifferenceVisitor.js +5 -0
  22. package/lib/cjs/Differencing/SchemaDifferenceVisitor.js.map +1 -1
  23. package/lib/cjs/Differencing/Utils.js.map +1 -1
  24. package/lib/cjs/Editing/Constants.d.ts +2 -1
  25. package/lib/cjs/Editing/Constants.d.ts.map +1 -1
  26. package/lib/cjs/Editing/Constants.js +4 -1
  27. package/lib/cjs/Editing/Constants.js.map +1 -1
  28. package/lib/cjs/Editing/CustomAttributes.d.ts +2 -1
  29. package/lib/cjs/Editing/CustomAttributes.d.ts.map +1 -1
  30. package/lib/cjs/Editing/CustomAttributes.js +3 -0
  31. package/lib/cjs/Editing/CustomAttributes.js.map +1 -1
  32. package/lib/cjs/Editing/ECClasses.d.ts +6 -1
  33. package/lib/cjs/Editing/ECClasses.d.ts.map +1 -1
  34. package/lib/cjs/Editing/ECClasses.js +48 -49
  35. package/lib/cjs/Editing/ECClasses.js.map +1 -1
  36. package/lib/cjs/Editing/Editor.d.ts +2 -2
  37. package/lib/cjs/Editing/Editor.d.ts.map +1 -1
  38. package/lib/cjs/Editing/Editor.js +32 -21
  39. package/lib/cjs/Editing/Editor.js.map +1 -1
  40. package/lib/cjs/Editing/Entities.d.ts +2 -1
  41. package/lib/cjs/Editing/Entities.d.ts.map +1 -1
  42. package/lib/cjs/Editing/Entities.js +18 -14
  43. package/lib/cjs/Editing/Entities.js.map +1 -1
  44. package/lib/cjs/Editing/Enumerations.d.ts +2 -1
  45. package/lib/cjs/Editing/Enumerations.d.ts.map +1 -1
  46. package/lib/cjs/Editing/Enumerations.js +6 -3
  47. package/lib/cjs/Editing/Enumerations.js.map +1 -1
  48. package/lib/cjs/Editing/Exception.js +35 -6
  49. package/lib/cjs/Editing/Exception.js.map +1 -1
  50. package/lib/cjs/Editing/Formats.d.ts +2 -1
  51. package/lib/cjs/Editing/Formats.d.ts.map +1 -1
  52. package/lib/cjs/Editing/Formats.js +5 -1
  53. package/lib/cjs/Editing/Formats.js.map +1 -1
  54. package/lib/cjs/Editing/InvertedUnits.d.ts +2 -1
  55. package/lib/cjs/Editing/InvertedUnits.d.ts.map +1 -1
  56. package/lib/cjs/Editing/InvertedUnits.js +10 -6
  57. package/lib/cjs/Editing/InvertedUnits.js.map +1 -1
  58. package/lib/cjs/Editing/KindOfQuantities.d.ts +2 -1
  59. package/lib/cjs/Editing/KindOfQuantities.d.ts.map +1 -1
  60. package/lib/cjs/Editing/KindOfQuantities.js +11 -7
  61. package/lib/cjs/Editing/KindOfQuantities.js.map +1 -1
  62. package/lib/cjs/Editing/Mixins.d.ts +2 -1
  63. package/lib/cjs/Editing/Mixins.d.ts.map +1 -1
  64. package/lib/cjs/Editing/Mixins.js +13 -9
  65. package/lib/cjs/Editing/Mixins.js.map +1 -1
  66. package/lib/cjs/Editing/Mutable/MutableArrayProperty.js.map +1 -1
  67. package/lib/cjs/Editing/Mutable/MutableCAClass.js.map +1 -1
  68. package/lib/cjs/Editing/Mutable/MutableClass.d.ts +2 -1
  69. package/lib/cjs/Editing/Mutable/MutableClass.d.ts.map +1 -1
  70. package/lib/cjs/Editing/Mutable/MutableClass.js.map +1 -1
  71. package/lib/cjs/Editing/Mutable/MutableConstant.js.map +1 -1
  72. package/lib/cjs/Editing/Mutable/MutableEntityClass.js.map +1 -1
  73. package/lib/cjs/Editing/Mutable/MutableEnumeration.js.map +1 -1
  74. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts +8 -1
  75. package/lib/cjs/Editing/Mutable/MutableFormat.d.ts.map +1 -1
  76. package/lib/cjs/Editing/Mutable/MutableFormat.js.map +1 -1
  77. package/lib/cjs/Editing/Mutable/MutableInvertedUnit.js.map +1 -1
  78. package/lib/cjs/Editing/Mutable/MutableKindOfQuantity.js.map +1 -1
  79. package/lib/cjs/Editing/Mutable/MutableMixin.js.map +1 -1
  80. package/lib/cjs/Editing/Mutable/MutableNavigationProperty.js.map +1 -1
  81. package/lib/cjs/Editing/Mutable/MutablePhenomenon.js.map +1 -1
  82. package/lib/cjs/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -1
  83. package/lib/cjs/Editing/Mutable/MutableProperty.js.map +1 -1
  84. package/lib/cjs/Editing/Mutable/MutablePropertyCategory.js.map +1 -1
  85. package/lib/cjs/Editing/Mutable/MutableRelationshipClass.js.map +1 -1
  86. package/lib/cjs/Editing/Mutable/MutableSchema.js.map +1 -1
  87. package/lib/cjs/Editing/Mutable/MutableSchemaItem.js.map +1 -1
  88. package/lib/cjs/Editing/Mutable/MutableStructProperty.js.map +1 -1
  89. package/lib/cjs/Editing/Mutable/MutableUnit.js.map +1 -1
  90. package/lib/cjs/Editing/Mutable/MutableUnitSystem.js.map +1 -1
  91. package/lib/cjs/Editing/Phenomena.d.ts +2 -1
  92. package/lib/cjs/Editing/Phenomena.d.ts.map +1 -1
  93. package/lib/cjs/Editing/Phenomena.js +3 -0
  94. package/lib/cjs/Editing/Phenomena.js.map +1 -1
  95. package/lib/cjs/Editing/Properties.d.ts +2 -2
  96. package/lib/cjs/Editing/Properties.d.ts.map +1 -1
  97. package/lib/cjs/Editing/Properties.js +6 -4
  98. package/lib/cjs/Editing/Properties.js.map +1 -1
  99. package/lib/cjs/Editing/PropertyCategories.d.ts +2 -1
  100. package/lib/cjs/Editing/PropertyCategories.d.ts.map +1 -1
  101. package/lib/cjs/Editing/PropertyCategories.js +5 -1
  102. package/lib/cjs/Editing/PropertyCategories.js.map +1 -1
  103. package/lib/cjs/Editing/RelationshipClasses.d.ts +1 -0
  104. package/lib/cjs/Editing/RelationshipClasses.d.ts.map +1 -1
  105. package/lib/cjs/Editing/RelationshipClasses.js +17 -10
  106. package/lib/cjs/Editing/RelationshipClasses.js.map +1 -1
  107. package/lib/cjs/Editing/SchemaItems.d.ts +2 -2
  108. package/lib/cjs/Editing/SchemaItems.d.ts.map +1 -1
  109. package/lib/cjs/Editing/SchemaItems.js +8 -11
  110. package/lib/cjs/Editing/SchemaItems.js.map +1 -1
  111. package/lib/cjs/Editing/Structs.d.ts +2 -1
  112. package/lib/cjs/Editing/Structs.d.ts.map +1 -1
  113. package/lib/cjs/Editing/Structs.js +3 -0
  114. package/lib/cjs/Editing/Structs.js.map +1 -1
  115. package/lib/cjs/Editing/UnitSystems.d.ts +2 -1
  116. package/lib/cjs/Editing/UnitSystems.d.ts.map +1 -1
  117. package/lib/cjs/Editing/UnitSystems.js +3 -0
  118. package/lib/cjs/Editing/UnitSystems.js.map +1 -1
  119. package/lib/cjs/Editing/Units.d.ts +2 -1
  120. package/lib/cjs/Editing/Units.d.ts.map +1 -1
  121. package/lib/cjs/Editing/Units.js +5 -2
  122. package/lib/cjs/Editing/Units.js.map +1 -1
  123. package/lib/cjs/Merging/ClassMerger.js.map +1 -1
  124. package/lib/cjs/Merging/ConstantMerger.js +4 -4
  125. package/lib/cjs/Merging/ConstantMerger.js.map +1 -1
  126. package/lib/cjs/Merging/CustomAttributeClassMerger.js.map +1 -1
  127. package/lib/cjs/Merging/CustomAttributeMerger.d.ts.map +1 -1
  128. package/lib/cjs/Merging/CustomAttributeMerger.js +7 -6
  129. package/lib/cjs/Merging/CustomAttributeMerger.js.map +1 -1
  130. package/lib/cjs/Merging/Edits/NameMapping.d.ts +22 -0
  131. package/lib/cjs/Merging/Edits/NameMapping.d.ts.map +1 -0
  132. package/lib/cjs/Merging/Edits/NameMapping.js +54 -0
  133. package/lib/cjs/Merging/Edits/NameMapping.js.map +1 -0
  134. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts +1 -1
  135. package/lib/cjs/Merging/Edits/RenameEditHandler.d.ts.map +1 -1
  136. package/lib/cjs/Merging/Edits/RenameEditHandler.js +1 -260
  137. package/lib/cjs/Merging/Edits/RenameEditHandler.js.map +1 -1
  138. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts +9 -6
  139. package/lib/cjs/Merging/Edits/SchemaEdits.d.ts.map +1 -1
  140. package/lib/cjs/Merging/Edits/SchemaEdits.js +19 -14
  141. package/lib/cjs/Merging/Edits/SchemaEdits.js.map +1 -1
  142. package/lib/cjs/Merging/Edits/SkipEditHandler.js.map +1 -1
  143. package/lib/cjs/Merging/EntityClassMerger.js +1 -2
  144. package/lib/cjs/Merging/EntityClassMerger.js.map +1 -1
  145. package/lib/cjs/Merging/EnumerationMerger.js +1 -1
  146. package/lib/cjs/Merging/EnumerationMerger.js.map +1 -1
  147. package/lib/cjs/Merging/EnumeratorMerger.d.ts.map +1 -1
  148. package/lib/cjs/Merging/EnumeratorMerger.js +2 -2
  149. package/lib/cjs/Merging/EnumeratorMerger.js.map +1 -1
  150. package/lib/cjs/Merging/FormatMerger.d.ts +24 -0
  151. package/lib/cjs/Merging/FormatMerger.d.ts.map +1 -0
  152. package/lib/cjs/Merging/FormatMerger.js +143 -0
  153. package/lib/cjs/Merging/FormatMerger.js.map +1 -0
  154. package/lib/cjs/Merging/InvertedUnitMerger.d.ts +14 -0
  155. package/lib/cjs/Merging/InvertedUnitMerger.d.ts.map +1 -0
  156. package/lib/cjs/Merging/InvertedUnitMerger.js +45 -0
  157. package/lib/cjs/Merging/InvertedUnitMerger.js.map +1 -0
  158. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts +1 -1
  159. package/lib/cjs/Merging/KindOfQuantityMerger.d.ts.map +1 -1
  160. package/lib/cjs/Merging/KindOfQuantityMerger.js +4 -5
  161. package/lib/cjs/Merging/KindOfQuantityMerger.js.map +1 -1
  162. package/lib/cjs/Merging/MixinMerger.js +1 -1
  163. package/lib/cjs/Merging/MixinMerger.js.map +1 -1
  164. package/lib/cjs/Merging/PhenomenonMerger.js +1 -1
  165. package/lib/cjs/Merging/PhenomenonMerger.js.map +1 -1
  166. package/lib/cjs/Merging/PropertyCategoryMerger.js.map +1 -1
  167. package/lib/cjs/Merging/PropertyMerger.js +28 -26
  168. package/lib/cjs/Merging/PropertyMerger.js.map +1 -1
  169. package/lib/cjs/Merging/RelationshipClassMerger.d.ts.map +1 -1
  170. package/lib/cjs/Merging/RelationshipClassMerger.js +4 -4
  171. package/lib/cjs/Merging/RelationshipClassMerger.js.map +1 -1
  172. package/lib/cjs/Merging/SchemaMerger.d.ts +5 -3
  173. package/lib/cjs/Merging/SchemaMerger.d.ts.map +1 -1
  174. package/lib/cjs/Merging/SchemaMerger.js +45 -5
  175. package/lib/cjs/Merging/SchemaMerger.js.map +1 -1
  176. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts +14 -8
  177. package/lib/cjs/Merging/SchemaMergingVisitor.d.ts.map +1 -1
  178. package/lib/cjs/Merging/SchemaMergingVisitor.js +42 -17
  179. package/lib/cjs/Merging/SchemaMergingVisitor.js.map +1 -1
  180. package/lib/cjs/Merging/SchemaMergingWalker.d.ts.map +1 -1
  181. package/lib/cjs/Merging/SchemaMergingWalker.js +2 -0
  182. package/lib/cjs/Merging/SchemaMergingWalker.js.map +1 -1
  183. package/lib/cjs/Merging/SchemaReferenceMerger.js.map +1 -1
  184. package/lib/cjs/Merging/StructClassMerger.js.map +1 -1
  185. package/lib/cjs/Merging/UnitMerger.d.ts +14 -0
  186. package/lib/cjs/Merging/UnitMerger.d.ts.map +1 -0
  187. package/lib/cjs/Merging/UnitMerger.js +62 -0
  188. package/lib/cjs/Merging/UnitMerger.js.map +1 -0
  189. package/lib/cjs/Merging/UnitSystemMerger.js.map +1 -1
  190. package/lib/cjs/Merging/Utils.d.ts +11 -0
  191. package/lib/cjs/Merging/Utils.d.ts.map +1 -1
  192. package/lib/cjs/Merging/Utils.js +23 -3
  193. package/lib/cjs/Merging/Utils.js.map +1 -1
  194. package/lib/cjs/Validation/Diagnostic.js +18 -16
  195. package/lib/cjs/Validation/Diagnostic.js.map +1 -1
  196. package/lib/cjs/Validation/DiagnosticReporter.js +4 -1
  197. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  198. package/lib/cjs/Validation/ECRules.js +1 -1
  199. package/lib/cjs/Validation/ECRules.js.map +1 -1
  200. package/lib/cjs/Validation/LoggingDiagnosticReporter.js.map +1 -1
  201. package/lib/cjs/Validation/RuleSuppressionSet.js.map +1 -1
  202. package/lib/cjs/Validation/Rules.js.map +1 -1
  203. package/lib/cjs/Validation/SchemaChanges.js +39 -69
  204. package/lib/cjs/Validation/SchemaChanges.js.map +1 -1
  205. package/lib/cjs/Validation/SchemaCompareDiagnostics.d.ts +2 -2
  206. package/lib/cjs/Validation/SchemaCompareDiagnostics.js.map +1 -1
  207. package/lib/cjs/Validation/SchemaCompareReporter.js.map +1 -1
  208. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts +1 -1
  209. package/lib/cjs/Validation/SchemaCompareResultDelegate.d.ts.map +1 -1
  210. package/lib/cjs/Validation/SchemaCompareResultDelegate.js +4 -1
  211. package/lib/cjs/Validation/SchemaCompareResultDelegate.js.map +1 -1
  212. package/lib/cjs/Validation/SchemaCompareVisitor.d.ts.map +1 -1
  213. package/lib/cjs/Validation/SchemaCompareVisitor.js +23 -23
  214. package/lib/cjs/Validation/SchemaCompareVisitor.js.map +1 -1
  215. package/lib/cjs/Validation/SchemaComparer.d.ts +22 -1
  216. package/lib/cjs/Validation/SchemaComparer.d.ts.map +1 -1
  217. package/lib/cjs/Validation/SchemaComparer.js +30 -5
  218. package/lib/cjs/Validation/SchemaComparer.js.map +1 -1
  219. package/lib/cjs/Validation/SchemaValidater.js +1 -4
  220. package/lib/cjs/Validation/SchemaValidater.js.map +1 -1
  221. package/lib/cjs/Validation/SchemaValidationVisitor.js +3 -4
  222. package/lib/cjs/Validation/SchemaValidationVisitor.js.map +1 -1
  223. package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
  224. package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
  225. package/lib/cjs/Validation/SchemaWalker.js +6 -4
  226. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  227. package/lib/cjs/ecschema-editing.js.map +1 -1
  228. package/lib/esm/Differencing/Errors.d.ts +19 -0
  229. package/lib/esm/Differencing/Errors.d.ts.map +1 -0
  230. package/lib/esm/Differencing/Errors.js +26 -0
  231. package/lib/esm/Differencing/Errors.js.map +1 -0
  232. package/lib/esm/Differencing/SchemaConflicts.d.ts +84 -0
  233. package/lib/esm/Differencing/SchemaConflicts.d.ts.map +1 -0
  234. package/lib/esm/Differencing/SchemaConflicts.js +60 -0
  235. package/lib/esm/Differencing/SchemaConflicts.js.map +1 -0
  236. package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts +41 -0
  237. package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
  238. package/lib/esm/Differencing/SchemaDiagnosticVisitor.js +443 -0
  239. package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
  240. package/lib/esm/Differencing/SchemaDifference.d.ts +357 -0
  241. package/lib/esm/Differencing/SchemaDifference.d.ts.map +1 -0
  242. package/lib/esm/Differencing/SchemaDifference.js +106 -0
  243. package/lib/esm/Differencing/SchemaDifference.js.map +1 -0
  244. package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts +18 -0
  245. package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts.map +1 -0
  246. package/lib/esm/Differencing/SchemaDifferenceValidator.js +521 -0
  247. package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -0
  248. package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts +32 -0
  249. package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -0
  250. package/lib/esm/Differencing/SchemaDifferenceVisitor.js +88 -0
  251. package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -0
  252. package/lib/esm/Differencing/Utils.d.ts +110 -0
  253. package/lib/esm/Differencing/Utils.d.ts.map +1 -0
  254. package/lib/esm/Differencing/Utils.js +161 -0
  255. package/lib/esm/Differencing/Utils.js.map +1 -0
  256. package/lib/esm/Editing/Constants.d.ts +22 -0
  257. package/lib/esm/Editing/Constants.d.ts.map +1 -0
  258. package/lib/esm/Editing/Constants.js +55 -0
  259. package/lib/esm/Editing/Constants.js.map +1 -0
  260. package/lib/esm/Editing/CustomAttributes.d.ts +22 -0
  261. package/lib/esm/Editing/CustomAttributes.d.ts.map +1 -0
  262. package/lib/esm/Editing/CustomAttributes.js +49 -0
  263. package/lib/esm/Editing/CustomAttributes.js.map +1 -0
  264. package/lib/esm/Editing/ECClasses.d.ts +86 -0
  265. package/lib/esm/Editing/ECClasses.d.ts.map +1 -0
  266. package/lib/esm/Editing/ECClasses.js +294 -0
  267. package/lib/esm/Editing/ECClasses.js.map +1 -0
  268. package/lib/esm/Editing/Editor.d.ts +117 -0
  269. package/lib/esm/Editing/Editor.d.ts.map +1 -0
  270. package/lib/esm/Editing/Editor.js +264 -0
  271. package/lib/esm/Editing/Editor.js.map +1 -0
  272. package/lib/esm/Editing/Entities.d.ts +38 -0
  273. package/lib/esm/Editing/Entities.d.ts.map +1 -0
  274. package/lib/esm/Editing/Entities.js +126 -0
  275. package/lib/esm/Editing/Entities.js.map +1 -0
  276. package/lib/esm/Editing/Enumerations.d.ts +25 -0
  277. package/lib/esm/Editing/Enumerations.d.ts.map +1 -0
  278. package/lib/esm/Editing/Enumerations.js +90 -0
  279. package/lib/esm/Editing/Enumerations.js.map +1 -0
  280. package/lib/esm/Editing/Exception.d.ts +358 -0
  281. package/lib/esm/Editing/Exception.d.ts.map +1 -0
  282. package/lib/esm/Editing/Exception.js +471 -0
  283. package/lib/esm/Editing/Exception.js.map +1 -0
  284. package/lib/esm/Editing/Formats.d.ts +23 -0
  285. package/lib/esm/Editing/Formats.d.ts.map +1 -0
  286. package/lib/esm/Editing/Formats.js +62 -0
  287. package/lib/esm/Editing/Formats.js.map +1 -0
  288. package/lib/esm/Editing/InvertedUnits.d.ts +19 -0
  289. package/lib/esm/Editing/InvertedUnits.d.ts.map +1 -0
  290. package/lib/esm/Editing/InvertedUnits.js +68 -0
  291. package/lib/esm/Editing/InvertedUnits.js.map +1 -0
  292. package/lib/esm/Editing/KindOfQuantities.d.ts +30 -0
  293. package/lib/esm/Editing/KindOfQuantities.d.ts.map +1 -0
  294. package/lib/esm/Editing/KindOfQuantities.js +92 -0
  295. package/lib/esm/Editing/KindOfQuantities.js.map +1 -0
  296. package/lib/esm/Editing/Mixins.d.ts +35 -0
  297. package/lib/esm/Editing/Mixins.d.ts.map +1 -0
  298. package/lib/esm/Editing/Mixins.js +90 -0
  299. package/lib/esm/Editing/Mixins.js.map +1 -0
  300. package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts +10 -0
  301. package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts.map +1 -0
  302. package/lib/esm/Editing/Mutable/MutableArrayProperty.js +12 -0
  303. package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -0
  304. package/lib/esm/Editing/Mutable/MutableCAClass.d.ts +10 -0
  305. package/lib/esm/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
  306. package/lib/esm/Editing/Mutable/MutableCAClass.js +12 -0
  307. package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -0
  308. package/lib/esm/Editing/Mutable/MutableClass.d.ts +39 -0
  309. package/lib/esm/Editing/Mutable/MutableClass.d.ts.map +1 -0
  310. package/lib/esm/Editing/Mutable/MutableClass.js +18 -0
  311. package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -0
  312. package/lib/esm/Editing/Mutable/MutableConstant.d.ts +14 -0
  313. package/lib/esm/Editing/Mutable/MutableConstant.d.ts.map +1 -0
  314. package/lib/esm/Editing/Mutable/MutableConstant.js +12 -0
  315. package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -0
  316. package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts +12 -0
  317. package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
  318. package/lib/esm/Editing/Mutable/MutableEntityClass.js +12 -0
  319. package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -0
  320. package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts +11 -0
  321. package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
  322. package/lib/esm/Editing/Mutable/MutableEnumeration.js +11 -0
  323. package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -0
  324. package/lib/esm/Editing/Mutable/MutableFormat.d.ts +26 -0
  325. package/lib/esm/Editing/Mutable/MutableFormat.d.ts.map +1 -0
  326. package/lib/esm/Editing/Mutable/MutableFormat.js +12 -0
  327. package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -0
  328. package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
  329. package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
  330. package/lib/esm/Editing/Mutable/MutableInvertedUnit.js +12 -0
  331. package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
  332. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts +14 -0
  333. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
  334. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js +12 -0
  335. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
  336. package/lib/esm/Editing/Mutable/MutableMixin.d.ts +12 -0
  337. package/lib/esm/Editing/Mutable/MutableMixin.d.ts.map +1 -0
  338. package/lib/esm/Editing/Mutable/MutableMixin.js +12 -0
  339. package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -0
  340. package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts +8 -0
  341. package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts.map +1 -0
  342. package/lib/esm/Editing/Mutable/MutableNavigationProperty.js +12 -0
  343. package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -0
  344. package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts +11 -0
  345. package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
  346. package/lib/esm/Editing/Mutable/MutablePhenomenon.js +12 -0
  347. package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -0
  348. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts +13 -0
  349. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts.map +1 -0
  350. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js +12 -0
  351. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -0
  352. package/lib/esm/Editing/Mutable/MutableProperty.d.ts +16 -0
  353. package/lib/esm/Editing/Mutable/MutableProperty.d.ts.map +1 -0
  354. package/lib/esm/Editing/Mutable/MutableProperty.js +12 -0
  355. package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -0
  356. package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts +11 -0
  357. package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
  358. package/lib/esm/Editing/Mutable/MutablePropertyCategory.js +12 -0
  359. package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
  360. package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts +30 -0
  361. package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
  362. package/lib/esm/Editing/Mutable/MutableRelationshipClass.js +20 -0
  363. package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
  364. package/lib/esm/Editing/Mutable/MutableSchema.d.ts +51 -0
  365. package/lib/esm/Editing/Mutable/MutableSchema.d.ts.map +1 -0
  366. package/lib/esm/Editing/Mutable/MutableSchema.js +14 -0
  367. package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -0
  368. package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
  369. package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
  370. package/lib/esm/Editing/Mutable/MutableSchemaItem.js +12 -0
  371. package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -0
  372. package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts +8 -0
  373. package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts.map +1 -0
  374. package/lib/esm/Editing/Mutable/MutableStructProperty.js +12 -0
  375. package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -0
  376. package/lib/esm/Editing/Mutable/MutableUnit.d.ts +12 -0
  377. package/lib/esm/Editing/Mutable/MutableUnit.d.ts.map +1 -0
  378. package/lib/esm/Editing/Mutable/MutableUnit.js +12 -0
  379. package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -0
  380. package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts +10 -0
  381. package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
  382. package/lib/esm/Editing/Mutable/MutableUnitSystem.js +12 -0
  383. package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -0
  384. package/lib/esm/Editing/Phenomena.d.ts +17 -0
  385. package/lib/esm/Editing/Phenomena.d.ts.map +1 -0
  386. package/lib/esm/Editing/Phenomena.js +44 -0
  387. package/lib/esm/Editing/Phenomena.js.map +1 -0
  388. package/lib/esm/Editing/Properties.d.ts +206 -0
  389. package/lib/esm/Editing/Properties.d.ts.map +1 -0
  390. package/lib/esm/Editing/Properties.js +415 -0
  391. package/lib/esm/Editing/Properties.js.map +1 -0
  392. package/lib/esm/Editing/PropertyCategories.d.ts +18 -0
  393. package/lib/esm/Editing/PropertyCategories.d.ts.map +1 -0
  394. package/lib/esm/Editing/PropertyCategories.js +54 -0
  395. package/lib/esm/Editing/PropertyCategories.js.map +1 -0
  396. package/lib/esm/Editing/RelationshipClasses.d.ts +69 -0
  397. package/lib/esm/Editing/RelationshipClasses.d.ts.map +1 -0
  398. package/lib/esm/Editing/RelationshipClasses.js +236 -0
  399. package/lib/esm/Editing/RelationshipClasses.js.map +1 -0
  400. package/lib/esm/Editing/SchemaItems.d.ts +42 -0
  401. package/lib/esm/Editing/SchemaItems.d.ts.map +1 -0
  402. package/lib/esm/Editing/SchemaItems.js +104 -0
  403. package/lib/esm/Editing/SchemaItems.js.map +1 -0
  404. package/lib/esm/Editing/Structs.d.ts +21 -0
  405. package/lib/esm/Editing/Structs.d.ts.map +1 -0
  406. package/lib/esm/Editing/Structs.js +47 -0
  407. package/lib/esm/Editing/Structs.js.map +1 -0
  408. package/lib/esm/Editing/UnitSystems.d.ts +17 -0
  409. package/lib/esm/Editing/UnitSystems.d.ts.map +1 -0
  410. package/lib/esm/Editing/UnitSystems.js +43 -0
  411. package/lib/esm/Editing/UnitSystems.js.map +1 -0
  412. package/lib/esm/Editing/Units.d.ts +17 -0
  413. package/lib/esm/Editing/Units.d.ts.map +1 -0
  414. package/lib/esm/Editing/Units.js +49 -0
  415. package/lib/esm/Editing/Units.js.map +1 -0
  416. package/lib/esm/Merging/ClassMerger.d.ts +9 -0
  417. package/lib/esm/Merging/ClassMerger.d.ts.map +1 -0
  418. package/lib/esm/Merging/ClassMerger.js +66 -0
  419. package/lib/esm/Merging/ClassMerger.js.map +1 -0
  420. package/lib/esm/Merging/ConstantMerger.d.ts +14 -0
  421. package/lib/esm/Merging/ConstantMerger.d.ts.map +1 -0
  422. package/lib/esm/Merging/ConstantMerger.js +64 -0
  423. package/lib/esm/Merging/ConstantMerger.js.map +1 -0
  424. package/lib/esm/Merging/CustomAttributeClassMerger.d.ts +14 -0
  425. package/lib/esm/Merging/CustomAttributeClassMerger.d.ts.map +1 -0
  426. package/lib/esm/Merging/CustomAttributeClassMerger.js +36 -0
  427. package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -0
  428. package/lib/esm/Merging/CustomAttributeMerger.d.ts +19 -0
  429. package/lib/esm/Merging/CustomAttributeMerger.d.ts.map +1 -0
  430. package/lib/esm/Merging/CustomAttributeMerger.js +66 -0
  431. package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -0
  432. package/lib/esm/Merging/Edits/NameMapping.d.ts +22 -0
  433. package/lib/esm/Merging/Edits/NameMapping.d.ts.map +1 -0
  434. package/lib/esm/Merging/Edits/NameMapping.js +49 -0
  435. package/lib/esm/Merging/Edits/NameMapping.js.map +1 -0
  436. package/lib/esm/Merging/Edits/RenameEditHandler.d.ts +14 -0
  437. package/lib/esm/Merging/Edits/RenameEditHandler.d.ts.map +1 -0
  438. package/lib/esm/Merging/Edits/RenameEditHandler.js +62 -0
  439. package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -0
  440. package/lib/esm/Merging/Edits/SchemaEdits.d.ts +81 -0
  441. package/lib/esm/Merging/Edits/SchemaEdits.d.ts.map +1 -0
  442. package/lib/esm/Merging/Edits/SchemaEdits.js +112 -0
  443. package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -0
  444. package/lib/esm/Merging/Edits/SkipEditHandler.d.ts +14 -0
  445. package/lib/esm/Merging/Edits/SkipEditHandler.d.ts.map +1 -0
  446. package/lib/esm/Merging/Edits/SkipEditHandler.js +60 -0
  447. package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -0
  448. package/lib/esm/Merging/EntityClassMerger.d.ts +19 -0
  449. package/lib/esm/Merging/EntityClassMerger.d.ts.map +1 -0
  450. package/lib/esm/Merging/EntityClassMerger.js +39 -0
  451. package/lib/esm/Merging/EntityClassMerger.js.map +1 -0
  452. package/lib/esm/Merging/EnumerationMerger.d.ts +14 -0
  453. package/lib/esm/Merging/EnumerationMerger.d.ts.map +1 -0
  454. package/lib/esm/Merging/EnumerationMerger.js +48 -0
  455. package/lib/esm/Merging/EnumerationMerger.js.map +1 -0
  456. package/lib/esm/Merging/EnumeratorMerger.d.ts +14 -0
  457. package/lib/esm/Merging/EnumeratorMerger.d.ts.map +1 -0
  458. package/lib/esm/Merging/EnumeratorMerger.js +36 -0
  459. package/lib/esm/Merging/EnumeratorMerger.js.map +1 -0
  460. package/lib/esm/Merging/FormatMerger.d.ts +24 -0
  461. package/lib/esm/Merging/FormatMerger.d.ts.map +1 -0
  462. package/lib/esm/Merging/FormatMerger.js +137 -0
  463. package/lib/esm/Merging/FormatMerger.js.map +1 -0
  464. package/lib/esm/Merging/InvertedUnitMerger.d.ts +14 -0
  465. package/lib/esm/Merging/InvertedUnitMerger.d.ts.map +1 -0
  466. package/lib/esm/Merging/InvertedUnitMerger.js +41 -0
  467. package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -0
  468. package/lib/esm/Merging/KindOfQuantityMerger.d.ts +19 -0
  469. package/lib/esm/Merging/KindOfQuantityMerger.d.ts.map +1 -0
  470. package/lib/esm/Merging/KindOfQuantityMerger.js +89 -0
  471. package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -0
  472. package/lib/esm/Merging/MixinMerger.d.ts +14 -0
  473. package/lib/esm/Merging/MixinMerger.d.ts.map +1 -0
  474. package/lib/esm/Merging/MixinMerger.js +33 -0
  475. package/lib/esm/Merging/MixinMerger.js.map +1 -0
  476. package/lib/esm/Merging/PhenomenonMerger.d.ts +14 -0
  477. package/lib/esm/Merging/PhenomenonMerger.d.ts.map +1 -0
  478. package/lib/esm/Merging/PhenomenonMerger.js +36 -0
  479. package/lib/esm/Merging/PhenomenonMerger.js.map +1 -0
  480. package/lib/esm/Merging/PropertyCategoryMerger.d.ts +14 -0
  481. package/lib/esm/Merging/PropertyCategoryMerger.d.ts.map +1 -0
  482. package/lib/esm/Merging/PropertyCategoryMerger.js +31 -0
  483. package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -0
  484. package/lib/esm/Merging/PropertyMerger.d.ts +12 -0
  485. package/lib/esm/Merging/PropertyMerger.d.ts.map +1 -0
  486. package/lib/esm/Merging/PropertyMerger.js +228 -0
  487. package/lib/esm/Merging/PropertyMerger.js.map +1 -0
  488. package/lib/esm/Merging/RelationshipClassMerger.d.ts +27 -0
  489. package/lib/esm/Merging/RelationshipClassMerger.d.ts.map +1 -0
  490. package/lib/esm/Merging/RelationshipClassMerger.js +136 -0
  491. package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -0
  492. package/lib/esm/Merging/SchemaMerger.d.ts +49 -0
  493. package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -0
  494. package/lib/esm/Merging/SchemaMerger.js +117 -0
  495. package/lib/esm/Merging/SchemaMerger.js.map +1 -0
  496. package/lib/esm/Merging/SchemaMergingVisitor.d.ts +149 -0
  497. package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -0
  498. package/lib/esm/Merging/SchemaMergingVisitor.js +339 -0
  499. package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -0
  500. package/lib/esm/Merging/SchemaMergingWalker.d.ts +19 -0
  501. package/lib/esm/Merging/SchemaMergingWalker.d.ts.map +1 -0
  502. package/lib/esm/Merging/SchemaMergingWalker.js +61 -0
  503. package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -0
  504. package/lib/esm/Merging/SchemaReferenceMerger.d.ts +13 -0
  505. package/lib/esm/Merging/SchemaReferenceMerger.d.ts.map +1 -0
  506. package/lib/esm/Merging/SchemaReferenceMerger.js +57 -0
  507. package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -0
  508. package/lib/esm/Merging/StructClassMerger.d.ts +14 -0
  509. package/lib/esm/Merging/StructClassMerger.d.ts.map +1 -0
  510. package/lib/esm/Merging/StructClassMerger.js +20 -0
  511. package/lib/esm/Merging/StructClassMerger.js.map +1 -0
  512. package/lib/esm/Merging/UnitMerger.d.ts +14 -0
  513. package/lib/esm/Merging/UnitMerger.d.ts.map +1 -0
  514. package/lib/esm/Merging/UnitMerger.js +58 -0
  515. package/lib/esm/Merging/UnitMerger.js.map +1 -0
  516. package/lib/esm/Merging/UnitSystemMerger.d.ts +14 -0
  517. package/lib/esm/Merging/UnitSystemMerger.d.ts.map +1 -0
  518. package/lib/esm/Merging/UnitSystemMerger.js +24 -0
  519. package/lib/esm/Merging/UnitSystemMerger.js.map +1 -0
  520. package/lib/esm/Merging/Utils.d.ts +34 -0
  521. package/lib/esm/Merging/Utils.d.ts.map +1 -0
  522. package/lib/esm/Merging/Utils.js +90 -0
  523. package/lib/esm/Merging/Utils.js.map +1 -0
  524. package/lib/esm/Validation/Diagnostic.d.ts +322 -0
  525. package/lib/esm/Validation/Diagnostic.d.ts.map +1 -0
  526. package/lib/esm/Validation/Diagnostic.js +295 -0
  527. package/lib/esm/Validation/Diagnostic.js.map +1 -0
  528. package/lib/esm/Validation/DiagnosticReporter.d.ts +97 -0
  529. package/lib/esm/Validation/DiagnosticReporter.d.ts.map +1 -0
  530. package/lib/esm/Validation/DiagnosticReporter.js +105 -0
  531. package/lib/esm/Validation/DiagnosticReporter.js.map +1 -0
  532. package/lib/esm/Validation/ECRules.d.ts +454 -0
  533. package/lib/esm/Validation/ECRules.d.ts.map +1 -0
  534. package/lib/esm/Validation/ECRules.js +578 -0
  535. package/lib/esm/Validation/ECRules.js.map +1 -0
  536. package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts +14 -0
  537. package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
  538. package/lib/esm/Validation/LoggingDiagnosticReporter.js +37 -0
  539. package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -0
  540. package/lib/esm/Validation/RuleSuppressionSet.d.ts +60 -0
  541. package/lib/esm/Validation/RuleSuppressionSet.d.ts.map +1 -0
  542. package/lib/esm/Validation/RuleSuppressionSet.js +9 -0
  543. package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -0
  544. package/lib/esm/Validation/Rules.d.ts +65 -0
  545. package/lib/esm/Validation/Rules.d.ts.map +1 -0
  546. package/lib/esm/Validation/Rules.js +9 -0
  547. package/lib/esm/Validation/Rules.js.map +1 -0
  548. package/lib/esm/Validation/SchemaChanges.d.ts +640 -0
  549. package/lib/esm/Validation/SchemaChanges.d.ts.map +1 -0
  550. package/lib/esm/Validation/SchemaChanges.js +1141 -0
  551. package/lib/esm/Validation/SchemaChanges.js.map +1 -0
  552. package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts +423 -0
  553. package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
  554. package/lib/esm/Validation/SchemaCompareDiagnostics.js +109 -0
  555. package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -0
  556. package/lib/esm/Validation/SchemaCompareReporter.d.ts +12 -0
  557. package/lib/esm/Validation/SchemaCompareReporter.d.ts.map +1 -0
  558. package/lib/esm/Validation/SchemaCompareReporter.js +9 -0
  559. package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -0
  560. package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts +237 -0
  561. package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
  562. package/lib/esm/Validation/SchemaCompareResultDelegate.js +346 -0
  563. package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -0
  564. package/lib/esm/Validation/SchemaCompareVisitor.d.ts +120 -0
  565. package/lib/esm/Validation/SchemaCompareVisitor.d.ts.map +1 -0
  566. package/lib/esm/Validation/SchemaCompareVisitor.js +222 -0
  567. package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -0
  568. package/lib/esm/Validation/SchemaComparer.d.ts +211 -0
  569. package/lib/esm/Validation/SchemaComparer.d.ts.map +1 -0
  570. package/lib/esm/Validation/SchemaComparer.js +770 -0
  571. package/lib/esm/Validation/SchemaComparer.js.map +1 -0
  572. package/lib/esm/Validation/SchemaValidater.d.ts +20 -0
  573. package/lib/esm/Validation/SchemaValidater.d.ts.map +1 -0
  574. package/lib/esm/Validation/SchemaValidater.js +55 -0
  575. package/lib/esm/Validation/SchemaValidater.js.map +1 -0
  576. package/lib/esm/Validation/SchemaValidationVisitor.d.ts +171 -0
  577. package/lib/esm/Validation/SchemaValidationVisitor.d.ts.map +1 -0
  578. package/lib/esm/Validation/SchemaValidationVisitor.js +488 -0
  579. package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -0
  580. package/lib/esm/Validation/SchemaWalker.d.ts +23 -0
  581. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
  582. package/lib/esm/Validation/SchemaWalker.js +50 -0
  583. package/lib/esm/Validation/SchemaWalker.js.map +1 -0
  584. package/lib/esm/ecschema-editing.d.ts +49 -0
  585. package/lib/esm/ecschema-editing.d.ts.map +1 -0
  586. package/lib/esm/ecschema-editing.js +52 -0
  587. package/lib/esm/ecschema-editing.js.map +1 -0
  588. package/package.json +19 -17
  589. package/public/locales/en/ECSchemaEditing.json +26 -26
@@ -0,0 +1,357 @@
1
+ /** @packageDocumentation
2
+ * @module Differencing
3
+ */
4
+ import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
5
+ import { AnySchemaEdits } from "../Merging/Edits/SchemaEdits";
6
+ import { AnyEnumerator, AnyPropertyProps, ConstantProps, CustomAttribute, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps, type Schema, SchemaItemFormatProps, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps } from "@itwin/ecschema-metadata";
7
+ /** Utility-Type to remove possible readonly flags on the given type. */
8
+ type PartialEditable<T> = {
9
+ -readonly [P in keyof T]?: T[P];
10
+ };
11
+ /**
12
+ * Utility-Type to simplify the expected SchemaItem props by omitting the base properties
13
+ * that are not needed for the schema differencing. Also all properties are made mutable
14
+ * by removing the readonly flag if present.
15
+ */
16
+ type SchemaItemProperties<T extends SchemaItemProps> = {
17
+ [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, "label" | "description" | "customAttributes">>>]: T[P];
18
+ };
19
+ /**
20
+ * Defines the type of the difference operation.
21
+ * @alpha
22
+ */
23
+ export type DifferenceType = "add" | "modify";
24
+ /**
25
+ * Defines the SchemaTypes that are not SchemaItems.
26
+ * @alpha
27
+ */
28
+ export declare enum SchemaOtherTypes {
29
+ Schema = "Schema",
30
+ SchemaReference = "SchemaReference",
31
+ Property = "Property",
32
+ Enumerator = "Enumerator",
33
+ CustomAttributeInstance = "CustomAttributeInstance",
34
+ RelationshipConstraint = "RelationshipConstraint",
35
+ RelationshipConstraintClass = "RelationshipConstraintClass",
36
+ EntityClassMixin = "EntityClassMixin",
37
+ KindOfQuantityPresentationFormat = "KindOfQuantityPresentationFormat",
38
+ FormatUnit = "FormatUnit",
39
+ FormatUnitLabel = "FormatUnitLabel"
40
+ }
41
+ /**
42
+ * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.
43
+ * @alpha
44
+ */
45
+ export type SchemaType = SchemaOtherTypes | SchemaItemType;
46
+ /**
47
+ * Definition of the difference result between two Schemas.
48
+ * @alpha
49
+ */
50
+ export interface SchemaDifferenceResult {
51
+ /** Full name of the source schema */
52
+ readonly sourceSchemaName: string;
53
+ /** Full name of the target schema */
54
+ readonly targetSchemaName: string;
55
+ /** List of differences between the compared schemas. */
56
+ readonly differences: AnySchemaDifference[];
57
+ /** List of conflicts found while comparing the schemas. */
58
+ readonly conflicts?: AnySchemaDifferenceConflict[];
59
+ }
60
+ /**
61
+ * Union of all supported schema differencing types.
62
+ * @alpha
63
+ */
64
+ export type AnySchemaDifference = SchemaDifference | SchemaReferenceDifference | AnySchemaItemDifference | AnySchemaItemPathDifference | EntityClassMixinDifference | CustomAttributeDifference | KindOfQuantityPresentationFormatDifference | FormatUnitDifference;
65
+ /**
66
+ * Differencing entry for changes on a Schema.
67
+ * @alpha
68
+ */
69
+ export interface SchemaDifference {
70
+ readonly changeType: "modify";
71
+ readonly schemaType: SchemaOtherTypes.Schema;
72
+ readonly difference: {
73
+ label?: string;
74
+ description?: string;
75
+ };
76
+ }
77
+ /**
78
+ * Differencing entry for added or changed Schema References of a Schema.
79
+ * @alpha
80
+ */
81
+ export interface SchemaReferenceDifference {
82
+ readonly changeType: "add" | "modify";
83
+ readonly schemaType: SchemaOtherTypes.SchemaReference;
84
+ readonly difference: SchemaReferenceProps;
85
+ }
86
+ /**
87
+ * Union of all supported schema item differencing types.
88
+ * @alpha
89
+ */
90
+ export type AnySchemaItemDifference = AnyClassItemDifference | ConstantDifference | EnumerationDifference | FormatDifference | KindOfQuantityDifference | InvertedUnitDifference | PhenomenonDifference | PropertyCategoryDifference | UnitDifference | UnitSystemDifference;
91
+ /**
92
+ * Union for supported class Schema Items.
93
+ * @alpha
94
+ */
95
+ export type AnyClassItemDifference = EntityClassDifference | MixinClassDifference | StructClassDifference | CustomAttributeClassDifference | RelationshipClassDifference;
96
+ /**
97
+ * Union of all differences that have a path pointing inside a schema item.
98
+ * @alpha
99
+ */
100
+ export type AnySchemaItemPathDifference = RelationshipConstraintDifference | RelationshipConstraintClassDifference | CustomAttributePropertyDifference | EnumeratorDifference | ClassPropertyDifference | FormatUnitLabelDifference;
101
+ /**
102
+ * Internal base class for all Schema Item differencing entries.
103
+ * @alpha
104
+ */
105
+ interface SchemaItemDifference<T extends SchemaItemProps> {
106
+ readonly changeType: "add" | "modify";
107
+ readonly itemName: string;
108
+ readonly difference: SchemaItemProperties<T>;
109
+ }
110
+ /**
111
+ * Differencing entry for Constant Schema Items.
112
+ * @alpha
113
+ */
114
+ export interface ConstantDifference extends SchemaItemDifference<ConstantProps> {
115
+ readonly schemaType: SchemaItemType.Constant;
116
+ }
117
+ /**
118
+ * Differencing entry for Custom Attribute Class Schema Items.
119
+ * @alpha
120
+ */
121
+ export interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {
122
+ readonly schemaType: SchemaItemType.CustomAttributeClass;
123
+ }
124
+ /**
125
+ * Differencing entry for Entity Class Schema Items.
126
+ * @alpha
127
+ */
128
+ export interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {
129
+ readonly schemaType: SchemaItemType.EntityClass;
130
+ }
131
+ /**
132
+ * Differencing entry for Enumerator Schema Items.
133
+ * @alpha
134
+ */
135
+ export interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {
136
+ readonly schemaType: SchemaItemType.Enumeration;
137
+ }
138
+ /**
139
+ * Differencing entry for Kind-Of-Quantities Schema Items.
140
+ * @alpha
141
+ */
142
+ export interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {
143
+ readonly schemaType: SchemaItemType.KindOfQuantity;
144
+ }
145
+ /**
146
+ * Differencing entry for Mixin Class Schema Items.
147
+ * @alpha
148
+ */
149
+ export interface MixinClassDifference extends SchemaItemDifference<MixinProps> {
150
+ readonly schemaType: SchemaItemType.Mixin;
151
+ }
152
+ /**
153
+ * Differencing entry for Phenomenon Schema Items.
154
+ * @alpha
155
+ */
156
+ export interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {
157
+ readonly schemaType: SchemaItemType.Phenomenon;
158
+ }
159
+ /**
160
+ * Differencing entry for Property Category Schema Items.
161
+ * @alpha
162
+ */
163
+ export interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {
164
+ readonly schemaType: SchemaItemType.PropertyCategory;
165
+ }
166
+ /**
167
+ * Differencing entry for Relationship Class Schema Items.
168
+ * @alpha
169
+ */
170
+ export interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {
171
+ readonly schemaType: SchemaItemType.RelationshipClass;
172
+ }
173
+ /**
174
+ * Differencing entry for Struct Class Schema Items.
175
+ * @alpha
176
+ */
177
+ export interface StructClassDifference extends SchemaItemDifference<StructClassProps> {
178
+ readonly schemaType: SchemaItemType.StructClass;
179
+ }
180
+ /**
181
+ * Differencing entry for Unit System Schema Items.
182
+ * @alpha
183
+ */
184
+ export interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {
185
+ readonly schemaType: SchemaItemType.UnitSystem;
186
+ }
187
+ /**
188
+ * Differencing entry for Unit Schema Items.
189
+ * @alpha
190
+ */
191
+ export interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {
192
+ readonly schemaType: SchemaItemType.Unit;
193
+ }
194
+ /**
195
+ * Differencing entry for Inverted Unit Schema Items.
196
+ * @alpha
197
+ */
198
+ export interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {
199
+ readonly schemaType: SchemaItemType.InvertedUnit;
200
+ }
201
+ /**
202
+ * Differencing entry for Format Schema Items.
203
+ * @alpha
204
+ */
205
+ export interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {
206
+ readonly schemaType: SchemaItemType.Format;
207
+ }
208
+ /**
209
+ * Differencing entry for added or changed Properties.
210
+ * @alpha
211
+ */
212
+ export interface ClassPropertyDifference {
213
+ readonly changeType: "add" | "modify";
214
+ readonly schemaType: SchemaOtherTypes.Property;
215
+ readonly itemName: string;
216
+ readonly path: string;
217
+ readonly difference: PartialEditable<AnyPropertyProps>;
218
+ }
219
+ /**
220
+ * Union of supported Custom Attribute Differences.
221
+ * @alpha
222
+ */
223
+ export type CustomAttributeDifference = CustomAttributeSchemaDifference | CustomAttributeSchemaItemDifference | CustomAttributePropertyDifference | CustomAttributeRelationshipConstraintDifference;
224
+ /**
225
+ * Differencing entry for Custom Attributes on Schema.
226
+ * @alpha
227
+ */
228
+ export interface CustomAttributeSchemaDifference {
229
+ readonly changeType: "add";
230
+ readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
231
+ readonly appliedTo: "Schema";
232
+ readonly difference: PartialEditable<CustomAttribute>;
233
+ }
234
+ /**
235
+ * Differencing entry for Custom Attributes on Schema Items.
236
+ * @alpha
237
+ */
238
+ export interface CustomAttributeSchemaItemDifference {
239
+ readonly changeType: "add";
240
+ readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
241
+ readonly appliedTo: "SchemaItem";
242
+ readonly itemName: string;
243
+ readonly difference: PartialEditable<CustomAttribute>;
244
+ }
245
+ /**
246
+ * Differencing entry for Custom Attributes on Properties.
247
+ * @alpha
248
+ */
249
+ export interface CustomAttributePropertyDifference {
250
+ readonly changeType: "add";
251
+ readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
252
+ readonly appliedTo: "Property";
253
+ readonly itemName: string;
254
+ readonly path: string;
255
+ readonly difference: PartialEditable<CustomAttribute>;
256
+ }
257
+ /**
258
+ * Differencing entry for Custom Attributes on Relationship Constraints.
259
+ * @alpha
260
+ */
261
+ export interface CustomAttributeRelationshipConstraintDifference {
262
+ readonly changeType: "add";
263
+ readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;
264
+ readonly appliedTo: "RelationshipConstraint";
265
+ readonly itemName: string;
266
+ readonly path: "$source" | "$target";
267
+ readonly difference: PartialEditable<CustomAttribute>;
268
+ }
269
+ /**
270
+ * Differencing entry for changed mixins on EntityClasses.
271
+ * @alpha
272
+ */
273
+ export interface EntityClassMixinDifference {
274
+ readonly changeType: "add";
275
+ readonly schemaType: SchemaOtherTypes.EntityClassMixin;
276
+ readonly itemName: string;
277
+ readonly difference: string[];
278
+ }
279
+ /**
280
+ * Differencing entry for changed Enumerators on Enumerable Schema Items.
281
+ * @alpha
282
+ */
283
+ export interface EnumeratorDifference {
284
+ readonly changeType: "add" | "modify";
285
+ readonly schemaType: SchemaOtherTypes.Enumerator;
286
+ readonly itemName: string;
287
+ readonly path: string;
288
+ readonly difference: PartialEditable<AnyEnumerator>;
289
+ }
290
+ /**
291
+ * Differencing entry for Relationship Constraints.
292
+ * @alpha
293
+ */
294
+ export interface RelationshipConstraintDifference {
295
+ readonly changeType: "modify";
296
+ readonly schemaType: SchemaOtherTypes.RelationshipConstraint;
297
+ readonly itemName: string;
298
+ readonly path: "$source" | "$target";
299
+ readonly difference: PartialEditable<Omit<RelationshipConstraintProps, "constraintClasses">>;
300
+ }
301
+ /**
302
+ * Differencing entry for constraint classes added to Relationship Constrains.
303
+ * @alpha
304
+ */
305
+ export interface RelationshipConstraintClassDifference {
306
+ readonly changeType: "add";
307
+ readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;
308
+ readonly itemName: string;
309
+ readonly path: "$source" | "$target";
310
+ readonly difference: string[];
311
+ }
312
+ /**
313
+ * Differencing entry for presentation formats added to KindOfQuantities.
314
+ * @alpha
315
+ */
316
+ export interface KindOfQuantityPresentationFormatDifference {
317
+ readonly changeType: "add";
318
+ readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;
319
+ readonly itemName: string;
320
+ readonly difference: string[];
321
+ }
322
+ /**
323
+ * Differencing entry for changed Units on Formats.
324
+ * @alpha
325
+ */
326
+ export interface FormatUnitDifference {
327
+ readonly changeType: "modify";
328
+ readonly schemaType: SchemaOtherTypes.FormatUnit;
329
+ readonly itemName: string;
330
+ readonly difference: {
331
+ name: string;
332
+ label?: string;
333
+ }[];
334
+ }
335
+ /**
336
+ * Differencing entry for changed labels on Format Units.
337
+ * @alpha
338
+ */
339
+ export interface FormatUnitLabelDifference {
340
+ readonly changeType: "modify";
341
+ readonly schemaType: SchemaOtherTypes.FormatUnitLabel;
342
+ readonly itemName: string;
343
+ readonly path: string;
344
+ readonly difference: {
345
+ label?: string;
346
+ };
347
+ }
348
+ /**
349
+ * Creates a [[SchemaDifferenceResult]] for two given schemas.
350
+ * @param targetSchema The schema the differences gets merged into.
351
+ * @param sourceSchema The schema to get merged in the target.
352
+ * @returns An [[SchemaDifferenceResult]] object.
353
+ * @alpha
354
+ */
355
+ export declare function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult>;
356
+ export {};
357
+ //# sourceMappingURL=SchemaDifference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDifference.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAkB,MAAM,8BAA8B,CAAC;AAI9E,OAAO,EAAE,aAAa,EAAe,gBAAgB,EAAE,aAAa,EAAE,eAAe,EACnF,yBAAyB,EAAW,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,mBAAmB,EAC9G,UAAU,EAAE,eAAe,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,2BAA2B,EACvG,KAAK,MAAM,EAAc,qBAAqB,EAAiB,eAAe,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,eAAe,EAC7K,MAAM,0BAA0B,CAAC;AAKlC,wEAAwE;AACxE,KAAK,eAAe,CAAC,CAAC,IAAI;IACxB,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CAChC,CAAC;AAEF;;;;GAIG;AACH,KAAK,oBAAoB,CAAC,CAAC,SAAS,eAAe,IAAI;KACpD,CAAC,IAAI,MAAM,eAAe,CAAC,IAAI,CAAC,C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AC;IAC1B,QAAQ,CAAC,UAAU,EAAE;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,EAAE,CAAC;CACL;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC;IAC9B,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC,eAAe,CAAC;IACtD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;CACH;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAmC9J"}
@@ -0,0 +1,106 @@
1
+ /*---------------------------------------------------------------------------------------------
2
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
+ * See LICENSE.md in the project root for license terms and full copyright notice.
4
+ *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Differencing
7
+ */
8
+ import { SchemaEditType } from "../Merging/Edits/SchemaEdits";
9
+ import { SchemaDiagnosticVisitor } from "./SchemaDiagnosticVisitor";
10
+ import { SchemaComparer } from "../Validation/SchemaComparer";
11
+ import { SchemaItem, } from "@itwin/ecschema-metadata";
12
+ import { validateDifferences } from "./SchemaDifferenceValidator";
13
+ import { NameMapping, PropertyKey } from "../Merging/Edits/NameMapping";
14
+ /**
15
+ * Defines the SchemaTypes that are not SchemaItems.
16
+ * @alpha
17
+ */
18
+ export 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["KindOfQuantityPresentationFormat"] = "KindOfQuantityPresentationFormat";
29
+ SchemaOtherTypes["FormatUnit"] = "FormatUnit";
30
+ SchemaOtherTypes["FormatUnitLabel"] = "FormatUnitLabel";
31
+ })(SchemaOtherTypes || (SchemaOtherTypes = {}));
32
+ /**
33
+ * Creates a [[SchemaDifferenceResult]] for two given schemas.
34
+ * @param targetSchema The schema the differences gets merged into.
35
+ * @param sourceSchema The schema to get merged in the target.
36
+ * @returns An [[SchemaDifferenceResult]] object.
37
+ * @alpha
38
+ */
39
+ export async function getSchemaDifferences(targetSchema, sourceSchema, schemaEdits) {
40
+ const schemaComparer = new DifferenceSchemaComparer();
41
+ if (schemaEdits) {
42
+ for (const edit of schemaEdits) {
43
+ if (edit.type === SchemaEditType.RenameSchemaItem) {
44
+ schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);
45
+ }
46
+ if (edit.type === SchemaEditType.RenameProperty) {
47
+ schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);
48
+ }
49
+ }
50
+ }
51
+ await schemaComparer.compareSchemas(sourceSchema, targetSchema);
52
+ const visitor = new SchemaDiagnosticVisitor();
53
+ for (const diagnostic of schemaComparer.diagnostics) {
54
+ visitor.visit(diagnostic);
55
+ }
56
+ const differences = [
57
+ ...visitor.schemaDifferences,
58
+ ...visitor.schemaItemDifferences,
59
+ ...visitor.schemaItemPathDifferences,
60
+ ...visitor.customAttributeDifferences,
61
+ ];
62
+ const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);
63
+ return {
64
+ sourceSchemaName: sourceSchema.schemaKey.toString(),
65
+ targetSchemaName: targetSchema.schemaKey.toString(),
66
+ conflicts: conflicts.length > 0 ? conflicts : undefined,
67
+ differences,
68
+ };
69
+ }
70
+ /**
71
+ * Implementation of a SchemaComparer that is used in the schema differencing process.
72
+ * It extends the SchemaComparer base class with additional functionality to store the
73
+ * name mappings of renamed schema items and properties.
74
+ *
75
+ * @internal
76
+ */
77
+ class DifferenceSchemaComparer extends SchemaComparer {
78
+ nameMappings;
79
+ _changes;
80
+ get diagnostics() {
81
+ return this._changes[0].allDiagnostics;
82
+ }
83
+ constructor() {
84
+ super({ report: (changes) => this._changes.push(changes) });
85
+ this._changes = [];
86
+ this.nameMappings = new NameMapping();
87
+ }
88
+ async resolveItem(item, lookupSchema, itemConstructor) {
89
+ const classKey = this.nameMappings.resolveItemKey(item.key);
90
+ return lookupSchema.lookupItem(classKey.name, itemConstructor);
91
+ }
92
+ async resolveProperty(propertyA, ecClass) {
93
+ const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));
94
+ return ecClass.getProperty(propertyKey.propertyName);
95
+ }
96
+ areEqualByName(itemKeyA, itemKeyB) {
97
+ if (itemKeyA) {
98
+ if (SchemaItem.isSchemaItem(itemKeyA)) {
99
+ itemKeyA = itemKeyA.key;
100
+ }
101
+ itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);
102
+ }
103
+ return super.areEqualByName(itemKeyA, itemKeyB);
104
+ }
105
+ }
106
+ //# sourceMappingURL=SchemaDifference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDifference.js","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifference.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAkB,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,OAAO,EAAE,cAAc,EAAE,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cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC5D,OAAO,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACjE,CAAC;IAEe,KAAK,CAAC,eAAe,CAAC,SAAsB,EAAE,OAAgB;QAC5E,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,IAAI,WAAW,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAC/G,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,YAAY,CAAqC,CAAC;IAC3F,CAAC;IAEe,cAAc,CAAC,QAA+C,EAAE,QAA+C;QAC7H,IAAI,QAAQ,EAAE,CAAC;YACb,IAAI,UAAU,CAAC,YAAY,CAAC,QAAQ,CAAC,EAAE,CAAC;gBACtC,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC;YAC1B,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACxD,CAAC;QACD,OAAO,KAAK,CAAC,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAClD,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Differencing\n */\n\nimport { AnySchemaDifferenceConflict } from \"./SchemaConflicts\";\nimport { AnySchemaEdits, SchemaEditType } from \"../Merging/Edits/SchemaEdits\";\nimport { SchemaDiagnosticVisitor } from \"./SchemaDiagnosticVisitor\";\nimport { SchemaChanges } from \"../Validation/SchemaChanges\";\nimport { SchemaComparer } from \"../Validation/SchemaComparer\";\nimport { AnyEnumerator, AnyProperty, AnyPropertyProps, ConstantProps, CustomAttribute,\n CustomAttributeClassProps, ECClass, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps,\n MixinProps, PhenomenonProps, PropertyCategoryProps, RelationshipClassProps, RelationshipConstraintProps,\n type Schema, SchemaItem, SchemaItemFormatProps, SchemaItemKey, SchemaItemProps, SchemaItemType, SchemaItemUnitProps, SchemaReferenceProps, StructClassProps, UnitSystemProps,\n} from \"@itwin/ecschema-metadata\";\nimport { validateDifferences } from \"./SchemaDifferenceValidator\";\nimport { AnyDiagnostic } from \"../Validation/Diagnostic\";\nimport { NameMapping, PropertyKey } from \"../Merging/Edits/NameMapping\";\n\n/** Utility-Type to remove possible readonly flags on the given type. */\ntype PartialEditable<T> = {\n -readonly [P in keyof T]?: T[P];\n};\n\n/**\n * Utility-Type to simplify the expected SchemaItem props by omitting the base properties\n * that are not needed for the schema differencing. Also all properties are made mutable\n * by removing the readonly flag if present.\n */\ntype SchemaItemProperties<T extends SchemaItemProps> = {\n [P in keyof PartialEditable<Omit<T, keyof Omit<SchemaItemProps, \"label\" | \"description\" | \"customAttributes\">>>]: T[P]\n};\n\n/**\n * Defines the type of the difference operation.\n * @alpha\n */\nexport type DifferenceType = \"add\" | \"modify\";\n\n/**\n * Defines the SchemaTypes that are not SchemaItems.\n * @alpha\n */\nexport enum SchemaOtherTypes {\n Schema = \"Schema\",\n SchemaReference = \"SchemaReference\",\n Property = \"Property\",\n Enumerator = \"Enumerator\",\n CustomAttributeInstance = \"CustomAttributeInstance\",\n RelationshipConstraint = \"RelationshipConstraint\",\n RelationshipConstraintClass = \"RelationshipConstraintClass\",\n EntityClassMixin = \"EntityClassMixin\",\n KindOfQuantityPresentationFormat = \"KindOfQuantityPresentationFormat\",\n FormatUnit = \"FormatUnit\",\n FormatUnitLabel = \"FormatUnitLabel\",\n}\n\n/**\n * Defines the possible values SchemaTypes that can occur in SchemaDifferences or Conflicts.\n * @alpha\n */\nexport type SchemaType = SchemaOtherTypes | SchemaItemType;\n\n/**\n * Definition of the difference result between two Schemas.\n * @alpha\n */\nexport interface SchemaDifferenceResult {\n /** Full name of the source schema */\n readonly sourceSchemaName: string;\n /** Full name of the target schema */\n readonly targetSchemaName: string;\n\n /** List of differences between the compared schemas. */\n readonly differences: AnySchemaDifference[];\n\n /** List of conflicts found while comparing the schemas. */\n readonly conflicts?: AnySchemaDifferenceConflict[];\n}\n\n/**\n * Union of all supported schema differencing types.\n * @alpha\n */\nexport type AnySchemaDifference =\n SchemaDifference |\n SchemaReferenceDifference |\n AnySchemaItemDifference |\n AnySchemaItemPathDifference |\n EntityClassMixinDifference |\n CustomAttributeDifference |\n KindOfQuantityPresentationFormatDifference |\n FormatUnitDifference;\n\n/**\n * Differencing entry for changes on a Schema.\n * @alpha\n */\nexport interface SchemaDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.Schema;\n readonly difference: {\n label?: string;\n description?: string;\n };\n}\n\n/**\n * Differencing entry for added or changed Schema References of a Schema.\n * @alpha\n */\nexport interface SchemaReferenceDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.SchemaReference;\n readonly difference: SchemaReferenceProps;\n}\n\n/**\n * Union of all supported schema item differencing types.\n * @alpha\n */\nexport type AnySchemaItemDifference =\n AnyClassItemDifference |\n ConstantDifference |\n EnumerationDifference |\n FormatDifference |\n KindOfQuantityDifference |\n InvertedUnitDifference |\n PhenomenonDifference |\n PropertyCategoryDifference |\n UnitDifference |\n UnitSystemDifference;\n\n/**\n * Union for supported class Schema Items.\n * @alpha\n */\nexport type AnyClassItemDifference =\n EntityClassDifference |\n MixinClassDifference |\n StructClassDifference |\n CustomAttributeClassDifference |\n RelationshipClassDifference;\n\n/**\n * Union of all differences that have a path pointing inside a schema item.\n * @alpha\n */\nexport type AnySchemaItemPathDifference =\n RelationshipConstraintDifference |\n RelationshipConstraintClassDifference |\n CustomAttributePropertyDifference |\n EnumeratorDifference |\n ClassPropertyDifference |\n FormatUnitLabelDifference;\n\n/**\n * Internal base class for all Schema Item differencing entries.\n * @alpha\n */\ninterface SchemaItemDifference<T extends SchemaItemProps> {\n readonly changeType: \"add\" | \"modify\";\n readonly itemName: string;\n readonly difference: SchemaItemProperties<T>;\n}\n\n/**\n * Differencing entry for Constant Schema Items.\n * @alpha\n */\nexport interface ConstantDifference extends SchemaItemDifference<ConstantProps> {\n readonly schemaType: SchemaItemType.Constant;\n}\n\n/**\n * Differencing entry for Custom Attribute Class Schema Items.\n * @alpha\n */\nexport interface CustomAttributeClassDifference extends SchemaItemDifference<CustomAttributeClassProps> {\n readonly schemaType: SchemaItemType.CustomAttributeClass;\n}\n\n/**\n * Differencing entry for Entity Class Schema Items.\n * @alpha\n */\nexport interface EntityClassDifference extends SchemaItemDifference<EntityClassProps> {\n readonly schemaType: SchemaItemType.EntityClass;\n}\n\n/**\n * Differencing entry for Enumerator Schema Items.\n * @alpha\n */\nexport interface EnumerationDifference extends SchemaItemDifference<EnumerationProps> {\n readonly schemaType: SchemaItemType.Enumeration;\n}\n\n/**\n * Differencing entry for Kind-Of-Quantities Schema Items.\n * @alpha\n */\nexport interface KindOfQuantityDifference extends SchemaItemDifference<KindOfQuantityProps> {\n readonly schemaType: SchemaItemType.KindOfQuantity;\n}\n\n/**\n * Differencing entry for Mixin Class Schema Items.\n * @alpha\n */\nexport interface MixinClassDifference extends SchemaItemDifference<MixinProps> {\n readonly schemaType: SchemaItemType.Mixin;\n}\n\n/**\n * Differencing entry for Phenomenon Schema Items.\n * @alpha\n */\nexport interface PhenomenonDifference extends SchemaItemDifference<PhenomenonProps> {\n readonly schemaType: SchemaItemType.Phenomenon;\n}\n\n/**\n * Differencing entry for Property Category Schema Items.\n * @alpha\n */\nexport interface PropertyCategoryDifference extends SchemaItemDifference<PropertyCategoryProps> {\n readonly schemaType: SchemaItemType.PropertyCategory;\n}\n\n/**\n * Differencing entry for Relationship Class Schema Items.\n * @alpha\n */\nexport interface RelationshipClassDifference extends SchemaItemDifference<RelationshipClassProps> {\n readonly schemaType: SchemaItemType.RelationshipClass;\n}\n\n/**\n * Differencing entry for Struct Class Schema Items.\n * @alpha\n */\nexport interface StructClassDifference extends SchemaItemDifference<StructClassProps> {\n readonly schemaType: SchemaItemType.StructClass;\n}\n\n/**\n * Differencing entry for Unit System Schema Items.\n * @alpha\n */\nexport interface UnitSystemDifference extends SchemaItemDifference<UnitSystemProps> {\n readonly schemaType: SchemaItemType.UnitSystem;\n}\n\n/**\n * Differencing entry for Unit Schema Items.\n * @alpha\n */\nexport interface UnitDifference extends SchemaItemDifference<SchemaItemUnitProps> {\n readonly schemaType: SchemaItemType.Unit;\n}\n\n/**\n * Differencing entry for Inverted Unit Schema Items.\n * @alpha\n */\nexport interface InvertedUnitDifference extends SchemaItemDifference<InvertedUnitProps> {\n readonly schemaType: SchemaItemType.InvertedUnit;\n}\n/**\n * Differencing entry for Format Schema Items.\n * @alpha\n */\nexport interface FormatDifference extends SchemaItemDifference<SchemaItemFormatProps> {\n readonly schemaType: SchemaItemType.Format;\n}\n\n/**\n * Differencing entry for added or changed Properties.\n * @alpha\n */\nexport interface ClassPropertyDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Property;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyPropertyProps>;\n}\n\n/**\n * Union of supported Custom Attribute Differences.\n * @alpha\n */\nexport type CustomAttributeDifference =\n CustomAttributeSchemaDifference |\n CustomAttributeSchemaItemDifference |\n CustomAttributePropertyDifference |\n CustomAttributeRelationshipConstraintDifference;\n\n/**\n * Differencing entry for Custom Attributes on Schema.\n * @alpha\n */\nexport interface CustomAttributeSchemaDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Schema\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Schema Items.\n * @alpha\n */\nexport interface CustomAttributeSchemaItemDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"SchemaItem\";\n readonly itemName: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Properties.\n * @alpha\n */\nexport interface CustomAttributePropertyDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"Property\";\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for Custom Attributes on Relationship Constraints.\n * @alpha\n */\nexport interface CustomAttributeRelationshipConstraintDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.CustomAttributeInstance;\n readonly appliedTo: \"RelationshipConstraint\";\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<CustomAttribute>;\n}\n\n/**\n * Differencing entry for changed mixins on EntityClasses.\n * @alpha\n */\nexport interface EntityClassMixinDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.EntityClassMixin;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Enumerators on Enumerable Schema Items.\n * @alpha\n */\nexport interface EnumeratorDifference {\n readonly changeType: \"add\" | \"modify\";\n readonly schemaType: SchemaOtherTypes.Enumerator;\n readonly itemName: string;\n readonly path: string;\n readonly difference: PartialEditable<AnyEnumerator>;\n}\n\n/**\n * Differencing entry for Relationship Constraints.\n * @alpha\n */\nexport interface RelationshipConstraintDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraint;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: PartialEditable<Omit<RelationshipConstraintProps, \"constraintClasses\">>;\n}\n\n/**\n * Differencing entry for constraint classes added to Relationship Constrains.\n * @alpha\n */\nexport interface RelationshipConstraintClassDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.RelationshipConstraintClass;\n readonly itemName: string;\n readonly path: \"$source\" | \"$target\";\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for presentation formats added to KindOfQuantities.\n * @alpha\n */\nexport interface KindOfQuantityPresentationFormatDifference {\n readonly changeType: \"add\";\n readonly schemaType: SchemaOtherTypes.KindOfQuantityPresentationFormat;\n readonly itemName: string;\n readonly difference: string[];\n}\n\n/**\n * Differencing entry for changed Units on Formats.\n * @alpha\n */\nexport interface FormatUnitDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnit;\n readonly itemName: string;\n readonly difference: {\n name: string;\n label?: string;\n }[];\n}\n\n/**\n * Differencing entry for changed labels on Format Units.\n * @alpha\n */\nexport interface FormatUnitLabelDifference {\n readonly changeType: \"modify\";\n readonly schemaType: SchemaOtherTypes.FormatUnitLabel;\n readonly itemName: string;\n readonly path: string;\n readonly difference: {\n label?: string;\n };\n}\n\n/**\n * Creates a [[SchemaDifferenceResult]] for two given schemas.\n * @param targetSchema The schema the differences gets merged into.\n * @param sourceSchema The schema to get merged in the target.\n * @returns An [[SchemaDifferenceResult]] object.\n * @alpha\n */\nexport async function getSchemaDifferences(targetSchema: Schema, sourceSchema: Schema, schemaEdits?: Iterable<AnySchemaEdits>): Promise<SchemaDifferenceResult> {\n const schemaComparer = new DifferenceSchemaComparer();\n if(schemaEdits) {\n for(const edit of schemaEdits) {\n if(edit.type === SchemaEditType.RenameSchemaItem) {\n schemaComparer.nameMappings.addItemMapping(edit.key, edit.value);\n }\n if(edit.type === SchemaEditType.RenameProperty) {\n schemaComparer.nameMappings.addPropertyMapping(edit.key, edit.value);\n }\n }\n }\n\n await schemaComparer.compareSchemas(sourceSchema, targetSchema);\n\n const visitor = new SchemaDiagnosticVisitor();\n for (const diagnostic of schemaComparer.diagnostics) {\n visitor.visit(diagnostic);\n }\n\n const differences: AnySchemaDifference[] = [\n ...visitor.schemaDifferences,\n ...visitor.schemaItemDifferences,\n ...visitor.schemaItemPathDifferences,\n ...visitor.customAttributeDifferences,\n ];\n\n const conflicts = await validateDifferences(differences, targetSchema, sourceSchema, schemaComparer.nameMappings);\n\n return {\n sourceSchemaName: sourceSchema.schemaKey.toString(),\n targetSchemaName: targetSchema.schemaKey.toString(),\n conflicts: conflicts.length > 0 ? conflicts : undefined,\n differences,\n };\n}\n\n/**\n * Implementation of a SchemaComparer that is used in the schema differencing process.\n * It extends the SchemaComparer base class with additional functionality to store the\n * name mappings of renamed schema items and properties.\n *\n * @internal\n */\nclass DifferenceSchemaComparer extends SchemaComparer {\n public readonly nameMappings: NameMapping;\n private readonly _changes: Array<SchemaChanges>;\n\n public get diagnostics(): Iterable<AnyDiagnostic> {\n return this._changes[0].allDiagnostics;\n }\n\n constructor() {\n super({ report: (changes) => this._changes.push(changes as SchemaChanges) });\n\n this._changes = [];\n this.nameMappings = new NameMapping();\n }\n\n public override async resolveItem<TItem extends typeof SchemaItem>(item: SchemaItem, lookupSchema: Schema, itemConstructor: TItem): Promise<InstanceType<TItem> | undefined> {\n const classKey = this.nameMappings.resolveItemKey(item.key);\n return lookupSchema.lookupItem(classKey.name, itemConstructor);\n }\n\n public override async resolveProperty(propertyA: AnyProperty, ecClass: ECClass): Promise<AnyProperty | undefined> {\n const propertyKey = this.nameMappings.resolvePropertyKey(new PropertyKey(propertyA.name, propertyA.class.key));\n return ecClass.getProperty(propertyKey.propertyName) as Promise<AnyProperty | undefined>;\n }\n\n public override areEqualByName(itemKeyA?: Readonly<SchemaItemKey> | SchemaItem, itemKeyB?: Readonly<SchemaItemKey> | SchemaItem): boolean {\n if (itemKeyA) {\n if (SchemaItem.isSchemaItem(itemKeyA)) {\n itemKeyA = itemKeyA.key;\n }\n itemKeyA = this.nameMappings.resolveItemKey(itemKeyA);\n }\n return super.areEqualByName(itemKeyA, itemKeyB);\n }\n}\n"]}
@@ -0,0 +1,18 @@
1
+ /** @packageDocumentation
2
+ * @module Differencing
3
+ */
4
+ import { Schema } from "@itwin/ecschema-metadata";
5
+ import { AnySchemaDifference } from "./SchemaDifference";
6
+ import { AnySchemaDifferenceConflict } from "./SchemaConflicts";
7
+ import { NameMapping } from "../Merging/Edits/NameMapping";
8
+ /**
9
+ * Validates the given array of schema differences and returns a list of conflicts if the
10
+ * validation finds violation against rules.
11
+ * @param differences An array of schema differences.
12
+ * @param targetSchema The target schema reference.
13
+ * @param sourceSchema The source schema reference.
14
+ * @returns An array of conflicts found when validating the difference.
15
+ * @internal
16
+ */
17
+ export declare function validateDifferences(differences: AnySchemaDifference[], targetSchema: Schema, sourceSchema: Schema, nameMappings: NameMapping): Promise<AnySchemaDifferenceConflict[]>;
18
+ //# sourceMappingURL=SchemaDifferenceValidator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDifferenceValidator.d.ts","sourceRoot":"","sources":["../../../src/Differencing/SchemaDifferenceValidator.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAA2N,MAAM,EAAoD,MAAM,0BAA0B,CAAC;AAC7T,OAAO,EAA0B,mBAAmB,EAA4pB,MAAM,oBAAoB,CAAC;AAC3uB,OAAO,EAAE,2BAA2B,EAAgB,MAAM,mBAAmB,CAAC;AAE9E,OAAO,EAAE,WAAW,EAAe,MAAM,8BAA8B,CAAC;AAExE;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CAAC,WAAW,EAAE,mBAAmB,EAAE,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,0CAOlJ"}