@itwin/ecschema-metadata 5.0.0-dev.32 → 5.0.0-dev.35

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 (172) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Constants.js +20 -20
  3. package/lib/cjs/Constants.js.map +1 -1
  4. package/lib/cjs/DelayedPromise.js +1 -1
  5. package/lib/cjs/DelayedPromise.js.map +1 -1
  6. package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
  7. package/lib/cjs/Deserialization/Helper.js.map +1 -1
  8. package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
  9. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  10. package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
  11. package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
  12. package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
  13. package/lib/cjs/ECName.js.map +1 -1
  14. package/lib/cjs/ECObjects.js.map +1 -1
  15. package/lib/cjs/Exception.js.map +1 -1
  16. package/lib/cjs/Interfaces.js.map +1 -1
  17. package/lib/cjs/Metadata/Class.d.ts +1 -2
  18. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  19. package/lib/cjs/Metadata/Class.js +2 -2
  20. package/lib/cjs/Metadata/Class.js.map +1 -1
  21. package/lib/cjs/Metadata/Constant.d.ts +1 -1
  22. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  23. package/lib/cjs/Metadata/Constant.js.map +1 -1
  24. package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
  25. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +2 -4
  26. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  27. package/lib/cjs/Metadata/CustomAttributeClass.js +4 -4
  28. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  29. package/lib/cjs/Metadata/EntityClass.d.ts +2 -4
  30. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  31. package/lib/cjs/Metadata/EntityClass.js +2 -2
  32. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  33. package/lib/cjs/Metadata/Enumeration.d.ts +1 -1
  34. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  35. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  36. package/lib/cjs/Metadata/Format.d.ts +1 -1
  37. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  38. package/lib/cjs/Metadata/Format.js.map +1 -1
  39. package/lib/cjs/Metadata/InvertedUnit.d.ts +1 -3
  40. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  41. package/lib/cjs/Metadata/InvertedUnit.js +2 -2
  42. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  43. package/lib/cjs/Metadata/KindOfQuantity.d.ts +1 -3
  44. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  45. package/lib/cjs/Metadata/KindOfQuantity.js +6 -6
  46. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  47. package/lib/cjs/Metadata/Mixin.d.ts +1 -1
  48. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  49. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  50. package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
  51. package/lib/cjs/Metadata/Phenomenon.d.ts +1 -1
  52. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  53. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  54. package/lib/cjs/Metadata/Property.js.map +1 -1
  55. package/lib/cjs/Metadata/PropertyCategory.d.ts +1 -1
  56. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  57. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  58. package/lib/cjs/Metadata/RelationshipClass.d.ts +1 -1
  59. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  60. package/lib/cjs/Metadata/RelationshipClass.js +4 -4
  61. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  62. package/lib/cjs/Metadata/Schema.js +1 -1
  63. package/lib/cjs/Metadata/Schema.js.map +1 -1
  64. package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
  65. package/lib/cjs/Metadata/Unit.d.ts +1 -1
  66. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  67. package/lib/cjs/Metadata/Unit.js.map +1 -1
  68. package/lib/cjs/Metadata/UnitSystem.d.ts +1 -3
  69. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  70. package/lib/cjs/Metadata/UnitSystem.js +2 -2
  71. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  72. package/lib/cjs/PropertyTypes.js.map +1 -1
  73. package/lib/cjs/SchemaJsonLocater.js.map +1 -1
  74. package/lib/cjs/SchemaKey.js.map +1 -1
  75. package/lib/cjs/SchemaLoader.js.map +1 -1
  76. package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
  77. package/lib/cjs/UnitConversion/Graph.js.map +1 -1
  78. package/lib/cjs/UnitConversion/Parser.js.map +1 -1
  79. package/lib/cjs/UnitConversion/UnitConversion.js +2 -2
  80. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  81. package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
  82. package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
  83. package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
  84. package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
  85. package/lib/cjs/ecschema-metadata.js.map +1 -1
  86. package/lib/cjs/utils/SchemaGraph.js.map +1 -1
  87. package/lib/esm/Constants.js +20 -20
  88. package/lib/esm/Constants.js.map +1 -1
  89. package/lib/esm/DelayedPromise.js +1 -1
  90. package/lib/esm/DelayedPromise.js.map +1 -1
  91. package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
  92. package/lib/esm/Deserialization/Helper.js.map +1 -1
  93. package/lib/esm/Deserialization/JsonParser.js.map +1 -1
  94. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  95. package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
  96. package/lib/esm/Deserialization/XmlParser.js.map +1 -1
  97. package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
  98. package/lib/esm/ECName.js.map +1 -1
  99. package/lib/esm/ECObjects.js.map +1 -1
  100. package/lib/esm/Exception.js.map +1 -1
  101. package/lib/esm/Interfaces.js.map +1 -1
  102. package/lib/esm/Metadata/Class.d.ts +1 -2
  103. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  104. package/lib/esm/Metadata/Class.js +2 -2
  105. package/lib/esm/Metadata/Class.js.map +1 -1
  106. package/lib/esm/Metadata/Constant.d.ts +1 -1
  107. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  108. package/lib/esm/Metadata/Constant.js.map +1 -1
  109. package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
  110. package/lib/esm/Metadata/CustomAttributeClass.d.ts +2 -4
  111. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  112. package/lib/esm/Metadata/CustomAttributeClass.js +4 -4
  113. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  114. package/lib/esm/Metadata/EntityClass.d.ts +2 -4
  115. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  116. package/lib/esm/Metadata/EntityClass.js +2 -2
  117. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  118. package/lib/esm/Metadata/Enumeration.d.ts +1 -1
  119. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  120. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  121. package/lib/esm/Metadata/Format.d.ts +1 -1
  122. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  123. package/lib/esm/Metadata/Format.js.map +1 -1
  124. package/lib/esm/Metadata/InvertedUnit.d.ts +1 -3
  125. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  126. package/lib/esm/Metadata/InvertedUnit.js +2 -2
  127. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  128. package/lib/esm/Metadata/KindOfQuantity.d.ts +1 -3
  129. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  130. package/lib/esm/Metadata/KindOfQuantity.js +6 -6
  131. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  132. package/lib/esm/Metadata/Mixin.d.ts +1 -1
  133. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  134. package/lib/esm/Metadata/Mixin.js.map +1 -1
  135. package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
  136. package/lib/esm/Metadata/Phenomenon.d.ts +1 -1
  137. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  138. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  139. package/lib/esm/Metadata/Property.js.map +1 -1
  140. package/lib/esm/Metadata/PropertyCategory.d.ts +1 -1
  141. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  142. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  143. package/lib/esm/Metadata/RelationshipClass.d.ts +1 -1
  144. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  145. package/lib/esm/Metadata/RelationshipClass.js +4 -4
  146. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  147. package/lib/esm/Metadata/Schema.js +1 -1
  148. package/lib/esm/Metadata/Schema.js.map +1 -1
  149. package/lib/esm/Metadata/SchemaItem.js.map +1 -1
  150. package/lib/esm/Metadata/Unit.d.ts +1 -1
  151. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  152. package/lib/esm/Metadata/Unit.js.map +1 -1
  153. package/lib/esm/Metadata/UnitSystem.d.ts +1 -3
  154. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  155. package/lib/esm/Metadata/UnitSystem.js +2 -2
  156. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  157. package/lib/esm/PropertyTypes.js.map +1 -1
  158. package/lib/esm/SchemaJsonLocater.js.map +1 -1
  159. package/lib/esm/SchemaKey.js.map +1 -1
  160. package/lib/esm/SchemaLoader.js.map +1 -1
  161. package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
  162. package/lib/esm/UnitConversion/Graph.js.map +1 -1
  163. package/lib/esm/UnitConversion/Parser.js.map +1 -1
  164. package/lib/esm/UnitConversion/UnitConversion.js +2 -2
  165. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  166. package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
  167. package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
  168. package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
  169. package/lib/esm/Validation/SchemaWalker.js.map +1 -1
  170. package/lib/esm/ecschema-metadata.js.map +1 -1
  171. package/lib/esm/utils/SchemaGraph.js.map +1 -1
  172. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaWalker.js","sourceRoot":"","sources":["../../../src/Validation/SchemaWalker.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,4CAA8C;AAC9C,6CAA4C;AAI5C,4EAA6F;AAE7F;;;;GAIG;AACH,MAAa,YAAY;IAOvB;;;OAGG;IACH,YAAY,OAA2B;QACrC,IAAI,CAAC,cAAc,GAAG,IAAI,qDAAyB,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,cAAc,CAAmB,MAAS;QACrD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAElD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACxC,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,UAAsB;QACrD,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAEtD,IAAI,eAAO,CAAC,SAAS,CAAC,UAAU,CAAC;YAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,OAAgB;QAC1C,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC1C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,cAAc,KAAK,0BAAc,CAAC,iBAAiB,EAAE,CAAC;YAChE,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAE,OAA6B,CAAC,MAAM,CAAC,CAAC;YACjF,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAE,OAA6B,CAAC,MAAM,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AAjDD,oCAiDC","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 { SchemaItemType } from \"../ECObjects\";\nimport { ECClass } from \"../Metadata/Class\";\nimport { RelationshipClass } from \"../Metadata/RelationshipClass\";\nimport { Schema } from \"../Metadata/Schema\";\nimport { SchemaItem } from \"../Metadata/SchemaItem\";\nimport { ISchemaPartVisitor, SchemaPartVisitorDelegate } from \"../SchemaPartVisitorDelegate\";\n\n/**\n * The purpose of this class is to traverse a given schema, allowing clients to hook into\n * the traversal process via Visitors to allow for custom processing of the schema elements.\n * @internal\n */\nexport class SchemaWalker {\n private _visitorHelper: SchemaPartVisitorDelegate;\n\n // This is a cache of the schema we are traversing. The schema also exists within the _context but in order\n // to not have to go back to the context every time we use this cache.\n private _schema?: Schema;\n\n /**\n * Initializes a new SchemaWalker instance.\n * @param visitor An ISchemaWalkerVisitor implementation whose methods will be called during schema traversal.\n */\n constructor(visitor: ISchemaPartVisitor) {\n this._visitorHelper = new SchemaPartVisitorDelegate(visitor);\n }\n\n /**\n * Traverses the given Schema, calling ISchemaWalkerVisitor methods along the way.\n * @param schema The Schema to traverse.\n */\n public async traverseSchema<T extends Schema>(schema: T): Promise<T> {\n this._schema = schema;\n\n await this._visitorHelper.visitSchema(schema);\n await this._visitorHelper.visitSchemaPart(schema);\n\n for (const item of this._schema.getItems())\n await this.traverseSchemaItem(item);\n return schema;\n }\n\n private async traverseSchemaItem(schemaItem: SchemaItem): Promise<void> {\n await this._visitorHelper.visitSchemaPart(schemaItem);\n\n if (ECClass.isECClass(schemaItem))\n await this.traverseClass(schemaItem);\n }\n\n private async traverseClass(ecClass: ECClass): Promise<void> {\n if (ecClass.properties) {\n for (const property of ecClass.properties) {\n await this._visitorHelper.visitSchemaPart(property);\n }\n }\n\n if (ecClass.schemaItemType === SchemaItemType.RelationshipClass) {\n await this._visitorHelper.visitSchemaPart((ecClass as RelationshipClass).source);\n await this._visitorHelper.visitSchemaPart((ecClass as RelationshipClass).target);\n }\n }\n}\n"]}
1
+ {"version":3,"file":"SchemaWalker.js","sourceRoot":"","sources":["../../../src/Validation/SchemaWalker.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,4CAA8C;AAC9C,6CAA4C;AAI5C,4EAA6F;AAE7F;;;;GAIG;AACH,MAAa,YAAY;IAOvB;;;OAGG;IACH,YAAY,OAA2B;QACrC,IAAI,CAAC,cAAc,GAAG,IAAI,qDAAyB,CAAC,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,cAAc,CAAmB,MAAS;QACrD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,MAAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAElD,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE;YACxC,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACtC,OAAO,MAAM,CAAC;IAChB,CAAC;IAEO,KAAK,CAAC,kBAAkB,CAAC,UAAsB;QACrD,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;QAEtD,IAAI,eAAO,CAAC,SAAS,CAAC,UAAU,CAAC;YAC/B,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IAEO,KAAK,CAAC,aAAa,CAAC,OAAgB;QAC1C,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,KAAK,MAAM,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;gBAC1C,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;YACtD,CAAC;QACH,CAAC;QAED,IAAI,OAAO,CAAC,cAAc,KAAK,0BAAc,CAAC,iBAAiB,EAAE,CAAC;YAChE,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAE,OAA6B,CAAC,MAAM,CAAC,CAAC;YACjF,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAE,OAA6B,CAAC,MAAM,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF;AAjDD,oCAiDC","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 { SchemaItemType } from \"../ECObjects\";\r\nimport { ECClass } from \"../Metadata/Class\";\r\nimport { RelationshipClass } from \"../Metadata/RelationshipClass\";\r\nimport { Schema } from \"../Metadata/Schema\";\r\nimport { SchemaItem } from \"../Metadata/SchemaItem\";\r\nimport { ISchemaPartVisitor, SchemaPartVisitorDelegate } from \"../SchemaPartVisitorDelegate\";\r\n\r\n/**\r\n * The purpose of this class is to traverse a given schema, allowing clients to hook into\r\n * the traversal process via Visitors to allow for custom processing of the schema elements.\r\n * @internal\r\n */\r\nexport class SchemaWalker {\r\n private _visitorHelper: SchemaPartVisitorDelegate;\r\n\r\n // This is a cache of the schema we are traversing. The schema also exists within the _context but in order\r\n // to not have to go back to the context every time we use this cache.\r\n private _schema?: Schema;\r\n\r\n /**\r\n * Initializes a new SchemaWalker instance.\r\n * @param visitor An ISchemaWalkerVisitor implementation whose methods will be called during schema traversal.\r\n */\r\n constructor(visitor: ISchemaPartVisitor) {\r\n this._visitorHelper = new SchemaPartVisitorDelegate(visitor);\r\n }\r\n\r\n /**\r\n * Traverses the given Schema, calling ISchemaWalkerVisitor methods along the way.\r\n * @param schema The Schema to traverse.\r\n */\r\n public async traverseSchema<T extends Schema>(schema: T): Promise<T> {\r\n this._schema = schema;\r\n\r\n await this._visitorHelper.visitSchema(schema);\r\n await this._visitorHelper.visitSchemaPart(schema);\r\n\r\n for (const item of this._schema.getItems())\r\n await this.traverseSchemaItem(item);\r\n return schema;\r\n }\r\n\r\n private async traverseSchemaItem(schemaItem: SchemaItem): Promise<void> {\r\n await this._visitorHelper.visitSchemaPart(schemaItem);\r\n\r\n if (ECClass.isECClass(schemaItem))\r\n await this.traverseClass(schemaItem);\r\n }\r\n\r\n private async traverseClass(ecClass: ECClass): Promise<void> {\r\n if (ecClass.properties) {\r\n for (const property of ecClass.properties) {\r\n await this._visitorHelper.visitSchemaPart(property);\r\n }\r\n }\r\n\r\n if (ecClass.schemaItemType === SchemaItemType.RelationshipClass) {\r\n await this._visitorHelper.visitSchemaPart((ecClass as RelationshipClass).source);\r\n await this._visitorHelper.visitSchemaPart((ecClass as RelationshipClass).target);\r\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MAAM,OAAA;AACf,wDAAsC;AACtC,wCAAuC;AAA9B,4FAAA,IAAI,OAAA;AACb,oDAAmD;AAA1C,wGAAA,UAAU,OAAA;AACnB,kDAAgC;AAChC,sDAAoC;AACpC,8CAA4B;AAC5B,iDAA+B;AAC/B,kEAAgD;AAChD,iEAA+C;AAC/C,oEAAkD;AAClD,4DAA0C;AAC1C,8DAA4C;AAE5C,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAEpB;;GAEG;AACH;;;GAGG;AACH;;;GAGG","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\nexport * from \"./Constants\";\nexport * from \"./Context\";\nexport * from \"./DelayedPromise\";\nexport * from \"./Deserialization/SchemaGraphUtil\";\nexport * from \"./Deserialization/JsonProps\";\nexport * from \"./Deserialization/Helper\";\nexport * from \"./Deserialization/XmlParser\";\nexport * from \"./ECName\";\nexport * from \"./ECObjects\";\nexport * from \"./Exception\";\nexport * from \"./Interfaces\";\nexport { ECClass, StructClass } from \"./Metadata/Class\";\nexport { Constant } from \"./Metadata/Constant\";\nexport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nexport { EntityClass } from \"./Metadata/EntityClass\";\nexport { AnyEnumerator, Enumeration, Enumerator } from \"./Metadata/Enumeration\";\nexport { Format } from \"./Metadata/Format\";\nexport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nexport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nexport { Mixin } from \"./Metadata/Mixin\";\nexport * from \"./Metadata/OverrideFormat\";\nexport { Phenomenon } from \"./Metadata/Phenomenon\";\nexport {\n Property, PrimitiveProperty, PrimitiveArrayProperty, EnumerationProperty, StructProperty,\n StructArrayProperty, EnumerationArrayProperty, NavigationProperty, AnyArrayProperty, AnyEnumerationProperty,\n AnyPrimitiveProperty, AnyProperty, AnyStructProperty, ArrayProperty, PrimitiveOrEnumPropertyBase,\n} from \"./Metadata/Property\";\nexport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nexport { RelationshipClass, RelationshipConstraint, RelationshipMultiplicity } from \"./Metadata/RelationshipClass\";\nexport { Schema } from \"./Metadata/Schema\";\nexport * from \"./Metadata/SchemaItem\";\nexport { Unit } from \"./Metadata/Unit\";\nexport { UnitSystem } from \"./Metadata/UnitSystem\";\nexport * from \"./PropertyTypes\";\nexport * from \"./SchemaJsonLocater\";\nexport * from \"./SchemaKey\";\nexport * from \"./SchemaLoader\";\nexport * from \"./UnitConversion/UnitConversion\";\nexport * from \"./UnitConversion/UnitConverter\";\nexport * from \"./UnitProvider/SchemaUnitProvider\";\nexport * from \"./Validation/SchemaWalker\";\nexport * from \"./SchemaPartVisitorDelegate\";\nexport { CustomAttribute, CustomAttributeContainerProps} from \"./Metadata/CustomAttribute\";\nexport { SchemaGraph } from \"./utils/SchemaGraph\";\n\n/** @docs-package-description\n * The ecschema-metadata package contains classes for working with ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\n */\n/**\n * @docs-group-description Metadata\n * Definitions of classes and interfaces that represent all [EC elements]($docs/bis/ec/index.md).\n */\n/**\n * @docs-group-description Utils\n * A set of utility classes used throughout the package.\n */\n"]}
1
+ {"version":3,"file":"ecschema-metadata.js","sourceRoot":"","sources":["../../src/ecschema-metadata.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;;AAE/F,8CAA4B;AAC5B,4CAA0B;AAC1B,mDAAiC;AACjC,oEAAkD;AAClD,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,2CAAyB;AACzB,8CAA4B;AAC5B,8CAA4B;AAC5B,+CAA6B;AAC7B,0CAAwD;AAA/C,gGAAA,OAAO,OAAA;AAAE,oGAAA,WAAW,OAAA;AAC7B,gDAA+C;AAAtC,oGAAA,QAAQ,OAAA;AACjB,wEAAuE;AAA9D,4HAAA,oBAAoB,OAAA;AAC7B,sDAAqD;AAA5C,0GAAA,WAAW,OAAA;AACpB,sDAAgF;AAAxD,0GAAA,WAAW,OAAA;AACnC,4CAA2C;AAAlC,gGAAA,MAAM,OAAA;AACf,wDAAuD;AAA9C,4GAAA,YAAY,OAAA;AACrB,4DAA2D;AAAlD,gHAAA,cAAc,OAAA;AACvB,0CAAyC;AAAhC,8FAAA,KAAK,OAAA;AACd,4DAA0C;AAC1C,oDAAmD;AAA1C,wGAAA,UAAU,OAAA;AACnB,gDAI6B;AAH3B,oGAAA,QAAQ,OAAA;AAAE,6GAAA,iBAAiB,OAAA;AAAE,kHAAA,sBAAsB,OAAA;AAAE,+GAAA,mBAAmB,OAAA;AAAE,0GAAA,cAAc,OAAA;AACxF,+GAAA,mBAAmB,OAAA;AAAE,oHAAA,wBAAwB,OAAA;AAAE,8GAAA,kBAAkB,OAAA;AACX,yGAAA,aAAa,OAAA;AAAE,uHAAA,2BAA2B,OAAA;AAElG,gEAA+D;AAAtD,oHAAA,gBAAgB,OAAA;AACzB,kEAAmH;AAA1G,sHAAA,iBAAiB,OAAA;AAAE,2HAAA,sBAAsB,OAAA;AAAE,6HAAA,wBAAwB,OAAA;AAC5E,4CAA2C;AAAlC,gGAAA,MAAM,OAAA;AACf,wDAAsC;AACtC,wCAAuC;AAA9B,4FAAA,IAAI,OAAA;AACb,oDAAmD;AAA1C,wGAAA,UAAU,OAAA;AACnB,kDAAgC;AAChC,sDAAoC;AACpC,8CAA4B;AAC5B,iDAA+B;AAC/B,kEAAgD;AAChD,iEAA+C;AAC/C,oEAAkD;AAClD,4DAA0C;AAC1C,8DAA4C;AAE5C,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAEpB;;GAEG;AACH;;;GAGG;AACH;;;GAGG","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\nexport * from \"./Constants\";\r\nexport * from \"./Context\";\r\nexport * from \"./DelayedPromise\";\r\nexport * from \"./Deserialization/SchemaGraphUtil\";\r\nexport * from \"./Deserialization/JsonProps\";\r\nexport * from \"./Deserialization/Helper\";\r\nexport * from \"./Deserialization/XmlParser\";\r\nexport * from \"./ECName\";\r\nexport * from \"./ECObjects\";\r\nexport * from \"./Exception\";\r\nexport * from \"./Interfaces\";\r\nexport { ECClass, StructClass } from \"./Metadata/Class\";\r\nexport { Constant } from \"./Metadata/Constant\";\r\nexport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\r\nexport { EntityClass } from \"./Metadata/EntityClass\";\r\nexport { AnyEnumerator, Enumeration, Enumerator } from \"./Metadata/Enumeration\";\r\nexport { Format } from \"./Metadata/Format\";\r\nexport { InvertedUnit } from \"./Metadata/InvertedUnit\";\r\nexport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\r\nexport { Mixin } from \"./Metadata/Mixin\";\r\nexport * from \"./Metadata/OverrideFormat\";\r\nexport { Phenomenon } from \"./Metadata/Phenomenon\";\r\nexport {\r\n Property, PrimitiveProperty, PrimitiveArrayProperty, EnumerationProperty, StructProperty,\r\n StructArrayProperty, EnumerationArrayProperty, NavigationProperty, AnyArrayProperty, AnyEnumerationProperty,\r\n AnyPrimitiveProperty, AnyProperty, AnyStructProperty, ArrayProperty, PrimitiveOrEnumPropertyBase,\r\n} from \"./Metadata/Property\";\r\nexport { PropertyCategory } from \"./Metadata/PropertyCategory\";\r\nexport { RelationshipClass, RelationshipConstraint, RelationshipMultiplicity } from \"./Metadata/RelationshipClass\";\r\nexport { Schema } from \"./Metadata/Schema\";\r\nexport * from \"./Metadata/SchemaItem\";\r\nexport { Unit } from \"./Metadata/Unit\";\r\nexport { UnitSystem } from \"./Metadata/UnitSystem\";\r\nexport * from \"./PropertyTypes\";\r\nexport * from \"./SchemaJsonLocater\";\r\nexport * from \"./SchemaKey\";\r\nexport * from \"./SchemaLoader\";\r\nexport * from \"./UnitConversion/UnitConversion\";\r\nexport * from \"./UnitConversion/UnitConverter\";\r\nexport * from \"./UnitProvider/SchemaUnitProvider\";\r\nexport * from \"./Validation/SchemaWalker\";\r\nexport * from \"./SchemaPartVisitorDelegate\";\r\nexport { CustomAttribute, CustomAttributeContainerProps} from \"./Metadata/CustomAttribute\";\r\nexport { SchemaGraph } from \"./utils/SchemaGraph\";\r\n\r\n/** @docs-package-description\r\n * The ecschema-metadata package contains classes for working with ECSchemas that can be used in both [frontend]($docs/learning/frontend/index.md) and [backend]($docs/learning/backend/index.md).\r\n */\r\n/**\r\n * @docs-group-description Metadata\r\n * Definitions of classes and interfaces that represent all [EC elements]($docs/bis/ec/index.md).\r\n */\r\n/**\r\n * @docs-group-description Utils\r\n * A set of utility classes used throughout the package.\r\n */\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"SchemaGraph.js","sourceRoot":"","sources":["../../../src/utils/SchemaGraph.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAG/F,4CAA+C;AAC/C,4CAA+D;AAc/D;;;GAGG;AACH,MAAa,WAAW;IAGtB;QAFQ,aAAQ,GAAiB,EAAE,CAAC;IAEZ,CAAC;IAEjB,IAAI,CAAC,SAA8B;QACzC,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAgB,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7G,CAAC;IAED;;OAEG;IACI,aAAa;QAClB,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QACnC,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,QAAQ,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI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CAAC,aAAa,CAAC,SAAS,CAAC,SAAS,EAAE,2BAAe,CAAC,qBAAqB,CAAC,CAAC;oBACxG,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;wBAC1B,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,oBAAoB,EAC3D,2CAA2C,SAAS,CAAC,SAAS,CAAC,IAAI,IAAI,SAAS,CAAC,SAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,SAAS,CAAC,IAAI,kCAAkC,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC;oBACpM,CAAC;oBACD,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC,CAAC;QAEF,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;QAEhC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE;YAC7B,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzB,OAAO;YAET,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAEvB,KAAK,MAAM,SAAS,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;gBACrC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;oBAClC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;CAEF;AAvHD,kCAuHC","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 { SchemaContext } from \"../Context\";\nimport { SchemaMatchType } from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { SchemaInfo } from \"../Interfaces\";\nimport { Schema } from \"../Metadata/Schema\";\nimport { SchemaKey } from \"../SchemaKey\";\n\n/**\n * A schema and it's reference that make up part of a schema cycle\n * @internal\n */\nexport interface ReferenceCycle {\n schema: SchemaInfo;\n refSchema: SchemaInfo;\n}\n\n/**\n * Utility class for detecting cyclic references in a Schema graph.\n * @internal\n */\nexport class SchemaGraph {\n private _schemas: SchemaInfo[] = [];\n\n private constructor() { }\n\n private find(schemaKey: Readonly<SchemaKey>) {\n return this._schemas.find((info: SchemaInfo) => info.schemaKey.matches(schemaKey, SchemaMatchType.Latest));\n }\n\n /**\n * Detected cyclic references in a schema and throw an exception if a cycle is found.\n */\n public throwIfCycles() {\n const cycles = this.detectCycles();\n if (cycles) {\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Schema '${this._schemas[0].schemaKey.name}' has reference cycles: ${result}`);\n }\n }\n\n /**\n * Detected cyclic references in a schema.\n * @returns An array describing the cycle if there is a cycle or undefined if no cycles found.\n */\n public detectCycles(): ReferenceCycle[] | undefined {\n const visited = {};\n const recStack = {};\n const cycles: ReferenceCycle[] = [];\n\n for (const schema of this._schemas) {\n if (this.detectCycleUtil(schema, visited, recStack, cycles)) {\n return cycles.length > 0 ? cycles : undefined;\n }\n }\n\n return undefined;\n }\n\n private detectCycleUtil(schema: SchemaInfo, visited: any, recStack: any, cycles: ReferenceCycle[]): boolean {\n let cycleFound = false;\n\n if (!visited[schema.schemaKey.name]) {\n visited[schema.schemaKey.name] = true;\n recStack[schema.schemaKey.name] = true;\n\n for (const refKey of schema.references) {\n const refSchema = this.find(refKey.schemaKey);\n if (undefined === refSchema)\n throw new ECObjectsError(ECObjectsStatus.UnableToLoadSchema, `Could not find the schema info for ref schema ${refKey.schemaKey.toString()} for schema ${schema.schemaKey.toString()}`);\n if (!visited[refKey.schemaKey.name] && this.detectCycleUtil(refSchema, visited, recStack, cycles)) {\n cycles.push({ schema, refSchema });\n cycleFound = true;\n } else if (recStack[refKey.schemaKey.name]) {\n cycles.push({ schema, refSchema });\n cycleFound = true;\n }\n }\n }\n if (!cycleFound)\n recStack[schema.schemaKey.name] = false;\n\n return cycleFound;\n }\n\n /**\n * Generates a SchemaGraph for the input schema using the context to find info on referenced schemas. Use the generateGraphSync if you have the fully loaded Schema.\n * @param schema The SchemaInfo to build the graph from\n * @param context The SchemaContext used to locate info on the referenced schemas\n * @returns A SchemaGraph that can be used to detect schema cycles\n */\n public static async generateGraph(schema: SchemaInfo, context: SchemaContext): Promise<SchemaGraph> {\n const graph = new SchemaGraph();\n\n const genGraph = async (s: SchemaInfo) => {\n if (graph.find(s.schemaKey))\n return;\n\n graph._schemas.push(s);\n\n for (const refSchema of s.references) {\n if (!graph.find(refSchema.schemaKey)) {\n const refInfo = await context.getSchemaInfo(refSchema.schemaKey, SchemaMatchType.LatestWriteCompatible);\n if (undefined === refInfo) {\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema,\n `Could not locate the referenced schema, ${refSchema.schemaKey.name}.${refSchema.schemaKey.version.toString()}, of ${s.schemaKey.name} when populating the graph for ${schema.schemaKey.name}`);\n }\n await genGraph(refInfo);\n }\n }\n };\n\n await genGraph(schema);\n return graph;\n }\n\n /**\n * Generates a SchemaGraph for the input schema. Use the generateGraph if you just have schema info.\n * @param schema The Schema to build the graph from.\n * @returns A SchemaGraph that can be used to detect schema cycles\n */\n public static generateGraphSync(schema: Schema): SchemaGraph {\n const graph = new SchemaGraph();\n\n const genGraph = (s: Schema) => {\n if (graph.find(s.schemaKey))\n return;\n\n graph._schemas.push(s);\n\n for (const refSchema of s.references) {\n if (!graph.find(refSchema.schemaKey))\n genGraph(refSchema);\n }\n };\n\n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C,MAAM,CAAC,CAAC;QACvB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,iBAAiB,CAAC,MAAc;QAC5C,MAAM,KAAK,GAAG,IAAI,WAAW,EAAE,CAAC;QAEhC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE;YAC7B,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;gBACzB,OAAO;YAET,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAEvB,KAAK,MAAM,SAAS,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;gBACrC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;oBAClC,QAAQ,CAAC,SAAS,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC;QAEF,QAAQ,CAAC,MAAM,CAAC,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;CAEF;AAvHD,kCAuHC","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 { SchemaContext } from \"../Context\";\r\nimport { SchemaMatchType } from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { SchemaInfo } from \"../Interfaces\";\r\nimport { Schema } from \"../Metadata/Schema\";\r\nimport { SchemaKey } from \"../SchemaKey\";\r\n\r\n/**\r\n * A schema and it's reference that make up part of a schema cycle\r\n * @internal\r\n */\r\nexport interface ReferenceCycle {\r\n schema: SchemaInfo;\r\n refSchema: SchemaInfo;\r\n}\r\n\r\n/**\r\n * Utility class for detecting cyclic references in a Schema graph.\r\n * @internal\r\n */\r\nexport class SchemaGraph {\r\n private _schemas: SchemaInfo[] = [];\r\n\r\n private constructor() { }\r\n\r\n private find(schemaKey: Readonly<SchemaKey>) {\r\n return this._schemas.find((info: SchemaInfo) => info.schemaKey.matches(schemaKey, SchemaMatchType.Latest));\r\n }\r\n\r\n /**\r\n * Detected cyclic references in a schema and throw an exception if a cycle is found.\r\n */\r\n public throwIfCycles() {\r\n const cycles = this.detectCycles();\r\n if (cycles) {\r\n const result = cycles.map((cycle) => `${cycle.schema.schemaKey.name} --> ${cycle.refSchema.schemaKey.name}`).join(\", \");\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Schema '${this._schemas[0].schemaKey.name}' has reference cycles: ${result}`);\r\n }\r\n }\r\n\r\n /**\r\n * Detected cyclic references in a schema.\r\n * @returns An array describing the cycle if there is a cycle or undefined if no cycles found.\r\n */\r\n public detectCycles(): ReferenceCycle[] | undefined {\r\n const visited = {};\r\n const recStack = {};\r\n const cycles: ReferenceCycle[] = [];\r\n\r\n for (const schema of this._schemas) {\r\n if (this.detectCycleUtil(schema, visited, recStack, cycles)) {\r\n return cycles.length > 0 ? cycles : undefined;\r\n }\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n private detectCycleUtil(schema: SchemaInfo, visited: any, recStack: any, cycles: ReferenceCycle[]): boolean {\r\n let cycleFound = false;\r\n\r\n if (!visited[schema.schemaKey.name]) {\r\n visited[schema.schemaKey.name] = true;\r\n recStack[schema.schemaKey.name] = true;\r\n\r\n for (const refKey of schema.references) {\r\n const refSchema = this.find(refKey.schemaKey);\r\n if (undefined === refSchema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLoadSchema, `Could not find the schema info for ref schema ${refKey.schemaKey.toString()} for schema ${schema.schemaKey.toString()}`);\r\n if (!visited[refKey.schemaKey.name] && this.detectCycleUtil(refSchema, visited, recStack, cycles)) {\r\n cycles.push({ schema, refSchema });\r\n cycleFound = true;\r\n } else if (recStack[refKey.schemaKey.name]) {\r\n cycles.push({ schema, refSchema });\r\n cycleFound = true;\r\n }\r\n }\r\n }\r\n if (!cycleFound)\r\n recStack[schema.schemaKey.name] = false;\r\n\r\n return cycleFound;\r\n }\r\n\r\n /**\r\n * Generates a SchemaGraph for the input schema using the context to find info on referenced schemas. Use the generateGraphSync if you have the fully loaded Schema.\r\n * @param schema The SchemaInfo to build the graph from\r\n * @param context The SchemaContext used to locate info on the referenced schemas\r\n * @returns A SchemaGraph that can be used to detect schema cycles\r\n */\r\n public static async generateGraph(schema: SchemaInfo, context: SchemaContext): Promise<SchemaGraph> {\r\n const graph = new SchemaGraph();\r\n\r\n const genGraph = async (s: SchemaInfo) => {\r\n if (graph.find(s.schemaKey))\r\n return;\r\n\r\n graph._schemas.push(s);\r\n\r\n for (const refSchema of s.references) {\r\n if (!graph.find(refSchema.schemaKey)) {\r\n const refInfo = await context.getSchemaInfo(refSchema.schemaKey, SchemaMatchType.LatestWriteCompatible);\r\n if (undefined === refInfo) {\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema,\r\n `Could not locate the referenced schema, ${refSchema.schemaKey.name}.${refSchema.schemaKey.version.toString()}, of ${s.schemaKey.name} when populating the graph for ${schema.schemaKey.name}`);\r\n }\r\n await genGraph(refInfo);\r\n }\r\n }\r\n };\r\n\r\n await genGraph(schema);\r\n return graph;\r\n }\r\n\r\n /**\r\n * Generates a SchemaGraph for the input schema. Use the generateGraph if you just have schema info.\r\n * @param schema The Schema to build the graph from.\r\n * @returns A SchemaGraph that can be used to detect schema cycles\r\n */\r\n public static generateGraphSync(schema: Schema): SchemaGraph {\r\n const graph = new SchemaGraph();\r\n\r\n const genGraph = (s: Schema) => {\r\n if (graph.find(s.schemaKey))\r\n return;\r\n\r\n graph._schemas.push(s);\r\n\r\n for (const refSchema of s.references) {\r\n if (!graph.find(refSchema.schemaKey))\r\n genGraph(refSchema);\r\n }\r\n };\r\n\r\n genGraph(schema);\r\n return graph;\r\n }\r\n\r\n}\r\n\r\n"]}
@@ -6,25 +6,25 @@
6
6
  * @internal
7
7
  */
8
8
  export class ECStringConstants {
9
+ // Relationship End
10
+ static { this.RELATIONSHIP_END_SOURCE = "Source"; }
11
+ static { this.RELATIONSHIP_END_TARGET = "Target"; }
12
+ // Container Type
13
+ static { this.CONTAINERTYPE_SCHEMA = "Schema"; }
14
+ static { this.CONTAINERTYPE_ENTITYCLASS = "EntityClass"; }
15
+ static { this.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass"; }
16
+ static { this.CONTAINERTYPE_STRUCTCLASS = "StructClass"; }
17
+ static { this.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass"; }
18
+ static { this.CONTAINERTYPE_ANYCLASS = "AnyClass"; }
19
+ static { this.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty"; }
20
+ static { this.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty"; }
21
+ static { this.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty"; }
22
+ static { this.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty"; }
23
+ static { this.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty"; }
24
+ static { this.CONTAINERTYPE_ANYPROPERTY = "AnyProperty"; }
25
+ static { this.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint"; }
26
+ static { this.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint"; }
27
+ static { this.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint"; }
28
+ static { this.CONTAINERTYPE_ANY = "Any"; }
9
29
  }
10
- // Relationship End
11
- ECStringConstants.RELATIONSHIP_END_SOURCE = "Source";
12
- ECStringConstants.RELATIONSHIP_END_TARGET = "Target";
13
- // Container Type
14
- ECStringConstants.CONTAINERTYPE_SCHEMA = "Schema";
15
- ECStringConstants.CONTAINERTYPE_ENTITYCLASS = "EntityClass";
16
- ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass";
17
- ECStringConstants.CONTAINERTYPE_STRUCTCLASS = "StructClass";
18
- ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass";
19
- ECStringConstants.CONTAINERTYPE_ANYCLASS = "AnyClass";
20
- ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty";
21
- ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty";
22
- ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty";
23
- ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty";
24
- ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty";
25
- ECStringConstants.CONTAINERTYPE_ANYPROPERTY = "AnyProperty";
26
- ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint";
27
- ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint";
28
- ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint";
29
- ECStringConstants.CONTAINERTYPE_ANY = "Any";
30
30
  //# sourceMappingURL=Constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,MAAM,OAAO,iBAAiB;;AAC5B,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
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC5B,mBAAmB;aACI,4BAAuB,GAAW,QAAQ,CAAC;aAC3C,4BAAuB,GAAW,QAAQ,CAAC;IAElE,iBAAiB;aACM,yBAAoB,GAAW,QAAQ,CAAC;aACxC,8BAAyB,GAAW,aAAa,CAAC;aAClD,uCAAkC,GAAW,sBAAsB,CAAC;aACpE,8BAAyB,GAAW,aAAa,CAAC;aAClD,oCAA+B,GAAW,mBAAmB,CAAC;aAC9D,2BAAsB,GAAW,UAAU,CAAC;aAE5C,oCAA+B,GAAW,mBAAmB,CAAC;aAC9D,iCAA4B,GAAW,gBAAgB,CAAC;aACxD,yCAAoC,GAAW,eAAe,CAAC;aAC/D,sCAAiC,GAAW,qBAAqB,CAAC;aAClE,qCAAgC,GAAW,oBAAoB,CAAC;aAChE,8BAAyB,GAAW,aAAa,CAAC;aAElD,+CAA0C,GAAW,8BAA8B,CAAC;aACpF,+CAA0C,GAAW,8BAA8B,CAAC;aACpF,4CAAuC,GAAW,2BAA2B,CAAC;aAE9E,sBAAiB,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"]}
@@ -28,6 +28,7 @@ var _a;
28
28
  * @beta
29
29
  */
30
30
  export class DelayedPromise {
31
+ static { _a = Symbol.toStringTag; }
31
32
  /**
32
33
  * Constructs a DelayedPromise object.
33
34
  * @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
@@ -67,7 +68,6 @@ export class DelayedPromise {
67
68
  return this.start().finally(onFinally);
68
69
  }
69
70
  }
70
- _a = Symbol.toStringTag;
71
71
  // Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
72
72
  // So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
73
73
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,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;KAlCkB,MAAM,CAAC,WAAW;AAkErC,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,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
+ {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAc;kBAeR,MAAM,CAAC,WAAW;IAbnC;;;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;AAgCD,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,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 +1 @@
1
- {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,gBAAgB;AAChB,MAAM,OAAgB,cAAc;CAoCnC","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"]}
1
+ {"version":3,"file":"AbstractParser.js","sourceRoot":"","sources":["../../../src/Deserialization/AbstractParser.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAoB/F,gBAAgB;AAChB,MAAM,OAAgB,cAAc;CAoCnC","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\nimport { ECSpecVersion } from \"./Helper\";\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 protected _ecSpecVersion?: ECSpecVersion;\r\n\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 public abstract get getECSpecVersion(): ECSpecVersion | undefined;\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"]}