@itwin/ecschema-editing 5.0.0-dev.90 → 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 (363) hide show
  1. package/lib/cjs/Validation/DiagnosticReporter.js +1 -1
  2. package/lib/cjs/Validation/DiagnosticReporter.js.map +1 -1
  3. package/lib/esm/Differencing/Errors.d.ts +19 -0
  4. package/lib/esm/Differencing/Errors.d.ts.map +1 -0
  5. package/lib/esm/Differencing/Errors.js +26 -0
  6. package/lib/esm/Differencing/Errors.js.map +1 -0
  7. package/lib/esm/Differencing/SchemaConflicts.d.ts +84 -0
  8. package/lib/esm/Differencing/SchemaConflicts.d.ts.map +1 -0
  9. package/lib/esm/Differencing/SchemaConflicts.js +60 -0
  10. package/lib/esm/Differencing/SchemaConflicts.js.map +1 -0
  11. package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts +41 -0
  12. package/lib/esm/Differencing/SchemaDiagnosticVisitor.d.ts.map +1 -0
  13. package/lib/esm/Differencing/SchemaDiagnosticVisitor.js +443 -0
  14. package/lib/esm/Differencing/SchemaDiagnosticVisitor.js.map +1 -0
  15. package/lib/esm/Differencing/SchemaDifference.d.ts +357 -0
  16. package/lib/esm/Differencing/SchemaDifference.d.ts.map +1 -0
  17. package/lib/esm/Differencing/SchemaDifference.js +106 -0
  18. package/lib/esm/Differencing/SchemaDifference.js.map +1 -0
  19. package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts +18 -0
  20. package/lib/esm/Differencing/SchemaDifferenceValidator.d.ts.map +1 -0
  21. package/lib/esm/Differencing/SchemaDifferenceValidator.js +521 -0
  22. package/lib/esm/Differencing/SchemaDifferenceValidator.js.map +1 -0
  23. package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts +32 -0
  24. package/lib/esm/Differencing/SchemaDifferenceVisitor.d.ts.map +1 -0
  25. package/lib/esm/Differencing/SchemaDifferenceVisitor.js +88 -0
  26. package/lib/esm/Differencing/SchemaDifferenceVisitor.js.map +1 -0
  27. package/lib/esm/Differencing/Utils.d.ts +110 -0
  28. package/lib/esm/Differencing/Utils.d.ts.map +1 -0
  29. package/lib/esm/Differencing/Utils.js +161 -0
  30. package/lib/esm/Differencing/Utils.js.map +1 -0
  31. package/lib/esm/Editing/Constants.d.ts +22 -0
  32. package/lib/esm/Editing/Constants.d.ts.map +1 -0
  33. package/lib/esm/Editing/Constants.js +55 -0
  34. package/lib/esm/Editing/Constants.js.map +1 -0
  35. package/lib/esm/Editing/CustomAttributes.d.ts +22 -0
  36. package/lib/esm/Editing/CustomAttributes.d.ts.map +1 -0
  37. package/lib/esm/Editing/CustomAttributes.js +49 -0
  38. package/lib/esm/Editing/CustomAttributes.js.map +1 -0
  39. package/lib/esm/Editing/ECClasses.d.ts +86 -0
  40. package/lib/esm/Editing/ECClasses.d.ts.map +1 -0
  41. package/lib/esm/Editing/ECClasses.js +294 -0
  42. package/lib/esm/Editing/ECClasses.js.map +1 -0
  43. package/lib/esm/Editing/Editor.d.ts +117 -0
  44. package/lib/esm/Editing/Editor.d.ts.map +1 -0
  45. package/lib/esm/Editing/Editor.js +264 -0
  46. package/lib/esm/Editing/Editor.js.map +1 -0
  47. package/lib/esm/Editing/Entities.d.ts +38 -0
  48. package/lib/esm/Editing/Entities.d.ts.map +1 -0
  49. package/lib/esm/Editing/Entities.js +126 -0
  50. package/lib/esm/Editing/Entities.js.map +1 -0
  51. package/lib/esm/Editing/Enumerations.d.ts +25 -0
  52. package/lib/esm/Editing/Enumerations.d.ts.map +1 -0
  53. package/lib/esm/Editing/Enumerations.js +90 -0
  54. package/lib/esm/Editing/Enumerations.js.map +1 -0
  55. package/lib/esm/Editing/Exception.d.ts +358 -0
  56. package/lib/esm/Editing/Exception.d.ts.map +1 -0
  57. package/lib/esm/Editing/Exception.js +471 -0
  58. package/lib/esm/Editing/Exception.js.map +1 -0
  59. package/lib/esm/Editing/Formats.d.ts +23 -0
  60. package/lib/esm/Editing/Formats.d.ts.map +1 -0
  61. package/lib/esm/Editing/Formats.js +62 -0
  62. package/lib/esm/Editing/Formats.js.map +1 -0
  63. package/lib/esm/Editing/InvertedUnits.d.ts +19 -0
  64. package/lib/esm/Editing/InvertedUnits.d.ts.map +1 -0
  65. package/lib/esm/Editing/InvertedUnits.js +68 -0
  66. package/lib/esm/Editing/InvertedUnits.js.map +1 -0
  67. package/lib/esm/Editing/KindOfQuantities.d.ts +30 -0
  68. package/lib/esm/Editing/KindOfQuantities.d.ts.map +1 -0
  69. package/lib/esm/Editing/KindOfQuantities.js +92 -0
  70. package/lib/esm/Editing/KindOfQuantities.js.map +1 -0
  71. package/lib/esm/Editing/Mixins.d.ts +35 -0
  72. package/lib/esm/Editing/Mixins.d.ts.map +1 -0
  73. package/lib/esm/Editing/Mixins.js +90 -0
  74. package/lib/esm/Editing/Mixins.js.map +1 -0
  75. package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts +10 -0
  76. package/lib/esm/Editing/Mutable/MutableArrayProperty.d.ts.map +1 -0
  77. package/lib/esm/Editing/Mutable/MutableArrayProperty.js +12 -0
  78. package/lib/esm/Editing/Mutable/MutableArrayProperty.js.map +1 -0
  79. package/lib/esm/Editing/Mutable/MutableCAClass.d.ts +10 -0
  80. package/lib/esm/Editing/Mutable/MutableCAClass.d.ts.map +1 -0
  81. package/lib/esm/Editing/Mutable/MutableCAClass.js +12 -0
  82. package/lib/esm/Editing/Mutable/MutableCAClass.js.map +1 -0
  83. package/lib/esm/Editing/Mutable/MutableClass.d.ts +39 -0
  84. package/lib/esm/Editing/Mutable/MutableClass.d.ts.map +1 -0
  85. package/lib/esm/Editing/Mutable/MutableClass.js +18 -0
  86. package/lib/esm/Editing/Mutable/MutableClass.js.map +1 -0
  87. package/lib/esm/Editing/Mutable/MutableConstant.d.ts +14 -0
  88. package/lib/esm/Editing/Mutable/MutableConstant.d.ts.map +1 -0
  89. package/lib/esm/Editing/Mutable/MutableConstant.js +12 -0
  90. package/lib/esm/Editing/Mutable/MutableConstant.js.map +1 -0
  91. package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts +12 -0
  92. package/lib/esm/Editing/Mutable/MutableEntityClass.d.ts.map +1 -0
  93. package/lib/esm/Editing/Mutable/MutableEntityClass.js +12 -0
  94. package/lib/esm/Editing/Mutable/MutableEntityClass.js.map +1 -0
  95. package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts +11 -0
  96. package/lib/esm/Editing/Mutable/MutableEnumeration.d.ts.map +1 -0
  97. package/lib/esm/Editing/Mutable/MutableEnumeration.js +11 -0
  98. package/lib/esm/Editing/Mutable/MutableEnumeration.js.map +1 -0
  99. package/lib/esm/Editing/Mutable/MutableFormat.d.ts +26 -0
  100. package/lib/esm/Editing/Mutable/MutableFormat.d.ts.map +1 -0
  101. package/lib/esm/Editing/Mutable/MutableFormat.js +12 -0
  102. package/lib/esm/Editing/Mutable/MutableFormat.js.map +1 -0
  103. package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts +11 -0
  104. package/lib/esm/Editing/Mutable/MutableInvertedUnit.d.ts.map +1 -0
  105. package/lib/esm/Editing/Mutable/MutableInvertedUnit.js +12 -0
  106. package/lib/esm/Editing/Mutable/MutableInvertedUnit.js.map +1 -0
  107. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts +14 -0
  108. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.d.ts.map +1 -0
  109. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js +12 -0
  110. package/lib/esm/Editing/Mutable/MutableKindOfQuantity.js.map +1 -0
  111. package/lib/esm/Editing/Mutable/MutableMixin.d.ts +12 -0
  112. package/lib/esm/Editing/Mutable/MutableMixin.d.ts.map +1 -0
  113. package/lib/esm/Editing/Mutable/MutableMixin.js +12 -0
  114. package/lib/esm/Editing/Mutable/MutableMixin.js.map +1 -0
  115. package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts +8 -0
  116. package/lib/esm/Editing/Mutable/MutableNavigationProperty.d.ts.map +1 -0
  117. package/lib/esm/Editing/Mutable/MutableNavigationProperty.js +12 -0
  118. package/lib/esm/Editing/Mutable/MutableNavigationProperty.js.map +1 -0
  119. package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts +11 -0
  120. package/lib/esm/Editing/Mutable/MutablePhenomenon.d.ts.map +1 -0
  121. package/lib/esm/Editing/Mutable/MutablePhenomenon.js +12 -0
  122. package/lib/esm/Editing/Mutable/MutablePhenomenon.js.map +1 -0
  123. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts +13 -0
  124. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.d.ts.map +1 -0
  125. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js +12 -0
  126. package/lib/esm/Editing/Mutable/MutablePrimitiveOrEnumProperty.js.map +1 -0
  127. package/lib/esm/Editing/Mutable/MutableProperty.d.ts +16 -0
  128. package/lib/esm/Editing/Mutable/MutableProperty.d.ts.map +1 -0
  129. package/lib/esm/Editing/Mutable/MutableProperty.js +12 -0
  130. package/lib/esm/Editing/Mutable/MutableProperty.js.map +1 -0
  131. package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts +11 -0
  132. package/lib/esm/Editing/Mutable/MutablePropertyCategory.d.ts.map +1 -0
  133. package/lib/esm/Editing/Mutable/MutablePropertyCategory.js +12 -0
  134. package/lib/esm/Editing/Mutable/MutablePropertyCategory.js.map +1 -0
  135. package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts +30 -0
  136. package/lib/esm/Editing/Mutable/MutableRelationshipClass.d.ts.map +1 -0
  137. package/lib/esm/Editing/Mutable/MutableRelationshipClass.js +20 -0
  138. package/lib/esm/Editing/Mutable/MutableRelationshipClass.js.map +1 -0
  139. package/lib/esm/Editing/Mutable/MutableSchema.d.ts +51 -0
  140. package/lib/esm/Editing/Mutable/MutableSchema.d.ts.map +1 -0
  141. package/lib/esm/Editing/Mutable/MutableSchema.js +14 -0
  142. package/lib/esm/Editing/Mutable/MutableSchema.js.map +1 -0
  143. package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts +11 -0
  144. package/lib/esm/Editing/Mutable/MutableSchemaItem.d.ts.map +1 -0
  145. package/lib/esm/Editing/Mutable/MutableSchemaItem.js +12 -0
  146. package/lib/esm/Editing/Mutable/MutableSchemaItem.js.map +1 -0
  147. package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts +8 -0
  148. package/lib/esm/Editing/Mutable/MutableStructProperty.d.ts.map +1 -0
  149. package/lib/esm/Editing/Mutable/MutableStructProperty.js +12 -0
  150. package/lib/esm/Editing/Mutable/MutableStructProperty.js.map +1 -0
  151. package/lib/esm/Editing/Mutable/MutableUnit.d.ts +12 -0
  152. package/lib/esm/Editing/Mutable/MutableUnit.d.ts.map +1 -0
  153. package/lib/esm/Editing/Mutable/MutableUnit.js +12 -0
  154. package/lib/esm/Editing/Mutable/MutableUnit.js.map +1 -0
  155. package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts +10 -0
  156. package/lib/esm/Editing/Mutable/MutableUnitSystem.d.ts.map +1 -0
  157. package/lib/esm/Editing/Mutable/MutableUnitSystem.js +12 -0
  158. package/lib/esm/Editing/Mutable/MutableUnitSystem.js.map +1 -0
  159. package/lib/esm/Editing/Phenomena.d.ts +17 -0
  160. package/lib/esm/Editing/Phenomena.d.ts.map +1 -0
  161. package/lib/esm/Editing/Phenomena.js +44 -0
  162. package/lib/esm/Editing/Phenomena.js.map +1 -0
  163. package/lib/esm/Editing/Properties.d.ts +206 -0
  164. package/lib/esm/Editing/Properties.d.ts.map +1 -0
  165. package/lib/esm/Editing/Properties.js +415 -0
  166. package/lib/esm/Editing/Properties.js.map +1 -0
  167. package/lib/esm/Editing/PropertyCategories.d.ts +18 -0
  168. package/lib/esm/Editing/PropertyCategories.d.ts.map +1 -0
  169. package/lib/esm/Editing/PropertyCategories.js +54 -0
  170. package/lib/esm/Editing/PropertyCategories.js.map +1 -0
  171. package/lib/esm/Editing/RelationshipClasses.d.ts +69 -0
  172. package/lib/esm/Editing/RelationshipClasses.d.ts.map +1 -0
  173. package/lib/esm/Editing/RelationshipClasses.js +236 -0
  174. package/lib/esm/Editing/RelationshipClasses.js.map +1 -0
  175. package/lib/esm/Editing/SchemaItems.d.ts +42 -0
  176. package/lib/esm/Editing/SchemaItems.d.ts.map +1 -0
  177. package/lib/esm/Editing/SchemaItems.js +104 -0
  178. package/lib/esm/Editing/SchemaItems.js.map +1 -0
  179. package/lib/esm/Editing/Structs.d.ts +21 -0
  180. package/lib/esm/Editing/Structs.d.ts.map +1 -0
  181. package/lib/esm/Editing/Structs.js +47 -0
  182. package/lib/esm/Editing/Structs.js.map +1 -0
  183. package/lib/esm/Editing/UnitSystems.d.ts +17 -0
  184. package/lib/esm/Editing/UnitSystems.d.ts.map +1 -0
  185. package/lib/esm/Editing/UnitSystems.js +43 -0
  186. package/lib/esm/Editing/UnitSystems.js.map +1 -0
  187. package/lib/esm/Editing/Units.d.ts +17 -0
  188. package/lib/esm/Editing/Units.d.ts.map +1 -0
  189. package/lib/esm/Editing/Units.js +49 -0
  190. package/lib/esm/Editing/Units.js.map +1 -0
  191. package/lib/esm/Merging/ClassMerger.d.ts +9 -0
  192. package/lib/esm/Merging/ClassMerger.d.ts.map +1 -0
  193. package/lib/esm/Merging/ClassMerger.js +66 -0
  194. package/lib/esm/Merging/ClassMerger.js.map +1 -0
  195. package/lib/esm/Merging/ConstantMerger.d.ts +14 -0
  196. package/lib/esm/Merging/ConstantMerger.d.ts.map +1 -0
  197. package/lib/esm/Merging/ConstantMerger.js +64 -0
  198. package/lib/esm/Merging/ConstantMerger.js.map +1 -0
  199. package/lib/esm/Merging/CustomAttributeClassMerger.d.ts +14 -0
  200. package/lib/esm/Merging/CustomAttributeClassMerger.d.ts.map +1 -0
  201. package/lib/esm/Merging/CustomAttributeClassMerger.js +36 -0
  202. package/lib/esm/Merging/CustomAttributeClassMerger.js.map +1 -0
  203. package/lib/esm/Merging/CustomAttributeMerger.d.ts +19 -0
  204. package/lib/esm/Merging/CustomAttributeMerger.d.ts.map +1 -0
  205. package/lib/esm/Merging/CustomAttributeMerger.js +66 -0
  206. package/lib/esm/Merging/CustomAttributeMerger.js.map +1 -0
  207. package/lib/esm/Merging/Edits/NameMapping.d.ts +22 -0
  208. package/lib/esm/Merging/Edits/NameMapping.d.ts.map +1 -0
  209. package/lib/esm/Merging/Edits/NameMapping.js +49 -0
  210. package/lib/esm/Merging/Edits/NameMapping.js.map +1 -0
  211. package/lib/esm/Merging/Edits/RenameEditHandler.d.ts +14 -0
  212. package/lib/esm/Merging/Edits/RenameEditHandler.d.ts.map +1 -0
  213. package/lib/esm/Merging/Edits/RenameEditHandler.js +62 -0
  214. package/lib/esm/Merging/Edits/RenameEditHandler.js.map +1 -0
  215. package/lib/esm/Merging/Edits/SchemaEdits.d.ts +81 -0
  216. package/lib/esm/Merging/Edits/SchemaEdits.d.ts.map +1 -0
  217. package/lib/esm/Merging/Edits/SchemaEdits.js +112 -0
  218. package/lib/esm/Merging/Edits/SchemaEdits.js.map +1 -0
  219. package/lib/esm/Merging/Edits/SkipEditHandler.d.ts +14 -0
  220. package/lib/esm/Merging/Edits/SkipEditHandler.d.ts.map +1 -0
  221. package/lib/esm/Merging/Edits/SkipEditHandler.js +60 -0
  222. package/lib/esm/Merging/Edits/SkipEditHandler.js.map +1 -0
  223. package/lib/esm/Merging/EntityClassMerger.d.ts +19 -0
  224. package/lib/esm/Merging/EntityClassMerger.d.ts.map +1 -0
  225. package/lib/esm/Merging/EntityClassMerger.js +39 -0
  226. package/lib/esm/Merging/EntityClassMerger.js.map +1 -0
  227. package/lib/esm/Merging/EnumerationMerger.d.ts +14 -0
  228. package/lib/esm/Merging/EnumerationMerger.d.ts.map +1 -0
  229. package/lib/esm/Merging/EnumerationMerger.js +48 -0
  230. package/lib/esm/Merging/EnumerationMerger.js.map +1 -0
  231. package/lib/esm/Merging/EnumeratorMerger.d.ts +14 -0
  232. package/lib/esm/Merging/EnumeratorMerger.d.ts.map +1 -0
  233. package/lib/esm/Merging/EnumeratorMerger.js +36 -0
  234. package/lib/esm/Merging/EnumeratorMerger.js.map +1 -0
  235. package/lib/esm/Merging/FormatMerger.d.ts +24 -0
  236. package/lib/esm/Merging/FormatMerger.d.ts.map +1 -0
  237. package/lib/esm/Merging/FormatMerger.js +137 -0
  238. package/lib/esm/Merging/FormatMerger.js.map +1 -0
  239. package/lib/esm/Merging/InvertedUnitMerger.d.ts +14 -0
  240. package/lib/esm/Merging/InvertedUnitMerger.d.ts.map +1 -0
  241. package/lib/esm/Merging/InvertedUnitMerger.js +41 -0
  242. package/lib/esm/Merging/InvertedUnitMerger.js.map +1 -0
  243. package/lib/esm/Merging/KindOfQuantityMerger.d.ts +19 -0
  244. package/lib/esm/Merging/KindOfQuantityMerger.d.ts.map +1 -0
  245. package/lib/esm/Merging/KindOfQuantityMerger.js +89 -0
  246. package/lib/esm/Merging/KindOfQuantityMerger.js.map +1 -0
  247. package/lib/esm/Merging/MixinMerger.d.ts +14 -0
  248. package/lib/esm/Merging/MixinMerger.d.ts.map +1 -0
  249. package/lib/esm/Merging/MixinMerger.js +33 -0
  250. package/lib/esm/Merging/MixinMerger.js.map +1 -0
  251. package/lib/esm/Merging/PhenomenonMerger.d.ts +14 -0
  252. package/lib/esm/Merging/PhenomenonMerger.d.ts.map +1 -0
  253. package/lib/esm/Merging/PhenomenonMerger.js +36 -0
  254. package/lib/esm/Merging/PhenomenonMerger.js.map +1 -0
  255. package/lib/esm/Merging/PropertyCategoryMerger.d.ts +14 -0
  256. package/lib/esm/Merging/PropertyCategoryMerger.d.ts.map +1 -0
  257. package/lib/esm/Merging/PropertyCategoryMerger.js +31 -0
  258. package/lib/esm/Merging/PropertyCategoryMerger.js.map +1 -0
  259. package/lib/esm/Merging/PropertyMerger.d.ts +12 -0
  260. package/lib/esm/Merging/PropertyMerger.d.ts.map +1 -0
  261. package/lib/esm/Merging/PropertyMerger.js +228 -0
  262. package/lib/esm/Merging/PropertyMerger.js.map +1 -0
  263. package/lib/esm/Merging/RelationshipClassMerger.d.ts +27 -0
  264. package/lib/esm/Merging/RelationshipClassMerger.d.ts.map +1 -0
  265. package/lib/esm/Merging/RelationshipClassMerger.js +136 -0
  266. package/lib/esm/Merging/RelationshipClassMerger.js.map +1 -0
  267. package/lib/esm/Merging/SchemaMerger.d.ts +49 -0
  268. package/lib/esm/Merging/SchemaMerger.d.ts.map +1 -0
  269. package/lib/esm/Merging/SchemaMerger.js +117 -0
  270. package/lib/esm/Merging/SchemaMerger.js.map +1 -0
  271. package/lib/esm/Merging/SchemaMergingVisitor.d.ts +149 -0
  272. package/lib/esm/Merging/SchemaMergingVisitor.d.ts.map +1 -0
  273. package/lib/esm/Merging/SchemaMergingVisitor.js +339 -0
  274. package/lib/esm/Merging/SchemaMergingVisitor.js.map +1 -0
  275. package/lib/esm/Merging/SchemaMergingWalker.d.ts +19 -0
  276. package/lib/esm/Merging/SchemaMergingWalker.d.ts.map +1 -0
  277. package/lib/esm/Merging/SchemaMergingWalker.js +61 -0
  278. package/lib/esm/Merging/SchemaMergingWalker.js.map +1 -0
  279. package/lib/esm/Merging/SchemaReferenceMerger.d.ts +13 -0
  280. package/lib/esm/Merging/SchemaReferenceMerger.d.ts.map +1 -0
  281. package/lib/esm/Merging/SchemaReferenceMerger.js +57 -0
  282. package/lib/esm/Merging/SchemaReferenceMerger.js.map +1 -0
  283. package/lib/esm/Merging/StructClassMerger.d.ts +14 -0
  284. package/lib/esm/Merging/StructClassMerger.d.ts.map +1 -0
  285. package/lib/esm/Merging/StructClassMerger.js +20 -0
  286. package/lib/esm/Merging/StructClassMerger.js.map +1 -0
  287. package/lib/esm/Merging/UnitMerger.d.ts +14 -0
  288. package/lib/esm/Merging/UnitMerger.d.ts.map +1 -0
  289. package/lib/esm/Merging/UnitMerger.js +58 -0
  290. package/lib/esm/Merging/UnitMerger.js.map +1 -0
  291. package/lib/esm/Merging/UnitSystemMerger.d.ts +14 -0
  292. package/lib/esm/Merging/UnitSystemMerger.d.ts.map +1 -0
  293. package/lib/esm/Merging/UnitSystemMerger.js +24 -0
  294. package/lib/esm/Merging/UnitSystemMerger.js.map +1 -0
  295. package/lib/esm/Merging/Utils.d.ts +34 -0
  296. package/lib/esm/Merging/Utils.d.ts.map +1 -0
  297. package/lib/esm/Merging/Utils.js +90 -0
  298. package/lib/esm/Merging/Utils.js.map +1 -0
  299. package/lib/esm/Validation/Diagnostic.d.ts +322 -0
  300. package/lib/esm/Validation/Diagnostic.d.ts.map +1 -0
  301. package/lib/esm/Validation/Diagnostic.js +295 -0
  302. package/lib/esm/Validation/Diagnostic.js.map +1 -0
  303. package/lib/esm/Validation/DiagnosticReporter.d.ts +97 -0
  304. package/lib/esm/Validation/DiagnosticReporter.d.ts.map +1 -0
  305. package/lib/esm/Validation/DiagnosticReporter.js +105 -0
  306. package/lib/esm/Validation/DiagnosticReporter.js.map +1 -0
  307. package/lib/esm/Validation/ECRules.d.ts +454 -0
  308. package/lib/esm/Validation/ECRules.d.ts.map +1 -0
  309. package/lib/esm/Validation/ECRules.js +578 -0
  310. package/lib/esm/Validation/ECRules.js.map +1 -0
  311. package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts +14 -0
  312. package/lib/esm/Validation/LoggingDiagnosticReporter.d.ts.map +1 -0
  313. package/lib/esm/Validation/LoggingDiagnosticReporter.js +37 -0
  314. package/lib/esm/Validation/LoggingDiagnosticReporter.js.map +1 -0
  315. package/lib/esm/Validation/RuleSuppressionSet.d.ts +60 -0
  316. package/lib/esm/Validation/RuleSuppressionSet.d.ts.map +1 -0
  317. package/lib/esm/Validation/RuleSuppressionSet.js +9 -0
  318. package/lib/esm/Validation/RuleSuppressionSet.js.map +1 -0
  319. package/lib/esm/Validation/Rules.d.ts +65 -0
  320. package/lib/esm/Validation/Rules.d.ts.map +1 -0
  321. package/lib/esm/Validation/Rules.js +9 -0
  322. package/lib/esm/Validation/Rules.js.map +1 -0
  323. package/lib/esm/Validation/SchemaChanges.d.ts +640 -0
  324. package/lib/esm/Validation/SchemaChanges.d.ts.map +1 -0
  325. package/lib/esm/Validation/SchemaChanges.js +1141 -0
  326. package/lib/esm/Validation/SchemaChanges.js.map +1 -0
  327. package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts +423 -0
  328. package/lib/esm/Validation/SchemaCompareDiagnostics.d.ts.map +1 -0
  329. package/lib/esm/Validation/SchemaCompareDiagnostics.js +109 -0
  330. package/lib/esm/Validation/SchemaCompareDiagnostics.js.map +1 -0
  331. package/lib/esm/Validation/SchemaCompareReporter.d.ts +12 -0
  332. package/lib/esm/Validation/SchemaCompareReporter.d.ts.map +1 -0
  333. package/lib/esm/Validation/SchemaCompareReporter.js +9 -0
  334. package/lib/esm/Validation/SchemaCompareReporter.js.map +1 -0
  335. package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts +237 -0
  336. package/lib/esm/Validation/SchemaCompareResultDelegate.d.ts.map +1 -0
  337. package/lib/esm/Validation/SchemaCompareResultDelegate.js +346 -0
  338. package/lib/esm/Validation/SchemaCompareResultDelegate.js.map +1 -0
  339. package/lib/esm/Validation/SchemaCompareVisitor.d.ts +120 -0
  340. package/lib/esm/Validation/SchemaCompareVisitor.d.ts.map +1 -0
  341. package/lib/esm/Validation/SchemaCompareVisitor.js +222 -0
  342. package/lib/esm/Validation/SchemaCompareVisitor.js.map +1 -0
  343. package/lib/esm/Validation/SchemaComparer.d.ts +211 -0
  344. package/lib/esm/Validation/SchemaComparer.d.ts.map +1 -0
  345. package/lib/esm/Validation/SchemaComparer.js +770 -0
  346. package/lib/esm/Validation/SchemaComparer.js.map +1 -0
  347. package/lib/esm/Validation/SchemaValidater.d.ts +20 -0
  348. package/lib/esm/Validation/SchemaValidater.d.ts.map +1 -0
  349. package/lib/esm/Validation/SchemaValidater.js +55 -0
  350. package/lib/esm/Validation/SchemaValidater.js.map +1 -0
  351. package/lib/esm/Validation/SchemaValidationVisitor.d.ts +171 -0
  352. package/lib/esm/Validation/SchemaValidationVisitor.d.ts.map +1 -0
  353. package/lib/esm/Validation/SchemaValidationVisitor.js +488 -0
  354. package/lib/esm/Validation/SchemaValidationVisitor.js.map +1 -0
  355. package/lib/esm/Validation/SchemaWalker.d.ts +23 -0
  356. package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -0
  357. package/lib/esm/Validation/SchemaWalker.js +50 -0
  358. package/lib/esm/Validation/SchemaWalker.js.map +1 -0
  359. package/lib/esm/ecschema-editing.d.ts +49 -0
  360. package/lib/esm/ecschema-editing.d.ts.map +1 -0
  361. package/lib/esm/ecschema-editing.js +52 -0
  362. package/lib/esm/ecschema-editing.js.map +1 -0
  363. package/package.json +12 -10
@@ -0,0 +1,1141 @@
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 Comparison
7
+ */
8
+ import { ECClass, ECObjectsError, ECObjectsStatus, OverrideFormat, Property, RelationshipConstraint, Schema, SchemaItem, SchemaItemType, } from "@itwin/ecschema-metadata";
9
+ import { SchemaCompareCodes } from "./SchemaCompareDiagnostics";
10
+ /**
11
+ * Possible change types used to categorize ISchemaChange objects.
12
+ * @alpha
13
+ */
14
+ export var ChangeType;
15
+ (function (ChangeType) {
16
+ ChangeType[ChangeType["Delta"] = 0] = "Delta";
17
+ ChangeType[ChangeType["Missing"] = 1] = "Missing";
18
+ })(ChangeType || (ChangeType = {}));
19
+ /**
20
+ * An ISchemaChange implementation meant to be used as the base class
21
+ * for all other ISchemaChange implementations.
22
+ * @alpha
23
+ */
24
+ export class BaseSchemaChange {
25
+ _diagnostic;
26
+ _changeType;
27
+ /**
28
+ * Initializes a new BaseSchemaChange instance.
29
+ * @param diagnostic The diagnostic holding the change data.
30
+ */
31
+ constructor(diagnostic) {
32
+ this._diagnostic = diagnostic;
33
+ }
34
+ /** Gets the diagnostic holding the information about the schema change. */
35
+ get diagnostic() { return this._diagnostic; }
36
+ /**
37
+ * Gets the change type (Delta or Missing) for the change. If not previously
38
+ * set, the defaultChangeType value will be returned.
39
+ */
40
+ get changeType() {
41
+ if (!this._changeType)
42
+ this._changeType = this.defaultChangeType;
43
+ return this._changeType;
44
+ }
45
+ set changeType(changeType) { this._changeType = changeType; }
46
+ /**
47
+ * Gets the name or fullName from an EC type that is in the args array at
48
+ * the specified index. Performs validation based on the given parameters.
49
+ * @param index The index in the args array to find the EC type.
50
+ * @param args The collection of arguments received in the diagnostics.
51
+ * @param allowUndefined Specifies that undefined values are allowed.
52
+ * @param fullName Flag indicating that the fullName should be returned rather than the name.
53
+ */
54
+ getNameFromArgument(index, allowUndefined = false, fullName = false) {
55
+ if (!this.diagnostic.messageArgs || this.diagnostic.messageArgs.length <= index)
56
+ throw new ECObjectsError(ECObjectsStatus.InvalidSchemaComparisonArgument, `Schema comparison diagnostic '${this.diagnostic.code}' for SchemaItem '${this.topLevelSchemaItem.fullName}' has invalid arguments`);
57
+ const schemaItem = this.getValueFromArgument(index);
58
+ if (Schema.isSchema(schemaItem) || SchemaItem.isSchemaItem(schemaItem) || OverrideFormat.isOverrideFormat(schemaItem))
59
+ return fullName ? schemaItem.fullName : schemaItem.name;
60
+ if (!allowUndefined)
61
+ throw new ECObjectsError(ECObjectsStatus.InvalidSchemaComparisonArgument, `Schema comparison diagnostic '${this.diagnostic.code}' for SchemaItem '${this.topLevelSchemaItem.fullName}' has invalid arguments`);
62
+ return "undefined";
63
+ }
64
+ /**
65
+ * Gets a string from the diagnostics arguments at the given index. If the value is undefined,
66
+ * the string 'undefined' will be returned.
67
+ * @param index The index in the args array to find the property value.
68
+ */
69
+ getStringFromArgument(index) {
70
+ const value = this.getValueFromArgument(index);
71
+ if (value === undefined)
72
+ return "undefined";
73
+ if (typeof value === "number")
74
+ return value.toString();
75
+ if (typeof value === "boolean")
76
+ return value ? "true" : "false";
77
+ if (typeof value !== "string")
78
+ throw new Error();
79
+ return value;
80
+ }
81
+ /**
82
+ * Helper method to retrieve a value from the diagnostic arguments, performing validation.
83
+ * @param index THe index in the diagnostic arguments array.
84
+ */
85
+ getValueFromArgument(index) {
86
+ if (!this.diagnostic.messageArgs || this.diagnostic.messageArgs.length <= index)
87
+ throw new Error();
88
+ return this.diagnostic.messageArgs[index];
89
+ }
90
+ }
91
+ /**
92
+ * Base class for all ISchemaChanges implementations.
93
+ * @alpha
94
+ */
95
+ export class BaseSchemaChanges {
96
+ _ecTypeName;
97
+ _schema;
98
+ _propertyValueChanges = [];
99
+ /**
100
+ * Initializes a new BaseSchemaChanges instance.
101
+ * @param schema The schema containing the changes.
102
+ * @param anyECTypeName The name of the EC type.
103
+ */
104
+ constructor(schema, anyECTypeName) {
105
+ this._schema = schema;
106
+ this._ecTypeName = anyECTypeName;
107
+ }
108
+ /** Gets the array of PropertyValueChange instances. */
109
+ get propertyValueChanges() {
110
+ return this._propertyValueChanges;
111
+ }
112
+ /** Gets the name of the EC type associated with these schema changes. */
113
+ get ecTypeName() {
114
+ return this._ecTypeName;
115
+ }
116
+ /** Gets the schema to which these changes are associated. */
117
+ get schema() {
118
+ return this._schema;
119
+ }
120
+ /**
121
+ * Helper method that adds a new ISchemaChange to a Map whose values are ISchemaChanges. The changesType will
122
+ * be used to create a new ISchemaChanges instance if the changes collection does not exist in the Map.
123
+ * @param changes The ISchemaChanges Map to which to add the ISchemaChange.
124
+ * @param changesType The constructor of the ISchemaChanges. Called if the ISchemaChanges instance does not exist in the Map.
125
+ * @param change The ISchemaChange to add.
126
+ * @param changeKey The key used to identify the ISchemaChanges in the Map (typically the name of the EC type, ie. SchemaItem.name).
127
+ */
128
+ addChangeToMap(changes, changesType, change, changeKey) {
129
+ if (changes.has(changeKey)) {
130
+ const existingChanges = changes.get(changeKey);
131
+ existingChanges.addChange(change);
132
+ }
133
+ else {
134
+ const newChanges = new changesType(this._schema, changeKey);
135
+ newChanges.addChange(change);
136
+ changes.set(changeKey, newChanges);
137
+ }
138
+ }
139
+ /**
140
+ * Helper method to determine if the diagnostic is a property value change delta for this ISchemaChanges instance.
141
+ * @param diagnostic The change diagnostic.
142
+ * @param ecTypeName The name of the EC type as determined by the implementation.
143
+ */
144
+ isPropertyValueChangeForThis(diagnostic, ecTypeName) {
145
+ if (this.ecTypeName !== ecTypeName)
146
+ return false;
147
+ switch (diagnostic.code) {
148
+ case SchemaCompareCodes.SchemaDelta:
149
+ case SchemaCompareCodes.SchemaItemDelta:
150
+ case SchemaCompareCodes.ClassDelta:
151
+ case SchemaCompareCodes.MixinDelta:
152
+ case SchemaCompareCodes.RelationshipDelta:
153
+ case SchemaCompareCodes.CustomAttributeClassDelta:
154
+ case SchemaCompareCodes.EnumerationDelta:
155
+ case SchemaCompareCodes.KoqDelta:
156
+ case SchemaCompareCodes.PropertyCategoryDelta:
157
+ case SchemaCompareCodes.FormatDelta:
158
+ case SchemaCompareCodes.UnitDelta:
159
+ case SchemaCompareCodes.InvertedUnitDelta:
160
+ case SchemaCompareCodes.PhenomenonDelta:
161
+ case SchemaCompareCodes.ConstantDelta:
162
+ case SchemaCompareCodes.PropertyDelta:
163
+ case SchemaCompareCodes.RelationshipConstraintDelta:
164
+ return true;
165
+ default:
166
+ return false;
167
+ }
168
+ }
169
+ /**
170
+ * Helper method to determine if the diagnostic is a CustomAttributeInstance class change for this ISchemaChanges instance.
171
+ * @param diagnostic The change diagnostic.
172
+ * @param ecTypeName The name of the EC type as determined by the implementation.
173
+ */
174
+ isCAContainerChangeForThis(diagnostic, ecTypeName) {
175
+ if (this.ecTypeName !== ecTypeName)
176
+ return false;
177
+ return diagnostic.code === SchemaCompareCodes.CustomAttributeInstanceClassMissing;
178
+ }
179
+ }
180
+ /**
181
+ * An ISchemaChanges implementation for managing schema comparison diagnostics at the Schema level.
182
+ * @alpha
183
+ */
184
+ export class SchemaChanges extends BaseSchemaChanges {
185
+ _diagnostics = [];
186
+ _missingSchemaReferences = [];
187
+ _schemaReferenceDeltas = [];
188
+ _customAttributeChanges = new Map();
189
+ _classChanges = new Map();
190
+ _entityClassChanges = new Map();
191
+ _relationshipClassChanges = new Map();
192
+ _schemaItemChanges = new Map();
193
+ _enumerationChanges = new Map();
194
+ _kindOfQuantityChanges = new Map();
195
+ _formatChanges = new Map();
196
+ /**
197
+ * Initializes a new SchemaChanges instance.
198
+ * @param schema The schema containing the changes.
199
+ */
200
+ constructor(schema) {
201
+ super(schema, schema.name);
202
+ }
203
+ /** Gets the MissingSchemaReferences collection. */
204
+ get missingSchemaReferences() { return this._missingSchemaReferences; }
205
+ /** Gets the SchemaReferenceChange collection. */
206
+ get schemaReferenceDeltas() { return this._schemaReferenceDeltas; }
207
+ /** Gets the CustomAttributeContainerChanges Map. */
208
+ get customAttributeChanges() { return this._customAttributeChanges; }
209
+ /** Gets the ClassChanges Map. */
210
+ get classChanges() { return this._classChanges; }
211
+ /** Gets the EntityClassChanges Map. */
212
+ get entityClassChanges() { return this._entityClassChanges; }
213
+ /** Gets the RelationshipClassChanges Map. */
214
+ get relationshipClassChanges() { return this._relationshipClassChanges; }
215
+ /** Gets the SchemaItemChanges Map. */
216
+ get schemaItemChanges() { return this._schemaItemChanges; }
217
+ /** Gets the EnumerationChanges Map. */
218
+ get enumerationChanges() { return this._enumerationChanges; }
219
+ /** Gets the KindOfQuantityChanges Map. */
220
+ get kindOfQuantityChanges() { return this._kindOfQuantityChanges; }
221
+ /** Gets the FormatChanges Map. */
222
+ get formatChanges() { return this._formatChanges; }
223
+ /** Gets all the change diagnostics that have been added to instance. */
224
+ get allDiagnostics() {
225
+ return this._diagnostics;
226
+ }
227
+ /**
228
+ * Adds a new change diagnostic for the schema.
229
+ * @param diagnostic
230
+ */
231
+ addDiagnostic(diagnostic) {
232
+ this._diagnostics.push(diagnostic);
233
+ const change = this.createChangeFromDiagnostic(diagnostic);
234
+ this.addChange(change);
235
+ }
236
+ /**
237
+ * Adds the change to the appropriate change collection at this level or adds the change
238
+ * to a Map of child changes will which propagate the change to lower levels. Typically
239
+ * any 'addChangeToMap' type method will then call addChange to add the ISchemaChange to
240
+ * the ISchemaChanges instance at that level.
241
+ * @param change The ISchemaChange to add.
242
+ */
243
+ addChange(change) {
244
+ const schemaName = this.getSchemaNameFromChange(change);
245
+ // If change is at the schema level, record change and return
246
+ if (schemaName) {
247
+ if (change.diagnostic.code === SchemaCompareCodes.SchemaReferenceMissing) {
248
+ this.missingSchemaReferences.push(change);
249
+ return;
250
+ }
251
+ if (change.diagnostic.code === SchemaCompareCodes.SchemaReferenceDelta) {
252
+ this.schemaReferenceDeltas.push(change);
253
+ return;
254
+ }
255
+ if (this.isCAContainerChangeForThis(change.diagnostic, schemaName)) {
256
+ this.addChangeToMap(this.customAttributeChanges, CustomAttributeContainerChanges, change, change.changeKey);
257
+ return;
258
+ }
259
+ if (this.isPropertyValueChangeForThis(change.diagnostic, schemaName)) {
260
+ this.propertyValueChanges.push(change);
261
+ return;
262
+ }
263
+ }
264
+ // Start by adding the change for the top-level SchemaItem which will
265
+ // start a recursion to add the change at each appropriate level.
266
+ const schemaItem = change.topLevelSchemaItem;
267
+ const schemaItemType = schemaItem.schemaItemType;
268
+ switch (schemaItemType) {
269
+ case SchemaItemType.Mixin:
270
+ case SchemaItemType.StructClass:
271
+ case SchemaItemType.CustomAttributeClass:
272
+ this.addChangeToClassMap(change, schemaItem);
273
+ return;
274
+ case SchemaItemType.EntityClass:
275
+ this.addChangeToEntityClassMap(change, schemaItem);
276
+ return;
277
+ case SchemaItemType.RelationshipClass:
278
+ this.addChangeToRelationshipClassMap(change, schemaItem);
279
+ return;
280
+ case SchemaItemType.PropertyCategory:
281
+ case SchemaItemType.Unit:
282
+ case SchemaItemType.InvertedUnit:
283
+ case SchemaItemType.UnitSystem:
284
+ case SchemaItemType.Phenomenon:
285
+ case SchemaItemType.Constant:
286
+ this.addChangeToSchemaItemMap(change, schemaItem);
287
+ return;
288
+ case SchemaItemType.Enumeration:
289
+ this.addChangeToEnumerationMap(change, schemaItem);
290
+ return;
291
+ case SchemaItemType.KindOfQuantity:
292
+ this.addChangeToKOQMap(change, schemaItem);
293
+ return;
294
+ case SchemaItemType.Format:
295
+ this.addChangeToFormatMap(change, schemaItem);
296
+ return;
297
+ }
298
+ }
299
+ getSchemaNameFromChange(change) {
300
+ const type = change.diagnostic.ecDefinition;
301
+ return (Schema.isSchema(type)) ? type.name : undefined;
302
+ }
303
+ /** This creates ISchemaChange instances based on the change diagnostic specified. */
304
+ createChangeFromDiagnostic(diagnostic) {
305
+ switch (diagnostic.code) {
306
+ case SchemaCompareCodes.SchemaReferenceMissing:
307
+ return new SchemaReferenceMissing(diagnostic);
308
+ case SchemaCompareCodes.SchemaReferenceDelta:
309
+ return new SchemaReferenceDelta(diagnostic);
310
+ case SchemaCompareCodes.SchemaDelta:
311
+ case SchemaCompareCodes.SchemaItemDelta:
312
+ case SchemaCompareCodes.ClassDelta:
313
+ case SchemaCompareCodes.MixinDelta:
314
+ case SchemaCompareCodes.RelationshipDelta:
315
+ case SchemaCompareCodes.CustomAttributeClassDelta:
316
+ case SchemaCompareCodes.EnumerationDelta:
317
+ case SchemaCompareCodes.KoqDelta:
318
+ case SchemaCompareCodes.PropertyCategoryDelta:
319
+ case SchemaCompareCodes.FormatDelta:
320
+ case SchemaCompareCodes.UnitDelta:
321
+ case SchemaCompareCodes.InvertedUnitDelta:
322
+ case SchemaCompareCodes.PhenomenonDelta:
323
+ case SchemaCompareCodes.ConstantDelta:
324
+ case SchemaCompareCodes.PropertyDelta:
325
+ case SchemaCompareCodes.RelationshipConstraintDelta:
326
+ return new PropertyValueChange(diagnostic);
327
+ case SchemaCompareCodes.SchemaItemMissing:
328
+ return new SchemaItemMissing(diagnostic);
329
+ case SchemaCompareCodes.BaseClassDelta:
330
+ return new BaseClassDelta(diagnostic);
331
+ case SchemaCompareCodes.PropertyMissing:
332
+ return new PropertyMissing(diagnostic);
333
+ case SchemaCompareCodes.EntityMixinMissing:
334
+ return new EntityMixinChange(diagnostic);
335
+ case SchemaCompareCodes.RelationshipConstraintClassMissing:
336
+ return new RelationshipConstraintClassChange(diagnostic);
337
+ case SchemaCompareCodes.CustomAttributeInstanceClassMissing:
338
+ return new CustomAttributeContainerChange(diagnostic);
339
+ case SchemaCompareCodes.EnumeratorMissing:
340
+ return new EnumeratorMissing(diagnostic);
341
+ case SchemaCompareCodes.EnumeratorDelta:
342
+ return new EnumeratorDelta(diagnostic);
343
+ case SchemaCompareCodes.PresentationUnitMissing:
344
+ return new PresentationUnitChange(diagnostic);
345
+ case SchemaCompareCodes.FormatUnitMissing:
346
+ return new FormatUnitChange(diagnostic);
347
+ case SchemaCompareCodes.UnitLabelOverrideDelta:
348
+ return new UnitLabelOverrideDelta(diagnostic);
349
+ default:
350
+ throw new Error();
351
+ }
352
+ }
353
+ addChangeToSchemaItemMap(change, schemaItem) {
354
+ if (this.schemaItemChanges.has(schemaItem.name)) {
355
+ const existingChanges = this.schemaItemChanges.get(schemaItem.name);
356
+ existingChanges.addChange(change);
357
+ }
358
+ else {
359
+ const newChanges = new SchemaItemChanges(this.schema, schemaItem.name, schemaItem.schemaItemType);
360
+ newChanges.addChange(change);
361
+ this.schemaItemChanges.set(schemaItem.name, newChanges);
362
+ }
363
+ }
364
+ addChangeToClassMap(change, ecClass) {
365
+ if (this.classChanges.has(ecClass.name)) {
366
+ const existingChanges = this.classChanges.get(ecClass.name);
367
+ existingChanges.addChange(change);
368
+ }
369
+ else {
370
+ const newChanges = new ClassChanges(this.schema, ecClass.name, ecClass.schemaItemType);
371
+ newChanges.addChange(change);
372
+ this.classChanges.set(ecClass.name, newChanges);
373
+ }
374
+ }
375
+ addChangeToEntityClassMap(change, ecClass) {
376
+ if (this.entityClassChanges.has(ecClass.name)) {
377
+ const existingChanges = this.entityClassChanges.get(ecClass.name);
378
+ existingChanges.addChange(change);
379
+ }
380
+ else {
381
+ const newChanges = new EntityClassChanges(this.schema, ecClass.name, ecClass.schemaItemType);
382
+ newChanges.addChange(change);
383
+ this.entityClassChanges.set(ecClass.name, newChanges);
384
+ }
385
+ }
386
+ addChangeToRelationshipClassMap(change, ecClass) {
387
+ if (this.relationshipClassChanges.has(ecClass.name)) {
388
+ const existingChanges = this.relationshipClassChanges.get(ecClass.name);
389
+ existingChanges.addChange(change);
390
+ }
391
+ else {
392
+ const newChanges = new RelationshipClassChanges(this.schema, ecClass.name, ecClass.schemaItemType);
393
+ newChanges.addChange(change);
394
+ this.relationshipClassChanges.set(ecClass.name, newChanges);
395
+ }
396
+ }
397
+ addChangeToEnumerationMap(change, enumeration) {
398
+ if (this.enumerationChanges.has(enumeration.name)) {
399
+ const existingChanges = this.enumerationChanges.get(enumeration.name);
400
+ existingChanges.addChange(change);
401
+ }
402
+ else {
403
+ const newChanges = new EnumerationChanges(this.schema, enumeration.name, enumeration.schemaItemType);
404
+ newChanges.addChange(change);
405
+ this.enumerationChanges.set(enumeration.name, newChanges);
406
+ }
407
+ }
408
+ addChangeToKOQMap(change, koq) {
409
+ if (this.kindOfQuantityChanges.has(koq.name)) {
410
+ const existingChanges = this.kindOfQuantityChanges.get(koq.name);
411
+ existingChanges.addChange(change);
412
+ }
413
+ else {
414
+ const newChanges = new KindOfQuantityChanges(this.schema, koq.name, koq.schemaItemType);
415
+ newChanges.addChange(change);
416
+ this.kindOfQuantityChanges.set(koq.name, newChanges);
417
+ }
418
+ }
419
+ addChangeToFormatMap(change, format) {
420
+ if (this.formatChanges.has(format.name)) {
421
+ const existingChanges = this.formatChanges.get(format.name);
422
+ existingChanges.addChange(change);
423
+ }
424
+ else {
425
+ const newChanges = new FormatChanges(this.schema, format.name, format.schemaItemType);
426
+ newChanges.addChange(change);
427
+ this.formatChanges.set(format.name, newChanges);
428
+ }
429
+ }
430
+ }
431
+ /**
432
+ * An ISchemaChanges implementation for managing schema comparison diagnostics at the SchemaItem level.
433
+ * @alpha
434
+ */
435
+ export class SchemaItemChanges extends BaseSchemaChanges {
436
+ _schemaItemType;
437
+ _schemaItemMissing;
438
+ /**
439
+ * Initializes a new SchemaItemChanges instance.
440
+ * @param schema The Schema containing the change.
441
+ * @param schemaItemName The name of the EC type associated with the change.
442
+ * @param schemaItemType The SchemaItemType of the EC type.
443
+ */
444
+ constructor(schema, schemaItemName, schemaItemType) {
445
+ super(schema, schemaItemName);
446
+ this._schemaItemType = schemaItemType;
447
+ }
448
+ /** Gets the SchemaItemType of the SchemaItem associated with the changes. */
449
+ get schemaItemType() {
450
+ return this._schemaItemType;
451
+ }
452
+ /** Gets the SchemaItemMissing change. Maybe undefined. */
453
+ get schemaItemMissing() {
454
+ return this._schemaItemMissing;
455
+ }
456
+ /**
457
+ * Adds the change to the appropriate change collection at this level or adds the change
458
+ * to a Map of child changes will which propagate the change to lower levels.
459
+ * @param change The ISchemaChange to add.
460
+ */
461
+ addChange(change) {
462
+ if (change.diagnostic.code === SchemaCompareCodes.SchemaItemMissing) {
463
+ this._schemaItemMissing = change;
464
+ return;
465
+ }
466
+ const name = this.getSchemaItemNameFromChange(change);
467
+ if (!name)
468
+ return;
469
+ if (this.isPropertyValueChangeForThis(change.diagnostic, name)) {
470
+ this.propertyValueChanges.push(change);
471
+ return;
472
+ }
473
+ }
474
+ getSchemaItemNameFromChange(change) {
475
+ const type = change.diagnostic.ecDefinition;
476
+ return (SchemaItem.isSchemaItem(type)) ? type.name : undefined;
477
+ }
478
+ }
479
+ /**
480
+ * An ISchemaChanges implementation for managing schema comparison diagnostics at the Class level.
481
+ * @alpha
482
+ */
483
+ export class ClassChanges extends SchemaItemChanges {
484
+ _baseClassDelta;
485
+ _propertyChanges = new Map();
486
+ _customAttributeChanges = new Map();
487
+ /** Gets the BaseClassDelta change. Maybe undefined. */
488
+ get baseClassDelta() {
489
+ return this._baseClassDelta;
490
+ }
491
+ /** Gets the PropertyChanges Map. */
492
+ get propertyChanges() {
493
+ return this._propertyChanges;
494
+ }
495
+ /** Gets the Map of CustomAttributeContainerChanges. */
496
+ get customAttributeChanges() {
497
+ return this._customAttributeChanges;
498
+ }
499
+ /**
500
+ * Adds the change to the appropriate change collection at this level or adds the change
501
+ * to a Map of child changes will which propagate the change to lower levels.
502
+ * @param change The ISchemaChange to add.
503
+ */
504
+ addChange(change) {
505
+ super.addChange(change);
506
+ if (change.diagnostic.code === SchemaCompareCodes.BaseClassDelta) {
507
+ this._baseClassDelta = change;
508
+ return;
509
+ }
510
+ if (Property.isProperty(change.diagnostic.ecDefinition)) {
511
+ this.addChangeToMap(this.propertyChanges, PropertyChanges, change, change.diagnostic.ecDefinition.name);
512
+ return;
513
+ }
514
+ if (this.isCAContainerChangeForThis(change.diagnostic, this.getSchemaItemNameFromChange(change))) {
515
+ this.addChangeToMap(this.customAttributeChanges, CustomAttributeContainerChanges, change, change.changeKey);
516
+ return;
517
+ }
518
+ }
519
+ }
520
+ /**
521
+ * An ISchemaChanges implementation for managing schema comparison diagnostics at the Class level.
522
+ * @alpha
523
+ */
524
+ export class EntityClassChanges extends ClassChanges {
525
+ _entityMixinChanges = new Map();
526
+ /** Gets the EntityMixinChanges Map. */
527
+ get entityMixinChanges() {
528
+ return this._entityMixinChanges;
529
+ }
530
+ /**
531
+ * Adds the change to the appropriate change collection at this level or adds the change
532
+ * to a Map of child changes will which propagate the change to lower levels.
533
+ * @param change The ISchemaChange to add.
534
+ */
535
+ addChange(change) {
536
+ super.addChange(change);
537
+ if (change.diagnostic.code === SchemaCompareCodes.EntityMixinMissing) {
538
+ this.addChangeToMap(this.entityMixinChanges, EntityMixinChanges, change, change.changeKey);
539
+ return;
540
+ }
541
+ }
542
+ }
543
+ /**
544
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for RelationshipClasses.
545
+ * @alpha
546
+ */
547
+ export class RelationshipClassChanges extends ClassChanges {
548
+ _sourceConstraintChanges = new Map();
549
+ _targetConstraintChanges = new Map();
550
+ /** Gets the source RelationshipConstraintChanges Map. */
551
+ get sourceConstraintChanges() {
552
+ return this._sourceConstraintChanges;
553
+ }
554
+ /** Gets the target RelationshipConstraintChanges Map. */
555
+ get targetConstraintChanges() {
556
+ return this._targetConstraintChanges;
557
+ }
558
+ /**
559
+ * Adds the change to the appropriate change collection at this level or adds the change
560
+ * to a Map of child changes will which propagate the change to lower levels.
561
+ * @param change The ISchemaChange to add.
562
+ */
563
+ addChange(change) {
564
+ super.addChange(change);
565
+ if (RelationshipConstraint.isRelationshipConstraint(change.diagnostic.ecDefinition)) {
566
+ if (change.diagnostic.ecDefinition.isSource)
567
+ this.addChangeToMap(this.sourceConstraintChanges, RelationshipConstraintChanges, change, change.diagnostic.ecDefinition.fullName);
568
+ else
569
+ this.addChangeToMap(this.targetConstraintChanges, RelationshipConstraintChanges, change, change.diagnostic.ecDefinition.fullName);
570
+ }
571
+ }
572
+ }
573
+ /**
574
+ * An ISchemaChanges implementation for managing schema comparison diagnostics at the Property level.
575
+ * @alpha
576
+ */
577
+ export class PropertyChanges extends BaseSchemaChanges {
578
+ _propertyMissing;
579
+ _customAttributeChanges = new Map();
580
+ /** Gets the PropertyMissing change. Maybe undefined. */
581
+ get propertyMissing() {
582
+ return this._propertyMissing;
583
+ }
584
+ /** Gets the CustomAttributeContainerChanges Map. */
585
+ get customAttributeChanges() {
586
+ return this._customAttributeChanges;
587
+ }
588
+ /**
589
+ * Adds the change to the appropriate change collection at this level or adds the change
590
+ * to a Map of child changes will which propagate the change to lower levels.
591
+ * @param change The ISchemaChange to add.
592
+ */
593
+ addChange(change) {
594
+ const propertyName = this.getPropertyNameFromChange(change);
595
+ if (!propertyName)
596
+ return;
597
+ if (change.diagnostic.code === SchemaCompareCodes.PropertyMissing) {
598
+ this._propertyMissing = change;
599
+ return;
600
+ }
601
+ if (this.isPropertyValueChangeForThis(change.diagnostic, propertyName)) {
602
+ this.propertyValueChanges.push(change);
603
+ return;
604
+ }
605
+ if (this.isCAContainerChangeForThis(change.diagnostic, propertyName))
606
+ this.addChangeToMap(this.customAttributeChanges, CustomAttributeContainerChanges, change, change.changeKey);
607
+ }
608
+ getPropertyNameFromChange(change) {
609
+ const type = change.diagnostic.ecDefinition;
610
+ return (Property.isProperty(type)) ? type.name : undefined;
611
+ }
612
+ }
613
+ /**
614
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for Enumerations.
615
+ * @alpha
616
+ */
617
+ export class EnumerationChanges extends SchemaItemChanges {
618
+ _enumeratorChanges = new Map();
619
+ /** Gets the EnumeratorChanges map. */
620
+ get enumeratorChanges() {
621
+ return this._enumeratorChanges;
622
+ }
623
+ /**
624
+ * Adds the change to the appropriate change collection at this level or adds the change
625
+ * to a Map of child changes will which propagate the change to lower levels.
626
+ * @param change The ISchemaChange to add.
627
+ */
628
+ addChange(change) {
629
+ super.addChange(change);
630
+ if (change.diagnostic.code === SchemaCompareCodes.EnumeratorDelta) {
631
+ this.addChangeToMap(this.enumeratorChanges, EnumeratorChanges, change, change.changeKey);
632
+ return;
633
+ }
634
+ if (change.diagnostic.code === SchemaCompareCodes.EnumeratorMissing) {
635
+ this.addChangeToMap(this.enumeratorChanges, EnumeratorChanges, change, change.changeKey);
636
+ }
637
+ }
638
+ }
639
+ /**
640
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for CustomAttributeContainers.
641
+ * @alpha
642
+ */
643
+ export class CustomAttributeContainerChanges extends BaseSchemaChanges {
644
+ _customAttributeChanges = [];
645
+ /** Gets the CustomAttributeContainerChange collection. */
646
+ get customAttributeChanges() {
647
+ return this._customAttributeChanges;
648
+ }
649
+ /**
650
+ * Adds the change to the appropriate change collection at this level.
651
+ * @param change The ISchemaChange to add.
652
+ */
653
+ addChange(change) {
654
+ if (change.diagnostic.code === SchemaCompareCodes.CustomAttributeInstanceClassMissing)
655
+ this.customAttributeChanges.push(change);
656
+ }
657
+ }
658
+ /**
659
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for RelationshipConstraints.
660
+ * @alpha
661
+ */
662
+ export class RelationshipConstraintChanges extends BaseSchemaChanges {
663
+ _constraintClassChanges = [];
664
+ _customAttributeChanges = new Map();
665
+ /** Gets the RelationshipConstraintClassChange collection. */
666
+ get constraintClassChanges() {
667
+ return this._constraintClassChanges;
668
+ }
669
+ /** Gets the CustomAttributeContainerChanges Map. */
670
+ get customAttributeChanges() {
671
+ return this._customAttributeChanges;
672
+ }
673
+ /**
674
+ * Adds the change to the appropriate change collection at this level or adds the change
675
+ * to a Map of child changes will which propagate the change to lower levels.
676
+ * @param change The ISchemaChange to add.
677
+ */
678
+ addChange(change) {
679
+ const constraintName = this.getConstraintNameFromChange(change);
680
+ if (!constraintName)
681
+ return;
682
+ if (this.isPropertyValueChangeForThis(change.diagnostic, constraintName)) {
683
+ this.propertyValueChanges.push(change);
684
+ return;
685
+ }
686
+ if (change.diagnostic.code === SchemaCompareCodes.RelationshipConstraintClassMissing) {
687
+ this.constraintClassChanges.push(change);
688
+ return;
689
+ }
690
+ if (this.isCAContainerChangeForThis(change.diagnostic, constraintName))
691
+ this.addChangeToMap(this.customAttributeChanges, CustomAttributeContainerChanges, change, change.changeKey);
692
+ }
693
+ getConstraintNameFromChange(change) {
694
+ const type = change.diagnostic.ecDefinition;
695
+ if (RelationshipConstraint.isRelationshipConstraint(type))
696
+ return type.fullName;
697
+ return undefined;
698
+ }
699
+ }
700
+ /**
701
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for Enumerators.
702
+ * @alpha
703
+ */
704
+ export class EnumeratorChanges extends BaseSchemaChanges {
705
+ _enumeratorDeltas = [];
706
+ _enumeratorMissing;
707
+ /** Gets the EnumeratorDelta collection. */
708
+ get enumeratorDeltas() {
709
+ return this._enumeratorDeltas;
710
+ }
711
+ /** Gets the EnumeratorMissing change. Maybe undefined. */
712
+ get enumeratorMissing() {
713
+ return this._enumeratorMissing;
714
+ }
715
+ /**
716
+ * Adds the change to the appropriate change collection.
717
+ * @param change The ISchemaChange to add.
718
+ */
719
+ addChange(change) {
720
+ if (change.diagnostic.code === SchemaCompareCodes.EnumeratorDelta) {
721
+ this.enumeratorDeltas.push(change);
722
+ return;
723
+ }
724
+ if (change.diagnostic.code === SchemaCompareCodes.EnumeratorMissing)
725
+ this._enumeratorMissing = change;
726
+ }
727
+ }
728
+ /**
729
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for EntityClass mixin changes.
730
+ * @alpha
731
+ */
732
+ export class EntityMixinChanges extends BaseSchemaChanges {
733
+ _entityMixinChange = [];
734
+ /** Gets the EntityMixinChange collection. */
735
+ get entityMixinChange() {
736
+ return this._entityMixinChange;
737
+ }
738
+ /**
739
+ * Adds the change to the appropriate change collection.
740
+ * @param change The ISchemaChange to add.
741
+ */
742
+ addChange(change) {
743
+ if (change.diagnostic.code === SchemaCompareCodes.EntityMixinMissing)
744
+ this.entityMixinChange.push(change);
745
+ }
746
+ }
747
+ /**
748
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for KindOfQuantities.
749
+ * @alpha
750
+ */
751
+ export class KindOfQuantityChanges extends SchemaItemChanges {
752
+ _presentationUnitChanges = new Map();
753
+ /** Gets the EntityMixinChange Map. */
754
+ get presentationUnitChanges() {
755
+ return this._presentationUnitChanges;
756
+ }
757
+ /**
758
+ * Adds the change to the appropriate change collection.
759
+ * @param change The ISchemaChange to add.
760
+ */
761
+ addChange(change) {
762
+ super.addChange(change);
763
+ if (change.diagnostic.code === SchemaCompareCodes.PresentationUnitMissing)
764
+ this.addChangeToMap(this.presentationUnitChanges, PresentationUnitChanges, change, change.changeKey);
765
+ }
766
+ }
767
+ /**
768
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for KindOfQuantity presentation units.
769
+ * @alpha
770
+ */
771
+ export class PresentationUnitChanges extends BaseSchemaChanges {
772
+ _presentationUnitChange = [];
773
+ /** Gets the PresentationUnitChange collection. */
774
+ get presentationUnitChange() {
775
+ return this._presentationUnitChange;
776
+ }
777
+ /**
778
+ * Adds the change to the appropriate change collection.
779
+ * @param change The ISchemaChange to add.
780
+ */
781
+ addChange(change) {
782
+ if (change.diagnostic.code === SchemaCompareCodes.PresentationUnitMissing)
783
+ this.presentationUnitChange.push(change);
784
+ }
785
+ }
786
+ /**
787
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for Formats.
788
+ * @alpha
789
+ */
790
+ export class FormatChanges extends SchemaItemChanges {
791
+ _formatUnitChanges = new Map();
792
+ /** Gets the FormatUnitChanges collection. */
793
+ get formatUnitChanges() {
794
+ return this._formatUnitChanges;
795
+ }
796
+ /**
797
+ * Adds the change to the appropriate change collection.
798
+ * @param change The ISchemaChange to add.
799
+ */
800
+ addChange(change) {
801
+ super.addChange(change);
802
+ if (change.diagnostic.code === SchemaCompareCodes.UnitLabelOverrideDelta) {
803
+ this.addChangeToMap(this.formatUnitChanges, FormatUnitChanges, change, change.changeKey);
804
+ return;
805
+ }
806
+ if (change.diagnostic.code === SchemaCompareCodes.FormatUnitMissing)
807
+ this.addChangeToMap(this.formatUnitChanges, FormatUnitChanges, change, change.changeKey);
808
+ }
809
+ }
810
+ /**
811
+ * An ISchemaChanges implementation for managing schema comparison diagnostics for Format units.
812
+ * @alpha
813
+ */
814
+ export class FormatUnitChanges extends BaseSchemaChanges {
815
+ _unitLabelOverrideDeltas = [];
816
+ _formatUnitChanges = [];
817
+ /** Gets the UnitLabelOverrideDelta collection. */
818
+ get unitLabelOverrideDeltas() {
819
+ return this._unitLabelOverrideDeltas;
820
+ }
821
+ /** Gets the FormatUnitChange collection. */
822
+ get formatUnitChanges() {
823
+ return this._formatUnitChanges;
824
+ }
825
+ /**
826
+ * Adds the change to the appropriate change collection.
827
+ * @param change The ISchemaChange to add.
828
+ */
829
+ addChange(change) {
830
+ if (change.diagnostic.code === SchemaCompareCodes.UnitLabelOverrideDelta) {
831
+ this.unitLabelOverrideDeltas.push(change);
832
+ return;
833
+ }
834
+ if (change.diagnostic.code === SchemaCompareCodes.FormatUnitMissing)
835
+ this.formatUnitChanges.push(change);
836
+ }
837
+ }
838
+ /** ISchemaChange Implementations */
839
+ /**
840
+ * An ISchemaChange implementation to act as the base class for all changes
841
+ * associated with SchemaItem instances.
842
+ * @alpha
843
+ */
844
+ export class SchemaItemChange extends BaseSchemaChange {
845
+ get topLevelSchemaItem() { return this.diagnostic.ecDefinition; }
846
+ }
847
+ /**
848
+ * An ISchemaChange implementation for Schema reference changes.
849
+ * @alpha
850
+ */
851
+ export class SchemaReferenceMissing extends BaseSchemaChange {
852
+ /** Gets the default ChangeType (Delta or Missing) for this change */
853
+ get defaultChangeType() { return ChangeType.Missing; }
854
+ /** Gets the SchemaItem or Schema (if a schema change) that this change ultimately belongs to. */
855
+ get topLevelSchemaItem() { return this.diagnostic.ecDefinition; }
856
+ /** Gets a string representation of the change. */
857
+ toString() {
858
+ const refSchema = this.getNameFromArgument(0, false, true);
859
+ return `Schema(${refSchema})`;
860
+ }
861
+ }
862
+ /**
863
+ * An ISchemaChange implementation differences of baseClasses between two ECClasses.
864
+ * @alpha
865
+ */
866
+ export class SchemaReferenceDelta extends BaseSchemaChange {
867
+ /** Gets the default ChangeType (Delta or Missing) for this change */
868
+ get defaultChangeType() { return ChangeType.Delta; }
869
+ /** Gets the SchemaItem or Schema (if a schema change) that this change ultimately belongs to. */
870
+ get topLevelSchemaItem() { return this.diagnostic.ecDefinition; }
871
+ /** Gets a string representation of the change. */
872
+ toString() {
873
+ const refSchema = this.getNameFromArgument(0, false, true);
874
+ const versionA = this.getStringFromArgument(1);
875
+ const versionB = this.getStringFromArgument(2);
876
+ return `Schema(${refSchema}): ${versionA} -> ${versionB}`;
877
+ }
878
+ }
879
+ /**
880
+ * An ISchemaChange implementation for missing SchemaItems.
881
+ * @alpha
882
+ */
883
+ export class SchemaItemMissing extends SchemaItemChange {
884
+ /** Gets the default ChangeType (Delta or Missing) for this change */
885
+ get defaultChangeType() { return ChangeType.Missing; }
886
+ /** Gets a string representation of the change. */
887
+ toString() {
888
+ const item = this.diagnostic.ecDefinition;
889
+ const typeName = ECClass.isECClass(item) ? "Class" : item.schemaItemType;
890
+ return `${typeName}(${item.name})`;
891
+ }
892
+ }
893
+ /**
894
+ * An ISchemaChange implementation for changes in property values of any EC type.
895
+ * @alpha
896
+ */
897
+ export class PropertyValueChange extends BaseSchemaChange {
898
+ /** Gets the SchemaItem that this change ultimately belongs to. */
899
+ get topLevelSchemaItem() {
900
+ if (SchemaItem.isSchemaItem(this.diagnostic.ecDefinition))
901
+ return this.diagnostic.ecDefinition;
902
+ if (Schema.isSchema(this.diagnostic.ecDefinition))
903
+ return this.diagnostic.ecDefinition;
904
+ if (Property.isProperty(this.diagnostic.ecDefinition))
905
+ return this.diagnostic.ecDefinition.class;
906
+ if (RelationshipConstraint.isRelationshipConstraint(this.diagnostic.ecDefinition))
907
+ return this.diagnostic.ecDefinition.relationshipClass;
908
+ throw new Error();
909
+ }
910
+ /** Gets the default ChangeType (Delta or Missing) for this change */
911
+ get defaultChangeType() { return ChangeType.Delta; }
912
+ /** Gets a string representation of the change. */
913
+ toString() {
914
+ let property = this.getStringFromArgument(0);
915
+ // Capitalize property name
916
+ property = property.charAt(0).toUpperCase() + property.slice(1);
917
+ const valueA = this.getStringFromArgument(1);
918
+ const valueB = this.getStringFromArgument(2);
919
+ return `${property}: ${valueA} -> ${valueB}`;
920
+ }
921
+ }
922
+ /**
923
+ * An ISchemaChange implementation for missing CustomAttribute instances
924
+ * for a given container.
925
+ * @alpha
926
+ */
927
+ export class CustomAttributeContainerChange extends BaseSchemaChange {
928
+ /** Gets the default ChangeType (Delta or Missing) for this change */
929
+ get defaultChangeType() { return ChangeType.Missing; }
930
+ /** Gets the SchemaItem that this change ultimately belongs to. */
931
+ get topLevelSchemaItem() {
932
+ if (SchemaItem.isSchemaItem(this.diagnostic.ecDefinition))
933
+ return this.diagnostic.ecDefinition;
934
+ if (Property.isProperty(this.diagnostic.ecDefinition))
935
+ return this.diagnostic.ecDefinition.class;
936
+ if (Schema.isSchema(this.diagnostic.ecDefinition))
937
+ return this.diagnostic.ecDefinition;
938
+ if (RelationshipConstraint.isRelationshipConstraint(this.diagnostic.ecDefinition))
939
+ return this.diagnostic.ecDefinition.relationshipClass;
940
+ throw new Error();
941
+ }
942
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
943
+ get changeKey() {
944
+ return this.getValueFromArgument(0).className;
945
+ }
946
+ /** Gets a string representation of the change. */
947
+ toString() {
948
+ return `CustomAttribute: ${this.changeKey}`;
949
+ }
950
+ }
951
+ /**
952
+ * An ISchemaChange implementation differences of baseClasses between two ECClasses.
953
+ * @alpha
954
+ */
955
+ export class BaseClassDelta extends SchemaItemChange {
956
+ /** Gets the default ChangeType (Delta or Missing) for this change */
957
+ get defaultChangeType() { return ChangeType.Delta; }
958
+ /** Gets a string representation of the change. */
959
+ toString() {
960
+ const classA = this.getNameFromArgument(0, true, true);
961
+ const classB = this.getNameFromArgument(1, true, true);
962
+ return `BaseClass: ${classA} -> ${classB}`;
963
+ }
964
+ }
965
+ /**
966
+ * An ISchemaChange implementation for missing properties.
967
+ * @alpha
968
+ */
969
+ export class PropertyMissing extends BaseSchemaChange {
970
+ /** Gets the SchemaItem that this change ultimately belongs to. */
971
+ get topLevelSchemaItem() {
972
+ return this.diagnostic.ecDefinition.class;
973
+ }
974
+ /** Gets the default ChangeType (Delta or Missing) for this change */
975
+ get defaultChangeType() { return ChangeType.Missing; }
976
+ /** Gets a string representation of the change. */
977
+ toString() {
978
+ return `Property(${this.diagnostic.ecDefinition.name})`;
979
+ }
980
+ }
981
+ /**
982
+ * An ISchemaChange implementation for missing RelationshipConstraint classes.
983
+ * @alpha
984
+ */
985
+ export class RelationshipConstraintClassChange extends BaseSchemaChange {
986
+ /** Gets the default ChangeType (Delta or Missing) for this change */
987
+ get defaultChangeType() { return ChangeType.Missing; }
988
+ /** Gets the SchemaItem that this change ultimately belongs to. */
989
+ get topLevelSchemaItem() {
990
+ return this.diagnostic.ecDefinition.relationshipClass;
991
+ }
992
+ /** Gets a string representation of the change. */
993
+ toString() {
994
+ const constraintClass = this.getNameFromArgument(0, false, true);
995
+ return `ConstraintClass: ${constraintClass}`;
996
+ }
997
+ }
998
+ /**
999
+ * An ISchemaChange implementation for differences of Enumerator properties.
1000
+ * @alpha
1001
+ */
1002
+ export class EnumeratorDelta extends BaseSchemaChange {
1003
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1004
+ get defaultChangeType() { return ChangeType.Delta; }
1005
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1006
+ get topLevelSchemaItem() {
1007
+ return this.diagnostic.ecDefinition;
1008
+ }
1009
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1010
+ get changeKey() {
1011
+ const enumerator = this.getValueFromArgument(0);
1012
+ return enumerator.name;
1013
+ }
1014
+ /** Gets a string representation of the change. */
1015
+ toString() {
1016
+ let propertyName = this.getStringFromArgument(1);
1017
+ // Capitalize property name
1018
+ propertyName = propertyName.charAt(0).toUpperCase() + propertyName.slice(1);
1019
+ const valueA = this.getStringFromArgument(2);
1020
+ const valueB = this.getStringFromArgument(3);
1021
+ return `${propertyName}: ${valueA} -> ${valueB}`;
1022
+ }
1023
+ }
1024
+ /**
1025
+ * An ISchemaChange implementation for missing Enumerators within an Enumeration.
1026
+ * @alpha
1027
+ */
1028
+ export class EnumeratorMissing extends BaseSchemaChange {
1029
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1030
+ get defaultChangeType() { return ChangeType.Missing; }
1031
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1032
+ get topLevelSchemaItem() {
1033
+ return this.diagnostic.ecDefinition;
1034
+ }
1035
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1036
+ get changeKey() {
1037
+ return this.getValueFromArgument(0).name;
1038
+ }
1039
+ /** Gets a string representation of the change. */
1040
+ toString() {
1041
+ return `Enumerator(${this.changeKey})`;
1042
+ }
1043
+ }
1044
+ /**
1045
+ * An ISchemaChange implementation for missing mixins within an EntityClass.
1046
+ * @alpha
1047
+ */
1048
+ export class EntityMixinChange extends BaseSchemaChange {
1049
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1050
+ get defaultChangeType() { return ChangeType.Missing; }
1051
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1052
+ get topLevelSchemaItem() {
1053
+ return this.diagnostic.ecDefinition;
1054
+ }
1055
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1056
+ get changeKey() {
1057
+ return this.getNameFromArgument(0, false, true);
1058
+ }
1059
+ /** Gets a string representation of the change. */
1060
+ toString() {
1061
+ return `Mixin: ${this.changeKey}`;
1062
+ }
1063
+ }
1064
+ /**
1065
+ * An ISchemaChange implementation for missing presentation Units within a KindOfQuantity.
1066
+ * @alpha
1067
+ */
1068
+ export class PresentationUnitChange extends BaseSchemaChange {
1069
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1070
+ get defaultChangeType() { return ChangeType.Missing; }
1071
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1072
+ get topLevelSchemaItem() {
1073
+ return this.diagnostic.ecDefinition;
1074
+ }
1075
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1076
+ get changeKey() {
1077
+ return this.getNameFromArgument(0, false, true);
1078
+ }
1079
+ /** Gets a string representation of the change. */
1080
+ toString() {
1081
+ return `Unit: ${this.changeKey}`;
1082
+ }
1083
+ get _isOverrideFormat() {
1084
+ if (!this.diagnostic.messageArgs)
1085
+ return false;
1086
+ return OverrideFormat.isOverrideFormat(this.diagnostic.messageArgs[0]);
1087
+ }
1088
+ }
1089
+ /**
1090
+ * An ISchemaChange implementation for missing Units within a Format.
1091
+ * @alpha
1092
+ */
1093
+ export class FormatUnitChange extends BaseSchemaChange {
1094
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1095
+ get defaultChangeType() { return ChangeType.Missing; }
1096
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1097
+ get topLevelSchemaItem() {
1098
+ return this.diagnostic.ecDefinition;
1099
+ }
1100
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1101
+ get changeKey() {
1102
+ return this.getNameFromArgument(0, false, true);
1103
+ }
1104
+ /** Gets a string representation of the change. */
1105
+ toString() {
1106
+ return `Unit: ${this.changeKey}, label: ${this.getStringFromArgument(1)}`;
1107
+ }
1108
+ get _isInvertedUnit() {
1109
+ if (!this.diagnostic.messageArgs)
1110
+ return false;
1111
+ return this.diagnostic.messageArgs[0].schemaItemType === SchemaItemType.InvertedUnit;
1112
+ }
1113
+ }
1114
+ /**
1115
+ * An ISchemaChange implementation for differences of Unit label overrides within a given Format.
1116
+ * @alpha
1117
+ */
1118
+ export class UnitLabelOverrideDelta extends BaseSchemaChange {
1119
+ /** Gets the default ChangeType (Delta or Missing) for this change */
1120
+ get defaultChangeType() { return ChangeType.Delta; }
1121
+ /** Gets the SchemaItem that this change ultimately belongs to. */
1122
+ get topLevelSchemaItem() {
1123
+ return this.diagnostic.ecDefinition;
1124
+ }
1125
+ /** Gets the key to use in a Map of this type of ISchemaChange. */
1126
+ get changeKey() {
1127
+ return this.getNameFromArgument(0, false, true);
1128
+ }
1129
+ /** Gets a string representation of the change. */
1130
+ toString() {
1131
+ const valueA = this.getStringFromArgument(1);
1132
+ const valueB = this.getStringFromArgument(2);
1133
+ return `Label: ${valueA} -> ${valueB}`;
1134
+ }
1135
+ get _isInvertedUnit() {
1136
+ if (!this.diagnostic.messageArgs)
1137
+ return false;
1138
+ return this.diagnostic.messageArgs[0].schemaItemType === SchemaItemType.InvertedUnit;
1139
+ }
1140
+ }
1141
+ //# sourceMappingURL=SchemaChanges.js.map