@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,117 @@
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 Merging
7
+ */
8
+ import { SchemaContext, SchemaItemKey, SchemaKey } from "@itwin/ecschema-metadata";
9
+ import { SchemaContextEditor } from "../Editing/Editor";
10
+ import { SchemaConflictsError } from "../Differencing/Errors";
11
+ import { getSchemaDifferences } from "../Differencing/SchemaDifference";
12
+ import { SchemaMergingVisitor } from "./SchemaMergingVisitor";
13
+ import { SchemaMergingWalker } from "./SchemaMergingWalker";
14
+ import { ECEditingStatus, SchemaEditingError } from "../Editing/Exception";
15
+ import { NameMapping } from "./Edits/NameMapping";
16
+ /**
17
+ * Class to merge two schemas together.
18
+ * @see [[merge]] or [[mergeSchemas]] to merge two schemas together.
19
+ * @beta
20
+ */
21
+ export class SchemaMerger {
22
+ _editingContext;
23
+ /**
24
+ * Constructs a new instance of the SchemaMerger object.
25
+ * @param editingContext The schema contexts that holds the schema to be edited.
26
+ */
27
+ constructor(editingContext) {
28
+ this._editingContext = editingContext;
29
+ }
30
+ /**
31
+ * Copy the SchemaItems of the source schemas to the target schema.
32
+ * @param targetSchema The schema the SchemaItems gets merged to.
33
+ * @param sourceSchema The schema the SchemaItems gets copied from.
34
+ * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.
35
+ * @returns The merged target schema.
36
+ * @alpha
37
+ */
38
+ async mergeSchemas(targetSchema, sourceSchema, edits) {
39
+ return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);
40
+ }
41
+ /**
42
+ * Merges the schema differences into the target schema context.
43
+ * @param differenceResult The differences that shall be applied to the target schema.
44
+ * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.
45
+ * @alpha
46
+ */
47
+ async merge(differenceResult, edits) {
48
+ const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);
49
+ const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);
50
+ const nameMapping = new NameMapping();
51
+ const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));
52
+ // If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned
53
+ // to prevent altering the differenceResult the caller passed in.
54
+ if (edits) {
55
+ await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);
56
+ }
57
+ if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {
58
+ throw new SchemaConflictsError("Schema's can't be merged if there are unresolved conflicts.", differenceResult.conflicts, sourceSchemaKey, targetSchemaKey);
59
+ }
60
+ const schema = await editor.getSchema(targetSchemaKey).catch((error) => {
61
+ if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {
62
+ throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);
63
+ }
64
+ throw error;
65
+ });
66
+ if (!schema.customAttributes || !schema.customAttributes.has("CoreCustomAttributes.DynamicSchema")) {
67
+ throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);
68
+ }
69
+ const visitor = new SchemaMergingVisitor({
70
+ editor,
71
+ targetSchema: schema,
72
+ targetSchemaKey,
73
+ sourceSchemaKey,
74
+ nameMapping,
75
+ });
76
+ const walker = new SchemaMergingWalker(visitor);
77
+ await walker.traverse(differenceResult.differences, "add");
78
+ await walker.traverse(differenceResult.differences, "modify");
79
+ return schema;
80
+ }
81
+ }
82
+ /**
83
+ * SchemaContext implementation that overrides certain methods to allow to apply name mappings
84
+ * for certain schema elements during the schema merging process.
85
+ *
86
+ * @internal
87
+ */
88
+ class MergingSchemaContext extends SchemaContext {
89
+ _internalContext;
90
+ _nameMappings;
91
+ constructor(internalContext, nameMapping) {
92
+ super();
93
+ this._internalContext = internalContext;
94
+ this._nameMappings = nameMapping;
95
+ }
96
+ async getCachedSchema(schemaKey, matchType) {
97
+ return this._internalContext.getCachedSchema(schemaKey, matchType);
98
+ }
99
+ async getSchema(schemaKey, matchType) {
100
+ return this._internalContext.getSchema(schemaKey, matchType);
101
+ }
102
+ async getSchemaItem(schemaNameOrKey, itemNameOrCtor, itemConstructor) {
103
+ let schemaItemKey;
104
+ if (typeof schemaNameOrKey === "string")
105
+ schemaItemKey = new SchemaItemKey(itemNameOrCtor, new SchemaKey(schemaNameOrKey));
106
+ else
107
+ schemaItemKey = schemaNameOrKey;
108
+ const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);
109
+ if (mappedKey !== undefined) {
110
+ schemaItemKey = mappedKey;
111
+ }
112
+ if (itemConstructor === undefined)
113
+ return this._internalContext.getSchemaItem(schemaItemKey);
114
+ return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);
115
+ }
116
+ }
117
+ //# sourceMappingURL=SchemaMerger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaMerger.js","sourceRoot":"","sources":["../../../src/Merging/SchemaMerger.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAU,aAAa,EAAc,aAAa,EAAE,SAAS,EAAmB,MAAM,0BAA0B,CAAC;AACxH,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAA+B,MAAM,kCAAkC,CAAC;AACrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAclD;;;;GAIG;AACH,MAAM,OAAO,YAAY;IAEN,eAAe,CAAgB;IAEhD;;;OAGG;IACH,YAAY,cAA6B;QACvC,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;IACxC,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,YAAY,CAAC,YAAoB,EAAE,YAAoB,EAAE,KAAmB;QACvF,OAAO,IAAI,CAA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AAI,OAAO,eAAe,KAAK,QAAQ;YACrC,aAAa,GAAG,IAAI,aAAa,CAAC,cAAwB,EAAE,IAAI,SAAS,CAAC,eAAe,CAAC,CAAC,CAAC;;YAE5F,aAAa,GAAG,eAAe,CAAC;QAElC,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QACnE,IAAG,SAAS,KAAK,SAAS,EAAE,CAAC;YAC3B,aAAa,GAAG,SAA0B,CAAC;QAC7C,CAAC;QAED,IAAG,eAAe,KAAK,SAAS;YAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAE5D,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC7E,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 Merging\n */\n\nimport { Schema, SchemaContext, SchemaItem, SchemaItemKey, SchemaKey, SchemaMatchType } from \"@itwin/ecschema-metadata\";\nimport { SchemaContextEditor } from \"../Editing/Editor\";\nimport { SchemaConflictsError } from \"../Differencing/Errors\";\nimport { getSchemaDifferences, type SchemaDifferenceResult } from \"../Differencing/SchemaDifference\";\nimport { SchemaMergingVisitor } from \"./SchemaMergingVisitor\";\nimport { SchemaMergingWalker } from \"./SchemaMergingWalker\";\nimport { SchemaEdits } from \"./Edits/SchemaEdits\";\nimport { ECEditingStatus, SchemaEditingError } from \"../Editing/Exception\";\nimport { NameMapping } from \"./Edits/NameMapping\";\n\n/**\n * Defines the context of a Schema merging run.\n * @internal\n */\nexport interface SchemaMergeContext {\n readonly targetSchema: Schema;\n readonly targetSchemaKey: SchemaKey;\n readonly sourceSchemaKey: SchemaKey;\n readonly editor: SchemaContextEditor;\n readonly nameMapping: NameMapping;\n}\n\n/**\n * Class to merge two schemas together.\n * @see [[merge]] or [[mergeSchemas]] to merge two schemas together.\n * @beta\n */\nexport class SchemaMerger {\n\n private readonly _editingContext: SchemaContext;\n\n /**\n * Constructs a new instance of the SchemaMerger object.\n * @param editingContext The schema contexts that holds the schema to be edited.\n */\n constructor(editingContext: SchemaContext) {\n this._editingContext = editingContext;\n }\n\n /**\n * Copy the SchemaItems of the source schemas to the target schema.\n * @param targetSchema The schema the SchemaItems gets merged to.\n * @param sourceSchema The schema the SchemaItems gets copied from.\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\n * @returns The merged target schema.\n * @alpha\n */\n public async mergeSchemas(targetSchema: Schema, sourceSchema: Schema, edits?: SchemaEdits): Promise<Schema> {\n return this.merge(await getSchemaDifferences(targetSchema, sourceSchema, edits), edits);\n }\n\n /**\n * Merges the schema differences into the target schema context.\n * @param differenceResult The differences that shall be applied to the target schema.\n * @param edits An optional instance of schema edits that shall be applied before the schemas get merged.\n * @alpha\n */\n public async merge(differenceResult: SchemaDifferenceResult, edits?: SchemaEdits): Promise<Schema> {\n const targetSchemaKey = SchemaKey.parseString(differenceResult.targetSchemaName);\n const sourceSchemaKey = SchemaKey.parseString(differenceResult.sourceSchemaName);\n\n const nameMapping = new NameMapping();\n const editor = new SchemaContextEditor(new MergingSchemaContext(this._editingContext, nameMapping));\n\n // If schema changes were provided, they'll get applied and a new SchemaDifferenceResult is returned\n // to prevent altering the differenceResult the caller passed in.\n if (edits) {\n await edits.applyTo(differenceResult = { ...differenceResult }, nameMapping);\n }\n\n if (differenceResult.conflicts && differenceResult.conflicts.length > 0) {\n throw new SchemaConflictsError(\n \"Schema's can't be merged if there are unresolved conflicts.\",\n differenceResult.conflicts,\n sourceSchemaKey,\n targetSchemaKey,\n );\n }\n\n const schema = await editor.getSchema(targetSchemaKey).catch((error: Error) => {\n if (error instanceof SchemaEditingError && error.errorNumber === ECEditingStatus.SchemaNotFound) {\n throw new Error(`The target schema '${targetSchemaKey.name}' could not be found in the editing context.`);\n }\n throw error;\n });\n\n if (!schema.customAttributes || !schema.customAttributes.has(\"CoreCustomAttributes.DynamicSchema\")) {\n throw new Error(`The target schema '${targetSchemaKey.name}' is not dynamic. Only dynamic schemas are supported for merging.`);\n }\n\n const visitor = new SchemaMergingVisitor({\n editor,\n targetSchema: schema,\n targetSchemaKey,\n sourceSchemaKey,\n nameMapping,\n });\n\n const walker = new SchemaMergingWalker(visitor);\n await walker.traverse(differenceResult.differences, \"add\");\n await walker.traverse(differenceResult.differences, \"modify\");\n\n return schema;\n }\n}\n\n/**\n * SchemaContext implementation that overrides certain methods to allow to apply name mappings\n * for certain schema elements during the schema merging process.\n *\n * @internal\n */\nclass MergingSchemaContext extends SchemaContext {\n private _internalContext: SchemaContext;\n private _nameMappings: NameMapping;\n\n public constructor(internalContext: SchemaContext, nameMapping: NameMapping) {\n super();\n this._internalContext = internalContext;\n this._nameMappings = nameMapping;\n }\n\n public override async getCachedSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\n return this._internalContext.getCachedSchema(schemaKey, matchType);\n }\n\n public override async getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined> {\n return this._internalContext.getSchema(schemaKey, matchType);\n }\n\n public override async getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string | SchemaItemKey, itemNameOrCtor?: string | T, itemConstructor?: T): Promise<SchemaItem | InstanceType<T> | undefined> {\n let schemaItemKey: SchemaItemKey;\n if (typeof schemaNameOrKey === \"string\")\n schemaItemKey = new SchemaItemKey(itemNameOrCtor as string, new SchemaKey(schemaNameOrKey));\n else\n schemaItemKey = schemaNameOrKey;\n\n const mappedKey = this._nameMappings.resolveItemKey(schemaItemKey);\n if(mappedKey !== undefined) {\n schemaItemKey = mappedKey as SchemaItemKey;\n }\n\n if(itemConstructor === undefined)\n return this._internalContext.getSchemaItem(schemaItemKey);\n\n return this._internalContext.getSchemaItem(schemaItemKey, itemConstructor);\n }\n}\n"]}
@@ -0,0 +1,149 @@
1
+ import { AnySchemaDifference, ClassPropertyDifference, ConstantDifference, CustomAttributeClassDifference, CustomAttributeDifference, EntityClassDifference, EntityClassMixinDifference, EnumerationDifference, EnumeratorDifference, FormatDifference, FormatUnitDifference, FormatUnitLabelDifference, InvertedUnitDifference, KindOfQuantityDifference, KindOfQuantityPresentationFormatDifference, MixinClassDifference, PhenomenonDifference, PropertyCategoryDifference, RelationshipClassDifference, RelationshipConstraintClassDifference, RelationshipConstraintDifference, SchemaDifference, SchemaReferenceDifference, StructClassDifference, UnitDifference, UnitSystemDifference } from "../Differencing/SchemaDifference";
2
+ import { SchemaDifferenceVisitor } from "../Differencing/SchemaDifferenceVisitor";
3
+ import { SchemaMergeContext } from "./SchemaMerger";
4
+ /**
5
+ * Implementation of ISchemaDifferenceVisitor that can be used to traverse schema
6
+ * differences to call the appropriated merger methods.
7
+ * @internal
8
+ */
9
+ export declare class SchemaMergingVisitor implements SchemaDifferenceVisitor {
10
+ private readonly _context;
11
+ /**
12
+ * Initializes a new instance of SchemaMergingVisitor class.
13
+ */
14
+ constructor(context: SchemaMergeContext);
15
+ /**
16
+ * Shared merging logic for all types of ClassItemDifference union.
17
+ */
18
+ private visitClassDifference;
19
+ /**
20
+ * Visitor implementation for handling ConstantDifference.
21
+ * @internal
22
+ */
23
+ visitConstantDifference(entry: ConstantDifference): Promise<void>;
24
+ /**
25
+ * Visitor implementation for handling CustomAttributeClassDifference.
26
+ * @internal
27
+ */
28
+ visitCustomAttributeClassDifference(entry: CustomAttributeClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
29
+ /**
30
+ * Visitor implementation for handling CustomAttributeDifference.
31
+ * @internal
32
+ */
33
+ visitCustomAttributeInstanceDifference(entry: CustomAttributeDifference): Promise<void>;
34
+ /**
35
+ * Visitor implementation for handling EntityClassDifference.
36
+ * @internal
37
+ */
38
+ visitEntityClassDifference(entry: EntityClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
39
+ /**
40
+ * Visitor implementation for handling EntityClassMixinDifference.
41
+ * @internal
42
+ */
43
+ visitEntityClassMixinDifference(entry: EntityClassMixinDifference): Promise<void>;
44
+ /**
45
+ * Visitor implementation for handling EnumerationDifference.
46
+ * @internal
47
+ */
48
+ visitEnumerationDifference(entry: EnumerationDifference): Promise<void>;
49
+ /**
50
+ * Visitor implementation for handling EnumeratorDifference.
51
+ * @internal
52
+ */
53
+ visitEnumeratorDifference(entry: EnumeratorDifference): Promise<void>;
54
+ /**
55
+ * Visitor implementation for handling FormatDifference.
56
+ * @internal
57
+ */
58
+ visitFormatDifference(entry: FormatDifference): Promise<void>;
59
+ /**
60
+ * Visitor implementation for handling FormatUnitDifference.
61
+ * @internal
62
+ */
63
+ visitFormatUnitDifference(entry: FormatUnitDifference): Promise<void>;
64
+ /**
65
+ * Visitor implementation for handling FormatUnitLabelDifference.
66
+ * @internal
67
+ */
68
+ visitFormatUnitLabelDifference(entry: FormatUnitLabelDifference): Promise<void>;
69
+ /**
70
+ * Visitor implementation for handling InvertedUnitDifference.
71
+ * @internal
72
+ */
73
+ visitInvertedUnitDifference(entry: InvertedUnitDifference): Promise<void>;
74
+ /**
75
+ * Visitor implementation for handling KindOfQuantityDifference.
76
+ * @internal
77
+ */
78
+ visitKindOfQuantityDifference(entry: KindOfQuantityDifference): Promise<void>;
79
+ /**
80
+ * Visitor implementation for handling MixinClassDifference.
81
+ * @internal
82
+ */
83
+ visitMixinDifference(entry: MixinClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
84
+ /**
85
+ * Visitor implementation for handling PhenomenonDifference.
86
+ * @internal
87
+ */
88
+ visitPhenomenonDifference(entry: PhenomenonDifference): Promise<void>;
89
+ /**
90
+ * Visitor implementation for handling PropertyCategoryDifference.
91
+ * @internal
92
+ */
93
+ visitPropertyCategoryDifference(entry: PropertyCategoryDifference): Promise<void>;
94
+ /**
95
+ * Visitor implementation for handling ClassPropertyDifference.
96
+ * @internal
97
+ */
98
+ visitPropertyDifference(entry: ClassPropertyDifference): Promise<void>;
99
+ /**
100
+ * Visitor implementation for handling RelationshipClassDifference.
101
+ * @internal
102
+ */
103
+ visitRelationshipClassDifference(entry: RelationshipClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
104
+ /**
105
+ * Visitor implementation for handling RelationshipConstraintClassDifference.
106
+ * @internal
107
+ */
108
+ visitRelationshipConstraintClassDifference(entry: RelationshipConstraintClassDifference): Promise<void>;
109
+ /**
110
+ * Visitor implementation for handling RelationshipConstraintDifference.
111
+ * @internal
112
+ */
113
+ visitRelationshipConstraintDifference(entry: RelationshipConstraintDifference): Promise<void>;
114
+ /**
115
+ * Visitor implementation for handling SchemaDifference.
116
+ * @internal
117
+ */
118
+ visitSchemaDifference({ difference }: SchemaDifference): Promise<void>;
119
+ /**
120
+ * Shared merging logic for all types of AnySchemaItemDifference union.
121
+ */
122
+ private visitSchemaItemDifference;
123
+ /**
124
+ * Visitor implementation for handling SchemaReferenceDifference.
125
+ * @internal
126
+ */
127
+ visitSchemaReferenceDifference(entry: SchemaReferenceDifference): Promise<void>;
128
+ /**
129
+ * Visitor implementation for handling StructClassDifference.
130
+ * @internal
131
+ */
132
+ visitStructClassDifference(entry: StructClassDifference, index: number, array: AnySchemaDifference[]): Promise<void>;
133
+ /**
134
+ * Visitor implementation for handling UnitDifference.
135
+ * @internal
136
+ */
137
+ visitUnitDifference(entry: UnitDifference): Promise<void>;
138
+ /**
139
+ * Visitor implementation for handling UnitSystemDifference.
140
+ * @internal
141
+ */
142
+ visitUnitSystemDifference(entry: UnitSystemDifference): Promise<void>;
143
+ /**
144
+ * Visitor implementation for handling KindOfQuantityPresentationFormatDifference.
145
+ * @internal
146
+ */
147
+ visitKindOfQuantityPresentationFormatDifference(entry: KindOfQuantityPresentationFormatDifference): Promise<void>;
148
+ }
149
+ //# sourceMappingURL=SchemaMergingVisitor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaMergingVisitor.d.ts","sourceRoot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E,qCAAqC,GAAG,OAAO,CAAC,IAAI,CAAC;IAIpH;;;OAGG;IACU,qCAAqC,CAAC,KAAK,EAAE,gCAAgC,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1G;;;OAGG;IACU,qBAAqB,CAAC,EAAE,UAAU,EAAE,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;IASnF;;OAEG;YACW,yBAAyB;IAevC;;;OAGG;IACU,8BAA8B,CAAC,KAAK,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC;IAO5F;;;OAGG;IACU,0BAA0B,CAAC,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjI;;;OAGG;IACU,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAOtE;;;OAGG;IACU,yBAAyB,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC;IAOlF;;;MAGE;IACW,+CAA+C,CAAC,KAAK,EAAE,0CAA0C,GAAG,OAAO,CAAC,IAAI,CAAC;CAK/H"}
@@ -0,0 +1,339 @@
1
+ import { addConstant, modifyConstant } from "./ConstantMerger";
2
+ import { addCustomAttribute } from "./CustomAttributeMerger";
3
+ import { addCustomAttributeClass, modifyCustomAttributeClass } from "./CustomAttributeClassMerger";
4
+ import { addClassMixins, addEntityClass, modifyEntityClass } from "./EntityClassMerger";
5
+ import { addEnumeration, modifyEnumeration } from "./EnumerationMerger";
6
+ import { addEnumerator, modifyEnumerator } from "./EnumeratorMerger";
7
+ import { addKindOfQuantity, addPresentationFormat, modifyKindOfQuantity } from "./KindOfQuantityMerger";
8
+ import { addMixinClass, modifyMixinClass } from "./MixinMerger";
9
+ import { addPhenomenon, modifyPhenomenon } from "./PhenomenonMerger";
10
+ import { addPropertyCategory, modifyPropertyCategory } from "./PropertyCategoryMerger";
11
+ import { addRelationshipClass, mergeRelationshipClassConstraint, mergeRelationshipConstraint, modifyRelationshipClass } from "./RelationshipClassMerger";
12
+ import { addSchemaReferences, modifySchemaReferences } from "./SchemaReferenceMerger";
13
+ import { addStructClass, modifyStructClass } from "./StructClassMerger";
14
+ import { addUnitSystem, modifyUnitSystem } from "./UnitSystemMerger";
15
+ import { mergePropertyDifference } from "./PropertyMerger";
16
+ import { isClassDifference } from "../Differencing/Utils";
17
+ import { toItemKey } from "./Utils";
18
+ import { addUnit, modifyUnit } from "./UnitMerger";
19
+ import { addInvertedUnit, modifyInvertedUnit } from "./InvertedUnitMerger";
20
+ import { addFormat, modifyFormat, modifyFormatUnit, modifyFormatUnitLabel } from "./FormatMerger";
21
+ /**
22
+ * Implementation of ISchemaDifferenceVisitor that can be used to traverse schema
23
+ * differences to call the appropriated merger methods.
24
+ * @internal
25
+ */
26
+ export class SchemaMergingVisitor {
27
+ _context;
28
+ /**
29
+ * Initializes a new instance of SchemaMergingVisitor class.
30
+ */
31
+ constructor(context) {
32
+ this._context = context;
33
+ }
34
+ /**
35
+ * Shared merging logic for all types of ClassItemDifference union.
36
+ */
37
+ async visitClassDifference(entry, index, array, handler) {
38
+ return this.visitSchemaItemDifference(entry, {
39
+ add: async (context) => {
40
+ // To add classes a slightly different approach is done. In fact the class entries gets processed
41
+ // two times. The first time, a stub with the bare minimum is added to the schema. The second time,
42
+ // the class gets completed with all properties, mixins, etc...
43
+ if (entry.changeType === "add" && !await context.targetSchema.getItem(entry.itemName)) {
44
+ await handler.add(this._context, {
45
+ ...entry,
46
+ difference: {
47
+ ...entry.difference,
48
+ // Remove everything we want to validate before setting, this is done in the second iteration.
49
+ baseClass: undefined,
50
+ mixins: undefined,
51
+ properties: undefined,
52
+ customAttributes: undefined,
53
+ },
54
+ });
55
+ // Searches for the last class difference and adds the entry after it. That way,
56
+ // the class is completed before class related entries get processed.
57
+ const insertIndex = findIndexOf(array, (e) => !isClassDifference(e), index) || array.length;
58
+ array.splice(insertIndex, 0, entry);
59
+ return;
60
+ }
61
+ // Now both a modification change or the second add iteration is a modification of an existing class.
62
+ // So, regardless of the actual change type, modify is called.
63
+ return handler.modify(this._context, entry, toItemKey(this._context, entry.itemName));
64
+ },
65
+ modify: handler.modify,
66
+ });
67
+ }
68
+ /**
69
+ * Visitor implementation for handling ConstantDifference.
70
+ * @internal
71
+ */
72
+ async visitConstantDifference(entry) {
73
+ return this.visitSchemaItemDifference(entry, {
74
+ add: addConstant,
75
+ modify: modifyConstant,
76
+ });
77
+ }
78
+ /**
79
+ * Visitor implementation for handling CustomAttributeClassDifference.
80
+ * @internal
81
+ */
82
+ async visitCustomAttributeClassDifference(entry, index, array) {
83
+ return this.visitClassDifference(entry, index, array, {
84
+ add: addCustomAttributeClass,
85
+ modify: modifyCustomAttributeClass,
86
+ });
87
+ }
88
+ /**
89
+ * Visitor implementation for handling CustomAttributeDifference.
90
+ * @internal
91
+ */
92
+ async visitCustomAttributeInstanceDifference(entry) {
93
+ switch (entry.changeType) {
94
+ case "add": return addCustomAttribute(this._context, entry);
95
+ }
96
+ }
97
+ /**
98
+ * Visitor implementation for handling EntityClassDifference.
99
+ * @internal
100
+ */
101
+ async visitEntityClassDifference(entry, index, array) {
102
+ return this.visitClassDifference(entry, index, array, {
103
+ add: addEntityClass,
104
+ modify: modifyEntityClass,
105
+ });
106
+ }
107
+ /**
108
+ * Visitor implementation for handling EntityClassMixinDifference.
109
+ * @internal
110
+ */
111
+ async visitEntityClassMixinDifference(entry) {
112
+ switch (entry.changeType) {
113
+ case "add": return addClassMixins(this._context, entry);
114
+ }
115
+ }
116
+ /**
117
+ * Visitor implementation for handling EnumerationDifference.
118
+ * @internal
119
+ */
120
+ async visitEnumerationDifference(entry) {
121
+ return this.visitSchemaItemDifference(entry, {
122
+ add: addEnumeration,
123
+ modify: modifyEnumeration,
124
+ });
125
+ }
126
+ /**
127
+ * Visitor implementation for handling EnumeratorDifference.
128
+ * @internal
129
+ */
130
+ async visitEnumeratorDifference(entry) {
131
+ switch (entry.changeType) {
132
+ case "add": return addEnumerator(this._context, entry);
133
+ case "modify": return modifyEnumerator(this._context, entry, toItemKey(this._context, entry.itemName));
134
+ }
135
+ }
136
+ /**
137
+ * Visitor implementation for handling FormatDifference.
138
+ * @internal
139
+ */
140
+ async visitFormatDifference(entry) {
141
+ return this.visitSchemaItemDifference(entry, {
142
+ add: addFormat,
143
+ modify: modifyFormat,
144
+ });
145
+ }
146
+ /**
147
+ * Visitor implementation for handling FormatUnitDifference.
148
+ * @internal
149
+ */
150
+ async visitFormatUnitDifference(entry) {
151
+ switch (entry.changeType) {
152
+ case "modify": return modifyFormatUnit(this._context, entry, toItemKey(this._context, entry.itemName));
153
+ }
154
+ }
155
+ /**
156
+ * Visitor implementation for handling FormatUnitLabelDifference.
157
+ * @internal
158
+ */
159
+ async visitFormatUnitLabelDifference(entry) {
160
+ switch (entry.changeType) {
161
+ case "modify": return modifyFormatUnitLabel(this._context, entry, toItemKey(this._context, entry.itemName));
162
+ }
163
+ }
164
+ /**
165
+ * Visitor implementation for handling InvertedUnitDifference.
166
+ * @internal
167
+ */
168
+ async visitInvertedUnitDifference(entry) {
169
+ return this.visitSchemaItemDifference(entry, {
170
+ add: addInvertedUnit,
171
+ modify: modifyInvertedUnit,
172
+ });
173
+ }
174
+ /**
175
+ * Visitor implementation for handling KindOfQuantityDifference.
176
+ * @internal
177
+ */
178
+ async visitKindOfQuantityDifference(entry) {
179
+ return this.visitSchemaItemDifference(entry, {
180
+ add: addKindOfQuantity,
181
+ modify: modifyKindOfQuantity,
182
+ });
183
+ }
184
+ /**
185
+ * Visitor implementation for handling MixinClassDifference.
186
+ * @internal
187
+ */
188
+ async visitMixinDifference(entry, index, array) {
189
+ return this.visitClassDifference(entry, index, array, {
190
+ add: addMixinClass,
191
+ modify: modifyMixinClass,
192
+ });
193
+ }
194
+ /**
195
+ * Visitor implementation for handling PhenomenonDifference.
196
+ * @internal
197
+ */
198
+ async visitPhenomenonDifference(entry) {
199
+ return this.visitSchemaItemDifference(entry, {
200
+ add: addPhenomenon,
201
+ modify: modifyPhenomenon,
202
+ });
203
+ }
204
+ /**
205
+ * Visitor implementation for handling PropertyCategoryDifference.
206
+ * @internal
207
+ */
208
+ async visitPropertyCategoryDifference(entry) {
209
+ return this.visitSchemaItemDifference(entry, {
210
+ add: addPropertyCategory,
211
+ modify: modifyPropertyCategory,
212
+ });
213
+ }
214
+ /**
215
+ * Visitor implementation for handling ClassPropertyDifference.
216
+ * @internal
217
+ */
218
+ async visitPropertyDifference(entry) {
219
+ await mergePropertyDifference(this._context, entry);
220
+ }
221
+ /**
222
+ * Visitor implementation for handling RelationshipClassDifference.
223
+ * @internal
224
+ */
225
+ async visitRelationshipClassDifference(entry, index, array) {
226
+ return this.visitClassDifference(entry, index, array, {
227
+ add: addRelationshipClass,
228
+ modify: modifyRelationshipClass,
229
+ });
230
+ }
231
+ /**
232
+ * Visitor implementation for handling RelationshipConstraintClassDifference.
233
+ * @internal
234
+ */
235
+ async visitRelationshipConstraintClassDifference(entry) {
236
+ await mergeRelationshipClassConstraint(this._context, entry);
237
+ }
238
+ /**
239
+ * Visitor implementation for handling RelationshipConstraintDifference.
240
+ * @internal
241
+ */
242
+ async visitRelationshipConstraintDifference(entry) {
243
+ await mergeRelationshipConstraint(this._context, entry);
244
+ }
245
+ /**
246
+ * Visitor implementation for handling SchemaDifference.
247
+ * @internal
248
+ */
249
+ async visitSchemaDifference({ difference }) {
250
+ if (difference.label !== undefined) {
251
+ await this._context.editor.setDisplayLabel(this._context.targetSchemaKey, difference.label);
252
+ }
253
+ if (difference.description !== undefined) {
254
+ await this._context.editor.setDescription(this._context.targetSchemaKey, difference.description);
255
+ }
256
+ }
257
+ /**
258
+ * Shared merging logic for all types of AnySchemaItemDifference union.
259
+ */
260
+ async visitSchemaItemDifference(entry, handler) {
261
+ switch (entry.changeType) {
262
+ case "add": {
263
+ return handler.add(this._context, entry);
264
+ }
265
+ case "modify":
266
+ {
267
+ if ("schemaItemType" in entry.difference && entry.difference.schemaItemType !== entry.schemaType) {
268
+ throw new Error(`Changing the type of item '${entry.itemName}' not supported.`);
269
+ }
270
+ return handler.modify(this._context, entry, toItemKey(this._context, entry.itemName));
271
+ }
272
+ ;
273
+ }
274
+ }
275
+ /**
276
+ * Visitor implementation for handling SchemaReferenceDifference.
277
+ * @internal
278
+ */
279
+ async visitSchemaReferenceDifference(entry) {
280
+ switch (entry.changeType) {
281
+ case "add": return addSchemaReferences(this._context, entry);
282
+ case "modify": return modifySchemaReferences(this._context, entry);
283
+ }
284
+ }
285
+ /**
286
+ * Visitor implementation for handling StructClassDifference.
287
+ * @internal
288
+ */
289
+ async visitStructClassDifference(entry, index, array) {
290
+ return this.visitClassDifference(entry, index, array, {
291
+ add: addStructClass,
292
+ modify: modifyStructClass,
293
+ });
294
+ }
295
+ /**
296
+ * Visitor implementation for handling UnitDifference.
297
+ * @internal
298
+ */
299
+ async visitUnitDifference(entry) {
300
+ return this.visitSchemaItemDifference(entry, {
301
+ add: addUnit,
302
+ modify: modifyUnit,
303
+ });
304
+ }
305
+ /**
306
+ * Visitor implementation for handling UnitSystemDifference.
307
+ * @internal
308
+ */
309
+ async visitUnitSystemDifference(entry) {
310
+ return this.visitSchemaItemDifference(entry, {
311
+ add: addUnitSystem,
312
+ modify: modifyUnitSystem,
313
+ });
314
+ }
315
+ /**
316
+ * Visitor implementation for handling KindOfQuantityPresentationFormatDifference.
317
+ * @internal
318
+ */
319
+ async visitKindOfQuantityPresentationFormatDifference(entry) {
320
+ switch (entry.changeType) {
321
+ case "add": return addPresentationFormat(this._context, entry, toItemKey(this._context, entry.itemName));
322
+ }
323
+ }
324
+ }
325
+ /**
326
+ * Helper method to get the index of the first element in the array that satisfies the provided testing function.
327
+ * @param array Array to search.
328
+ * @param predicate Function to execute on each value in the array.
329
+ * @param fromIndex The index to start the search at.
330
+ * @returns An index in the array if an element passes the test; otherwise, false.
331
+ */
332
+ function findIndexOf(array, predicate, fromIndex) {
333
+ for (let i = fromIndex; i < array.length; i++) {
334
+ if (predicate(array[i]))
335
+ return i;
336
+ }
337
+ return false;
338
+ }
339
+ //# sourceMappingURL=SchemaMergingVisitor.js.map