@itwin/ecschema-metadata 5.0.0-dev.4 → 5.0.0-dev.40

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 (136) hide show
  1. package/CHANGELOG.md +30 -1
  2. package/lib/cjs/Constants.js +20 -20
  3. package/lib/cjs/Constants.js.map +1 -1
  4. package/lib/cjs/Context.d.ts +19 -0
  5. package/lib/cjs/Context.d.ts.map +1 -1
  6. package/lib/cjs/Context.js +29 -1
  7. package/lib/cjs/Context.js.map +1 -1
  8. package/lib/cjs/DelayedPromise.js +1 -1
  9. package/lib/cjs/DelayedPromise.js.map +1 -1
  10. package/lib/cjs/Deserialization/JsonProps.d.ts +3 -0
  11. package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
  12. package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
  13. package/lib/cjs/Metadata/Class.d.ts +1 -2
  14. package/lib/cjs/Metadata/Class.d.ts.map +1 -1
  15. package/lib/cjs/Metadata/Class.js +2 -2
  16. package/lib/cjs/Metadata/Class.js.map +1 -1
  17. package/lib/cjs/Metadata/Constant.d.ts +1 -1
  18. package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
  19. package/lib/cjs/Metadata/Constant.js.map +1 -1
  20. package/lib/cjs/Metadata/CustomAttributeClass.d.ts +2 -4
  21. package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
  22. package/lib/cjs/Metadata/CustomAttributeClass.js +4 -4
  23. package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
  24. package/lib/cjs/Metadata/EntityClass.d.ts +2 -4
  25. package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
  26. package/lib/cjs/Metadata/EntityClass.js +2 -2
  27. package/lib/cjs/Metadata/EntityClass.js.map +1 -1
  28. package/lib/cjs/Metadata/Enumeration.d.ts +1 -1
  29. package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
  30. package/lib/cjs/Metadata/Enumeration.js.map +1 -1
  31. package/lib/cjs/Metadata/Format.d.ts +1 -1
  32. package/lib/cjs/Metadata/Format.d.ts.map +1 -1
  33. package/lib/cjs/Metadata/Format.js.map +1 -1
  34. package/lib/cjs/Metadata/InvertedUnit.d.ts +1 -3
  35. package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
  36. package/lib/cjs/Metadata/InvertedUnit.js +2 -2
  37. package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
  38. package/lib/cjs/Metadata/KindOfQuantity.d.ts +1 -3
  39. package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
  40. package/lib/cjs/Metadata/KindOfQuantity.js +6 -6
  41. package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
  42. package/lib/cjs/Metadata/Mixin.d.ts +1 -1
  43. package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
  44. package/lib/cjs/Metadata/Mixin.js.map +1 -1
  45. package/lib/cjs/Metadata/Phenomenon.d.ts +1 -1
  46. package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
  47. package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
  48. package/lib/cjs/Metadata/Property.d.ts.map +1 -1
  49. package/lib/cjs/Metadata/Property.js +49 -15
  50. package/lib/cjs/Metadata/Property.js.map +1 -1
  51. package/lib/cjs/Metadata/PropertyCategory.d.ts +1 -1
  52. package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
  53. package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
  54. package/lib/cjs/Metadata/RelationshipClass.d.ts +1 -1
  55. package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
  56. package/lib/cjs/Metadata/RelationshipClass.js +4 -4
  57. package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
  58. package/lib/cjs/Metadata/Schema.js +1 -1
  59. package/lib/cjs/Metadata/Schema.js.map +1 -1
  60. package/lib/cjs/Metadata/Unit.d.ts +1 -1
  61. package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
  62. package/lib/cjs/Metadata/Unit.js.map +1 -1
  63. package/lib/cjs/Metadata/UnitSystem.d.ts +1 -3
  64. package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
  65. package/lib/cjs/Metadata/UnitSystem.js +2 -2
  66. package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
  67. package/lib/cjs/UnitConversion/UnitConversion.js +2 -2
  68. package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
  69. package/lib/esm/Constants.js +20 -20
  70. package/lib/esm/Constants.js.map +1 -1
  71. package/lib/esm/Context.d.ts +19 -0
  72. package/lib/esm/Context.d.ts.map +1 -1
  73. package/lib/esm/Context.js +29 -1
  74. package/lib/esm/Context.js.map +1 -1
  75. package/lib/esm/DelayedPromise.js +1 -1
  76. package/lib/esm/DelayedPromise.js.map +1 -1
  77. package/lib/esm/Deserialization/JsonProps.d.ts +3 -0
  78. package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
  79. package/lib/esm/Deserialization/JsonProps.js.map +1 -1
  80. package/lib/esm/Metadata/Class.d.ts +1 -2
  81. package/lib/esm/Metadata/Class.d.ts.map +1 -1
  82. package/lib/esm/Metadata/Class.js +2 -2
  83. package/lib/esm/Metadata/Class.js.map +1 -1
  84. package/lib/esm/Metadata/Constant.d.ts +1 -1
  85. package/lib/esm/Metadata/Constant.d.ts.map +1 -1
  86. package/lib/esm/Metadata/Constant.js.map +1 -1
  87. package/lib/esm/Metadata/CustomAttributeClass.d.ts +2 -4
  88. package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
  89. package/lib/esm/Metadata/CustomAttributeClass.js +4 -4
  90. package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
  91. package/lib/esm/Metadata/EntityClass.d.ts +2 -4
  92. package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
  93. package/lib/esm/Metadata/EntityClass.js +2 -2
  94. package/lib/esm/Metadata/EntityClass.js.map +1 -1
  95. package/lib/esm/Metadata/Enumeration.d.ts +1 -1
  96. package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
  97. package/lib/esm/Metadata/Enumeration.js.map +1 -1
  98. package/lib/esm/Metadata/Format.d.ts +1 -1
  99. package/lib/esm/Metadata/Format.d.ts.map +1 -1
  100. package/lib/esm/Metadata/Format.js.map +1 -1
  101. package/lib/esm/Metadata/InvertedUnit.d.ts +1 -3
  102. package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
  103. package/lib/esm/Metadata/InvertedUnit.js +2 -2
  104. package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
  105. package/lib/esm/Metadata/KindOfQuantity.d.ts +1 -3
  106. package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
  107. package/lib/esm/Metadata/KindOfQuantity.js +6 -6
  108. package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
  109. package/lib/esm/Metadata/Mixin.d.ts +1 -1
  110. package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
  111. package/lib/esm/Metadata/Mixin.js.map +1 -1
  112. package/lib/esm/Metadata/Phenomenon.d.ts +1 -1
  113. package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
  114. package/lib/esm/Metadata/Phenomenon.js.map +1 -1
  115. package/lib/esm/Metadata/Property.d.ts.map +1 -1
  116. package/lib/esm/Metadata/Property.js +49 -15
  117. package/lib/esm/Metadata/Property.js.map +1 -1
  118. package/lib/esm/Metadata/PropertyCategory.d.ts +1 -1
  119. package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
  120. package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
  121. package/lib/esm/Metadata/RelationshipClass.d.ts +1 -1
  122. package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
  123. package/lib/esm/Metadata/RelationshipClass.js +4 -4
  124. package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
  125. package/lib/esm/Metadata/Schema.js +1 -1
  126. package/lib/esm/Metadata/Schema.js.map +1 -1
  127. package/lib/esm/Metadata/Unit.d.ts +1 -1
  128. package/lib/esm/Metadata/Unit.d.ts.map +1 -1
  129. package/lib/esm/Metadata/Unit.js.map +1 -1
  130. package/lib/esm/Metadata/UnitSystem.d.ts +1 -3
  131. package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
  132. package/lib/esm/Metadata/UnitSystem.js +2 -2
  133. package/lib/esm/Metadata/UnitSystem.js.map +1 -1
  134. package/lib/esm/UnitConversion/UnitConversion.js +2 -2
  135. package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
  136. package/package.json +9 -9
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, 06 Nov 2024 19:24:30 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 13 Jan 2025 14:09:29 GMT and should not be manually modified.
4
+
5
+ ## 4.10.4
6
+ Mon, 13 Jan 2025 14:06:43 GMT
7
+
8
+ _Version update only_
9
+
10
+ ## 4.10.3
11
+ Mon, 06 Jan 2025 14:00:13 GMT
12
+
13
+ _Version update only_
14
+
15
+ ## 4.10.2
16
+ Thu, 21 Nov 2024 15:22:20 GMT
17
+
18
+ _Version update only_
19
+
20
+ ## 4.10.1
21
+ Thu, 14 Nov 2024 18:11:00 GMT
22
+
23
+ _Version update only_
24
+
25
+ ## 4.10.0
26
+ Wed, 13 Nov 2024 15:23:38 GMT
27
+
28
+ ### Updates
29
+
30
+ - Deprecate SchemaMatchType.Identical and switch to Exact as default
31
+ - Support inverted units through SchemaUnitsConverter
32
+ - Updated deserialization/serialization logic to handle newer schemas containing unknowns.
4
33
 
5
34
  ## 4.9.7
6
35
  Wed, 06 Nov 2024 19:23:04 GMT
@@ -9,26 +9,26 @@ exports.ECStringConstants = void 0;
9
9
  * @internal
10
10
  */
11
11
  class ECStringConstants {
12
+ // Relationship End
13
+ static { this.RELATIONSHIP_END_SOURCE = "Source"; }
14
+ static { this.RELATIONSHIP_END_TARGET = "Target"; }
15
+ // Container Type
16
+ static { this.CONTAINERTYPE_SCHEMA = "Schema"; }
17
+ static { this.CONTAINERTYPE_ENTITYCLASS = "EntityClass"; }
18
+ static { this.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass"; }
19
+ static { this.CONTAINERTYPE_STRUCTCLASS = "StructClass"; }
20
+ static { this.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass"; }
21
+ static { this.CONTAINERTYPE_ANYCLASS = "AnyClass"; }
22
+ static { this.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty"; }
23
+ static { this.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty"; }
24
+ static { this.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty"; }
25
+ static { this.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty"; }
26
+ static { this.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty"; }
27
+ static { this.CONTAINERTYPE_ANYPROPERTY = "AnyProperty"; }
28
+ static { this.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint"; }
29
+ static { this.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint"; }
30
+ static { this.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint"; }
31
+ static { this.CONTAINERTYPE_ANY = "Any"; }
12
32
  }
13
33
  exports.ECStringConstants = ECStringConstants;
14
- // Relationship End
15
- ECStringConstants.RELATIONSHIP_END_SOURCE = "Source";
16
- ECStringConstants.RELATIONSHIP_END_TARGET = "Target";
17
- // Container Type
18
- ECStringConstants.CONTAINERTYPE_SCHEMA = "Schema";
19
- ECStringConstants.CONTAINERTYPE_ENTITYCLASS = "EntityClass";
20
- ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass";
21
- ECStringConstants.CONTAINERTYPE_STRUCTCLASS = "StructClass";
22
- ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass";
23
- ECStringConstants.CONTAINERTYPE_ANYCLASS = "AnyClass";
24
- ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty";
25
- ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty";
26
- ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty";
27
- ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty";
28
- ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty";
29
- ECStringConstants.CONTAINERTYPE_ANYPROPERTY = "AnyProperty";
30
- ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint";
31
- ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint";
32
- ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint";
33
- ECStringConstants.CONTAINERTYPE_ANY = "Any";
34
34
  //# 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,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
+ {"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,MAAa,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;;AAxB3D,8CAyBC","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"]}
@@ -118,8 +118,27 @@ export declare class SchemaCache implements ISchemaLocater {
118
118
  export declare class SchemaContext implements ISchemaItemLocater {
119
119
  private _locaters;
120
120
  private _knownSchemas;
121
+ private _fallbackLocaterDefined;
121
122
  constructor();
123
+ get locaters(): ISchemaLocater[];
124
+ /**
125
+ * Adds a locater to the context.
126
+ *
127
+ * If no locaters are defined or a fallback locater is not defined, the new locater is added at the end of the locaters array.
128
+ * If a fallback locater is already defined, the new locater is inserted before the fallback locater.
129
+ *
130
+ * @param locater - The locater to be added.
131
+ */
122
132
  addLocater(locater: ISchemaLocater): void;
133
+ /**
134
+ * Adds a fallback locater to the context.
135
+ *
136
+ * If a fallback locater is already defined, it replaces the existing one.
137
+ * Otherwise, it adds the new locater to the end of the locaters array and marks the fallback locater as defined.
138
+ *
139
+ * @param locater - The locater to be added as a fallback.
140
+ */
141
+ addFallbackLocater(locater: ISchemaLocater): void;
123
142
  /**
124
143
  * Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.
125
144
  * @param schema The schema to add to this context
@@ -1 +1 @@
1
- {"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAiB,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAgBvD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAE7B;;;;;;OAMG;IACH,SAAS,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAExI;;;;;MAKE;IACF,aAAa,CAAC,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAEnI;;;;;;OAMG;IACH,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,CAAC,GAAG,SAAS,CAAC;CACpI;AAED;;GAEG;AACH,MAA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GAAG,SAAS;IAWhI;;;;;;OAMG;IACU,eAAe,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAE,eAAwC,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAI3J;;;;;;OAMG;IACI,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,GAAE,eAAwC,GAAG,CAAC,GAAG,SAAS;IAIhJ;;;;;OAKG;IACU,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC;IAOtG;;;;;OAKG;IACI,iBAAiB,CAAC,CAAC,SAAS,UAAU,EAAE,aAAa,EAAE,aAAa,GAAG,CAAC,GAAG,SAAS;IAO3F;;;;;OAKG;IACI,cAAc,IAAI,gBAAgB,CAAC,UAAU,CAAC;IAIrD;;;;;;OAMG;IACI,eAAe,IAAI,MAAM,EAAE;CAGnC"}
@@ -168,9 +168,37 @@ class SchemaContext {
168
168
  this._locaters = [];
169
169
  this._knownSchemas = new SchemaCache();
170
170
  this._locaters.push(this._knownSchemas);
171
+ this._fallbackLocaterDefined = false;
171
172
  }
173
+ get locaters() { return this._locaters; }
174
+ /**
175
+ * Adds a locater to the context.
176
+ *
177
+ * If no locaters are defined or a fallback locater is not defined, the new locater is added at the end of the locaters array.
178
+ * If a fallback locater is already defined, the new locater is inserted before the fallback locater.
179
+ *
180
+ * @param locater - The locater to be added.
181
+ */
172
182
  addLocater(locater) {
173
- this._locaters.push(locater);
183
+ const insertIndex = (this._locaters.length === 0 || !this._fallbackLocaterDefined) ? this._locaters.length : this._locaters.length - 1;
184
+ this._locaters.splice(insertIndex, 0, locater);
185
+ }
186
+ /**
187
+ * Adds a fallback locater to the context.
188
+ *
189
+ * If a fallback locater is already defined, it replaces the existing one.
190
+ * Otherwise, it adds the new locater to the end of the locaters array and marks the fallback locater as defined.
191
+ *
192
+ * @param locater - The locater to be added as a fallback.
193
+ */
194
+ addFallbackLocater(locater) {
195
+ if (this._fallbackLocaterDefined) {
196
+ this._locaters[this._locaters.length - 1] = locater;
197
+ }
198
+ else {
199
+ this._locaters.push(locater);
200
+ this._fallbackLocaterDefined = true;
201
+ }
174
202
  }
175
203
  /**
176
204
  * Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/Context.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F,2CAA8C;AAC9C,2CAA8D;AAM9D;;GAEG;AACH,MAAM,SAAU,SAAQ,KAAkB;CAAI;AAuD9C;;GAEG;AACH,MAAa,WAAW;IAGtB;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC;IACjC,CAAC;IAED,IAAW,KAAK,KAAK,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAE1C,kBAAkB,CAAC,SAA8B;QACvD,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;IAChK,CAAC;IAEO,mBAAmB,CAAC,SAA8B;QACxD,OAAO,SAAS,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAkB,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC,IAAI,SAAS,KAAK,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7K,CAAC;IAEO,SAAS,CAAC,SAA8B,EAAE,SAA0B;QAC1E,OAAO,IAAI,CAA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AAa,CAAC,SAAS,CAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;OAMG;IACI,mBAAmB,CAAmB,SAA8B,EAAE,YAA6B,2BAAe,CAAC,MAAM;QAC9H,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,CAAI,SAAS,EAAE,SAAS,CAAC,CAAC;IACnE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAuB,aAA4B;QAC3E,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACrF,IAAI,SAAS,KAAK,MAAM;YACtB,OAAO,SAAS,CAAC;QACnB,OAAO,MAAM,CAAC,OAAO,CAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IAC/C,CAAC;IAED;;;;;OAKG;IACI,iBAAiB,CAAuB,aAA4B;QACzE,MAAM,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,SAAS,EAAE,2BAAe,CAAC,MAAM,CAAC,CAAC;QACnF,IAAI,SAAS,KAAK,MAAM;YACtB,OAAO,SAAS,CAAC;QACnB,OAAO,MAAM,CAAC,WAAW,CAAI,aAAa,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;IAC5C,CAAC;CACF;AAtLD,sCAsLC","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 { SchemaMatchType } from \"./ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\r\nimport { SchemaInfo } from \"./Interfaces\";\r\nimport { MutableSchema, Schema } from \"./Metadata/Schema\";\r\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\r\nimport { SchemaItemKey, SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * @internal\r\n */\r\nclass SchemaMap extends Array<SchemaEntry> { }\r\n\r\n/**\r\n * @internal\r\n */\r\ninterface SchemaEntry {\r\n schemaInfo: SchemaInfo;\r\n schema: Schema;\r\n schemaPromise?: Promise<Schema>;\r\n}\r\n\r\n/**\r\n * The interface defines what is needed to be an `ISchemaLocater`.\r\n * A Schema Locater loads the requested schema if it can or returns undefined.\r\n * Schema Locaters should always load the schema on each request and should not hold a cache of schemas.\r\n * Schema locaters should never be used directly to load a schema, they should be added to a `SchemaContext`\r\n * and the context should be used to load schemas. The `SchemaContext` caches schemas and manages schema life time.\r\n * @beta\r\n */\r\nexport interface ISchemaLocater {\r\n\r\n /**\r\n * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.\r\n * For schemas that may have references, construct and call through a SchemaContext instead.\r\n * @param schemaKey key to look up\r\n * @param matchType how to match key against candidate schemas\r\n * @param context context for loading schema references\r\n */\r\n getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * May return the entire Schema so long as it is completely loaded as it satisfies the SchemaInfo interface.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;\r\n\r\n /**\r\n * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.\r\n * For schemas that may have references, construct and call through a SchemaContext instead.\r\n * @param schemaKey key to look up\r\n * @param matchType how to match key against candidate schemas\r\n * @param context context for loading schema references\r\n */\r\n getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): T | undefined;\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface ISchemaItemLocater {\r\n getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class SchemaCache implements ISchemaLocater {\r\n private _schema: SchemaMap;\r\n\r\n constructor() {\r\n this._schema = new SchemaMap();\r\n }\r\n\r\n public get count() { return this._schema.length; }\r\n\r\n private loadedSchemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return undefined !== this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, SchemaMatchType.Latest) && !entry.schemaPromise);\r\n }\r\n\r\n private schemaPromiseExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return undefined !== this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, SchemaMatchType.Latest) && undefined !== entry.schemaPromise);\r\n }\r\n\r\n private findEntry(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType): SchemaEntry | undefined {\r\n return this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, matchType));\r\n }\r\n\r\n private removeSchemaPromise(schemaKey: Readonly<SchemaKey>) {\r\n const entry = this.findEntry(schemaKey, SchemaMatchType.Latest);\r\n if (entry)\r\n entry.schemaPromise = undefined;\r\n }\r\n\r\n private removeEntry(schemaKey: Readonly<SchemaKey>) {\r\n this._schema = this._schema.filter((entry: SchemaEntry) => !entry.schemaInfo.schemaKey.matches(schemaKey));\r\n }\r\n\r\n /**\r\n * Returns true if the schema exists in either the schema cache or the promise cache. SchemaMatchType.Latest used.\r\n * @param schemaKey The key to search for.\r\n */\r\n public schemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return this.loadedSchemaExists(schemaKey) || this.schemaPromiseExists(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.\r\n * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache\r\n * @param schemaInfo An object with the schema key for the schema being loaded and it's references\r\n * @param schema The partially loaded schema that the promise will fulfill\r\n * @param schemaPromise The schema promise to add to the cache.\r\n */\r\n public async addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>) {\r\n if (this.schemaExists(schemaInfo.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schemaInfo.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo, schema, schemaPromise });\r\n\r\n // This promise is cached and will be awaited when the user requests the full schema.\r\n // If the promise competes successfully before the user requests the schema it will be removed from the cache\r\n // If it fails it will remain in the cache until the user awaits it and handles the error\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n schemaPromise.then(() => {\r\n this.removeSchemaPromise(schemaInfo.schemaKey);\r\n });\r\n }\r\n\r\n /**\r\n * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.\r\n * @param schema The schema to add to the cache.\r\n */\r\n public async addSchema<T extends Schema>(schema: T) {\r\n if (this.schemaExists(schema.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schema.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo: schema, schema });\r\n }\r\n\r\n /**\r\n * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.\r\n * @param schema The schema to add to the cache.\r\n */\r\n public addSchemaSync<T extends Schema>(schema: T) {\r\n if (this.schemaExists(schema.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schema.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo: schema, schema });\r\n }\r\n\r\n /**\r\n * Gets the schema which matches the provided SchemaKey.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (!entry)\r\n return undefined;\r\n\r\n if (entry.schemaPromise) {\r\n try {\r\n const schema = await entry.schemaPromise as T;\r\n return schema;\r\n } catch (e) {\r\n this.removeEntry(schemaKey);\r\n throw e;\r\n }\r\n }\r\n\r\n return entry.schema as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<SchemaInfo | undefined> {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (entry)\r\n return entry.schemaInfo;\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the schema which matches the provided SchemaKey. If the schema is partially loaded an exception will be thrown.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (entry) {\r\n if (entry.schemaPromise) {\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLoadSchema, `The Schema ${schemaKey.toString()} is partially loaded so cannot be loaded synchronously.`);\r\n }\r\n return entry.schema as T;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Generator function that can iterate through each schema in _schema SchemaMap and items for each Schema.\r\n * Does not include schema items from schemas that are not completely loaded yet.\r\n */\r\n public * getSchemaItems(): IterableIterator<SchemaItem> {\r\n for (const entry of this._schema) {\r\n for (const schemaItem of entry.schema.getItems()) {\r\n yield schemaItem;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets all the schemas from the schema cache.\r\n * Does not include schemas from schemas that are not completely loaded yet.\r\n * @returns An array of Schema objects.\r\n */\r\n public getAllSchemas(): Schema[] {\r\n return this._schema.map((entry: SchemaEntry) => entry.schema);\r\n }\r\n}\r\n\r\n/**\r\n * The SchemaContext, context object is used to facilitate schema and schema item location.\r\n *\r\n * The context controls the lifetime of each schema that it knows about. It has to be explicitly removed from the context to delete a schema object.\r\n *\r\n * The context is made up of a group of Schema Locators.\r\n * @beta\r\n */\r\nexport class SchemaContext implements ISchemaItemLocater {\r\n private _locaters: ISchemaLocater[];\r\n\r\n private _knownSchemas: SchemaCache;\r\n\r\n constructor() {\r\n this._locaters = [];\r\n\r\n this._knownSchemas = new SchemaCache();\r\n this._locaters.push(this._knownSchemas);\r\n }\r\n\r\n public addLocater(locater: ISchemaLocater) {\r\n this._locaters.push(locater);\r\n }\r\n\r\n /**\r\n * Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.\r\n * @param schema The schema to add to this context\r\n */\r\n public async addSchema(schema: Schema) {\r\n this.addSchemaSync(schema);\r\n }\r\n\r\n /**\r\n * Adds the schema to this context\r\n * @param schema The schema to add to this context\r\n */\r\n public addSchemaSync(schema: Schema) {\r\n this._knownSchemas.addSchemaSync(schema);\r\n }\r\n\r\n /**\r\n * Adds the given SchemaItem to the the SchemaContext by locating the schema, with the best match of SchemaMatchType.Exact, and\r\n * @param schemaItem The SchemaItem to add\r\n * @deprecated in 4.0 use ecschema-editing package\r\n */\r\n public async addSchemaItem(schemaItem: SchemaItem) {\r\n const schema = await this.getSchema(schemaItem.key.schemaKey, SchemaMatchType.Exact);\r\n if (!schema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to add the schema item ${schemaItem.name} to the schema ${schemaItem.key.schemaKey.toString()} because the schema could not be located.`);\r\n\r\n (schema as MutableSchema).addItem(schemaItem);\r\n }\r\n\r\n /**\r\n * Returns true if the schema is already in the context. SchemaMatchType.Latest is used to find a match.\r\n * @param schemaKey\r\n */\r\n public schemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return this._knownSchemas.schemaExists(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.\r\n * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache.\r\n * Use this method over addSchema when asynchronously loading schemas\r\n * @param schemaInfo An object with the schema key for the schema being loaded and it's references\r\n * @param schema The partially loaded schema that the promise will fulfill\r\n * @param schemaPromise The schema promise to add to the cache.\r\n */\r\n public async addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>) {\r\n return this._knownSchemas.addSchemaPromise(schemaInfo, schema, schemaPromise);\r\n }\r\n\r\n /** Attempts to obtain a schema from this context that matches the specified criteria.\r\n * @param schemaKey Identifies the schema to obtain.\r\n * @param matchType Criteria by which to identify potentially matching schemas.\r\n * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n // the first locater is _knownSchemas, so we don't have to check the cache explicitly here\r\n for (const locater of this._locaters) {\r\n const schema = await locater.getSchema<T>(schemaKey, matchType, this);\r\n if (undefined !== schema)\r\n return schema;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be gotten later from the context using [[getSchema]].\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType): Promise<SchemaInfo | undefined> {\r\n for (const locater of this._locaters) {\r\n const schemaInfo = await locater.getSchemaInfo(schemaKey, matchType, this);\r\n if (undefined !== schemaInfo)\r\n return schemaInfo;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Attempts to obtain a schema from this context that matches the specified criteria.\r\n * Will return undefined if the schema is partially loaded. Use [[getSchema]] to await until the schema is completely loaded.\r\n * @param schemaKey Identifies the schema to obtain.\r\n * @param matchType Criteria by which to identify potentially matching schemas.\r\n * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n // the first locater is _knownSchemas, so we don't have to check the cache explicitly here\r\n for (const locater of this._locaters) {\r\n const schema = locater.getSchemaSync<T>(schemaKey, matchType, this);\r\n if (undefined !== schema)\r\n return schema;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Attempts to get a Schema from the context's cache.\r\n * Will await a partially loaded schema then return when it is completely loaded.\r\n * @param schemaKey The SchemaKey to identify the Schema.\r\n * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.\r\n * @internal\r\n */\r\n public async getCachedSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n return this._knownSchemas.getSchema<T>(schemaKey, matchType);\r\n }\r\n\r\n /**\r\n * Attempts to get a Schema from the context's cache.\r\n * Will return undefined if the cached schema is partially loaded. Use [[getCachedSchema]] to await until the schema is completely loaded.\r\n * @param schemaKey The SchemaKey to identify the Schema.\r\n * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.\r\n * @internal\r\n */\r\n public getCachedSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n return this._knownSchemas.getSchemaSync<T>(schemaKey, matchType);\r\n }\r\n\r\n /**\r\n * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].\r\n * Will await a partially loaded schema then look in it for the requested item\r\n * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.\r\n * @returns The requested schema item\r\n */\r\n public async getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined> {\r\n const schema = await this.getSchema(schemaItemKey.schemaKey, SchemaMatchType.Latest);\r\n if (undefined === schema)\r\n return undefined;\r\n return schema.getItem<T>(schemaItemKey.name);\r\n }\r\n\r\n /**\r\n * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].\r\n * Will skip a partially loaded schema and return undefined if the item belongs to that schema. Use the async method to await partially loaded schemas.\r\n * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.\r\n * @returns The requested schema item\r\n */\r\n public getSchemaItemSync<T extends SchemaItem>(schemaItemKey: SchemaItemKey): T | undefined {\r\n const schema = this.getSchemaSync(schemaItemKey.schemaKey, SchemaMatchType.Latest);\r\n if (undefined === schema)\r\n return undefined;\r\n return schema.getItemSync<T>(schemaItemKey.name);\r\n }\r\n\r\n /**\r\n * Iterates through the items of each schema known to the context. This includes schemas added to the\r\n * context using [[SchemaContext.addSchema]]. This does not include schemas that\r\n * can be located by an ISchemaLocater instance added to the context.\r\n * Does not include schema items from schemas that are not completely loaded yet.\r\n */\r\n public getSchemaItems(): IterableIterator<SchemaItem> {\r\n return this._knownSchemas.getSchemaItems();\r\n }\r\n\r\n /**\r\n * Gets all the Schemas known by the context. This includes schemas added to the\r\n * context using [[SchemaContext.addSchema]]. This does not include schemas that\r\n * can be located by an ISchemaLocater instance added to the context. Does not\r\n * include schemas that are partially loaded.\r\n * @returns An array of Schema objects.\r\n */\r\n public getKnownSchemas(): Schema[] {\r\n return this._knownSchemas.getAllSchemas();\r\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AC;IACnD,CAAC;IAED;;;;;OAKG;IACI,cAAc;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,CAAC;IAC7C,CAAC;IAED;;;;;;OAMG;IACI,eAAe;QACpB,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;IAC5C,CAAC;CACF;AApND,sCAoNC","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 { SchemaMatchType } from \"./ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"./Exception\";\r\nimport { SchemaInfo } from \"./Interfaces\";\r\nimport { MutableSchema, Schema } from \"./Metadata/Schema\";\r\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\r\nimport { SchemaItemKey, SchemaKey } from \"./SchemaKey\";\r\n\r\n/**\r\n * @internal\r\n */\r\nclass SchemaMap extends Array<SchemaEntry> { }\r\n\r\n/**\r\n * @internal\r\n */\r\ninterface SchemaEntry {\r\n schemaInfo: SchemaInfo;\r\n schema: Schema;\r\n schemaPromise?: Promise<Schema>;\r\n}\r\n\r\n/**\r\n * The interface defines what is needed to be an `ISchemaLocater`.\r\n * A Schema Locater loads the requested schema if it can or returns undefined.\r\n * Schema Locaters should always load the schema on each request and should not hold a cache of schemas.\r\n * Schema locaters should never be used directly to load a schema, they should be added to a `SchemaContext`\r\n * and the context should be used to load schemas. The `SchemaContext` caches schemas and manages schema life time.\r\n * @beta\r\n */\r\nexport interface ISchemaLocater {\r\n\r\n /**\r\n * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.\r\n * For schemas that may have references, construct and call through a SchemaContext instead.\r\n * @param schemaKey key to look up\r\n * @param matchType how to match key against candidate schemas\r\n * @param context context for loading schema references\r\n */\r\n getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<T | undefined>;\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * May return the entire Schema so long as it is completely loaded as it satisfies the SchemaInfo interface.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;\r\n\r\n /**\r\n * Attempts to get a schema from the locater. Yields undefined if no matching schema is found.\r\n * For schemas that may have references, construct and call through a SchemaContext instead.\r\n * @param schemaKey key to look up\r\n * @param matchType how to match key against candidate schemas\r\n * @param context context for loading schema references\r\n */\r\n getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType, context: SchemaContext): T | undefined;\r\n}\r\n\r\n/**\r\n * @beta\r\n */\r\nexport interface ISchemaItemLocater {\r\n getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined>;\r\n}\r\n\r\n/**\r\n * @internal\r\n */\r\nexport class SchemaCache implements ISchemaLocater {\r\n private _schema: SchemaMap;\r\n\r\n constructor() {\r\n this._schema = new SchemaMap();\r\n }\r\n\r\n public get count() { return this._schema.length; }\r\n\r\n private loadedSchemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return undefined !== this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, SchemaMatchType.Latest) && !entry.schemaPromise);\r\n }\r\n\r\n private schemaPromiseExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return undefined !== this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, SchemaMatchType.Latest) && undefined !== entry.schemaPromise);\r\n }\r\n\r\n private findEntry(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType): SchemaEntry | undefined {\r\n return this._schema.find((entry: SchemaEntry) => entry.schemaInfo.schemaKey.matches(schemaKey, matchType));\r\n }\r\n\r\n private removeSchemaPromise(schemaKey: Readonly<SchemaKey>) {\r\n const entry = this.findEntry(schemaKey, SchemaMatchType.Latest);\r\n if (entry)\r\n entry.schemaPromise = undefined;\r\n }\r\n\r\n private removeEntry(schemaKey: Readonly<SchemaKey>) {\r\n this._schema = this._schema.filter((entry: SchemaEntry) => !entry.schemaInfo.schemaKey.matches(schemaKey));\r\n }\r\n\r\n /**\r\n * Returns true if the schema exists in either the schema cache or the promise cache. SchemaMatchType.Latest used.\r\n * @param schemaKey The key to search for.\r\n */\r\n public schemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return this.loadedSchemaExists(schemaKey) || this.schemaPromiseExists(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.\r\n * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache\r\n * @param schemaInfo An object with the schema key for the schema being loaded and it's references\r\n * @param schema The partially loaded schema that the promise will fulfill\r\n * @param schemaPromise The schema promise to add to the cache.\r\n */\r\n public async addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>) {\r\n if (this.schemaExists(schemaInfo.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schemaInfo.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo, schema, schemaPromise });\r\n\r\n // This promise is cached and will be awaited when the user requests the full schema.\r\n // If the promise competes successfully before the user requests the schema it will be removed from the cache\r\n // If it fails it will remain in the cache until the user awaits it and handles the error\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n schemaPromise.then(() => {\r\n this.removeSchemaPromise(schemaInfo.schemaKey);\r\n });\r\n }\r\n\r\n /**\r\n * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.\r\n * @param schema The schema to add to the cache.\r\n */\r\n public async addSchema<T extends Schema>(schema: T) {\r\n if (this.schemaExists(schema.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schema.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo: schema, schema });\r\n }\r\n\r\n /**\r\n * Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.\r\n * @param schema The schema to add to the cache.\r\n */\r\n public addSchemaSync<T extends Schema>(schema: T) {\r\n if (this.schemaExists(schema.schemaKey))\r\n throw new ECObjectsError(ECObjectsStatus.DuplicateSchema, `The schema, ${schema.schemaKey.toString()}, already exists within this cache.`);\r\n\r\n this._schema.push({ schemaInfo: schema, schema });\r\n }\r\n\r\n /**\r\n * Gets the schema which matches the provided SchemaKey.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (!entry)\r\n return undefined;\r\n\r\n if (entry.schemaPromise) {\r\n try {\r\n const schema = await entry.schemaPromise as T;\r\n return schema;\r\n } catch (e) {\r\n this.removeEntry(schemaKey);\r\n throw e;\r\n }\r\n }\r\n\r\n return entry.schema as T;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<SchemaInfo | undefined> {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (entry)\r\n return entry.schemaInfo;\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the schema which matches the provided SchemaKey. If the schema is partially loaded an exception will be thrown.\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n if (this.count === 0)\r\n return undefined;\r\n\r\n const entry = this.findEntry(schemaKey, matchType);\r\n if (entry) {\r\n if (entry.schemaPromise) {\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLoadSchema, `The Schema ${schemaKey.toString()} is partially loaded so cannot be loaded synchronously.`);\r\n }\r\n return entry.schema as T;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Generator function that can iterate through each schema in _schema SchemaMap and items for each Schema.\r\n * Does not include schema items from schemas that are not completely loaded yet.\r\n */\r\n public * getSchemaItems(): IterableIterator<SchemaItem> {\r\n for (const entry of this._schema) {\r\n for (const schemaItem of entry.schema.getItems()) {\r\n yield schemaItem;\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Gets all the schemas from the schema cache.\r\n * Does not include schemas from schemas that are not completely loaded yet.\r\n * @returns An array of Schema objects.\r\n */\r\n public getAllSchemas(): Schema[] {\r\n return this._schema.map((entry: SchemaEntry) => entry.schema);\r\n }\r\n}\r\n\r\n/**\r\n * The SchemaContext, context object is used to facilitate schema and schema item location.\r\n *\r\n * The context controls the lifetime of each schema that it knows about. It has to be explicitly removed from the context to delete a schema object.\r\n *\r\n * The context is made up of a group of Schema Locators.\r\n * @beta\r\n */\r\nexport class SchemaContext implements ISchemaItemLocater {\r\n private _locaters: ISchemaLocater[];\r\n\r\n private _knownSchemas: SchemaCache;\r\n private _fallbackLocaterDefined: boolean;\r\n\r\n constructor() {\r\n this._locaters = [];\r\n\r\n this._knownSchemas = new SchemaCache();\r\n this._locaters.push(this._knownSchemas);\r\n this._fallbackLocaterDefined = false;\r\n }\r\n\r\n public get locaters(): ISchemaLocater[] { return this._locaters; }\r\n\r\n /**\r\n * Adds a locater to the context.\r\n *\r\n * If no locaters are defined or a fallback locater is not defined, the new locater is added at the end of the locaters array.\r\n * If a fallback locater is already defined, the new locater is inserted before the fallback locater.\r\n *\r\n * @param locater - The locater to be added.\r\n */\r\n public addLocater(locater: ISchemaLocater) {\r\n const insertIndex = (this._locaters.length === 0 || !this._fallbackLocaterDefined) ? this._locaters.length : this._locaters.length - 1;\r\n this._locaters.splice(insertIndex, 0, locater);\r\n }\r\n\r\n /**\r\n * Adds a fallback locater to the context.\r\n *\r\n * If a fallback locater is already defined, it replaces the existing one.\r\n * Otherwise, it adds the new locater to the end of the locaters array and marks the fallback locater as defined.\r\n *\r\n * @param locater - The locater to be added as a fallback.\r\n */\r\n public addFallbackLocater(locater: ISchemaLocater) {\r\n if (this._fallbackLocaterDefined) {\r\n this._locaters[this._locaters.length - 1] = locater;\r\n } else {\r\n this._locaters.push(locater);\r\n this._fallbackLocaterDefined = true;\r\n }\r\n }\r\n\r\n /**\r\n * Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.\r\n * @param schema The schema to add to this context\r\n */\r\n public async addSchema(schema: Schema) {\r\n this.addSchemaSync(schema);\r\n }\r\n\r\n /**\r\n * Adds the schema to this context\r\n * @param schema The schema to add to this context\r\n */\r\n public addSchemaSync(schema: Schema) {\r\n this._knownSchemas.addSchemaSync(schema);\r\n }\r\n\r\n /**\r\n * Adds the given SchemaItem to the the SchemaContext by locating the schema, with the best match of SchemaMatchType.Exact, and\r\n * @param schemaItem The SchemaItem to add\r\n * @deprecated in 4.0 use ecschema-editing package\r\n */\r\n public async addSchemaItem(schemaItem: SchemaItem) {\r\n const schema = await this.getSchema(schemaItem.key.schemaKey, SchemaMatchType.Exact);\r\n if (!schema)\r\n throw new ECObjectsError(ECObjectsStatus.UnableToLocateSchema, `Unable to add the schema item ${schemaItem.name} to the schema ${schemaItem.key.schemaKey.toString()} because the schema could not be located.`);\r\n\r\n (schema as MutableSchema).addItem(schemaItem);\r\n }\r\n\r\n /**\r\n * Returns true if the schema is already in the context. SchemaMatchType.Latest is used to find a match.\r\n * @param schemaKey\r\n */\r\n public schemaExists(schemaKey: Readonly<SchemaKey>): boolean {\r\n return this._knownSchemas.schemaExists(schemaKey);\r\n }\r\n\r\n /**\r\n * Adds a promise to load the schema to the cache. Does not allow for duplicate schemas in the cache of schemas or cache of promises, checks using SchemaMatchType.Latest.\r\n * When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache.\r\n * Use this method over addSchema when asynchronously loading schemas\r\n * @param schemaInfo An object with the schema key for the schema being loaded and it's references\r\n * @param schema The partially loaded schema that the promise will fulfill\r\n * @param schemaPromise The schema promise to add to the cache.\r\n */\r\n public async addSchemaPromise(schemaInfo: SchemaInfo, schema: Schema, schemaPromise: Promise<Schema>) {\r\n return this._knownSchemas.addSchemaPromise(schemaInfo, schema, schemaPromise);\r\n }\r\n\r\n /** Attempts to obtain a schema from this context that matches the specified criteria.\r\n * @param schemaKey Identifies the schema to obtain.\r\n * @param matchType Criteria by which to identify potentially matching schemas.\r\n * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.\r\n */\r\n public async getSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n // the first locater is _knownSchemas, so we don't have to check the cache explicitly here\r\n for (const locater of this._locaters) {\r\n const schema = await locater.getSchema<T>(schemaKey, matchType, this);\r\n if (undefined !== schema)\r\n return schema;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.\r\n * The fully loaded schema can be gotten later from the context using [[getSchema]].\r\n * @param schemaKey The SchemaKey describing the schema to get from the cache.\r\n * @param matchType The match type to use when locating the schema\r\n */\r\n public async getSchemaInfo(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType): Promise<SchemaInfo | undefined> {\r\n for (const locater of this._locaters) {\r\n const schemaInfo = await locater.getSchemaInfo(schemaKey, matchType, this);\r\n if (undefined !== schemaInfo)\r\n return schemaInfo;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /** Attempts to obtain a schema from this context that matches the specified criteria.\r\n * Will return undefined if the schema is partially loaded. Use [[getSchema]] to await until the schema is completely loaded.\r\n * @param schemaKey Identifies the schema to obtain.\r\n * @param matchType Criteria by which to identify potentially matching schemas.\r\n * @returns the schema matching the input criteria, or `undefined` if no such schema could be located.\r\n */\r\n public getSchemaSync<T extends Schema>(schemaKey: SchemaKey, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n // the first locater is _knownSchemas, so we don't have to check the cache explicitly here\r\n for (const locater of this._locaters) {\r\n const schema = locater.getSchemaSync<T>(schemaKey, matchType, this);\r\n if (undefined !== schema)\r\n return schema;\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n /**\r\n * Attempts to get a Schema from the context's cache.\r\n * Will await a partially loaded schema then return when it is completely loaded.\r\n * @param schemaKey The SchemaKey to identify the Schema.\r\n * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.\r\n * @internal\r\n */\r\n public async getCachedSchema<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): Promise<T | undefined> {\r\n return this._knownSchemas.getSchema<T>(schemaKey, matchType);\r\n }\r\n\r\n /**\r\n * Attempts to get a Schema from the context's cache.\r\n * Will return undefined if the cached schema is partially loaded. Use [[getCachedSchema]] to await until the schema is completely loaded.\r\n * @param schemaKey The SchemaKey to identify the Schema.\r\n * @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.\r\n * @internal\r\n */\r\n public getCachedSchemaSync<T extends Schema>(schemaKey: Readonly<SchemaKey>, matchType: SchemaMatchType = SchemaMatchType.Latest): T | undefined {\r\n return this._knownSchemas.getSchemaSync<T>(schemaKey, matchType);\r\n }\r\n\r\n /**\r\n * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].\r\n * Will await a partially loaded schema then look in it for the requested item\r\n * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.\r\n * @returns The requested schema item\r\n */\r\n public async getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined> {\r\n const schema = await this.getSchema(schemaItemKey.schemaKey, SchemaMatchType.Latest);\r\n if (undefined === schema)\r\n return undefined;\r\n return schema.getItem<T>(schemaItemKey.name);\r\n }\r\n\r\n /**\r\n * Gets the schema item from the specified schema if it exists in this [[SchemaContext]].\r\n * Will skip a partially loaded schema and return undefined if the item belongs to that schema. Use the async method to await partially loaded schemas.\r\n * @param schemaItemKey The SchemaItemKey identifying the item to return. SchemaMatchType.Latest is used to match the schema.\r\n * @returns The requested schema item\r\n */\r\n public getSchemaItemSync<T extends SchemaItem>(schemaItemKey: SchemaItemKey): T | undefined {\r\n const schema = this.getSchemaSync(schemaItemKey.schemaKey, SchemaMatchType.Latest);\r\n if (undefined === schema)\r\n return undefined;\r\n return schema.getItemSync<T>(schemaItemKey.name);\r\n }\r\n\r\n /**\r\n * Iterates through the items of each schema known to the context. This includes schemas added to the\r\n * context using [[SchemaContext.addSchema]]. This does not include schemas that\r\n * can be located by an ISchemaLocater instance added to the context.\r\n * Does not include schema items from schemas that are not completely loaded yet.\r\n */\r\n public getSchemaItems(): IterableIterator<SchemaItem> {\r\n return this._knownSchemas.getSchemaItems();\r\n }\r\n\r\n /**\r\n * Gets all the Schemas known by the context. This includes schemas added to the\r\n * context using [[SchemaContext.addSchema]]. This does not include schemas that\r\n * can be located by an ISchemaLocater instance added to the context. Does not\r\n * include schemas that are partially loaded.\r\n * @returns An array of Schema objects.\r\n */\r\n public getKnownSchemas(): Schema[] {\r\n return this._knownSchemas.getAllSchemas();\r\n }\r\n}\r\n"]}
@@ -31,6 +31,7 @@ exports.DelayedPromiseWithProps = exports.DelayedPromise = void 0;
31
31
  * @beta
32
32
  */
33
33
  class DelayedPromise {
34
+ static { _a = Symbol.toStringTag; }
34
35
  /**
35
36
  * Constructs a DelayedPromise object.
36
37
  * @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
@@ -71,7 +72,6 @@ class DelayedPromise {
71
72
  }
72
73
  }
73
74
  exports.DelayedPromise = DelayedPromise;
74
- _a = Symbol.toStringTag;
75
75
  // Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
76
76
  // So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
77
77
  /**
@@ -1 +1 @@
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
+ {"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAa,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;AAjDD,wCAiDC;AAgCD,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"]}
@@ -124,6 +124,9 @@ export interface RelationshipConstraintProps {
124
124
  readonly polymorphic: boolean;
125
125
  readonly abstractConstraint?: string;
126
126
  readonly constraintClasses: string[];
127
+ readonly customAttributes?: Array<{
128
+ [value: string]: any;
129
+ }>;
127
130
  }
128
131
  /**
129
132
  * @beta
@@ -1 +1 @@
1
- {"version":3,"file":"JsonProps.d.ts","sourceRoot":"","sources":["../../../src/Deserialization/JsonProps.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,mBAAmB,GAAG,2BAA2B,GAAG,wBAAwB,GAAG,uBAAuB,CAAC;AAC/J;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG,UAAU,GAAG,yBAAyB,GAAG,sBAAsB,CAAC;AAC/G;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,iBAAiB,GAAG,aAAa,GAAG,eAAe,GAAG,qBAAqB,GAAG,6BAA6B,CAAC;AAEpP;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,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AC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,eAAe,GAAG,WAAW,CAAC;AAElE;;GAEG;AACH,MAAM,WAAW,6BAA8B,SAAQ,qBAAqB;IAC1E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAkB,SAAQ,eAAe;IACxD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,eAAe;IACtD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,mBAAoB,SAAQ,eAAe;IAC1D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"JsonProps.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { FormatProps } from \"@itwin/core-quantity\";\n\n/**\n * @beta\n */\nexport type AnyPropertyProps = PrimitivePropertyProps | StructPropertyProps | PrimitiveArrayPropertyProps | StructArrayPropertyProps | NavigationPropertyProps;\n/**\n * @beta\n */\nexport type AnyClassProps = EntityClassProps | MixinProps | CustomAttributeClassProps | RelationshipClassProps;\n/**\n * @beta\n */\nexport type AnySchemaItemProps = AnyClassProps | EnumerationProps | KindOfQuantityProps | PropertyCategoryProps | SchemaItemUnitProps | InvertedUnitProps | ConstantProps | PhenomenonProps | SchemaItemFormatProps | SchemaItemOverrideFormatProps;\n\n/**\n * @beta\n */\nexport interface SchemaProps {\n readonly $schema: string;\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly label?: string;\n readonly description?: string;\n readonly references?: SchemaReferenceProps[];\n readonly items?: { [name: string]: SchemaItemProps };\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly ecSpecMajorVersion?: number;\n readonly ecSpecMinorVersion?: number;\n}\n\n/**\n * JSON Object interface used to deserialize into a [[SchemaKey]].\n * @beta\n */\nexport interface SchemaKeyProps {\n /** The schema name */\n readonly name: string;\n /** Read version of the schema */\n readonly read: number;\n /** Write version of the schema */\n readonly write: number;\n /** Minor version of the schema */\n readonly minor: number;\n}\n\n/**\n * @beta\n */\nexport interface SchemaReferenceProps {\n readonly name: string;\n readonly version: string;\n}\n\n/**\n * @beta\n */\nexport interface SchemaItemProps {\n // NEEDSWORK: Still need to clarify how single-item deserialization works...\n readonly $schema?: string;\n readonly schema?: string; // conditionally required\n readonly schemaVersion?: string;\n readonly name?: string;\n readonly schemaItemType?: string;\n readonly label?: string;\n readonly description?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly originalECSpecMajorVersion?: number;\n readonly originalECSpecMinorVersion?: number;\n}\n\n/**\n * @beta\n */\nexport interface ClassProps extends SchemaItemProps {\n readonly modifier?: string;\n readonly baseClass?: string;\n readonly properties?: AnyPropertyProps[];\n}\n\n/**\n * @beta\n */\nexport interface EntityClassProps extends ClassProps {\n readonly mixins?: string[];\n}\n\n/**\n * @beta\n */\nexport interface MixinProps extends ClassProps {\n readonly appliesTo: string;\n}\n\n/**\n * @beta\n */\nexport type StructClassProps = ClassProps;\n\n/**\n * @beta\n */\nexport interface CustomAttributeClassProps extends ClassProps {\n /**\n * Can be any combination of the [CustomAttributeContainerType]$(docs/bis/ec/customattribute-container-types.md) string values\n * separated by commas.\n */\n readonly appliesTo: string;\n}\n\n/**\n * @beta\n */\nexport interface RelationshipClassProps extends ClassProps {\n readonly strength: string;\n readonly strengthDirection: string;\n readonly source: RelationshipConstraintProps;\n readonly target: RelationshipConstraintProps;\n}\n\n/**\n * @beta\n */\nexport interface RelationshipConstraintProps {\n readonly multiplicity: string;\n readonly roleLabel: string;\n readonly polymorphic: boolean;\n readonly abstractConstraint?: string;\n readonly constraintClasses: string[];\n}\n\n/**\n * @beta\n */\nexport interface EnumerationProps extends SchemaItemProps {\n readonly type: string;\n readonly isStrict: boolean;\n readonly enumerators: EnumeratorProps[];\n}\n\n/**\n * @beta\n */\nexport interface EnumeratorProps {\n readonly name: string;\n readonly value: string | number;\n readonly label?: string;\n readonly description?: string;\n}\n\n/**\n * @beta\n */\nexport interface KindOfQuantityProps extends SchemaItemProps {\n readonly persistenceUnit: string;\n readonly presentationUnits?: string | string[];\n readonly relativeError: number;\n}\n\n/**\n * @beta\n */\nexport interface PropertyCategoryProps extends SchemaItemProps {\n readonly priority: number;\n}\n\n/**\n * @beta\n */\nexport interface PropertyProps {\n readonly name: string;\n readonly type: string;\n readonly description?: string;\n readonly label?: string;\n readonly isReadOnly?: boolean;\n readonly category?: string;\n readonly priority?: number;\n readonly inherited?: boolean;\n readonly kindOfQuantity?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n}\n\n/**\n * @beta\n */\nexport interface PrimitiveOrEnumPropertyBaseProps extends PropertyProps {\n readonly extendedTypeName?: string;\n readonly minLength?: number;\n readonly maxLength?: number;\n readonly minValue?: number;\n readonly maxValue?: number;\n}\n\n/**\n * @beta\n */\nexport interface PrimitivePropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface StructPropertyProps extends PropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface EnumerationPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface ArrayPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly minOccurs?: number;\n readonly maxOccurs?: number;\n}\n\n/**\n * @beta\n */\nexport interface PrimitiveArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface StructArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface NavigationPropertyProps extends PropertyProps {\n readonly relationshipName: string;\n readonly direction: string;\n}\n\n/**\n * @beta\n */\nexport interface ConstantProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n}\n\n/**\n * @beta\n */\nexport type SchemaItemFormatProps = SchemaItemProps & FormatProps;\n\n/**\n * @beta\n */\nexport interface SchemaItemOverrideFormatProps extends SchemaItemFormatProps {\n readonly parent: string;\n}\n\n/**\n * @beta\n */\nexport interface InvertedUnitProps extends SchemaItemProps {\n readonly invertsUnit: string;\n readonly unitSystem: string;\n}\n\n/**\n * @beta\n */\nexport interface PhenomenonProps extends SchemaItemProps {\n readonly definition: string;\n}\n\n/**\n * @beta\n */\nexport type UnitSystemProps = SchemaItemProps;\n\n/**\n * @beta\n */\nexport interface SchemaItemUnitProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly unitSystem: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n readonly offset?: number;\n}\n"]}
1
+ {"version":3,"file":"JsonProps.js","sourceRoot":"","sources":["../../../src/Deserialization/JsonProps.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { FormatProps } from \"@itwin/core-quantity\";\n\n/**\n * @beta\n */\nexport type AnyPropertyProps = PrimitivePropertyProps | StructPropertyProps | PrimitiveArrayPropertyProps | StructArrayPropertyProps | NavigationPropertyProps;\n/**\n * @beta\n */\nexport type AnyClassProps = EntityClassProps | MixinProps | CustomAttributeClassProps | RelationshipClassProps;\n/**\n * @beta\n */\nexport type AnySchemaItemProps = AnyClassProps | EnumerationProps | KindOfQuantityProps | PropertyCategoryProps | SchemaItemUnitProps | InvertedUnitProps | ConstantProps | PhenomenonProps | SchemaItemFormatProps | SchemaItemOverrideFormatProps;\n\n/**\n * @beta\n */\nexport interface SchemaProps {\n readonly $schema: string;\n readonly name: string;\n readonly version: string;\n readonly alias: string;\n readonly label?: string;\n readonly description?: string;\n readonly references?: SchemaReferenceProps[];\n readonly items?: { [name: string]: SchemaItemProps };\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly ecSpecMajorVersion?: number;\n readonly ecSpecMinorVersion?: number;\n}\n\n/**\n * JSON Object interface used to deserialize into a [[SchemaKey]].\n * @beta\n */\nexport interface SchemaKeyProps {\n /** The schema name */\n readonly name: string;\n /** Read version of the schema */\n readonly read: number;\n /** Write version of the schema */\n readonly write: number;\n /** Minor version of the schema */\n readonly minor: number;\n}\n\n/**\n * @beta\n */\nexport interface SchemaReferenceProps {\n readonly name: string;\n readonly version: string;\n}\n\n/**\n * @beta\n */\nexport interface SchemaItemProps {\n // NEEDSWORK: Still need to clarify how single-item deserialization works...\n readonly $schema?: string;\n readonly schema?: string; // conditionally required\n readonly schemaVersion?: string;\n readonly name?: string;\n readonly schemaItemType?: string;\n readonly label?: string;\n readonly description?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n readonly originalECSpecMajorVersion?: number;\n readonly originalECSpecMinorVersion?: number;\n}\n\n/**\n * @beta\n */\nexport interface ClassProps extends SchemaItemProps {\n readonly modifier?: string;\n readonly baseClass?: string;\n readonly properties?: AnyPropertyProps[];\n}\n\n/**\n * @beta\n */\nexport interface EntityClassProps extends ClassProps {\n readonly mixins?: string[];\n}\n\n/**\n * @beta\n */\nexport interface MixinProps extends ClassProps {\n readonly appliesTo: string;\n}\n\n/**\n * @beta\n */\nexport type StructClassProps = ClassProps;\n\n/**\n * @beta\n */\nexport interface CustomAttributeClassProps extends ClassProps {\n /**\n * Can be any combination of the [CustomAttributeContainerType]$(docs/bis/ec/customattribute-container-types.md) string values\n * separated by commas.\n */\n readonly appliesTo: string;\n}\n\n/**\n * @beta\n */\nexport interface RelationshipClassProps extends ClassProps {\n readonly strength: string;\n readonly strengthDirection: string;\n readonly source: RelationshipConstraintProps;\n readonly target: RelationshipConstraintProps;\n}\n\n/**\n * @beta\n */\nexport interface RelationshipConstraintProps {\n readonly multiplicity: string;\n readonly roleLabel: string;\n readonly polymorphic: boolean;\n readonly abstractConstraint?: string;\n readonly constraintClasses: string[];\n readonly customAttributes?: Array<{ [value: string]: any }>;\n}\n\n/**\n * @beta\n */\nexport interface EnumerationProps extends SchemaItemProps {\n readonly type: string;\n readonly isStrict: boolean;\n readonly enumerators: EnumeratorProps[];\n}\n\n/**\n * @beta\n */\nexport interface EnumeratorProps {\n readonly name: string;\n readonly value: string | number;\n readonly label?: string;\n readonly description?: string;\n}\n\n/**\n * @beta\n */\nexport interface KindOfQuantityProps extends SchemaItemProps {\n readonly persistenceUnit: string;\n readonly presentationUnits?: string | string[];\n readonly relativeError: number;\n}\n\n/**\n * @beta\n */\nexport interface PropertyCategoryProps extends SchemaItemProps {\n readonly priority: number;\n}\n\n/**\n * @beta\n */\nexport interface PropertyProps {\n readonly name: string;\n readonly type: string;\n readonly description?: string;\n readonly label?: string;\n readonly isReadOnly?: boolean;\n readonly category?: string;\n readonly priority?: number;\n readonly inherited?: boolean;\n readonly kindOfQuantity?: string;\n readonly customAttributes?: Array<{ [value: string]: any }>;\n}\n\n/**\n * @beta\n */\nexport interface PrimitiveOrEnumPropertyBaseProps extends PropertyProps {\n readonly extendedTypeName?: string;\n readonly minLength?: number;\n readonly maxLength?: number;\n readonly minValue?: number;\n readonly maxValue?: number;\n}\n\n/**\n * @beta\n */\nexport interface PrimitivePropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface StructPropertyProps extends PropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface EnumerationPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface ArrayPropertyProps extends PrimitiveOrEnumPropertyBaseProps {\n readonly minOccurs?: number;\n readonly maxOccurs?: number;\n}\n\n/**\n * @beta\n */\nexport interface PrimitiveArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface StructArrayPropertyProps extends ArrayPropertyProps {\n readonly typeName: string;\n}\n\n/**\n * @beta\n */\nexport interface NavigationPropertyProps extends PropertyProps {\n readonly relationshipName: string;\n readonly direction: string;\n}\n\n/**\n * @beta\n */\nexport interface ConstantProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n}\n\n/**\n * @beta\n */\nexport type SchemaItemFormatProps = SchemaItemProps & FormatProps;\n\n/**\n * @beta\n */\nexport interface SchemaItemOverrideFormatProps extends SchemaItemFormatProps {\n readonly parent: string;\n}\n\n/**\n * @beta\n */\nexport interface InvertedUnitProps extends SchemaItemProps {\n readonly invertsUnit: string;\n readonly unitSystem: string;\n}\n\n/**\n * @beta\n */\nexport interface PhenomenonProps extends SchemaItemProps {\n readonly definition: string;\n}\n\n/**\n * @beta\n */\nexport type UnitSystemProps = SchemaItemProps;\n\n/**\n * @beta\n */\nexport interface SchemaItemUnitProps extends SchemaItemProps {\n readonly phenomenon: string;\n readonly unitSystem: string;\n readonly definition: string;\n readonly numerator?: number;\n readonly denominator?: number;\n readonly offset?: number;\n}\n"]}
@@ -205,8 +205,7 @@ export declare abstract class ECClass extends SchemaItem implements CustomAttrib
205
205
  * @beta
206
206
  */
207
207
  export declare class StructClass extends ECClass {
208
- readonly schemaItemType: SchemaItemType.StructClass;
209
- constructor(schema: Schema, name: string, modifier?: ECClassModifier);
208
+ readonly schemaItemType = SchemaItemType.StructClass;
210
209
  }
211
210
  /**
212
211
  * @internal
@@ -1 +1 @@
1
- {"version":3,"file":"Class.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Class.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE1D,OAAO,EAAyB,eAAe,EAA0C,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7I,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EACL,wBAAwB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,mBAAmB,EAAE,cAAc,EACxI,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;GAGG;AACH,8BAAsB,OAAQ,SAAQ,UAAW,YAAW,6BAA6B;IACvF,SAAS,CAAC,SAAS,EAAE,eAAe,CAAC;IACrC,SAAS,CAAC,UAAU,CAAC,EAAE,iBAAiB,CAAC;IACzC,SAAS,CAAC,WAAW,CAAC,EAAE,GAAG,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AI;CAChE"}
@@ -543,8 +543,8 @@ exports.ECClass = ECClass;
543
543
  * @beta
544
544
  */
545
545
  class StructClass extends ECClass {
546
- constructor(schema, name, modifier) {
547
- super(schema, name, modifier);
546
+ constructor() {
547
+ super(...arguments);
548
548
  this.schemaItemType = ECObjects_1.SchemaItemType.StructClass;
549
549
  }
550
550
  }