@itwin/ecschema-metadata 4.10.0-dev.9 → 4.10.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 (190) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/lib/cjs/Constants.js.map +1 -1
  3. package/lib/cjs/DelayedPromise.d.ts.map +1 -1
  4. package/lib/cjs/DelayedPromise.js.map +1 -1
  5. package/lib/cjs/Deserialization/AbstractParser.d.ts +3 -0
  6. package/lib/cjs/Deserialization/AbstractParser.d.ts.map +1 -1
  7. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  8. package/lib/cjs/Deserialization/Helper.d.ts +9 -0
  9. package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
  10. package/lib/cjs/Deserialization/Helper.js +24 -6
  11. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  12. package/lib/cjs/Deserialization/JsonParser.d.ts +3 -0
  13. package/lib/cjs/Deserialization/JsonParser.d.ts.map +1 -1
  14. package/lib/cjs/Deserialization/JsonParser.js +55 -9
  15. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  16. package/lib/cjs/Deserialization/JsonProps.d.ts +4 -0
  17. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  18. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  19. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  20. package/lib/cjs/Deserialization/XmlParser.d.ts +3 -2
  21. package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
  22. package/lib/cjs/Deserialization/XmlParser.js +32 -13
  23. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  24. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  25. package/lib/cjs/ECName.js.map +1 -1
  26. package/lib/cjs/ECObjects.d.ts.map +1 -1
  27. package/lib/cjs/ECObjects.js +24 -21
  28. package/lib/cjs/ECObjects.js.map +1 -1
  29. package/lib/cjs/Exception.d.ts +2 -1
  30. package/lib/cjs/Exception.d.ts.map +1 -1
  31. package/lib/cjs/Exception.js +1 -0
  32. package/lib/cjs/Exception.js.map +1 -1
  33. package/lib/cjs/Interfaces.js.map +1 -1
  34. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  35. package/lib/cjs/Metadata/Class.js +10 -3
  36. package/lib/cjs/Metadata/Class.js.map +1 -1
  37. package/lib/cjs/Metadata/Constant.js.map +1 -1
  38. package/lib/cjs/Metadata/CustomAttribute.js +1 -2
  39. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  40. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  41. package/lib/cjs/Metadata/EntityClass.js +3 -3
  42. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  43. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  44. package/lib/cjs/Metadata/Enumeration.js +11 -4
  45. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  46. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  47. package/lib/cjs/Metadata/Format.js +6 -6
  48. package/lib/cjs/Metadata/Format.js.map +1 -1
  49. package/lib/cjs/Metadata/InvertedUnit.d.ts +4 -0
  50. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  51. package/lib/cjs/Metadata/InvertedUnit.js +6 -0
  52. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  53. package/lib/cjs/Metadata/KindOfQuantity.d.ts +0 -4
  54. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  55. package/lib/cjs/Metadata/KindOfQuantity.js +2 -54
  56. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  57. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  58. package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -0
  59. package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
  60. package/lib/cjs/Metadata/OverrideFormat.js +55 -2
  61. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  62. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  63. package/lib/cjs/Metadata/Property.js.map +1 -1
  64. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  65. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  66. package/lib/cjs/Metadata/RelationshipClass.js +8 -3
  67. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  68. package/lib/cjs/Metadata/Schema.d.ts +9 -0
  69. package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
  70. package/lib/cjs/Metadata/Schema.js +74 -7
  71. package/lib/cjs/Metadata/Schema.js.map +1 -1
  72. package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
  73. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  74. package/lib/cjs/Metadata/Unit.js.map +1 -1
  75. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  76. package/lib/cjs/PropertyTypes.js +2 -2
  77. package/lib/cjs/PropertyTypes.js.map +1 -1
  78. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  79. package/lib/cjs/SchemaKey.d.ts.map +1 -1
  80. package/lib/cjs/SchemaKey.js +1 -5
  81. package/lib/cjs/SchemaKey.js.map +1 -1
  82. package/lib/cjs/SchemaLoader.js.map +1 -1
  83. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  84. package/lib/cjs/UnitConversion/Graph.d.ts.map +1 -1
  85. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  86. package/lib/cjs/UnitConversion/Parser.js +1 -2
  87. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  88. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  89. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  90. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  91. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +1 -6
  92. package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  93. package/lib/cjs/UnitProvider/SchemaUnitProvider.js +100 -58
  94. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  95. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  96. package/lib/cjs/ecschema-metadata.js.map +1 -1
  97. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  98. package/lib/esm/Constants.js.map +1 -1
  99. package/lib/esm/DelayedPromise.d.ts.map +1 -1
  100. package/lib/esm/DelayedPromise.js.map +1 -1
  101. package/lib/esm/Deserialization/AbstractParser.d.ts +3 -0
  102. package/lib/esm/Deserialization/AbstractParser.d.ts.map +1 -1
  103. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  104. package/lib/esm/Deserialization/Helper.d.ts +9 -0
  105. package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
  106. package/lib/esm/Deserialization/Helper.js +24 -6
  107. package/lib/esm/Deserialization/Helper.js.map +1 -1
  108. package/lib/esm/Deserialization/JsonParser.d.ts +3 -0
  109. package/lib/esm/Deserialization/JsonParser.d.ts.map +1 -1
  110. package/lib/esm/Deserialization/JsonParser.js +55 -9
  111. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  112. package/lib/esm/Deserialization/JsonProps.d.ts +4 -0
  113. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  114. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  115. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  116. package/lib/esm/Deserialization/XmlParser.d.ts +3 -2
  117. package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
  118. package/lib/esm/Deserialization/XmlParser.js +32 -13
  119. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  120. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  121. package/lib/esm/ECName.js.map +1 -1
  122. package/lib/esm/ECObjects.d.ts.map +1 -1
  123. package/lib/esm/ECObjects.js +8 -5
  124. package/lib/esm/ECObjects.js.map +1 -1
  125. package/lib/esm/Exception.d.ts +2 -1
  126. package/lib/esm/Exception.d.ts.map +1 -1
  127. package/lib/esm/Exception.js +1 -0
  128. package/lib/esm/Exception.js.map +1 -1
  129. package/lib/esm/Interfaces.js.map +1 -1
  130. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  131. package/lib/esm/Metadata/Class.js +10 -3
  132. package/lib/esm/Metadata/Class.js.map +1 -1
  133. package/lib/esm/Metadata/Constant.js.map +1 -1
  134. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  135. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  136. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  137. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  138. package/lib/esm/Metadata/Enumeration.js +11 -4
  139. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  140. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  141. package/lib/esm/Metadata/Format.js +7 -7
  142. package/lib/esm/Metadata/Format.js.map +1 -1
  143. package/lib/esm/Metadata/InvertedUnit.d.ts +4 -0
  144. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  145. package/lib/esm/Metadata/InvertedUnit.js +6 -0
  146. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  147. package/lib/esm/Metadata/KindOfQuantity.d.ts +0 -4
  148. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  149. package/lib/esm/Metadata/KindOfQuantity.js +2 -54
  150. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  151. package/lib/esm/Metadata/Mixin.js.map +1 -1
  152. package/lib/esm/Metadata/OverrideFormat.d.ts +12 -0
  153. package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
  154. package/lib/esm/Metadata/OverrideFormat.js +53 -0
  155. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  156. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  157. package/lib/esm/Metadata/Property.js.map +1 -1
  158. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  159. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  160. package/lib/esm/Metadata/RelationshipClass.js +8 -3
  161. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  162. package/lib/esm/Metadata/Schema.d.ts +9 -0
  163. package/lib/esm/Metadata/Schema.d.ts.map +1 -1
  164. package/lib/esm/Metadata/Schema.js +74 -7
  165. package/lib/esm/Metadata/Schema.js.map +1 -1
  166. package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
  167. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  168. package/lib/esm/Metadata/Unit.js.map +1 -1
  169. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  170. package/lib/esm/PropertyTypes.js.map +1 -1
  171. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  172. package/lib/esm/SchemaKey.d.ts.map +1 -1
  173. package/lib/esm/SchemaKey.js +1 -5
  174. package/lib/esm/SchemaKey.js.map +1 -1
  175. package/lib/esm/SchemaLoader.js.map +1 -1
  176. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  177. package/lib/esm/UnitConversion/Graph.d.ts.map +1 -1
  178. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  179. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  180. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  181. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  182. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  183. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +1 -6
  184. package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
  185. package/lib/esm/UnitProvider/SchemaUnitProvider.js +100 -58
  186. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  187. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  188. package/lib/esm/ecschema-metadata.js.map +1 -1
  189. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  190. package/package.json +10 -10
package/CHANGELOG.md CHANGED
@@ -1,6 +1,35 @@
1
1
  # Change Log - @itwin/ecschema-metadata
2
2
 
3
- This log was last generated on Wed, 25 Sep 2024 20:12:30 GMT and should not be manually modified.
3
+ This log was last generated on Wed, 13 Nov 2024 15:23:38 GMT and should not be manually modified.
4
+
5
+ ## 4.10.0
6
+ Wed, 13 Nov 2024 15:23:38 GMT
7
+
8
+ ### Updates
9
+
10
+ - Deprecate SchemaMatchType.Identical and switch to Exact as default
11
+ - Support inverted units through SchemaUnitsConverter
12
+ - Updated deserialization/serialization logic to handle newer schemas containing unknowns.
13
+
14
+ ## 4.9.5
15
+ Tue, 22 Oct 2024 20:01:40 GMT
16
+
17
+ _Version update only_
18
+
19
+ ## 4.9.4
20
+ Wed, 09 Oct 2024 20:22:04 GMT
21
+
22
+ _Version update only_
23
+
24
+ ## 4.9.3
25
+ Thu, 03 Oct 2024 19:15:45 GMT
26
+
27
+ _Version update only_
28
+
29
+ ## 4.9.2
30
+ Wed, 02 Oct 2024 15:14:43 GMT
31
+
32
+ _Version update only_
4
33
 
5
34
  ## 4.9.1
6
35
  Wed, 25 Sep 2024 20:10:58 GMT
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,MAAa,iBAAiB;;AAA9B,8CAyBC;AAxBC,mBAAmB;AACI,yCAAuB,GAAW,QAAQ,CAAC;AAC3C,yCAAuB,GAAW,QAAQ,CAAC;AAElE,iBAAiB;AACM,sCAAoB,GAAW,QAAQ,CAAC;AACxC,2CAAyB,GAAW,aAAa,CAAC;AAClD,oDAAkC,GAAW,sBAAsB,CAAC;AACpE,2CAAyB,GAAW,aAAa,CAAC;AAClD,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,wCAAsB,GAAW,UAAU,CAAC;AAE5C,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,8CAA4B,GAAW,gBAAgB,CAAC;AACxD,sDAAoC,GAAW,eAAe,CAAC;AAC/D,mDAAiC,GAAW,qBAAqB,CAAC;AAClE,kDAAgC,GAAW,oBAAoB,CAAC;AAChE,2CAAyB,GAAW,aAAa,CAAC;AAElD,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,yDAAuC,GAAW,2BAA2B,CAAC;AAE9E,mCAAiB,GAAW,KAAK,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\r\n/**\r\n * @internal\r\n */\r\nexport class ECStringConstants {\r\n // Relationship End\r\n public static readonly RELATIONSHIP_END_SOURCE: string = \"Source\";\r\n public static readonly RELATIONSHIP_END_TARGET: string = \"Target\";\r\n\r\n // Container Type\r\n public static readonly CONTAINERTYPE_SCHEMA: string = \"Schema\";\r\n public static readonly CONTAINERTYPE_ENTITYCLASS: string = \"EntityClass\";\r\n public static readonly CONTAINERTYPE_CUSTOMATTRIBUTECLASS: string = \"CustomAttributeClass\";\r\n public static readonly CONTAINERTYPE_STRUCTCLASS: string = \"StructClass\";\r\n public static readonly CONTAINERTYPE_RELATIONSHIPCLASS: string = \"RelationshipClass\";\r\n public static readonly CONTAINERTYPE_ANYCLASS: string = \"AnyClass\";\r\n\r\n public static readonly CONTAINERTYPE_PRIMITIVEPROPERTY: string = \"PrimitiveProperty\";\r\n public static readonly CONTAINERTYPE_STRUCTPROPERTY: string = \"StructProperty\";\r\n public static readonly CONTAINERTYPE_PRIMITIVEARRAYPROPERTY: string = \"ArrayProperty\";\r\n public static readonly CONTAINERTYPE_STRUCTARRAYPROPERTY: string = \"StructArrayProperty\";\r\n public static readonly CONTAINERTYPE_NAVIGATIONPROPERTY: string = \"NavigationProperty\";\r\n public static readonly CONTAINERTYPE_ANYPROPERTY: string = \"AnyProperty\";\r\n\r\n public static readonly CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT: string = \"SourceRelationshipConstraint\";\r\n public static readonly CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT: string = \"TargetRelationshipConstraint\";\r\n public static readonly CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT: string = \"AnyRelationshipConstraint\";\r\n\r\n public static readonly CONTAINERTYPE_ANY: string = \"Any\";\r\n}\r\n"]}
1
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,MAAa,iBAAiB;;AAA9B,8CAyBC;AAxBC,mBAAmB;AACI,yCAAuB,GAAW,QAAQ,CAAC;AAC3C,yCAAuB,GAAW,QAAQ,CAAC;AAElE,iBAAiB;AACM,sCAAoB,GAAW,QAAQ,CAAC;AACxC,2CAAyB,GAAW,aAAa,CAAC;AAClD,oDAAkC,GAAW,sBAAsB,CAAC;AACpE,2CAAyB,GAAW,aAAa,CAAC;AAClD,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,wCAAsB,GAAW,UAAU,CAAC;AAE5C,iDAA+B,GAAW,mBAAmB,CAAC;AAC9D,8CAA4B,GAAW,gBAAgB,CAAC;AACxD,sDAAoC,GAAW,eAAe,CAAC;AAC/D,mDAAiC,GAAW,qBAAqB,CAAC;AAClE,kDAAgC,GAAW,oBAAoB,CAAC;AAChE,2CAAyB,GAAW,aAAa,CAAC;AAElD,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,4DAA0C,GAAW,8BAA8B,CAAC;AACpF,yDAAuC,GAAW,2BAA2B,CAAC;AAE9E,mCAAiB,GAAW,KAAK,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\n/**\n * @internal\n */\nexport class ECStringConstants {\n // Relationship End\n public static readonly RELATIONSHIP_END_SOURCE: string = \"Source\";\n public static readonly RELATIONSHIP_END_TARGET: string = \"Target\";\n\n // Container Type\n public static readonly CONTAINERTYPE_SCHEMA: string = \"Schema\";\n public static readonly CONTAINERTYPE_ENTITYCLASS: string = \"EntityClass\";\n public static readonly CONTAINERTYPE_CUSTOMATTRIBUTECLASS: string = \"CustomAttributeClass\";\n public static readonly CONTAINERTYPE_STRUCTCLASS: string = \"StructClass\";\n public static readonly CONTAINERTYPE_RELATIONSHIPCLASS: string = \"RelationshipClass\";\n public static readonly CONTAINERTYPE_ANYCLASS: string = \"AnyClass\";\n\n public static readonly CONTAINERTYPE_PRIMITIVEPROPERTY: string = \"PrimitiveProperty\";\n public static readonly CONTAINERTYPE_STRUCTPROPERTY: string = \"StructProperty\";\n public static readonly CONTAINERTYPE_PRIMITIVEARRAYPROPERTY: string = \"ArrayProperty\";\n public static readonly CONTAINERTYPE_STRUCTARRAYPROPERTY: string = \"StructArrayProperty\";\n public static readonly CONTAINERTYPE_NAVIGATIONPROPERTY: string = \"NavigationProperty\";\n public static readonly CONTAINERTYPE_ANYPROPERTY: string = \"AnyProperty\";\n\n public static readonly CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT: string = \"SourceRelationshipConstraint\";\n public static readonly CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT: string = \"TargetRelationshipConstraint\";\n public static readonly CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT: string = \"AnyRelationshipConstraint\";\n\n public static readonly CONTAINERTYPE_ANY: string = \"Any\";\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedPromise.d.ts","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,qBAAa,cAAc,CAAC,CAAC,CAAE,YAAW,OAAO,CAAC,CAAC,CAAC;IAElD;;;OAGG;gBACS,aAAa,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC;IAS3C,SAAgB,CAAC,M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ACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAjDD,wCAiDC;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AACnD,QAAA,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,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 Utils\r\n */\r\n\r\n/**\r\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\r\n * and resulting value of an asynchronous operation ***that has not yet started***.\r\n *\r\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\r\n * - The DelayedPromise is `await`ed.\r\n * - A callback is attached via `.then()` or `.catch(() => { })`.\r\n * - The asynchronous operation is explicitly started via `.start()`\r\n *\r\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\r\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\r\n *\r\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\r\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\r\n * You could also accomplish something similar by defining an async function as a property getter.\r\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\r\n * additional (non-lazily-loaded) \"nested\" properties can be added.\r\n *\r\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\r\n * @beta\r\n */\r\nexport class DelayedPromise<T> implements Promise<T> {\r\n\r\n /**\r\n * Constructs a DelayedPromise object.\r\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\r\n */\r\n constructor(startCallback: () => Promise<T>) {\r\n let pending: Promise<T> | undefined;\r\n this.start = async () => {\r\n pending = pending || startCallback();\r\n return pending;\r\n };\r\n }\r\n\r\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\r\n public readonly [Symbol.toStringTag] = \"Promise\" as const;\r\n\r\n /**\r\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\r\n */\r\n public start: () => Promise<T>;\r\n\r\n /**\r\n * Attaches callbacks for the resolution and/or rejection of the Promise.\r\n * @param onfulfilled The callback to execute when the Promise is resolved.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of which ever callback is executed.\r\n */\r\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\r\n return this.start().then(onfulfilled, onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the rejection of the Promise.\r\n * @param onrejected The callback to execute when the Promise is rejected.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\r\n return this.start().catch(onrejected);\r\n }\r\n\r\n /**\r\n * Attaches a callback for only the finally clause of the Promise.\r\n * @param onrejected The callback to execute when the Promise is finalized.\r\n * @return A Promise for the completion of the callback.\r\n */\r\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\r\n return this.start().finally(onFinally);\r\n }\r\n}\r\n\r\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\r\n/**\r\n * @beta\r\n */\r\nexport interface NoDelayedPromiseMethods {\r\n [propName: string]: any;\r\n start?: never;\r\n then?: never;\r\n catch?: never;\r\n}\r\n\r\n// See definition of DelayedPromiseWithProps below\r\n/**\r\n * @beta\r\n */\r\nexport interface DelayedPromiseWithPropsConstructor {\r\n\r\n /**\r\n * Constructs a DelayedPromiseWithProps object, which is at once both:\r\n * - A DelayedPromise object representing the eventual completion (or failure)\r\n * of an asynchronous operation returning a value of type `TPayload`\r\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\r\n *\r\n * @param props An object with properties and methods that will be accessible\r\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\r\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\r\n */\r\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\r\n}\r\n\r\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\r\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\r\n/**\r\n * @beta\r\n */\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\r\n constructor(props: TProps, cb: () => Promise<TPayload>) {\r\n super(cb);\r\n\r\n const handler = {\r\n get: (target: TProps, name: string) => {\r\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\r\n },\r\n };\r\n\r\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\r\n }\r\n}) as DelayedPromiseWithPropsConstructor;\r\n\r\n/* eslint-disable @typescript-eslint/no-redeclare */\r\n\r\n/** Define the type of a DelayedPromiseWithProps instance\r\n * @beta\r\n */\r\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\r\n"]}
1
+ {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,cAAc;IAEzB;;;OAGG;IACH,YAAY,aAA+B;QAQ3C,qGAAqG;QACrF,QAAoB,GAAG,SAAkB,CAAC;QARxD,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAUD;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAjDD,wCAiDC;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AACnD,QAAA,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,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 Utils\n */\n\n/**\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\n * and resulting value of an asynchronous operation ***that has not yet started***.\n *\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\n * - The DelayedPromise is `await`ed.\n * - A callback is attached via `.then()` or `.catch(() => { })`.\n * - The asynchronous operation is explicitly started via `.start()`\n *\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\n *\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\n * You could also accomplish something similar by defining an async function as a property getter.\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\n * additional (non-lazily-loaded) \"nested\" properties can be added.\n *\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\n * @beta\n */\nexport class DelayedPromise<T> implements Promise<T> {\n\n /**\n * Constructs a DelayedPromise object.\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\n */\n constructor(startCallback: () => Promise<T>) {\n let pending: Promise<T> | undefined;\n this.start = async () => {\n pending = pending || startCallback();\n return pending;\n };\n }\n\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\n public readonly [Symbol.toStringTag] = \"Promise\" as const;\n\n /**\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\n */\n public start: () => Promise<T>;\n\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of which ever callback is executed.\n */\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n return this.start().then(onfulfilled, onrejected);\n }\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of the callback.\n */\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\n return this.start().catch(onrejected);\n }\n\n /**\n * Attaches a callback for only the finally clause of the Promise.\n * @param onrejected The callback to execute when the Promise is finalized.\n * @return A Promise for the completion of the callback.\n */\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\n return this.start().finally(onFinally);\n }\n}\n\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\n/**\n * @beta\n */\nexport interface NoDelayedPromiseMethods {\n [propName: string]: any;\n start?: never;\n then?: never;\n catch?: never;\n}\n\n// See definition of DelayedPromiseWithProps below\n/**\n * @beta\n */\nexport interface DelayedPromiseWithPropsConstructor {\n\n /**\n * Constructs a DelayedPromiseWithProps object, which is at once both:\n * - A DelayedPromise object representing the eventual completion (or failure)\n * of an asynchronous operation returning a value of type `TPayload`\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\n *\n * @param props An object with properties and methods that will be accessible\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\n */\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\n}\n\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\n/**\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\n constructor(props: TProps, cb: () => Promise<TPayload>) {\n super(cb);\n\n const handler = {\n get: (target: TProps, name: string) => {\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\n },\n };\n\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\n }\n}) as DelayedPromiseWithPropsConstructor;\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/** Define the type of a DelayedPromiseWithProps instance\n * @beta\n */\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps, NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps, SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps } from "../Deserialization/JsonProps";
2
2
  import { CustomAttribute } from "../Metadata/CustomAttribute";
3
3
  import { CustomAttributeClass } from "../Metadata/CustomAttributeClass";
4
+ import { ECSpecVersion } from "./Helper";
4
5
  type SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;
5
6
  type PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;
6
7
  /** @internal */
@@ -9,6 +10,7 @@ export type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomA
9
10
  export type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;
10
11
  /** @internal */
11
12
  export declare abstract class AbstractParser<TItem = any, TProperty = TItem> {
13
+ protected _ecSpecVersion?: ECSpecVersion;
12
14
  abstract parseSchema(): SchemaProps;
13
15
  abstract getReferences(): Iterable<SchemaReferenceProps>;
14
16
  abstract getItems(): Iterable<SchemaItemTuple<TItem>>;
@@ -37,6 +39,7 @@ export declare abstract class AbstractParser<TItem = any, TProperty = TItem> {
37
39
  abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;
38
40
  abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;
39
41
  abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple>, Iterable<CAProviderTuple>];
42
+ abstract get getECSpecVersion(): ECSpecVersion | undefined;
40
43
  }
41
44
  /** @internal */
42
45
  export interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> {
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractParser.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EAAE,yBAAyB,EAA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GAAG,uBAAuB;aAE3E,iCAAiC,IAAI,QAAQ,CAAC,eAAe,CAAC;aAC9D,gCAAgC,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;aAClF,mCAAmC,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC;aACzF,iDAAiD,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAe,QAAQ,CAAC,eAAe,CAAC,CAAc;IAC1K,aAAoB,gBAAgB,IAAI,aAAa,GAAG,SAAS,CAAC;CACnE;AAED,gBAAgB;AAEhB,MAAM,WAAW,yBAAyB,CAAC,OAAO,EAAE,KAAK,GAAG,GAAG,EAAE,SAAS,GAAG,KAAK;IAAI,KAAI,GAAG,EAAE,QAAQ,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;CAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAmB/F,gBAAgB;AAChB,MAAsB,cAAc;CAiCnC;AAjCD,wCAiCC","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\r\nimport {\r\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\r\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\r\n SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\r\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\r\n\r\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\r\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\r\n\r\n/** @internal */\r\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\r\n\r\n/** @internal */\r\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\r\n\r\n/** @internal */\r\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\r\n public abstract parseSchema(): SchemaProps;\r\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\r\n\r\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\r\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\r\n\r\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\r\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\r\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\r\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\r\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\r\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\r\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\r\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\r\n public abstract parseUnit(data: Readonly<TItem>): SchemaItemUnitProps;\r\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\r\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\r\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\r\n public abstract parseFormat(data: Readonly<TItem>): SchemaItemFormatProps;\r\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\r\n\r\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\r\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\r\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\r\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\r\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\r\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\r\n\r\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\r\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\r\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\r\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\r\n}\r\n\r\n/** @internal */\r\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\r\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\r\n"]}
1
+ {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAoB/F,gBAAgB;AAChB,MAAsB,cAAc;CAoCnC;AApCD,wCAoCC","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\nimport {\n ConstantProps, CustomAttributeClassProps, EntityClassProps, EnumerationProps, InvertedUnitProps, KindOfQuantityProps, MixinProps,\n NavigationPropertyProps, PhenomenonProps, PrimitiveArrayPropertyProps, PrimitivePropertyProps, PropertyCategoryProps, RelationshipClassProps,\n SchemaItemFormatProps, SchemaItemUnitProps, SchemaProps, SchemaReferenceProps, StructArrayPropertyProps, StructClassProps, StructPropertyProps, UnitSystemProps,\n} from \"../Deserialization/JsonProps\";\nimport { CustomAttribute } from \"../Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"../Metadata/CustomAttributeClass\";\nimport { ECSpecVersion } from \"./Helper\";\n\ntype SchemaItemTuple<T> = Readonly<[string /** Name */, string /** SchemaItemType */, Readonly<T>]>;\ntype PropertyTuple<T> = Readonly<[string /** Name */, string /** Property */, Readonly<T>]>;\n\n/** @internal */\nexport type CustomAttributeProvider = (caClass: CustomAttributeClass) => CustomAttribute;\n\n/** @internal */\nexport type CAProviderTuple = Readonly<[string /** Full Name */, CustomAttributeProvider]>;\n\n/** @internal */\nexport abstract class AbstractParser<TItem = any, TProperty = TItem> {\n protected _ecSpecVersion?: ECSpecVersion;\n\n public abstract parseSchema(): SchemaProps;\n public abstract getReferences(): Iterable<SchemaReferenceProps>;\n\n public abstract getItems(): Iterable<SchemaItemTuple<TItem>>;\n public abstract findItem(itemName: string): SchemaItemTuple<TItem> | undefined;\n\n public abstract parseEntityClass(data: Readonly<TItem>): EntityClassProps;\n public abstract parseMixin(data: Readonly<TItem>): MixinProps;\n public abstract parseStructClass(data: Readonly<TItem>): StructClassProps;\n public abstract parseCustomAttributeClass(data: Readonly<TItem>): CustomAttributeClassProps;\n public abstract parseRelationshipClass(data: Readonly<TItem>): RelationshipClassProps;\n public abstract parseEnumeration(data: Readonly<TItem>): EnumerationProps;\n public abstract parseKindOfQuantity(data: Readonly<TItem>): KindOfQuantityProps;\n public abstract parsePropertyCategory(data: Readonly<TItem>): PropertyCategoryProps;\n public abstract parseUnit(data: Readonly<TItem>): SchemaItemUnitProps;\n public abstract parseInvertedUnit(data: Readonly<TItem>): InvertedUnitProps;\n public abstract parseConstant(data: Readonly<TItem>): ConstantProps;\n public abstract parsePhenomenon(data: Readonly<TItem>): PhenomenonProps;\n public abstract parseFormat(data: Readonly<TItem>): SchemaItemFormatProps;\n public abstract parseUnitSystem(data: Readonly<TItem>): UnitSystemProps;\n\n public abstract getProperties(data: Readonly<TItem>, itemName: string): Iterable<PropertyTuple<TProperty>>;\n public abstract parsePrimitiveProperty(data: Readonly<TProperty>): PrimitivePropertyProps;\n public abstract parseStructProperty(data: Readonly<TProperty>): StructPropertyProps;\n public abstract parsePrimitiveArrayProperty(data: Readonly<TProperty>): PrimitiveArrayPropertyProps;\n public abstract parseStructArrayProperty(data: Readonly<TProperty>): StructArrayPropertyProps;\n public abstract parseNavigationProperty(data: Readonly<TProperty>): NavigationPropertyProps;\n\n public abstract getSchemaCustomAttributeProviders(): Iterable<CAProviderTuple>;\n public abstract getClassCustomAttributeProviders(data: Readonly<TItem>): Iterable<CAProviderTuple>;\n public abstract getPropertyCustomAttributeProviders(data: Readonly<TProperty>): Iterable<CAProviderTuple>;\n public abstract getRelationshipConstraintCustomAttributeProviders(data: Readonly<TItem>): [Iterable<CAProviderTuple> /* source */, Iterable<CAProviderTuple> /* target */];\n public abstract get getECSpecVersion(): ECSpecVersion | undefined;\n}\n\n/** @internal */\n// eslint-disable-next-line @typescript-eslint/prefer-function-type\nexport interface AbstractParserConstructor<TSchema, TItem = any, TProperty = TItem> { new(obj: Readonly<TSchema>): AbstractParser<TItem, TProperty> }\n"]}
@@ -3,6 +3,14 @@ import { SchemaInfo } from "../Interfaces";
3
3
  import { Schema } from "../Metadata/Schema";
4
4
  import { ISchemaPartVisitor } from "../SchemaPartVisitorDelegate";
5
5
  import { AbstractParserConstructor } from "./AbstractParser";
6
+ /**
7
+ * Specifies the version specification for the schema
8
+ * @internal
9
+ */
10
+ export interface ECSpecVersion {
11
+ readVersion: number;
12
+ writeVersion: number;
13
+ }
6
14
  /**
7
15
  * This class properly handles the order the deserialization of ECSchemas and SchemaItems from serialized formats.
8
16
  * For example, when deserializing an ECClass most times all base class should be de-serialized before the given class.
@@ -259,5 +267,6 @@ export declare class SchemaReadHelper<T = unknown> {
259
267
  * @param customAttributes An iterable set of parsed CustomAttribute objects.
260
268
  */
261
269
  private loadCustomAttributesSync;
270
+ static isECSpecVersionNewer(ecSpecVersion?: ECSpecVersion): boolean;
262
271
  }
263
272
  //# sourceMappingURL=Helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Helper.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/Helper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,OAAO,EAA2B,UAAU,EAAE,MAAM,eAAe,CAAC;AAWpE,OAAO,EAAiB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAI3D,OAAO,EAAE,kBAAkB,EAA6B,MAAM,8BAA8B,CAAC;AAE7F,OAAO,EAAkB,yBAAyB,EAAmB,MAAM,kBAAkB,CAAC;AAO9F;;;;GAIG;AACH,qBAAa,gBAAgB,CAAC,CAAC,GAAG,OAAO;IACvC,OAAO,CAAC,QAAQ,CAAgB;IAChC,OAAO,CAAC,cAAc,CAAC,CAA4B;IACnD,OAAO,CAAC,WAAW,CAAwC;IAC3D,OAAO,CAAC,OAAO,CAA2B;IAI1C,OAAO,CAAC,OAAO,CAAC,CAAS;IACzB,OAAO,CAAC,WAAW,CAAC,CAAa;gBAErB,UAAU,EAAE,yBAAyB,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,kBAAkB;IAM3G;;;;;;OAMG;IACU,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC;IA+B3F;;;;OAIG;IACU,UAAU,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;YAahE,UAAU;IAgCxB;;;;OAIG;IACI,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS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BAAoB;IAmBlC;;;;OAIG;IACH,OAAO,CAAC,wBAAwB;WAYlB,oBAAoB,CAAC,aAAa,CAAC,EAAE,aAAa,GAAG,OAAO;CAM3E"}
@@ -8,6 +8,7 @@ exports.SchemaReadHelper = void 0;
8
8
  const Context_1 = require("../Context");
9
9
  const ECObjects_1 = require("../ECObjects");
10
10
  const Exception_1 = require("../Exception");
11
+ const Schema_1 = require("../Metadata/Schema");
11
12
  const SchemaItem_1 = require("../Metadata/SchemaItem");
12
13
  const SchemaKey_1 = require("../SchemaKey");
13
14
  const SchemaPartVisitorDelegate_1 = require("../SchemaPartVisitorDelegate");
@@ -725,14 +726,19 @@ class SchemaReadHelper {
725
726
  */
726
727
  async loadPropertyTypes(classObj, propName, propType, rawProperty) {
727
728
  const loadTypeName = async (typeName) => {
728
- if (undefined === (0, ECObjects_1.parsePrimitiveType)(typeName))
729
+ if (undefined === (0, ECObjects_1.parsePrimitiveType)(typeName)) {
730
+ if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
731
+ return Exception_1.ECObjectsStatus.NewerECSpecVersion;
729
732
  await this.findSchemaItem(typeName);
733
+ }
734
+ return Exception_1.ECObjectsStatus.Success;
730
735
  };
731
736
  const lowerCasePropType = propType.toLowerCase();
732
737
  switch (lowerCasePropType) {
733
738
  case "primitiveproperty":
734
739
  const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
735
- await loadTypeName(primPropertyProps.typeName);
740
+ if (await loadTypeName(primPropertyProps.typeName) === Exception_1.ECObjectsStatus.NewerECSpecVersion)
741
+ primPropertyProps.typeName = "string";
736
742
  const primProp = await classObj.createPrimitiveProperty(propName, primPropertyProps.typeName);
737
743
  return this.loadProperty(primProp, primPropertyProps, rawProperty);
738
744
  case "structproperty":
@@ -742,7 +748,8 @@ class SchemaReadHelper {
742
748
  return this.loadProperty(structProp, structPropertyProps, rawProperty);
743
749
  case "primitivearrayproperty":
744
750
  const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
745
- await loadTypeName(primArrPropertyProps.typeName);
751
+ if (await loadTypeName(primArrPropertyProps.typeName) === Exception_1.ECObjectsStatus.NewerECSpecVersion)
752
+ primArrPropertyProps.typeName = "string";
746
753
  const primArrProp = await classObj.createPrimitiveArrayProperty(propName, primArrPropertyProps.typeName);
747
754
  return this.loadProperty(primArrProp, primArrPropertyProps, rawProperty);
748
755
  case "structarrayproperty":
@@ -768,14 +775,19 @@ class SchemaReadHelper {
768
775
  */
769
776
  loadPropertyTypesSync(classObj, propName, propType, rawProperty) {
770
777
  const loadTypeName = (typeName) => {
771
- if (undefined === (0, ECObjects_1.parsePrimitiveType)(typeName))
778
+ if (undefined === (0, ECObjects_1.parsePrimitiveType)(typeName)) {
779
+ if (SchemaReadHelper.isECSpecVersionNewer(this._parser.getECSpecVersion))
780
+ return Exception_1.ECObjectsStatus.NewerECSpecVersion;
772
781
  this.findSchemaItemSync(typeName);
782
+ }
783
+ return Exception_1.ECObjectsStatus.Success;
773
784
  };
774
785
  const lowerCasePropType = propType.toLowerCase();
775
786
  switch (lowerCasePropType) {
776
787
  case "primitiveproperty":
777
788
  const primPropertyProps = this._parser.parsePrimitiveProperty(rawProperty);
778
- loadTypeName(primPropertyProps.typeName);
789
+ if (loadTypeName(primPropertyProps.typeName) === Exception_1.ECObjectsStatus.NewerECSpecVersion)
790
+ primPropertyProps.typeName = "string";
779
791
  const primProp = classObj.createPrimitivePropertySync(propName, primPropertyProps.typeName);
780
792
  return this.loadPropertySync(primProp, primPropertyProps, rawProperty);
781
793
  case "structproperty":
@@ -785,7 +797,8 @@ class SchemaReadHelper {
785
797
  return this.loadPropertySync(structProp, structPropertyProps, rawProperty);
786
798
  case "primitivearrayproperty":
787
799
  const primArrPropertyProps = this._parser.parsePrimitiveArrayProperty(rawProperty);
788
- loadTypeName(primArrPropertyProps.typeName);
800
+ if (loadTypeName(primArrPropertyProps.typeName) === Exception_1.ECObjectsStatus.NewerECSpecVersion)
801
+ primArrPropertyProps.typeName = "string";
789
802
  const primArrProp = classObj.createPrimitiveArrayPropertySync(propName, primArrPropertyProps.typeName);
790
803
  return this.loadPropertySync(primArrProp, primArrPropertyProps, rawProperty);
791
804
  case "structarrayproperty":
@@ -870,6 +883,11 @@ class SchemaReadHelper {
870
883
  container.addCustomAttribute(customAttribute);
871
884
  }
872
885
  }
886
+ static isECSpecVersionNewer(ecSpecVersion) {
887
+ if (ecSpecVersion === undefined || ecSpecVersion.readVersion === undefined || ecSpecVersion.writeVersion === undefined)
888
+ return false;
889
+ return ((ecSpecVersion.readVersion > Schema_1.Schema.currentECSpecMajorVersion) || (ecSpecVersion.readVersion === Schema_1.Schema.currentECSpecMajorVersion && ecSpecVersion.writeVersion > Schema_1.Schema.currentECSpecMinorVersion));
890
+ }
873
891
  }
874
892
  exports.SchemaReadHelper = SchemaReadHelper;
875
893
  //# sourceMappingURL=Helper.js.map