@itwin/ecschema-metadata 5.1.0-dev.9 → 5.1.0

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 (268) hide show
  1. package/CHANGELOG.md +88 -1
  2. package/lib/cjs/Constants.js.map +1 -1
  3. package/lib/cjs/Context.d.ts +1 -1
  4. package/lib/cjs/Context.js +1 -1
  5. package/lib/cjs/Context.js.map +1 -1
  6. package/lib/cjs/DelayedPromise.js.map +1 -1
  7. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  8. package/lib/cjs/Deserialization/Helper.d.ts +30 -11
  9. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  10. package/lib/cjs/Deserialization/Helper.js +124 -96
  11. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  12. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  13. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  14. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts +12 -3
  15. package/lib/cjs/Deserialization/SchemaGraphUtil.d.ts.map +1 -1
  16. package/lib/cjs/Deserialization/SchemaGraphUtil.js +36 -23
  17. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  18. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  19. package/lib/cjs/Deserialization/XmlParser.js +14 -5
  20. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  21. package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
  22. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  23. package/lib/cjs/ECName.js +1 -1
  24. package/lib/cjs/ECName.js.map +1 -1
  25. package/lib/cjs/ECObjects.d.ts +1 -1
  26. package/lib/cjs/ECObjects.js +2 -2
  27. package/lib/cjs/ECObjects.js.map +1 -1
  28. package/lib/cjs/Exception.js.map +1 -1
  29. package/lib/cjs/IncrementalLoading/ClassParsers.d.ts +60 -0
  30. package/lib/cjs/IncrementalLoading/ClassParsers.d.ts.map +1 -0
  31. package/lib/cjs/IncrementalLoading/ClassParsers.js +111 -0
  32. package/lib/cjs/IncrementalLoading/ClassParsers.js.map +1 -0
  33. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
  34. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
  35. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js +387 -0
  36. package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
  37. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
  38. package/lib/cjs/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
  39. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js +609 -0
  40. package/lib/cjs/IncrementalLoading/FullSchemaQueries.js.map +1 -0
  41. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
  42. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
  43. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +219 -0
  44. package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
  45. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
  46. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
  47. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js +77 -0
  48. package/lib/cjs/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
  49. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts +60 -0
  50. package/lib/cjs/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
  51. package/lib/cjs/IncrementalLoading/PerformanceLogger.js +82 -0
  52. package/lib/cjs/IncrementalLoading/PerformanceLogger.js.map +1 -0
  53. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
  54. package/lib/cjs/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
  55. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js +122 -0
  56. package/lib/cjs/IncrementalLoading/SchemaItemParsers.js.map +1 -0
  57. package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
  58. package/lib/cjs/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
  59. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js +308 -0
  60. package/lib/cjs/IncrementalLoading/SchemaItemQueries.js.map +1 -0
  61. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts +42 -0
  62. package/lib/cjs/IncrementalLoading/SchemaParser.d.ts.map +1 -0
  63. package/lib/cjs/IncrementalLoading/SchemaParser.js +109 -0
  64. package/lib/cjs/IncrementalLoading/SchemaParser.js.map +1 -0
  65. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
  66. package/lib/cjs/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
  67. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js +365 -0
  68. package/lib/cjs/IncrementalLoading/SchemaStubQueries.js.map +1 -0
  69. package/lib/cjs/Interfaces.js.map +1 -1
  70. package/lib/cjs/Metadata/Class.d.ts +5 -16
  71. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  72. package/lib/cjs/Metadata/Class.js +68 -68
  73. package/lib/cjs/Metadata/Class.js.map +1 -1
  74. package/lib/cjs/Metadata/Constant.js.map +1 -1
  75. package/lib/cjs/Metadata/CustomAttribute.d.ts +7 -1
  76. package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
  77. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  78. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +1 -1
  79. package/lib/cjs/Metadata/CustomAttributeClass.js +1 -1
  80. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  81. package/lib/cjs/Metadata/EntityClass.d.ts +6 -6
  82. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  83. package/lib/cjs/Metadata/EntityClass.js +48 -26
  84. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  85. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  86. package/lib/cjs/Metadata/Format.d.ts +5 -0
  87. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  88. package/lib/cjs/Metadata/Format.js +7 -0
  89. package/lib/cjs/Metadata/Format.js.map +1 -1
  90. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  91. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  92. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  93. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  94. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  95. package/lib/cjs/Metadata/Property.js.map +1 -1
  96. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  97. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  98. package/lib/cjs/Metadata/Schema.d.ts +10 -0
  99. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  100. package/lib/cjs/Metadata/Schema.js +13 -0
  101. package/lib/cjs/Metadata/Schema.js.map +1 -1
  102. package/lib/cjs/Metadata/SchemaItem.d.ts +10 -0
  103. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  104. package/lib/cjs/Metadata/SchemaItem.js +13 -0
  105. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  106. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  107. package/lib/cjs/PropertyTypes.js.map +1 -1
  108. package/lib/cjs/SchemaFormatsProvider.d.ts +4 -3
  109. package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -1
  110. package/lib/cjs/SchemaFormatsProvider.js +60 -17
  111. package/lib/cjs/SchemaFormatsProvider.js.map +1 -1
  112. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  113. package/lib/cjs/SchemaKey.js.map +1 -1
  114. package/lib/cjs/SchemaLoader.d.ts +4 -1
  115. package/lib/cjs/SchemaLoader.d.ts.map +1 -1
  116. package/lib/cjs/SchemaLoader.js +4 -1
  117. package/lib/cjs/SchemaLoader.js.map +1 -1
  118. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  119. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  120. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  121. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  122. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  123. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  124. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  125. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  126. package/lib/cjs/ecschema-metadata.d.ts +2 -0
  127. package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
  128. package/lib/cjs/ecschema-metadata.js +2 -0
  129. package/lib/cjs/ecschema-metadata.js.map +1 -1
  130. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  131. package/lib/cjs/utils/SchemaLoadingController.d.ts +37 -0
  132. package/lib/cjs/utils/SchemaLoadingController.d.ts.map +1 -0
  133. package/lib/cjs/utils/SchemaLoadingController.js +65 -0
  134. package/lib/cjs/utils/SchemaLoadingController.js.map +1 -0
  135. package/lib/esm/Constants.js.map +1 -1
  136. package/lib/esm/Context.d.ts +1 -1
  137. package/lib/esm/Context.js +1 -1
  138. package/lib/esm/Context.js.map +1 -1
  139. package/lib/esm/DelayedPromise.js.map +1 -1
  140. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  141. package/lib/esm/Deserialization/Helper.d.ts +30 -11
  142. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  143. package/lib/esm/Deserialization/Helper.js +124 -96
  144. package/lib/esm/Deserialization/Helper.js.map +1 -1
  145. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  146. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  147. package/lib/esm/Deserialization/SchemaGraphUtil.d.ts +12 -3
  148. package/lib/esm/Deserialization/SchemaGraphUtil.d.ts.map +1 -1
  149. package/lib/esm/Deserialization/SchemaGraphUtil.js +36 -23
  150. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  151. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  152. package/lib/esm/Deserialization/XmlParser.js +14 -5
  153. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  154. package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
  155. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  156. package/lib/esm/ECName.js +1 -1
  157. package/lib/esm/ECName.js.map +1 -1
  158. package/lib/esm/ECObjects.d.ts +1 -1
  159. package/lib/esm/ECObjects.js +2 -2
  160. package/lib/esm/ECObjects.js.map +1 -1
  161. package/lib/esm/Exception.js.map +1 -1
  162. package/lib/esm/IncrementalLoading/ClassParsers.d.ts +60 -0
  163. package/lib/esm/IncrementalLoading/ClassParsers.d.ts.map +1 -0
  164. package/lib/esm/IncrementalLoading/ClassParsers.js +104 -0
  165. package/lib/esm/IncrementalLoading/ClassParsers.js.map +1 -0
  166. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts +211 -0
  167. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.d.ts.map +1 -0
  168. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js +383 -0
  169. package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -0
  170. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts +14 -0
  171. package/lib/esm/IncrementalLoading/FullSchemaQueries.d.ts.map +1 -0
  172. package/lib/esm/IncrementalLoading/FullSchemaQueries.js +606 -0
  173. package/lib/esm/IncrementalLoading/FullSchemaQueries.js.map +1 -0
  174. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts +109 -0
  175. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.d.ts.map +1 -0
  176. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +215 -0
  177. package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -0
  178. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts +36 -0
  179. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.d.ts.map +1 -0
  180. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js +73 -0
  181. package/lib/esm/IncrementalLoading/IncrementalSchemaReader.js.map +1 -0
  182. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts +60 -0
  183. package/lib/esm/IncrementalLoading/PerformanceLogger.d.ts.map +1 -0
  184. package/lib/esm/IncrementalLoading/PerformanceLogger.js +78 -0
  185. package/lib/esm/IncrementalLoading/PerformanceLogger.js.map +1 -0
  186. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts +51 -0
  187. package/lib/esm/IncrementalLoading/SchemaItemParsers.d.ts.map +1 -0
  188. package/lib/esm/IncrementalLoading/SchemaItemParsers.js +117 -0
  189. package/lib/esm/IncrementalLoading/SchemaItemParsers.js.map +1 -0
  190. package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts +16 -0
  191. package/lib/esm/IncrementalLoading/SchemaItemQueries.d.ts.map +1 -0
  192. package/lib/esm/IncrementalLoading/SchemaItemQueries.js +305 -0
  193. package/lib/esm/IncrementalLoading/SchemaItemQueries.js.map +1 -0
  194. package/lib/esm/IncrementalLoading/SchemaParser.d.ts +42 -0
  195. package/lib/esm/IncrementalLoading/SchemaParser.d.ts.map +1 -0
  196. package/lib/esm/IncrementalLoading/SchemaParser.js +104 -0
  197. package/lib/esm/IncrementalLoading/SchemaParser.js.map +1 -0
  198. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts +12 -0
  199. package/lib/esm/IncrementalLoading/SchemaStubQueries.d.ts.map +1 -0
  200. package/lib/esm/IncrementalLoading/SchemaStubQueries.js +359 -0
  201. package/lib/esm/IncrementalLoading/SchemaStubQueries.js.map +1 -0
  202. package/lib/esm/Interfaces.js.map +1 -1
  203. package/lib/esm/Metadata/Class.d.ts +5 -16
  204. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  205. package/lib/esm/Metadata/Class.js +68 -68
  206. package/lib/esm/Metadata/Class.js.map +1 -1
  207. package/lib/esm/Metadata/Constant.js.map +1 -1
  208. package/lib/esm/Metadata/CustomAttribute.d.ts +7 -1
  209. package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
  210. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  211. package/lib/esm/Metadata/CustomAttributeClass.d.ts +1 -1
  212. package/lib/esm/Metadata/CustomAttributeClass.js +1 -1
  213. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  214. package/lib/esm/Metadata/EntityClass.d.ts +6 -6
  215. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  216. package/lib/esm/Metadata/EntityClass.js +48 -26
  217. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  218. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  219. package/lib/esm/Metadata/Format.d.ts +5 -0
  220. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  221. package/lib/esm/Metadata/Format.js +7 -0
  222. package/lib/esm/Metadata/Format.js.map +1 -1
  223. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  224. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  225. package/lib/esm/Metadata/Mixin.js.map +1 -1
  226. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  227. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  228. package/lib/esm/Metadata/Property.js.map +1 -1
  229. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  230. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  231. package/lib/esm/Metadata/Schema.d.ts +10 -0
  232. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  233. package/lib/esm/Metadata/Schema.js +13 -0
  234. package/lib/esm/Metadata/Schema.js.map +1 -1
  235. package/lib/esm/Metadata/SchemaItem.d.ts +10 -0
  236. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  237. package/lib/esm/Metadata/SchemaItem.js +13 -0
  238. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  239. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  240. package/lib/esm/PropertyTypes.js.map +1 -1
  241. package/lib/esm/SchemaFormatsProvider.d.ts +4 -3
  242. package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -1
  243. package/lib/esm/SchemaFormatsProvider.js +61 -18
  244. package/lib/esm/SchemaFormatsProvider.js.map +1 -1
  245. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  246. package/lib/esm/SchemaKey.js.map +1 -1
  247. package/lib/esm/SchemaLoader.d.ts +4 -1
  248. package/lib/esm/SchemaLoader.d.ts.map +1 -1
  249. package/lib/esm/SchemaLoader.js +4 -1
  250. package/lib/esm/SchemaLoader.js.map +1 -1
  251. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  252. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  253. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  254. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  255. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  256. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  257. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  258. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  259. package/lib/esm/ecschema-metadata.d.ts +2 -0
  260. package/lib/esm/ecschema-metadata.d.ts.map +1 -1
  261. package/lib/esm/ecschema-metadata.js +2 -0
  262. package/lib/esm/ecschema-metadata.js.map +1 -1
  263. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  264. package/lib/esm/utils/SchemaLoadingController.d.ts +37 -0
  265. package/lib/esm/utils/SchemaLoadingController.d.ts.map +1 -0
  266. package/lib/esm/utils/SchemaLoadingController.js +61 -0
  267. package/lib/esm/utils/SchemaLoadingController.js.map +1 -0
  268. package/package.json +15 -10
@@ -1 +1 @@
1
- {"version":3,"file":"Constant.js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K,CAAC,QAAQ,CAAC,aAA4B;QACzD,IAAI,CAAC,YAAY,CAAC,aAAa,CAAC,CAAC;IACnC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,UAAgC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,UAAkB;QACxC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,SAAiB;QACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,WAAmB;QAC1C,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,UAAU,CAAC,IAAiB;QACxC,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,QAAQ;YACzD,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAiB;QAC9C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACxB,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,QAAQ,cAAc,CAAC,CAAC;IACtH,CAAC;CACF;AA9ID,4BA8IC;AACD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAMrD;AAND,0CAMC","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 Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { ConstantProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { LazyLoadedPhenomenon } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Constant is a specific type of Unit that represents a number.\n * @public @preview\n */\nexport class Constant extends SchemaItem {\n public override readonly schemaItemType = Constant.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.Constant; }\n private _phenomenon?: LazyLoadedPhenomenon;\n private _definition: string;\n private _numerator?: number;\n private _denominator?: number;\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this._definition = \"\";\n }\n\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\n public get definition(): string { return this._definition; }\n public get numerator(): number { return this._numerator ?? 1.0; }\n public get denominator(): number { return this._denominator ?? 1.0; }\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\n\n /**\n * Save this Constants properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ConstantProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (this.phenomenon !== undefined)\n schemaJson.phenomenon = this.phenomenon.fullName;\n schemaJson.definition = this.definition;\n if (this.hasNumerator)\n schemaJson.numerator = this.numerator;\n if (this.hasDenominator)\n schemaJson.denominator = this.denominator;\n return schemaJson as ConstantProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"definition\", this.definition);\n if (this.hasNumerator)\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\n if (this.hasDenominator)\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\n\n const phenomenon = await this.phenomenon;\n if (undefined !== phenomenon) {\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(constantProps: ConstantProps) {\n super.fromJSONSync(constantProps);\n\n const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);\n if (!schemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(schemaItemKey,\n async () => {\n const phenom = await this.schema.lookupItem(schemaItemKey, Phenomenon);\n if (undefined === phenom)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\n return phenom;\n });\n\n if (this._definition !== \"\" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);\n else if (this._definition === \"\")\n this._definition = constantProps.definition;\n\n if (undefined !== constantProps.numerator) {\n if (constantProps.numerator !== this._numerator)\n this._numerator = constantProps.numerator;\n }\n\n if (undefined !== constantProps.denominator) {\n if (constantProps.denominator !== this._denominator)\n this._denominator = constantProps.denominator;\n }\n }\n\n public override async fromJSON(constantProps: ConstantProps) {\n this.fromJSONSync(constantProps);\n }\n\n /**\n * @param phenomenon A LazyLoadedPhenomenon.\n * @internal\n */\n protected setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\n this._phenomenon = phenomenon;\n }\n\n /**\n * @internal\n */\n protected setDefinition(definition: string) {\n this._definition = definition;\n }\n\n /**\n * @internal\n */\n protected setNumerator(numerator: number) {\n this._numerator = numerator;\n }\n\n /**\n * @internal\n */\n protected setDenominator(denominator: number) {\n this._denominator = denominator;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type Constant.\n * @param item The SchemaItem to check.\n * @returns True if the item is a Constant, false otherwise.\n */\n public static isConstant(item?: SchemaItem): item is Constant {\n if (item && item.schemaItemType === SchemaItemType.Constant)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type Constant.\n * @param item The SchemaItem to check.\n * @returns The item cast to Constant if it is a Constant, undefined otherwise.\n * @internal\n */\n public static assertIsConstant(item?: SchemaItem): asserts item is Constant {\n if (!this.isConstant(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Constant}' (Constant)`);\n }\n}\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableConstant extends Constant {\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\n public abstract override setDefinition(definition: string): void;\n public abstract override setNumerator(numerator: number): void;\n public abstract override setDenominator(denominator: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"Constant.js","sourceRoot":"","sources":["../../../src/Metadata/Constant.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8C;AAC9C,4CAA6D;AAG7D,6CAA0C;AAE1C,6CAA0C;AAE1C;;;GAGG;AACH,MAAa,QAAS,SAAQ,uBAAU;IACb,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;IAClE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IACvE,WAAW,CAAwB;IACnC,WAAW,CAAS;IACpB,UAAU,CAAU;IACpB,YAAY,CAAU;IAE9B,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACxB,CAAC;IAED,IAAW,UAAU,KAAuC,OAAO,IAAI,CA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,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAiB;QAC9C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YACxB,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,QAAQ,cAAc,CAAC,CAAC;IACtH,CAAC;CACF;AA9ID,4BA8IC;AACD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAMrD;AAND,0CAMC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { ConstantProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { LazyLoadedPhenomenon } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Constant is a specific type of Unit that represents a number.\r\n * @public @preview\r\n */\r\nexport class Constant extends SchemaItem {\r\n public override readonly schemaItemType = Constant.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.Constant; }\r\n private _phenomenon?: LazyLoadedPhenomenon;\r\n private _definition: string;\r\n private _numerator?: number;\r\n private _denominator?: number;\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this._definition = \"\";\r\n }\r\n\r\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\r\n public get definition(): string { return this._definition; }\r\n public get numerator(): number { return this._numerator ?? 1.0; }\r\n public get denominator(): number { return this._denominator ?? 1.0; }\r\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\r\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\r\n\r\n /**\r\n * Save this Constants properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): ConstantProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n if (this.phenomenon !== undefined)\r\n schemaJson.phenomenon = this.phenomenon.fullName;\r\n schemaJson.definition = this.definition;\r\n if (this.hasNumerator)\r\n schemaJson.numerator = this.numerator;\r\n if (this.hasDenominator)\r\n schemaJson.denominator = this.denominator;\r\n return schemaJson as ConstantProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"definition\", this.definition);\r\n if (this.hasNumerator)\r\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\r\n if (this.hasDenominator)\r\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\r\n\r\n const phenomenon = await this.phenomenon;\r\n if (undefined !== phenomenon) {\r\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\r\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(constantProps: ConstantProps) {\r\n super.fromJSONSync(constantProps);\r\n\r\n const schemaItemKey = this.schema.getSchemaItemKey(constantProps.phenomenon);\r\n if (!schemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(schemaItemKey,\r\n async () => {\r\n const phenom = await this.schema.lookupItem(schemaItemKey, Phenomenon);\r\n if (undefined === phenom)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the phenomenon ${constantProps.phenomenon}.`);\r\n return phenom;\r\n });\r\n\r\n if (this._definition !== \"\" && constantProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Constant ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = constantProps.definition;\r\n\r\n if (undefined !== constantProps.numerator) {\r\n if (constantProps.numerator !== this._numerator)\r\n this._numerator = constantProps.numerator;\r\n }\r\n\r\n if (undefined !== constantProps.denominator) {\r\n if (constantProps.denominator !== this._denominator)\r\n this._denominator = constantProps.denominator;\r\n }\r\n }\r\n\r\n public override async fromJSON(constantProps: ConstantProps) {\r\n this.fromJSONSync(constantProps);\r\n }\r\n\r\n /**\r\n * @param phenomenon A LazyLoadedPhenomenon.\r\n * @internal\r\n */\r\n protected setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\r\n this._phenomenon = phenomenon;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setNumerator(numerator: number) {\r\n this._numerator = numerator;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setDenominator(denominator: number) {\r\n this._denominator = denominator;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type Constant.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a Constant, false otherwise.\r\n */\r\n public static isConstant(item?: SchemaItem): item is Constant {\r\n if (item && item.schemaItemType === SchemaItemType.Constant)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type Constant.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to Constant if it is a Constant, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsConstant(item?: SchemaItem): asserts item is Constant {\r\n if (!this.isConstant(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Constant}' (Constant)`);\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableConstant extends Constant {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): void;\r\n public abstract override setDefinition(definition: string): void;\r\n public abstract override setNumerator(numerator: number): void;\r\n public abstract override setDenominator(denominator: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -7,7 +7,13 @@ export interface CustomAttribute {
7
7
  className: string;
8
8
  [propName: string]: any;
9
9
  }
10
- /** @internal */
10
+ /**
11
+ * A collection of custom attributes, accessed by full class names in the format `SchemaName.ClassName`.
12
+ * Iterates over, checks, and retrieves attributes. Class names are case-insensitive, separated by a dot (`.`).
13
+ * @param className - The full class name.
14
+ * @returns Iterator, boolean, or custom attribute.
15
+ * @public @preview
16
+ */
11
17
  export interface CustomAttributeSet {
12
18
  [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;
13
19
  has(className: string): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttribute.d.ts","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,uBAAuB;AACvB,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED,gBAAgB;AAChB,MAAM,WAAW,kBAAkB;IACjC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CACrD;AAED,uBAAuB;AACvB,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG,EAAE,GAAG,SAAS,CAc7G"}
1
+ {"version":3,"file":"CustomAttribute.d.ts","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,uBAAuB;AACvB,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAC;CACzB;AAED;;;;;;EAME;AACF,MAAM,WAAW,kBAAkB;IACjC,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM,gBAAgB,CAAC,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC;IACrE,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAChC,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAAC;CACrD;AAED,uBAAuB;AACvB,MAAM,WAAW,6BAA6B;IAC5C,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gBAAgB;AAChB,wBAAgB,yBAAyB,CAAC,gBAAgB,EAAE,kBAAkB,GAAG,SAAS,GAAG,GAAG,EAAE,GAAG,SAAS,CAc7G"}
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttribute.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AAyBH,8DAcC;AAfD,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,gBAAgD;IACxF,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC,CAAC,gCAAgC;QACpE,MAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,gBAAgB,EAAE,CAAC;YACnD,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,QAAa,EAAE,EAAE;gBACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzC,SAAS,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","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 Metadata\n */\n\nimport { Schema } from \"./Schema\";\n\n/** @public @preview */\nexport interface CustomAttribute {\n className: string;\n [propName: string]: any;\n}\n\n/** @internal */\nexport interface CustomAttributeSet {\n [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;\n has(className: string): boolean;\n get(className: string): CustomAttribute | undefined;\n}\n\n/** @public @preview */\nexport interface CustomAttributeContainerProps {\n customAttributes?: CustomAttributeSet;\n fullName: string;\n schema: Schema;\n}\n\n/** @internal */\nexport function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined {\n if (undefined !== customAttributes) { // custom attributes is optional\n const attributes: any[] = [];\n for (const [, customAttribute] of customAttributes) {\n const attribute: { [value: string]: any } = {};\n Object.keys(customAttribute).map((property: any) => {\n const propertyName = property.toString();\n attribute[propertyName] = customAttribute[property];\n });\n attributes.push(attribute);\n }\n return (attributes.length > 0) ? attributes : undefined;\n }\n return undefined;\n}\n"]}
1
+ {"version":3,"file":"CustomAttribute.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttribute.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;AA+BH,8DAcC;AAfD,gBAAgB;AAChB,SAAgB,yBAAyB,CAAC,gBAAgD;IACxF,IAAI,SAAS,KAAK,gBAAgB,EAAE,CAAC,CAAC,gCAAgC;QACpE,MAAM,UAAU,GAAU,EAAE,CAAC;QAC7B,KAAK,MAAM,CAAC,EAAE,eAAe,CAAC,IAAI,gBAAgB,EAAE,CAAC;YACnD,MAAM,SAAS,GAA6B,EAAE,CAAC;YAC/C,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,GAAG,CAAC,CAAC,QAAa,EAAE,EAAE;gBACjD,MAAM,YAAY,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;gBACzC,SAAS,CAAC,YAAY,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC,CAAC,CAAC;YACH,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7B,CAAC;QACD,OAAO,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { Schema } from \"./Schema\";\r\n\r\n/** @public @preview */\r\nexport interface CustomAttribute {\r\n className: string;\r\n [propName: string]: any;\r\n}\r\n\r\n/**\r\n* A collection of custom attributes, accessed by full class names in the format `SchemaName.ClassName`.\r\n* Iterates over, checks, and retrieves attributes. Class names are case-insensitive, separated by a dot (`.`).\r\n* @param className - The full class name.\r\n* @returns Iterator, boolean, or custom attribute.\r\n* @public @preview\r\n*/\r\nexport interface CustomAttributeSet {\r\n [Symbol.iterator]: () => IterableIterator<[string, CustomAttribute]>;\r\n has(className: string): boolean;\r\n get(className: string): CustomAttribute | undefined;\r\n}\r\n\r\n/** @public @preview */\r\nexport interface CustomAttributeContainerProps {\r\n customAttributes?: CustomAttributeSet;\r\n fullName: string;\r\n schema: Schema;\r\n}\r\n\r\n/** @internal */\r\nexport function serializeCustomAttributes(customAttributes: CustomAttributeSet | undefined): any[] | undefined {\r\n if (undefined !== customAttributes) { // custom attributes is optional\r\n const attributes: any[] = [];\r\n for (const [, customAttribute] of customAttributes) {\r\n const attribute: { [value: string]: any } = {};\r\n Object.keys(customAttribute).map((property: any) => {\r\n const propertyName = property.toString();\r\n attribute[propertyName] = customAttribute[property];\r\n });\r\n attributes.push(attribute);\r\n }\r\n return (attributes.length > 0) ? attributes : undefined;\r\n }\r\n return undefined;\r\n}\r\n"]}
@@ -15,7 +15,7 @@ export declare class CustomAttributeClass extends ECClass {
15
15
  static get schemaItemType(): SchemaItemType;
16
16
  private _appliesTo?;
17
17
  /**
18
- * @deprecated in 4.8 use [[appliesTo]]
18
+ * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[appliesTo]]
19
19
  * */
20
20
  get containerType(): CustomAttributeContainerType;
21
21
  get appliesTo(): CustomAttributeContainerType;
@@ -21,7 +21,7 @@ class CustomAttributeClass extends Class_1.ECClass {
21
21
  static get schemaItemType() { return ECObjects_1.SchemaItemType.CustomAttributeClass; }
22
22
  _appliesTo;
23
23
  /**
24
- * @deprecated in 4.8 use [[appliesTo]]
24
+ * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[appliesTo]]
25
25
  * */
26
26
  get containerType() {
27
27
  return this.appliesTo;
@@ -1 +1 @@
1
- {"version":3,"file":"CustomAttributeClass.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAEsB;AACtB,4CAA6D;AAC7D,mCAAkC;AAGlC;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,eAAO;IACtB,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC;IAC9E,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACnF,UAAU,CAAgC;IAElD;;SAEK;IACL,IAAW,aAAa;QACtB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,SAAS;QAClB,IAAI,SAAS,KAAK,IAAI,CAAC,UAAU;YAC/B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,oBAAoB,EAAE,4BAA4B,IAAI,CAAC,IAAI,gDAAgD,CAAC,CAAC;QACtJ,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED;;;;OAIG;IACa,MAAM,CAAC,aAAsB,KAAK,EAAE,uBAAgC,KAAK;QACvF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,UAAU,CAAC,SAAS,GAAG,IAAA,iCAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7D,OAAO,UAAuC,CAAC;IACjD,CAAC;IAED,gBAAgB;IACA,KAAK,CAAC,KAAK,CAAC,SAAmB;QAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjD,WAAW,CAAC,YAAY,CAAC,WAAW,EAAE,IAAA,iCAAqB,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QAC7E,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,YAAY,CAAC,oBAA+C;QAC1E,KAAK,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;QACzC,MAAM,SAAS,GAAG,IAAA,6CAAiC,EAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QACpF,IAAI,SAAS,KAAK,SAAS;YACzB,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,oBAAoB,EAAE,GAAG,SAAS,+CAA+C,CAAC,CAAC;QAC5H,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,oBAA+C;QAC5E,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,aAA2C;QAChE,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAiB;QACpD,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,oBAAoB;YACrE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAiB;QAC1D,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACpC,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,oBAAoB,0BAA0B,CAAC,CAAC;IAC9I,CAAC;CACF;AA9ED,oDA8EC;AACD;;;GAGG;AACH,MAAsB,cAAe,SAAQ,oBAAoB;CAGhE;AAHD,wCAGC","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 Metadata\n */\n\nimport { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\nimport {\n containerTypeToString, CustomAttributeContainerType, parseCustomAttributeContainerType, SchemaItemType,\n} from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { ECClass } from \"./Class\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Typescript class representation of an ECCustomAttributeClass.\n * @public @preview\n */\nexport class CustomAttributeClass extends ECClass {\n public override readonly schemaItemType = CustomAttributeClass.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.CustomAttributeClass; }\n private _appliesTo?: CustomAttributeContainerType;\n\n /**\n * @deprecated in 4.8 use [[appliesTo]]\n * */\n public get containerType(): CustomAttributeContainerType {\n return this.appliesTo;\n }\n\n public get appliesTo(): CustomAttributeContainerType {\n if (undefined === this._appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\n return this._appliesTo;\n }\n\n /**\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.appliesTo = containerTypeToString(this.appliesTo);\n return schemaJson as CustomAttributeClassProps;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.appliesTo));\n return itemElement;\n }\n\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\n super.fromJSONSync(customAttributeProps);\n const appliesTo = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\n if (undefined === appliesTo)\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `${appliesTo} is not a valid CustomAttributeContainerType.`);\n this._appliesTo = appliesTo;\n }\n\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\n this.fromJSONSync(customAttributeProps);\n }\n\n /**\n * @internal\n */\n protected setAppliesTo(containerType: CustomAttributeContainerType) {\n this._appliesTo = containerType;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type CustomAttributeClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is a CustomAttributeClass, false otherwise.\n */\n public static isCustomAttributeClass(item?: SchemaItem): item is CustomAttributeClass {\n if (item && item.schemaItemType === SchemaItemType.CustomAttributeClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type CustomAttributeClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to CustomAttributeClass if it is a CustomAttributeClass, undefined otherwise.\n * @internal\n */\n public static assertIsCustomAttributeClass(item?: SchemaItem): asserts item is CustomAttributeClass {\n if (!this.isCustomAttributeClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.CustomAttributeClass}' (CustomAttributeClass)`);\n }\n}\n/**\n * @internal\n * An abstract class used for Schema editing.\n */\nexport abstract class MutableCAClass extends CustomAttributeClass {\n public abstract override setAppliesTo(containerType: CustomAttributeContainerType): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"CustomAttributeClass.js","sourceRoot":"","sources":["../../../src/Metadata/CustomAttributeClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAEsB;AACtB,4CAA6D;AAC7D,mCAAkC;AAGlC;;;GAGG;AACH,MAAa,oBAAqB,SAAQ,eAAO;IACtB,cAAc,GAAG,oBAAoB,CAAC,cAAc,CAAC;IAC9E,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,oBAAoB,CA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,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED;;OAEG;IACO,YAAY,CAAC,aAA2C;QAChE,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAiB;QACpD,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,oBAAoB;YACrE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,4BAA4B,CAAC,IAAiB;QAC1D,IAAI,CAAC,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC;YACpC,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,oBAAoB,0BAA0B,CAAC,CAAC;IAC9I,CAAC;CACF;AA9ED,oDA8EC;AACD;;;GAGG;AACH,MAAsB,cAAe,SAAQ,oBAAoB;CAGhE;AAHD,wCAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { CustomAttributeClassProps } from \"../Deserialization/JsonProps\";\r\nimport {\r\n containerTypeToString, CustomAttributeContainerType, parseCustomAttributeContainerType, SchemaItemType,\r\n} from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { ECClass } from \"./Class\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Typescript class representation of an ECCustomAttributeClass.\r\n * @public @preview\r\n */\r\nexport class CustomAttributeClass extends ECClass {\r\n public override readonly schemaItemType = CustomAttributeClass.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.CustomAttributeClass; }\r\n private _appliesTo?: CustomAttributeContainerType;\r\n\r\n /**\r\n * @deprecated in 4.8 - will not be removed until after 2026-06-13. Use [[appliesTo]]\r\n * */\r\n public get containerType(): CustomAttributeContainerType {\r\n return this.appliesTo;\r\n }\r\n\r\n public get appliesTo(): CustomAttributeContainerType {\r\n if (undefined === this._appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `The CustomAttributeClass ${this.name} does not have a CustomAttributeContainerType.`);\r\n return this._appliesTo;\r\n }\r\n\r\n /**\r\n * Save this CustomAttributeClasses properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): CustomAttributeClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.appliesTo = containerTypeToString(this.appliesTo);\r\n return schemaJson as CustomAttributeClassProps;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"appliesTo\", containerTypeToString(this.appliesTo));\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(customAttributeProps: CustomAttributeClassProps) {\r\n super.fromJSONSync(customAttributeProps);\r\n const appliesTo = parseCustomAttributeContainerType(customAttributeProps.appliesTo);\r\n if (undefined === appliesTo)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidContainerType, `${appliesTo} is not a valid CustomAttributeContainerType.`);\r\n this._appliesTo = appliesTo;\r\n }\r\n\r\n public override async fromJSON(customAttributeProps: CustomAttributeClassProps) {\r\n this.fromJSONSync(customAttributeProps);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setAppliesTo(containerType: CustomAttributeContainerType) {\r\n this._appliesTo = containerType;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type CustomAttributeClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a CustomAttributeClass, false otherwise.\r\n */\r\n public static isCustomAttributeClass(item?: SchemaItem): item is CustomAttributeClass {\r\n if (item && item.schemaItemType === SchemaItemType.CustomAttributeClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type CustomAttributeClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to CustomAttributeClass if it is a CustomAttributeClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsCustomAttributeClass(item?: SchemaItem): asserts item is CustomAttributeClass {\r\n if (!this.isCustomAttributeClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.CustomAttributeClass}' (CustomAttributeClass)`);\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for Schema editing.\r\n */\r\nexport abstract class MutableCAClass extends CustomAttributeClass {\r\n public abstract override setAppliesTo(containerType: CustomAttributeContainerType): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -38,18 +38,18 @@ export declare class EntityClass extends ECClass implements HasMixins {
38
38
  getInheritedPropertySync(name: string): Property | undefined;
39
39
  /**
40
40
  *
41
- * @param result
42
- * @param existingValues
41
+ * @param cache
42
+ * @returns
43
+ *
43
44
  * @internal
44
45
  */
45
- protected buildPropertyCache(result: Property[], existingValues?: Map<string, number>): Promise<void>;
46
+ protected buildPropertyCache(): Promise<Map<string, Property>>;
46
47
  /**
47
48
  *
48
- * @param result
49
- * @param existingValues
49
+ * @param cache
50
50
  * @internal
51
51
  */
52
- protected buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>): void;
52
+ protected buildPropertyCacheSync(): Map<string, Property>;
53
53
  /**
54
54
  *
55
55
  * @param name
@@ -1 +1 @@
1
- {"version":3,"file":"EntityClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAA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,KAAK,GAAG,GAAG;aAC3B,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;aACpJ,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,kBAAkB;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE;AAED,gBAAgB;AAChB,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAsB3L;AAED,gBAAgB;AAChB,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,kBAAkB,CAsBhL"}
@@ -92,44 +92,64 @@ class EntityClass extends Class_1.ECClass {
92
92
  }
93
93
  /**
94
94
  *
95
- * @param result
96
- * @param existingValues
95
+ * @param cache
96
+ * @returns
97
+ *
97
98
  * @internal
98
99
  */
99
- async buildPropertyCache(result, existingValues) {
100
- if (!existingValues) {
101
- existingValues = new Map();
102
- }
100
+ async buildPropertyCache() {
101
+ const cache = new Map();
103
102
  const baseClass = await this.baseClass;
104
103
  if (baseClass) {
105
- Class_1.ECClass.mergeProperties(result, existingValues, await baseClass.getProperties(), false);
104
+ for (const property of await baseClass.getProperties()) {
105
+ if (!cache.has(property.name.toUpperCase()))
106
+ cache.set(property.name.toUpperCase(), property);
107
+ }
106
108
  }
107
109
  for (const mixin of this.mixins) {
108
- const resolvedMixin = await mixin;
109
- Class_1.ECClass.mergeProperties(result, existingValues, await resolvedMixin.getProperties(), false);
110
+ const mixinObj = await mixin;
111
+ const mixinProps = mixinObj.getPropertiesSync();
112
+ for (const property of mixinProps) {
113
+ if (!cache.has(property.name.toUpperCase()))
114
+ cache.set(property.name.toUpperCase(), property);
115
+ }
116
+ }
117
+ const localProps = await this.getProperties(true);
118
+ if (localProps) {
119
+ for (const property of localProps) {
120
+ cache.set(property.name.toUpperCase(), property);
121
+ }
110
122
  }
111
- const localProps = await this.getProperties();
112
- Class_1.ECClass.mergeProperties(result, existingValues, localProps, true);
123
+ return cache;
113
124
  }
114
125
  /**
115
126
  *
116
- * @param result
117
- * @param existingValues
127
+ * @param cache
118
128
  * @internal
119
129
  */
120
- buildPropertyCacheSync(result, existingValues) {
121
- if (!existingValues) {
122
- existingValues = new Map();
123
- }
130
+ buildPropertyCacheSync() {
131
+ const cache = new Map();
124
132
  const baseClass = this.getBaseClassSync();
125
133
  if (baseClass) {
126
- Class_1.ECClass.mergeProperties(result, existingValues, baseClass.getPropertiesSync(), false);
134
+ Array.from(baseClass.getPropertiesSync()).forEach((property) => {
135
+ if (!cache.has(property.name.toUpperCase()))
136
+ cache.set(property.name.toUpperCase(), property);
137
+ });
127
138
  }
128
139
  for (const mixin of this.getMixinsSync()) {
129
- Class_1.ECClass.mergeProperties(result, existingValues, mixin.getPropertiesSync(), false);
140
+ const mixinProps = mixin.getPropertiesSync();
141
+ for (const property of mixinProps) {
142
+ if (!cache.has(property.name.toUpperCase()))
143
+ cache.set(property.name.toUpperCase(), property);
144
+ }
130
145
  }
131
146
  const localProps = this.getPropertiesSync(true);
132
- Class_1.ECClass.mergeProperties(result, existingValues, localProps, true);
147
+ if (localProps) {
148
+ Array.from(localProps).forEach(property => {
149
+ cache.set(property.name.toUpperCase(), property);
150
+ });
151
+ }
152
+ return cache;
133
153
  }
134
154
  /**
135
155
  *
@@ -186,12 +206,14 @@ class EntityClass extends Class_1.ECClass {
186
206
  const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);
187
207
  if (!mixinSchemaItemKey)
188
208
  throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin ("${name}") that cannot be found.`);
189
- this._mixins.push(new DelayedPromise_1.DelayedPromiseWithProps(mixinSchemaItemKey, async () => {
190
- const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin_1.Mixin);
191
- if (undefined === mixin)
192
- throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin ("${name}") that cannot be found.`);
193
- return mixin;
194
- }));
209
+ if (!this._mixins.find((value) => mixinSchemaItemKey.matchesFullName(value.fullName))) {
210
+ this._mixins.push(new DelayedPromise_1.DelayedPromiseWithProps(mixinSchemaItemKey, async () => {
211
+ const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin_1.Mixin);
212
+ if (undefined === mixin)
213
+ throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin ("${name}") that cannot be found.`);
214
+ return mixin;
215
+ }));
216
+ }
195
217
  }
196
218
  }
197
219
  }
@@ -1 +1 @@
1
- {"version":3,"file":"EntityClass.js","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAkQH,4DAsBC;AAGD,oEAsBC;AA/SD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAG7D,mCAAkC;AAClC,mCAAgC;AAChC,yCAAuE;AACvE,2DAAwD;AAGxD;;;GAGG;AACH,MAAa,WAAY,SAAQ,eAAO;IACb,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IACrE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAqB;IAEpC,IAAW,MAAM;QACf,IAAI,CA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AgB;AAChB,SAAgB,4BAA4B,CAAC,OAAgB,EAAE,IAAY,EAAE,YAAwC,EAAE,SAAqC;IAC1J,IAAI,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC;QAC/B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,iBAAiB,EAAE,+BAA+B,IAAI,gCAAgC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC;IAEhJ,IAAI,oBAAmD,CAAC;IACxD,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,QAAQ,EAAE,CAAC;QACvC,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,qCAAiB,CAAC,CAAC;IACxF,CAAC;;QACC,oBAAoB,GAAG,YAAY,CAAC;IAEtC,IAAI,CAAC,oBAAoB;QACvB,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,WAAW,EAAE,mCAAmC,YAAY,8CAA8C,CAAC,CAAC,CAAE,2DAA2D;IAElN,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,kCAAsB,EAAC,SAAS,CAAC,CAAC;QACvD,IAAI,SAAS,KAAK,YAAY;YAC5B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,wBAAwB,EAAE,mCAAmC,SAAS,qCAAqC,CAAC,CAAC;QACtJ,SAAS,GAAG,YAAY,CAAC;IAC3B,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI,wCAAuB,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACjH,OAAO,IAAI,6BAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC","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 Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { EntityClassProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parseStrengthDirection, SchemaItemType, StrengthDirection } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { HasMixins, LazyLoadedMixin } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { Mixin } from \"./Mixin\";\nimport { AnyProperty, NavigationProperty, Property } from \"./Property\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Typescript class representation of an ECEntityClass.\n * @public @preview\n */\nexport class EntityClass extends ECClass implements HasMixins {\n public override readonly schemaItemType = EntityClass.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.EntityClass; }\n private _mixins?: LazyLoadedMixin[];\n\n public get mixins(): ReadonlyArray<LazyLoadedMixin> {\n if (!this._mixins)\n return [];\n return this._mixins;\n }\n\n public *getMixinsSync(): Iterable<Mixin> {\n if (!this._mixins)\n return;\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin, Mixin);\n if (mObj) {\n yield mObj;\n }\n }\n }\n\n /**\n *\n * @param mixin\n * @internal\n */\n protected addMixin(mixin: Mixin) {\n if (!this._mixins)\n this._mixins = [];\n\n this._mixins.push(new DelayedPromiseWithProps(mixin.key, async () => mixin));\n return;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override async getInheritedProperty(name: string): Promise<AnyProperty | undefined> {\n let inheritedProperty = await super.getInheritedProperty(name);\n\n if (!inheritedProperty && this._mixins) {\n const mixinProps = await Promise.all(this._mixins.map(async (mixin) => (await mixin).getProperty(name)));\n mixinProps.some((prop) => {\n inheritedProperty = prop as AnyProperty;\n return inheritedProperty !== undefined;\n });\n }\n\n return inheritedProperty as AnyProperty | undefined;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override getInheritedPropertySync(name: string): Property | undefined {\n const inheritedProperty = super.getInheritedPropertySync(name);\n if (inheritedProperty)\n return inheritedProperty;\n\n if (!this._mixins) {\n return undefined;\n }\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin);\n if (mObj && ECClass.isECClass(mObj)) {\n const result = mObj.getPropertySync(name, true);\n if (result) {\n return result;\n }\n }\n }\n\n return undefined;\n }\n\n /**\n *\n * @param result\n * @param existingValues\n * @internal\n */\n protected override async buildPropertyCache(result: Property[], existingValues?: Map<string, number>): Promise<void> {\n if (!existingValues) {\n existingValues = new Map<string, number>();\n }\n\n const baseClass = await this.baseClass;\n if (baseClass) {\n ECClass.mergeProperties(result, existingValues, await baseClass.getProperties(), false);\n }\n\n for (const mixin of this.mixins) {\n const resolvedMixin = await mixin;\n ECClass.mergeProperties(result, existingValues, await resolvedMixin.getProperties(), false);\n }\n\n const localProps = await this.getProperties();\n ECClass.mergeProperties(result, existingValues, localProps, true);\n }\n\n /**\n *\n * @param result\n * @param existingValues\n * @internal\n */\n protected override buildPropertyCacheSync(result: Property[], existingValues?: Map<string, number>): void {\n if (!existingValues) {\n existingValues = new Map<string, number>();\n }\n\n const baseClass = this.getBaseClassSync();\n if (baseClass) {\n ECClass.mergeProperties(result, existingValues, baseClass.getPropertiesSync(), false);\n }\n\n for (const mixin of this.getMixinsSync()) {\n ECClass.mergeProperties(result, existingValues, mixin.getPropertiesSync(), false);\n }\n\n const localProps = this.getPropertiesSync(true);\n ECClass.mergeProperties(result, existingValues, localProps, true);\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * Save this EntityClass' properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): EntityClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (this.mixins.length > 0)\n schemaJson.mixins = this.mixins.map((mixin) => mixin.fullName);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n\n for (const lazyMixin of this.mixins) {\n const mixin = await lazyMixin;\n const mixinElement = schemaXml.createElement(\"BaseClass\");\n const mixinName = XmlSerializationUtils.createXmlTypedName(this.schema, mixin.schema, mixin.name);\n mixinElement.textContent = mixinName;\n itemElement.appendChild(mixinElement);\n }\n return itemElement;\n }\n\n public override async fromJSON(entityClassProps: EntityClassProps) {\n this.fromJSONSync(entityClassProps);\n }\n\n public override fromJSONSync(entityClassProps: EntityClassProps) {\n super.fromJSONSync(entityClassProps);\n\n if (undefined !== entityClassProps.mixins) {\n if (!this._mixins)\n this._mixins = [];\n for (const name of entityClassProps.mixins) {\n const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);\n if (!mixinSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n this._mixins.push(new DelayedPromiseWithProps<SchemaItemKey, Mixin>(mixinSchemaItemKey,\n async () => {\n const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin);\n if (undefined === mixin)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n return mixin;\n }));\n }\n }\n }\n\n /**\n * Type guard to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is an EntityClass, false otherwise.\n */\n public static isEntityClass(item?: SchemaItem): item is EntityClass {\n if (item && item.schemaItemType === SchemaItemType.EntityClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to EntityClass if it is an EntityClass, undefined otherwise.\n * @internal\n */\n public static assertIsEntityClass(item?: SchemaItem): asserts item is EntityClass {\n if (!this.isEntityClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.EntityClass}' (EntityClass)`);\n }\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableEntityClass extends EntityClass {\n public abstract override addMixin(mixin: Mixin): any;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/** @internal */\nexport async function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n if (await ecClass.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = await ecClass.schema.lookupItem(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n\n/** @internal */\nexport function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n if (ecClass.getPropertySync(name))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = ecClass.schema.lookupItemSync(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n"]}
1
+ {"version":3,"file":"EntityClass.js","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAuRH,4DAsBC;AAGD,oEAsBC;AApUD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAG7D,mCAAkC;AAClC,mCAAgC;AAChC,yCAAuE;AAC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---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { EntityClassProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { parseStrengthDirection, SchemaItemType, StrengthDirection } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { HasMixins, LazyLoadedMixin } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { ECClass } from \"./Class\";\r\nimport { Mixin } from \"./Mixin\";\r\nimport { AnyProperty, NavigationProperty, Property } from \"./Property\";\r\nimport { RelationshipClass } from \"./RelationshipClass\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * A Typescript class representation of an ECEntityClass.\r\n * @public @preview\r\n */\r\nexport class EntityClass extends ECClass implements HasMixins {\r\n public override readonly schemaItemType = EntityClass.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.EntityClass; }\r\n private _mixins?: LazyLoadedMixin[];\r\n\r\n public get mixins(): ReadonlyArray<LazyLoadedMixin> {\r\n if (!this._mixins)\r\n return [];\r\n return this._mixins;\r\n }\r\n\r\n public *getMixinsSync(): Iterable<Mixin> {\r\n if (!this._mixins)\r\n return;\r\n\r\n for (const mixin of this._mixins) {\r\n const mObj = this.schema.lookupItemSync(mixin, Mixin);\r\n if (mObj) {\r\n yield mObj;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n *\r\n * @param mixin\r\n * @internal\r\n */\r\n protected addMixin(mixin: Mixin) {\r\n if (!this._mixins)\r\n this._mixins = [];\r\n\r\n this._mixins.push(new DelayedPromiseWithProps(mixin.key, async () => mixin));\r\n return;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\r\n * @param name The name of the property to find.\r\n */\r\n public override async getInheritedProperty(name: string): Promise<AnyProperty | undefined> {\r\n let inheritedProperty = await super.getInheritedProperty(name);\r\n\r\n if (!inheritedProperty && this._mixins) {\r\n const mixinProps = await Promise.all(this._mixins.map(async (mixin) => (await mixin).getProperty(name)));\r\n mixinProps.some((prop) => {\r\n inheritedProperty = prop as AnyProperty;\r\n return inheritedProperty !== undefined;\r\n });\r\n }\r\n\r\n return inheritedProperty as AnyProperty | undefined;\r\n }\r\n\r\n /**\r\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\r\n * @param name The name of the property to find.\r\n */\r\n public override getInheritedPropertySync(name: string): Property | undefined {\r\n const inheritedProperty = super.getInheritedPropertySync(name);\r\n if (inheritedProperty)\r\n return inheritedProperty;\r\n\r\n if (!this._mixins) {\r\n return undefined;\r\n }\r\n\r\n for (const mixin of this._mixins) {\r\n const mObj = this.schema.lookupItemSync(mixin);\r\n if (mObj && ECClass.isECClass(mObj)) {\r\n const result = mObj.getPropertySync(name, true);\r\n if (result) {\r\n return result;\r\n }\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @returns\r\n *\r\n * @internal\r\n */\r\nprotected override async buildPropertyCache(): Promise<Map<string, Property>> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = await this.baseClass;\r\n if (baseClass) {\r\n for (const property of await baseClass.getProperties()) {\r\n if (!cache.has(property.name.toUpperCase()))\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n\r\n for (const mixin of this.mixins) {\r\n const mixinObj = await mixin;\r\n const mixinProps = mixinObj.getPropertiesSync();\r\n for (const property of mixinProps) {\r\n if (!cache.has(property.name.toUpperCase()))\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n\r\n const localProps = await this.getProperties(true);\r\n if (localProps) {\r\n for (const property of localProps) {\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n return cache;\r\n}\r\n\r\n /**\r\n *\r\n * @param cache\r\n * @internal\r\n */\r\n protected override buildPropertyCacheSync(): Map<string, Property> {\r\n const cache = new Map<string, Property>();\r\n const baseClass = this.getBaseClassSync();\r\n if (baseClass) {\r\n Array.from(baseClass.getPropertiesSync()).forEach((property) => {\r\n if (!cache.has(property.name.toUpperCase()))\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n\r\n for (const mixin of this.getMixinsSync()) {\r\n const mixinProps = mixin.getPropertiesSync();\r\n for (const property of mixinProps) {\r\n if (!cache.has(property.name.toUpperCase()))\r\n cache.set(property.name.toUpperCase(), property);\r\n }\r\n }\r\n\r\n const localProps = this.getPropertiesSync(true);\r\n if (localProps) {\r\n Array.from(localProps).forEach(property => {\r\n cache.set(property.name.toUpperCase(), property);\r\n });\r\n }\r\n return cache;\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param relationship\r\n * @param direction\r\n * @internal\r\n */\r\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\r\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\r\n }\r\n\r\n /**\r\n *\r\n * @param name\r\n * @param relationship\r\n * @param direction\r\n * @internal\r\n */\r\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\r\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\r\n }\r\n\r\n /**\r\n * Save this EntityClass' properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): EntityClassProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n if (this.mixins.length > 0)\r\n schemaJson.mixins = this.mixins.map((mixin) => mixin.fullName);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n for (const lazyMixin of this.mixins) {\r\n const mixin = await lazyMixin;\r\n const mixinElement = schemaXml.createElement(\"BaseClass\");\r\n const mixinName = XmlSerializationUtils.createXmlTypedName(this.schema, mixin.schema, mixin.name);\r\n mixinElement.textContent = mixinName;\r\n itemElement.appendChild(mixinElement);\r\n }\r\n return itemElement;\r\n }\r\n\r\n public override async fromJSON(entityClassProps: EntityClassProps) {\r\n this.fromJSONSync(entityClassProps);\r\n }\r\n\r\n public override fromJSONSync(entityClassProps: EntityClassProps) {\r\n super.fromJSONSync(entityClassProps);\r\n\r\n if (undefined !== entityClassProps.mixins) {\r\n if (!this._mixins)\r\n this._mixins = [];\r\n for (const name of entityClassProps.mixins) {\r\n const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);\r\n if (!mixinSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\r\n\r\n if (!this._mixins.find((value) => mixinSchemaItemKey.matchesFullName(value.fullName))) {\r\n this._mixins.push(new DelayedPromiseWithProps<SchemaItemKey, Mixin>(mixinSchemaItemKey,\r\n async () => {\r\n const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin);\r\n if (undefined === mixin)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\r\n return mixin;\r\n }));\r\n }\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type EntityClass.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is an EntityClass, false otherwise.\r\n */\r\n public static isEntityClass(item?: SchemaItem): item is EntityClass {\r\n if (item && item.schemaItemType === SchemaItemType.EntityClass)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type EntityClass.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to EntityClass if it is an EntityClass, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsEntityClass(item?: SchemaItem): asserts item is EntityClass {\r\n if (!this.isEntityClass(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.EntityClass}' (EntityClass)`);\r\n }\r\n}\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableEntityClass extends EntityClass {\r\n public abstract override addMixin(mixin: Mixin): any;\r\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\r\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n\r\n/** @internal */\r\nexport async function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\r\n if (await ecClass.getProperty(name, true))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\r\n\r\n let resolvedRelationship: RelationshipClass | undefined;\r\n if (typeof (relationship) === \"string\") {\r\n resolvedRelationship = await ecClass.schema.lookupItem(relationship, RelationshipClass);\r\n } else\r\n resolvedRelationship = relationship;\r\n\r\n if (!resolvedRelationship)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\r\n\r\n if (typeof (direction) === \"string\") {\r\n const tmpDirection = parseStrengthDirection(direction);\r\n if (undefined === tmpDirection)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\r\n direction = tmpDirection;\r\n }\r\n\r\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\r\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\r\n}\r\n\r\n/** @internal */\r\nexport function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\r\n if (ecClass.getPropertySync(name))\r\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\r\n\r\n let resolvedRelationship: RelationshipClass | undefined;\r\n if (typeof (relationship) === \"string\") {\r\n resolvedRelationship = ecClass.schema.lookupItemSync(relationship, RelationshipClass);\r\n } else\r\n resolvedRelationship = relationship;\r\n\r\n if (!resolvedRelationship)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\r\n\r\n if (typeof (direction) === \"string\") {\r\n const tmpDirection = parseStrengthDirection(direction);\r\n if (undefined === tmpDirection)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\r\n direction = tmpDirection;\r\n }\r\n\r\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\r\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Enumeration.js","sourceRoot":"","sources":["../../../src/Metadata/Enumeration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4E;AAE5E,4CAAoF;AACpF,4CAA6D;AAC7D,sCAAmC;AAEnC,6CAA0C;AAa1C;;;GAGG;AACH,MAAa,WAAY,SAAQ,uBAAU;IAChB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IACrE,gBAAgB;IACT,MAAM,KAAc,cAAc,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C;IACtC,CAAC;IAED;;OAEG;IACO,WAAW,CAAC,QAAiB;QACrC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,IAAiB;QAC3C,OAAO,IAAI,EAAE,cAAc,KAAK,0BAAc,CAAC,WAAW,CAAC;IAC7D,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,IAAiB;QACjD,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AA1LD,kCA0LC;AAED;;;;GAIG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAI3D;AAJD,gDAIC","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 Metadata\n */\n\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { EnumerationProps, EnumeratorProps } from \"../Deserialization/JsonProps\";\nimport { PrimitiveType, primitiveTypeToString, SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { ECName } from \"../ECName\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/** @public @preview */\nexport interface Enumerator<T> {\n readonly name: string;\n readonly value: T;\n readonly label?: string;\n readonly description?: string;\n}\n\n/** @public @preview */\nexport type AnyEnumerator = Enumerator<string | number>;\n\n/**\n * A Typescript class representation of an ECEnumeration.\n * @public @preview\n */\nexport class Enumeration extends SchemaItem {\n public override readonly schemaItemType = Enumeration.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.Enumeration; }\n private _type?: PrimitiveType.Integer | PrimitiveType.String;\n private _isStrict: boolean;\n private _enumerators: AnyEnumerator[];\n\n public get enumerators(): ReadonlyArray<AnyEnumerator> { return this._enumerators; }\n public get type() { return this._type; }\n public get isStrict() { return this._isStrict; }\n\n /** @internal */\n constructor(schema: Schema, name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String) {\n super(schema, name);\n this._type = primitiveType;\n this._isStrict = true;\n this._enumerators = [];\n }\n\n public get isInt(): boolean { return this._type === PrimitiveType.Integer; }\n public get isString(): boolean { return this._type === PrimitiveType.String; }\n\n /**\n * Gets an enumerator that matches the name provided.\n * @param name The ECName of the Enumerator to find.\n */\n public getEnumeratorByName(name: string): AnyEnumerator | undefined {\n return this.enumerators.find((item) => item.name.toLowerCase() === name.toLowerCase());\n }\n\n /**\n * Gets an enumerator that matches the value provided.\n * @param value The value of the Enumerator to find.\n */\n public getEnumerator(value: string): Enumerator<string> | undefined;\n public getEnumerator(value: number): Enumerator<number> | undefined;\n public getEnumerator(value: string | number): AnyEnumerator | undefined {\n return this.enumerators.find((item) => item.value === value);\n }\n\n /**\n * Checks whether there already exists an enumerator with this name or this value\n * @param name The name of the enumerator we are trying to create\n * @param value The value of the enumerator we are trying to create\n * @internal\n */\n private findDuplicateEnumerators(name: string, value: string | number) {\n this._enumerators.forEach((element: AnyEnumerator) => { // Name and value must be unique within the ECEnumerations\n if (element.name.toLowerCase() === name.toLowerCase())\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with name '${name}'.`);\n if (element.value === value)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with value '${value}'.`);\n });\n }\n\n /**\n * Creates an Enumerator with the provided name and value as well as optional parameters label and description\n * @param name The name of the enumerator\n * @param value The value of the enumerator. The type of this value is dependent on the backing type of the this Enumeration.\n * @param label A localized display label that is used instead of the name in a GUI.\n * @param description A localized description for the enumerator.\n * @return AnyEnumerator object\n * @internal\n */\n public createEnumerator(name: string, value: string | number, label?: string, description?: string): AnyEnumerator {\n if (this.isInt && typeof (value) === \"string\") // throws if backing type is int and value is string\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'integer' and an enumerator with value of type 'string'.`);\n if (!this.isInt && typeof (value) === \"number\") // also throws if backing type is string and value is number\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'string' and an enumerator with value of type 'integer'.`);\n this.findDuplicateEnumerators(name, value); // check for duplicates; throw if there are any\n if (!ECName.validate(name))\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `The Enumeration ${this.name} has an enumerator with an invalid 'name' attribute. ${name} is not a valid ECName.`);\n return { name, value, label, description };\n }\n\n /**\n * Adds enumerator to list of enumerators on this Enumeration\n * @param enumerator The enumerator to add\n * @internal\n */\n protected addEnumerator(enumerator: AnyEnumerator) {\n this._enumerators.push(enumerator);\n }\n\n /**\n * Save this Enumeration's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): EnumerationProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.type = (this.isInt) ? \"int\" : \"string\";\n schemaJson.isStrict = this.isStrict;\n schemaJson.enumerators = this._enumerators.map(({ name, label, value, description }) => {\n const enumJson: any = { name, value };\n if (undefined !== label)\n enumJson.label = label;\n if (undefined !== description)\n enumJson.description = description;\n return enumJson;\n });\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n if (undefined !== this.type)\n itemElement.setAttribute(\"backingTypeName\", primitiveTypeToString(this.type));\n itemElement.setAttribute(\"isStrict\", String(this.isStrict));\n\n for (const enumerator of this.enumerators) {\n const enumElement = schemaXml.createElement(\"ECEnumerator\");\n enumElement.setAttribute(\"name\", enumerator.name);\n const enumValue = typeof enumerator.value === \"string\" ? enumerator.value : enumerator.value.toString();\n enumElement.setAttribute(\"value\", enumValue);\n if (undefined !== enumerator.label)\n enumElement.setAttribute(\"displayLabel\", enumerator.label);\n if (undefined !== enumerator.description)\n enumElement.setAttribute(\"description\", enumerator.description);\n itemElement.appendChild(enumElement);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(enumerationProps: EnumerationProps) {\n super.fromJSONSync(enumerationProps);\n if (undefined === this._type) {\n if (/int/i.test(enumerationProps.type)) {\n this._type = PrimitiveType.Integer;\n } else if (/string/i.test(enumerationProps.type)) {\n this._type = PrimitiveType.String;\n } else {\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: enumerationProps.originalECSpecMajorVersion, writeVersion: enumerationProps.originalECSpecMinorVersion } as ECSpecVersion))\n this._type = PrimitiveType.String;\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has an invalid 'type' attribute. It should be either \"int\" or \"string\".`);\n }\n } else {\n const primitiveTypePattern = (this.isInt) ? /int/i : /string/i;\n if (!primitiveTypePattern.test(enumerationProps.type))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has an incompatible type. It must be \"${(this.isInt) ? \"int\" : \"string\"}\", not \"${(this.isInt) ? \"string\" : \"int\"}\".`);\n }\n this._isStrict = enumerationProps.isStrict;\n\n if (undefined !== enumerationProps.enumerators) {\n enumerationProps.enumerators.forEach((enumerator: EnumeratorProps) => {\n // Creates a new enumerator (with the specified name, value, label and description- label and description are optional) and adds to the list of enumerators.\n // Throws ECSchemaError if there are duplicate names or values present in the enumeration\n this.addEnumerator(this.createEnumerator(enumerator.name, enumerator.value, enumerator.label, enumerator.description));\n });\n }\n }\n\n public override async fromJSON(enumerationProps: EnumerationProps) {\n this.fromJSONSync(enumerationProps);\n }\n\n /**\n * @internal\n */\n protected setIsStrict(isStrict: boolean) {\n this._isStrict = isStrict;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type Enumeration.\n * @param item The SchemaItem to check.\n * @returns True if the item is an Enumeration, false otherwise.\n */\n public static isEnumeration(item?: SchemaItem): item is Enumeration {\n return item?.schemaItemType === SchemaItemType.Enumeration;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type Enumeration.\n * @param item The SchemaItem to check.\n * @returns The item cast to Enumeration if it is an Enumeration, undefined otherwise.\n * @internal\n */\n public static assertIsEnumeration(item?: SchemaItem): asserts item is Enumeration {\n if (!this.isEnumeration(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Enumeration}' (Enumeration)`);\n }\n}\n\n/**\n * An abstract class used for schema editing.\n *\n * @internal\n */\nexport abstract class MutableEnumeration extends Enumeration {\n public abstract override addEnumerator(enumerator: AnyEnumerator): void;\n public abstract override setIsStrict(isStrict: boolean): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
1
+ {"version":3,"file":"Enumeration.js","sourceRoot":"","sources":["../../../src/Metadata/Enumeration.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4E;AAE5E,4CAAoF;AACpF,4CAA6D;AAC7D,sCAAmC;AAEnC,6CAA0C;AAa1C;;;GAGG;AACH,MAAa,WAAY,SAAQ,uBAAU;IAChB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IACrE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1E,KAAK,CAAgD;IACrD,SAAS,CAAU;IACnB,YAAY,CAAkB;IAEtC,IAAW,WAAW,KAAmC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACpF,IAAW,IAAI,KAAK,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACxC,IAAW,QAAQ,KAAK,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,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C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC;YAC3B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,WAAW,iBAAiB,CAAC,CAAC;IAC5H,CAAC;CACF;AA1LD,kCA0LC;AAED;;;;GAIG;AACH,MAAsB,kBAAmB,SAAQ,WAAW;CAI3D;AAJD,gDAIC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\r\nimport { EnumerationProps, EnumeratorProps } from \"../Deserialization/JsonProps\";\r\nimport { PrimitiveType, primitiveTypeToString, SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { ECName } from \"../ECName\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/** @public @preview */\r\nexport interface Enumerator<T> {\r\n readonly name: string;\r\n readonly value: T;\r\n readonly label?: string;\r\n readonly description?: string;\r\n}\r\n\r\n/** @public @preview */\r\nexport type AnyEnumerator = Enumerator<string | number>;\r\n\r\n/**\r\n * A Typescript class representation of an ECEnumeration.\r\n * @public @preview\r\n */\r\nexport class Enumeration extends SchemaItem {\r\n public override readonly schemaItemType = Enumeration.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.Enumeration; }\r\n private _type?: PrimitiveType.Integer | PrimitiveType.String;\r\n private _isStrict: boolean;\r\n private _enumerators: AnyEnumerator[];\r\n\r\n public get enumerators(): ReadonlyArray<AnyEnumerator> { return this._enumerators; }\r\n public get type() { return this._type; }\r\n public get isStrict() { return this._isStrict; }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String) {\r\n super(schema, name);\r\n this._type = primitiveType;\r\n this._isStrict = true;\r\n this._enumerators = [];\r\n }\r\n\r\n public get isInt(): boolean { return this._type === PrimitiveType.Integer; }\r\n public get isString(): boolean { return this._type === PrimitiveType.String; }\r\n\r\n /**\r\n * Gets an enumerator that matches the name provided.\r\n * @param name The ECName of the Enumerator to find.\r\n */\r\n public getEnumeratorByName(name: string): AnyEnumerator | undefined {\r\n return this.enumerators.find((item) => item.name.toLowerCase() === name.toLowerCase());\r\n }\r\n\r\n /**\r\n * Gets an enumerator that matches the value provided.\r\n * @param value The value of the Enumerator to find.\r\n */\r\n public getEnumerator(value: string): Enumerator<string> | undefined;\r\n public getEnumerator(value: number): Enumerator<number> | undefined;\r\n public getEnumerator(value: string | number): AnyEnumerator | undefined {\r\n return this.enumerators.find((item) => item.value === value);\r\n }\r\n\r\n /**\r\n * Checks whether there already exists an enumerator with this name or this value\r\n * @param name The name of the enumerator we are trying to create\r\n * @param value The value of the enumerator we are trying to create\r\n * @internal\r\n */\r\n private findDuplicateEnumerators(name: string, value: string | number) {\r\n this._enumerators.forEach((element: AnyEnumerator) => { // Name and value must be unique within the ECEnumerations\r\n if (element.name.toLowerCase() === name.toLowerCase())\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with name '${name}'.`);\r\n if (element.value === value)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a duplicate Enumerator with value '${value}'.`);\r\n });\r\n }\r\n\r\n /**\r\n * Creates an Enumerator with the provided name and value as well as optional parameters label and description\r\n * @param name The name of the enumerator\r\n * @param value The value of the enumerator. The type of this value is dependent on the backing type of the this Enumeration.\r\n * @param label A localized display label that is used instead of the name in a GUI.\r\n * @param description A localized description for the enumerator.\r\n * @return AnyEnumerator object\r\n * @internal\r\n */\r\n public createEnumerator(name: string, value: string | number, label?: string, description?: string): AnyEnumerator {\r\n if (this.isInt && typeof (value) === \"string\") // throws if backing type is int and value is string\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'integer' and an enumerator with value of type 'string'.`);\r\n if (!this.isInt && typeof (value) === \"number\") // also throws if backing type is string and value is number\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has a backing type 'string' and an enumerator with value of type 'integer'.`);\r\n this.findDuplicateEnumerators(name, value); // check for duplicates; throw if there are any\r\n if (!ECName.validate(name))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECName, `The Enumeration ${this.name} has an enumerator with an invalid 'name' attribute. ${name} is not a valid ECName.`);\r\n return { name, value, label, description };\r\n }\r\n\r\n /**\r\n * Adds enumerator to list of enumerators on this Enumeration\r\n * @param enumerator The enumerator to add\r\n * @internal\r\n */\r\n protected addEnumerator(enumerator: AnyEnumerator) {\r\n this._enumerators.push(enumerator);\r\n }\r\n\r\n /**\r\n * Save this Enumeration's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): EnumerationProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.type = (this.isInt) ? \"int\" : \"string\";\r\n schemaJson.isStrict = this.isStrict;\r\n schemaJson.enumerators = this._enumerators.map(({ name, label, value, description }) => {\r\n const enumJson: any = { name, value };\r\n if (undefined !== label)\r\n enumJson.label = label;\r\n if (undefined !== description)\r\n enumJson.description = description;\r\n return enumJson;\r\n });\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n if (undefined !== this.type)\r\n itemElement.setAttribute(\"backingTypeName\", primitiveTypeToString(this.type));\r\n itemElement.setAttribute(\"isStrict\", String(this.isStrict));\r\n\r\n for (const enumerator of this.enumerators) {\r\n const enumElement = schemaXml.createElement(\"ECEnumerator\");\r\n enumElement.setAttribute(\"name\", enumerator.name);\r\n const enumValue = typeof enumerator.value === \"string\" ? enumerator.value : enumerator.value.toString();\r\n enumElement.setAttribute(\"value\", enumValue);\r\n if (undefined !== enumerator.label)\r\n enumElement.setAttribute(\"displayLabel\", enumerator.label);\r\n if (undefined !== enumerator.description)\r\n enumElement.setAttribute(\"description\", enumerator.description);\r\n itemElement.appendChild(enumElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(enumerationProps: EnumerationProps) {\r\n super.fromJSONSync(enumerationProps);\r\n if (undefined === this._type) {\r\n if (/int/i.test(enumerationProps.type)) {\r\n this._type = PrimitiveType.Integer;\r\n } else if (/string/i.test(enumerationProps.type)) {\r\n this._type = PrimitiveType.String;\r\n } else {\r\n if (SchemaReadHelper.isECSpecVersionNewer({ readVersion: enumerationProps.originalECSpecMajorVersion, writeVersion: enumerationProps.originalECSpecMinorVersion } as ECSpecVersion))\r\n this._type = PrimitiveType.String;\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has an invalid 'type' attribute. It should be either \"int\" or \"string\".`);\r\n }\r\n } else {\r\n const primitiveTypePattern = (this.isInt) ? /int/i : /string/i;\r\n if (!primitiveTypePattern.test(enumerationProps.type))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Enumeration ${this.name} has an incompatible type. It must be \"${(this.isInt) ? \"int\" : \"string\"}\", not \"${(this.isInt) ? \"string\" : \"int\"}\".`);\r\n }\r\n this._isStrict = enumerationProps.isStrict;\r\n\r\n if (undefined !== enumerationProps.enumerators) {\r\n enumerationProps.enumerators.forEach((enumerator: EnumeratorProps) => {\r\n // Creates a new enumerator (with the specified name, value, label and description- label and description are optional) and adds to the list of enumerators.\r\n // Throws ECSchemaError if there are duplicate names or values present in the enumeration\r\n this.addEnumerator(this.createEnumerator(enumerator.name, enumerator.value, enumerator.label, enumerator.description));\r\n });\r\n }\r\n }\r\n\r\n public override async fromJSON(enumerationProps: EnumerationProps) {\r\n this.fromJSONSync(enumerationProps);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n protected setIsStrict(isStrict: boolean) {\r\n this._isStrict = isStrict;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type Enumeration.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is an Enumeration, false otherwise.\r\n */\r\n public static isEnumeration(item?: SchemaItem): item is Enumeration {\r\n return item?.schemaItemType === SchemaItemType.Enumeration;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type Enumeration.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to Enumeration if it is an Enumeration, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsEnumeration(item?: SchemaItem): asserts item is Enumeration {\r\n if (!this.isEnumeration(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.Enumeration}' (Enumeration)`);\r\n }\r\n}\r\n\r\n/**\r\n * An abstract class used for schema editing.\r\n *\r\n * @internal\r\n */\r\nexport abstract class MutableEnumeration extends Enumeration {\r\n public abstract override addEnumerator(enumerator: AnyEnumerator): void;\r\n public abstract override setIsStrict(isStrict: boolean): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
@@ -29,6 +29,7 @@ export declare class Format extends SchemaItem {
29
29
  get uomSeparator(): string;
30
30
  get stationSeparator(): string;
31
31
  get stationOffsetSize(): number | undefined;
32
+ get stationBaseFactor(): number | undefined;
32
33
  get formatTraits(): FormatTraits;
33
34
  get spacer(): string | undefined;
34
35
  get includeZero(): boolean | undefined;
@@ -91,6 +92,10 @@ export declare class Format extends SchemaItem {
91
92
  * @internal
92
93
  */
93
94
  protected setStationOffsetSize(stationOffsetSize: number): void;
95
+ /**
96
+ * @internal
97
+ */
98
+ protected setStationBaseFactor(stationBaseFactor: number): void;
94
99
  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G,IAAI;aAC7C,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aACxC,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;aAC5C,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
@@ -41,6 +41,7 @@ class Format extends SchemaItem_1.SchemaItem {
41
41
  get uomSeparator() { return this._base.uomSeparator; }
42
42
  get stationSeparator() { return this._base.stationSeparator; }
43
43
  get stationOffsetSize() { return this._base.stationOffsetSize; }
44
+ get stationBaseFactor() { return this._base.stationBaseFactor; }
44
45
  get formatTraits() { return this._base.formatTraits; }
45
46
  get spacer() { return this._base.spacer; }
46
47
  get includeZero() { return this._base.includeZero; }
@@ -261,6 +262,12 @@ class Format extends SchemaItem_1.SchemaItem {
261
262
  setStationOffsetSize(stationOffsetSize) {
262
263
  this._base.stationOffsetSize = stationOffsetSize;
263
264
  }
265
+ /**
266
+ * @internal
267
+ */
268
+ setStationBaseFactor(stationBaseFactor) {
269
+ this._base.stationBaseFactor = stationBaseFactor;
270
+ }
264
271
  /**
265
272
  * @internal
266
273
  */