@itwin/ecschema-metadata 5.0.0-dev.9 → 5.0.0-dev.90
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.
- package/CHANGELOG.md +51 -1
- package/lib/cjs/Constants.js +20 -20
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Context.d.ts +83 -34
- package/lib/cjs/Context.d.ts.map +1 -1
- package/lib/cjs/Context.js +73 -23
- package/lib/cjs/Context.js.map +1 -1
- package/lib/cjs/DelayedPromise.js +6 -4
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/AbstractParser.js +1 -0
- package/lib/cjs/Deserialization/AbstractParser.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts +3 -3
- package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
- package/lib/cjs/Deserialization/Helper.js +8 -0
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js +3 -0
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +3 -0
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js +11 -3
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +2 -6
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.js +1 -0
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +21 -1
- package/lib/cjs/ECObjects.d.ts.map +1 -1
- package/lib/cjs/ECObjects.js +33 -2
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.js +1 -0
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +10 -3
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +75 -16
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +168 -46
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +14 -1
- package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
- package/lib/cjs/Metadata/Constant.js +27 -2
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +16 -4
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +22 -4
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +20 -8
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +42 -22
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts +14 -1
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js +22 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +41 -1
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js +68 -3
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +8 -3
- package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js +17 -6
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +14 -3
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +43 -18
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +15 -1
- package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
- package/lib/cjs/Metadata/Mixin.js +23 -2
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +9 -0
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +14 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js +22 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts +5 -1
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +83 -28
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +14 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js +21 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +15 -2
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +47 -10
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +116 -11
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +135 -33
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +11 -2
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +10 -0
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.d.ts +8 -1
- package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
- package/lib/cjs/Metadata/Unit.js +21 -3
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +14 -3
- package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js +21 -3
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaJsonLocater.d.ts +3 -3
- package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js +3 -3
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.d.ts +7 -1
- package/lib/cjs/SchemaKey.d.ts.map +1 -1
- package/lib/cjs/SchemaKey.js +13 -3
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +2 -2
- package/lib/cjs/SchemaLoader.d.ts.map +1 -1
- package/lib/cjs/SchemaLoader.js +1 -0
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js +1 -0
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/Graph.js +69 -65
- package/lib/cjs/UnitConversion/Graph.js.map +1 -1
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js +9 -7
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js +2 -0
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.d.ts +2 -0
- package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js +11 -1
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js +8 -9
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts +1 -1
- package/lib/cjs/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/cjs/Validation/SchemaWalker.js +6 -4
- package/lib/cjs/Validation/SchemaWalker.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +1 -1
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js +2 -3
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.js +20 -20
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Context.d.ts +83 -34
- package/lib/esm/Context.d.ts.map +1 -1
- package/lib/esm/Context.js +71 -21
- package/lib/esm/Context.js.map +1 -1
- package/lib/esm/DelayedPromise.js +6 -4
- package/lib/esm/DelayedPromise.js.map +1 -1
- package/lib/esm/Deserialization/AbstractParser.js +1 -0
- package/lib/esm/Deserialization/AbstractParser.js.map +1 -1
- package/lib/esm/Deserialization/Helper.d.ts +3 -3
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
- package/lib/esm/Deserialization/Helper.js +8 -0
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js +3 -0
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/JsonProps.d.ts +3 -0
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/esm/Deserialization/JsonProps.js.map +1 -1
- package/lib/esm/Deserialization/SchemaGraphUtil.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js +11 -3
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +2 -6
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECName.js +1 -0
- package/lib/esm/ECName.js.map +1 -1
- package/lib/esm/ECObjects.d.ts +21 -1
- package/lib/esm/ECObjects.d.ts.map +1 -1
- package/lib/esm/ECObjects.js +31 -1
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/Exception.js +1 -0
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +10 -3
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +75 -16
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +169 -47
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Constant.d.ts +14 -1
- package/lib/esm/Metadata/Constant.d.ts.map +1 -1
- package/lib/esm/Metadata/Constant.js +27 -2
- package/lib/esm/Metadata/Constant.js.map +1 -1
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +16 -4
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +22 -4
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +20 -8
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +42 -22
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Enumeration.d.ts +14 -1
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/esm/Metadata/Enumeration.js +22 -1
- package/lib/esm/Metadata/Enumeration.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +41 -1
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js +68 -3
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.d.ts +8 -3
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.js +17 -6
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.d.ts +14 -3
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +43 -18
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Mixin.d.ts +15 -1
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
- package/lib/esm/Metadata/Mixin.js +24 -3
- package/lib/esm/Metadata/Mixin.js.map +1 -1
- package/lib/esm/Metadata/OverrideFormat.js +9 -0
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts +14 -1
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/esm/Metadata/Phenomenon.js +22 -1
- package/lib/esm/Metadata/Phenomenon.js.map +1 -1
- package/lib/esm/Metadata/Property.d.ts +5 -1
- package/lib/esm/Metadata/Property.d.ts.map +1 -1
- package/lib/esm/Metadata/Property.js +84 -29
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts +14 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.js +21 -1
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts +15 -2
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +48 -11
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
- package/lib/esm/Metadata/Schema.d.ts +116 -11
- package/lib/esm/Metadata/Schema.d.ts.map +1 -1
- package/lib/esm/Metadata/Schema.js +135 -33
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.d.ts +11 -2
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +11 -1
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/Metadata/Unit.d.ts +8 -1
- package/lib/esm/Metadata/Unit.d.ts.map +1 -1
- package/lib/esm/Metadata/Unit.js +21 -3
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/Metadata/UnitSystem.d.ts +14 -3
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/esm/Metadata/UnitSystem.js +21 -3
- package/lib/esm/Metadata/UnitSystem.js.map +1 -1
- package/lib/esm/PropertyTypes.js.map +1 -1
- package/lib/esm/SchemaJsonLocater.d.ts +3 -3
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/esm/SchemaJsonLocater.js +3 -3
- package/lib/esm/SchemaJsonLocater.js.map +1 -1
- package/lib/esm/SchemaKey.d.ts +7 -1
- package/lib/esm/SchemaKey.d.ts.map +1 -1
- package/lib/esm/SchemaKey.js +13 -3
- package/lib/esm/SchemaKey.js.map +1 -1
- package/lib/esm/SchemaLoader.d.ts +2 -2
- package/lib/esm/SchemaLoader.d.ts.map +1 -1
- package/lib/esm/SchemaLoader.js +1 -0
- package/lib/esm/SchemaLoader.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js +1 -0
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/UnitConversion/Graph.js +69 -65
- package/lib/esm/UnitConversion/Graph.js.map +1 -1
- package/lib/esm/UnitConversion/Parser.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConversion.d.ts +1 -1
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitConversion.js +9 -7
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConverter.js +2 -0
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.d.ts +2 -0
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.js +11 -1
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +8 -9
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/esm/Validation/SchemaWalker.d.ts +1 -1
- package/lib/esm/Validation/SchemaWalker.d.ts.map +1 -1
- package/lib/esm/Validation/SchemaWalker.js +6 -4
- package/lib/esm/Validation/SchemaWalker.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +1 -1
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/lib/esm/utils/SchemaGraph.js +2 -3
- package/lib/esm/utils/SchemaGraph.js.map +1 -1
- package/package.json +14 -14
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
# Change Log - @itwin/ecschema-metadata
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 19 Mar 2025 15:33:24 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 4.10.11
|
|
6
|
+
Wed, 19 Mar 2025 15:30:39 GMT
|
|
7
|
+
|
|
8
|
+
_Version update only_
|
|
9
|
+
|
|
10
|
+
## 4.10.10
|
|
11
|
+
Tue, 11 Mar 2025 15:25:11 GMT
|
|
12
|
+
|
|
13
|
+
_Version update only_
|
|
14
|
+
|
|
15
|
+
## 4.10.9
|
|
16
|
+
Tue, 11 Mar 2025 05:17:33 GMT
|
|
17
|
+
|
|
18
|
+
_Version update only_
|
|
19
|
+
|
|
20
|
+
## 4.10.8
|
|
21
|
+
Thu, 06 Mar 2025 14:13:37 GMT
|
|
22
|
+
|
|
23
|
+
_Version update only_
|
|
24
|
+
|
|
25
|
+
## 4.10.7
|
|
26
|
+
Tue, 18 Feb 2025 17:27:03 GMT
|
|
27
|
+
|
|
28
|
+
_Version update only_
|
|
29
|
+
|
|
30
|
+
## 4.10.6
|
|
31
|
+
Fri, 24 Jan 2025 08:02:40 GMT
|
|
32
|
+
|
|
33
|
+
_Version update only_
|
|
34
|
+
|
|
35
|
+
## 4.10.5
|
|
36
|
+
Tue, 21 Jan 2025 21:56:45 GMT
|
|
37
|
+
|
|
38
|
+
_Version update only_
|
|
39
|
+
|
|
40
|
+
## 4.10.4
|
|
41
|
+
Mon, 13 Jan 2025 14:06:43 GMT
|
|
42
|
+
|
|
43
|
+
_Version update only_
|
|
44
|
+
|
|
45
|
+
## 4.10.3
|
|
46
|
+
Mon, 06 Jan 2025 14:00:13 GMT
|
|
47
|
+
|
|
48
|
+
_Version update only_
|
|
49
|
+
|
|
50
|
+
## 4.10.2
|
|
51
|
+
Thu, 21 Nov 2024 15:22:20 GMT
|
|
52
|
+
|
|
53
|
+
_Version update only_
|
|
4
54
|
|
|
5
55
|
## 4.10.1
|
|
6
56
|
Thu, 14 Nov 2024 18:11:00 GMT
|
package/lib/cjs/Constants.js
CHANGED
|
@@ -9,26 +9,26 @@ exports.ECStringConstants = void 0;
|
|
|
9
9
|
* @internal
|
|
10
10
|
*/
|
|
11
11
|
class ECStringConstants {
|
|
12
|
+
// Relationship End
|
|
13
|
+
static RELATIONSHIP_END_SOURCE = "Source";
|
|
14
|
+
static RELATIONSHIP_END_TARGET = "Target";
|
|
15
|
+
// Container Type
|
|
16
|
+
static CONTAINERTYPE_SCHEMA = "Schema";
|
|
17
|
+
static CONTAINERTYPE_ENTITYCLASS = "EntityClass";
|
|
18
|
+
static CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass";
|
|
19
|
+
static CONTAINERTYPE_STRUCTCLASS = "StructClass";
|
|
20
|
+
static CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass";
|
|
21
|
+
static CONTAINERTYPE_ANYCLASS = "AnyClass";
|
|
22
|
+
static CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty";
|
|
23
|
+
static CONTAINERTYPE_STRUCTPROPERTY = "StructProperty";
|
|
24
|
+
static CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty";
|
|
25
|
+
static CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty";
|
|
26
|
+
static CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty";
|
|
27
|
+
static CONTAINERTYPE_ANYPROPERTY = "AnyProperty";
|
|
28
|
+
static CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint";
|
|
29
|
+
static CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint";
|
|
30
|
+
static CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint";
|
|
31
|
+
static 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
|
package/lib/cjs/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,MAAa,iBAAiB
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,MAAa,iBAAiB;IAC5B,mBAAmB;IACZ,MAAM,CAAU,uBAAuB,GAAW,QAAQ,CAAC;IAC3D,MAAM,CAAU,uBAAuB,GAAW,QAAQ,CAAC;IAElE,iBAAiB;IACV,MAAM,CAAU,oBAAoB,GAAW,QAAQ,CAAC;IACxD,MAAM,CAAU,yBAAyB,GAAW,aAAa,CAAC;IAClE,MAAM,CAAU,kCAAkC,GAAW,sBAAsB,CAAC;IACpF,MAAM,CAAU,yBAAyB,GAAW,aAAa,CAAC;IAClE,MAAM,CAAU,+BAA+B,GAAW,mBAAmB,CAAC;IAC9E,MAAM,CAAU,sBAAsB,GAAW,UAAU,CAAC;IAE5D,MAAM,CAAU,+BAA+B,GAAW,mBAAmB,CAAC;IAC9E,MAAM,CAAU,4BAA4B,GAAW,gBAAgB,CAAC;IACxE,MAAM,CAAU,oCAAoC,GAAW,eAAe,CAAC;IAC/E,MAAM,CAAU,iCAAiC,GAAW,qBAAqB,CAAC;IAClF,MAAM,CAAU,gCAAgC,GAAW,oBAAoB,CAAC;IAChF,MAAM,CAAU,yBAAyB,GAAW,aAAa,CAAC;IAElE,MAAM,CAAU,0CAA0C,GAAW,8BAA8B,CAAC;IACpG,MAAM,CAAU,0CAA0C,GAAW,8BAA8B,CAAC;IACpG,MAAM,CAAU,uCAAuC,GAAW,2BAA2B,CAAC;IAE9F,MAAM,CAAU,iBAAiB,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"]}
|
package/lib/cjs/Context.d.ts
CHANGED
|
@@ -19,14 +19,14 @@ export interface ISchemaLocater {
|
|
|
19
19
|
* @param matchType how to match key against candidate schemas
|
|
20
20
|
* @param context context for loading schema references
|
|
21
21
|
*/
|
|
22
|
-
getSchema
|
|
22
|
+
getSchema(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<Schema | undefined>;
|
|
23
23
|
/**
|
|
24
24
|
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
25
25
|
* May return the entire Schema so long as it is completely loaded as it satisfies the SchemaInfo interface.
|
|
26
26
|
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
27
27
|
* @param matchType The match type to use when locating the schema
|
|
28
28
|
*/
|
|
29
|
-
getSchemaInfo(schemaKey:
|
|
29
|
+
getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Promise<SchemaInfo | undefined>;
|
|
30
30
|
/**
|
|
31
31
|
* Attempts to get a schema from the locater. Yields undefined if no matching schema is found.
|
|
32
32
|
* For schemas that may have references, construct and call through a SchemaContext instead.
|
|
@@ -34,13 +34,7 @@ export interface ISchemaLocater {
|
|
|
34
34
|
* @param matchType how to match key against candidate schemas
|
|
35
35
|
* @param context context for loading schema references
|
|
36
36
|
*/
|
|
37
|
-
getSchemaSync
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @beta
|
|
41
|
-
*/
|
|
42
|
-
export interface ISchemaItemLocater {
|
|
43
|
-
getSchemaItem<T extends SchemaItem>(schemaItemKey: SchemaItemKey): Promise<T | undefined>;
|
|
37
|
+
getSchemaSync(schemaKey: SchemaKey, matchType: SchemaMatchType, context: SchemaContext): Schema | undefined;
|
|
44
38
|
}
|
|
45
39
|
/**
|
|
46
40
|
* @internal
|
|
@@ -58,7 +52,7 @@ export declare class SchemaCache implements ISchemaLocater {
|
|
|
58
52
|
* Returns true if the schema exists in either the schema cache or the promise cache. SchemaMatchType.Latest used.
|
|
59
53
|
* @param schemaKey The key to search for.
|
|
60
54
|
*/
|
|
61
|
-
schemaExists(schemaKey:
|
|
55
|
+
schemaExists(schemaKey: SchemaKey): boolean;
|
|
62
56
|
/**
|
|
63
57
|
* 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.
|
|
64
58
|
* When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache
|
|
@@ -71,41 +65,41 @@ export declare class SchemaCache implements ISchemaLocater {
|
|
|
71
65
|
* Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.
|
|
72
66
|
* @param schema The schema to add to the cache.
|
|
73
67
|
*/
|
|
74
|
-
addSchema
|
|
68
|
+
addSchema(schema: Schema): Promise<void>;
|
|
75
69
|
/**
|
|
76
70
|
* Adds a schema to the cache. Does not allow for duplicate schemas, checks using SchemaMatchType.Latest.
|
|
77
71
|
* @param schema The schema to add to the cache.
|
|
78
72
|
*/
|
|
79
|
-
addSchemaSync
|
|
73
|
+
addSchemaSync(schema: Schema): void;
|
|
80
74
|
/**
|
|
81
75
|
* Gets the schema which matches the provided SchemaKey.
|
|
82
76
|
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
83
77
|
* @param matchType The match type to use when locating the schema
|
|
84
78
|
*/
|
|
85
|
-
getSchema
|
|
79
|
+
getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined>;
|
|
86
80
|
/**
|
|
87
81
|
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
88
82
|
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
89
83
|
* @param matchType The match type to use when locating the schema
|
|
90
84
|
*/
|
|
91
|
-
getSchemaInfo(schemaKey:
|
|
85
|
+
getSchemaInfo(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<SchemaInfo | undefined>;
|
|
92
86
|
/**
|
|
93
87
|
* Gets the schema which matches the provided SchemaKey. If the schema is partially loaded an exception will be thrown.
|
|
94
88
|
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
95
89
|
* @param matchType The match type to use when locating the schema
|
|
96
90
|
*/
|
|
97
|
-
getSchemaSync
|
|
91
|
+
getSchemaSync(schemaKey: SchemaKey, matchType?: SchemaMatchType): Schema | undefined;
|
|
98
92
|
/**
|
|
99
93
|
* Generator function that can iterate through each schema in _schema SchemaMap and items for each Schema.
|
|
100
94
|
* Does not include schema items from schemas that are not completely loaded yet.
|
|
101
95
|
*/
|
|
102
|
-
getSchemaItems():
|
|
96
|
+
getSchemaItems(): Iterable<SchemaItem>;
|
|
103
97
|
/**
|
|
104
98
|
* Gets all the schemas from the schema cache.
|
|
105
99
|
* Does not include schemas from schemas that are not completely loaded yet.
|
|
106
100
|
* @returns An array of Schema objects.
|
|
107
101
|
*/
|
|
108
|
-
getAllSchemas(): Schema
|
|
102
|
+
getAllSchemas(): Iterable<Schema>;
|
|
109
103
|
}
|
|
110
104
|
/**
|
|
111
105
|
* The SchemaContext, context object is used to facilitate schema and schema item location.
|
|
@@ -115,11 +109,30 @@ export declare class SchemaCache implements ISchemaLocater {
|
|
|
115
109
|
* The context is made up of a group of Schema Locators.
|
|
116
110
|
* @beta
|
|
117
111
|
*/
|
|
118
|
-
export declare class SchemaContext
|
|
112
|
+
export declare class SchemaContext {
|
|
119
113
|
private _locaters;
|
|
120
114
|
private _knownSchemas;
|
|
115
|
+
private _fallbackLocaterDefined;
|
|
121
116
|
constructor();
|
|
117
|
+
get locaters(): ISchemaLocater[];
|
|
118
|
+
/**
|
|
119
|
+
* Adds a locater to the context.
|
|
120
|
+
*
|
|
121
|
+
* If no locaters are defined or a fallback locater is not defined, the new locater is added at the end of the locaters array.
|
|
122
|
+
* If a fallback locater is already defined, the new locater is inserted before the fallback locater.
|
|
123
|
+
*
|
|
124
|
+
* @param locater - The locater to be added.
|
|
125
|
+
*/
|
|
122
126
|
addLocater(locater: ISchemaLocater): void;
|
|
127
|
+
/**
|
|
128
|
+
* Adds a fallback locater to the context.
|
|
129
|
+
*
|
|
130
|
+
* If a fallback locater is already defined, it replaces the existing one.
|
|
131
|
+
* Otherwise, it adds the new locater to the end of the locaters array and marks the fallback locater as defined.
|
|
132
|
+
*
|
|
133
|
+
* @param locater - The locater to be added as a fallback.
|
|
134
|
+
*/
|
|
135
|
+
addFallbackLocater(locater: ISchemaLocater): void;
|
|
123
136
|
/**
|
|
124
137
|
* Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.
|
|
125
138
|
* @param schema The schema to add to this context
|
|
@@ -140,7 +153,7 @@ export declare class SchemaContext implements ISchemaItemLocater {
|
|
|
140
153
|
* Returns true if the schema is already in the context. SchemaMatchType.Latest is used to find a match.
|
|
141
154
|
* @param schemaKey
|
|
142
155
|
*/
|
|
143
|
-
schemaExists(schemaKey:
|
|
156
|
+
schemaExists(schemaKey: SchemaKey): boolean;
|
|
144
157
|
/**
|
|
145
158
|
* 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.
|
|
146
159
|
* When the promise completes the schema will be added to the schema cache and the promise will be removed from the promise cache.
|
|
@@ -155,21 +168,21 @@ export declare class SchemaContext implements ISchemaItemLocater {
|
|
|
155
168
|
* @param matchType Criteria by which to identify potentially matching schemas.
|
|
156
169
|
* @returns the schema matching the input criteria, or `undefined` if no such schema could be located.
|
|
157
170
|
*/
|
|
158
|
-
getSchema
|
|
171
|
+
getSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined>;
|
|
159
172
|
/**
|
|
160
173
|
* Gets the schema info which matches the provided SchemaKey. The schema info may be returned before the schema is fully loaded.
|
|
161
174
|
* The fully loaded schema can be gotten later from the context using [[getSchema]].
|
|
162
175
|
* @param schemaKey The SchemaKey describing the schema to get from the cache.
|
|
163
176
|
* @param matchType The match type to use when locating the schema
|
|
164
177
|
*/
|
|
165
|
-
getSchemaInfo(schemaKey:
|
|
178
|
+
getSchemaInfo(schemaKey: SchemaKey, matchType: SchemaMatchType): Promise<SchemaInfo | undefined>;
|
|
166
179
|
/** Attempts to obtain a schema from this context that matches the specified criteria.
|
|
167
180
|
* Will return undefined if the schema is partially loaded. Use [[getSchema]] to await until the schema is completely loaded.
|
|
168
181
|
* @param schemaKey Identifies the schema to obtain.
|
|
169
182
|
* @param matchType Criteria by which to identify potentially matching schemas.
|
|
170
183
|
* @returns the schema matching the input criteria, or `undefined` if no such schema could be located.
|
|
171
184
|
*/
|
|
172
|
-
getSchemaSync
|
|
185
|
+
getSchemaSync(schemaKey: SchemaKey, matchType?: SchemaMatchType): Schema | undefined;
|
|
173
186
|
/**
|
|
174
187
|
* Attempts to get a Schema from the context's cache.
|
|
175
188
|
* Will await a partially loaded schema then return when it is completely loaded.
|
|
@@ -177,7 +190,7 @@ export declare class SchemaContext implements ISchemaItemLocater {
|
|
|
177
190
|
* @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.
|
|
178
191
|
* @internal
|
|
179
192
|
*/
|
|
180
|
-
getCachedSchema
|
|
193
|
+
getCachedSchema(schemaKey: SchemaKey, matchType?: SchemaMatchType): Promise<Schema | undefined>;
|
|
181
194
|
/**
|
|
182
195
|
* Attempts to get a Schema from the context's cache.
|
|
183
196
|
* Will return undefined if the cached schema is partially loaded. Use [[getCachedSchema]] to await until the schema is completely loaded.
|
|
@@ -185,28 +198,64 @@ export declare class SchemaContext implements ISchemaItemLocater {
|
|
|
185
198
|
* @param matchType The SchemaMatch type to use. Default is SchemaMatchType.Latest.
|
|
186
199
|
* @internal
|
|
187
200
|
*/
|
|
188
|
-
getCachedSchemaSync
|
|
201
|
+
getCachedSchemaSync(schemaKey: SchemaKey, matchType?: SchemaMatchType): Schema | undefined;
|
|
189
202
|
/**
|
|
190
203
|
* Gets the schema item from the specified schema if it exists in this [[SchemaContext]].
|
|
191
|
-
* Will await a partially loaded schema then look in it for the requested item
|
|
192
|
-
*
|
|
193
|
-
* @
|
|
204
|
+
* Will await a partially loaded schema then look in it for the requested item.
|
|
205
|
+
*
|
|
206
|
+
* @param schemaNameOrKey - The SchemaItemKey identifying the item to return or the name of the schema or the schema item full name.
|
|
207
|
+
* @param itemNameOrCtor - The name of the item to return or the constructor of the item to return.
|
|
208
|
+
* @param itemConstructor - The constructor of the item to return.
|
|
209
|
+
* @returns The requested schema item, or `undefined` if the item could not be found.
|
|
210
|
+
*
|
|
211
|
+
* @examples
|
|
212
|
+
* ```typescript
|
|
213
|
+
* const schemaItem = await schemaContext.getSchemaItem(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
|
|
214
|
+
* const schemaItemWithCtor = await schemaContext.getSchemaItem(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
|
|
215
|
+
* const schemaItemByName = await schemaContext.getSchemaItem("TestSchema", "TestElement");
|
|
216
|
+
* const schemaItemByNameWithCtor = await schemaContext.getSchemaItem("TestSchema", "TestElement", EntityClass);
|
|
217
|
+
* const schemaItemFullName = await schemaContext.getSchemaItem("TestSchema:TestElement", EntityClass);
|
|
218
|
+
* const schemaItemFullNameWithCtor = await schemaContext.getSchemaItem("TestSchema:TestElement", EntityClass);
|
|
219
|
+
* const schemaItemFullNameSep = await schemaContext.getSchemaItem("TestSchema.TestElement", EntityClass);
|
|
220
|
+
* const schemaItemFullNameSepWithCtor = await schemaContext.getSchemaItem("TestSchema.TestElement", EntityClass);
|
|
221
|
+
* ```
|
|
194
222
|
*/
|
|
195
|
-
getSchemaItem<T extends SchemaItem>(
|
|
223
|
+
getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: SchemaItemKey | string, itemNameOrCtor?: T): Promise<InstanceType<T> | undefined>;
|
|
224
|
+
getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: SchemaItemKey | string, itemNameOrCtor?: T): Promise<SchemaItem | undefined>;
|
|
225
|
+
getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): Promise<InstanceType<T> | undefined>;
|
|
226
|
+
getSchemaItem<T extends typeof SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): Promise<SchemaItem | undefined>;
|
|
196
227
|
/**
|
|
197
228
|
* Gets the schema item from the specified schema if it exists in this [[SchemaContext]].
|
|
198
|
-
* Will
|
|
199
|
-
*
|
|
200
|
-
* @
|
|
229
|
+
* Will return undefined if the cached schema is partially loaded. Use [[getSchemaItem]] to await until the schema is completely loaded.
|
|
230
|
+
*
|
|
231
|
+
* @param nameOrKey - The SchemaItemKey identifying the item to return or the name of the schema or the schema item full name.
|
|
232
|
+
* @param nameOrCtor - The name of the item to return or the constructor of the item to return.
|
|
233
|
+
* @param ctor - The constructor of the item to return.
|
|
234
|
+
* @returns The requested schema item, or `undefined` if the item could not be found.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```typescript
|
|
238
|
+
* const schemaItem = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")));
|
|
239
|
+
* const schemaItemWithCtor = schemaContext.getSchemaItemSync(new SchemaItemKey("TestElement", new SchemaKey("TestSchema")), EntityClass);
|
|
240
|
+
* const schemaItemByName = schemaContext.getSchemaItemSync("TestSchema", "TestElement");
|
|
241
|
+
* const schemaItemByNameWithCtor = schemaContext.getSchemaItemSync("TestSchema", "TestElement", EntityClass);
|
|
242
|
+
* const schemaItemFullName = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
|
|
243
|
+
* const schemaItemFullNameWithCtor = schemaContext.getSchemaItemSync("TestSchema:TestElement", EntityClass);
|
|
244
|
+
* const schemaItemFullNameSep = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
|
|
245
|
+
* const schemaItemFullNameSepWithCtor = schemaContext.getSchemaItemSync("TestSchema.TestElement", EntityClass);
|
|
246
|
+
* ```
|
|
201
247
|
*/
|
|
202
|
-
getSchemaItemSync<T extends SchemaItem>(
|
|
248
|
+
getSchemaItemSync<T extends typeof SchemaItem>(schemaNameOrKey: SchemaItemKey | string, itemNameOrCtor?: T): InstanceType<T> | undefined;
|
|
249
|
+
getSchemaItemSync<T extends typeof SchemaItem>(schemaNameOrKey: SchemaItemKey | string, itemNameOrCtor?: T): SchemaItem | undefined;
|
|
250
|
+
getSchemaItemSync<T extends typeof SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): InstanceType<T> | undefined;
|
|
251
|
+
getSchemaItemSync<T extends typeof SchemaItem>(schemaNameOrKey: string, itemNameOrCtor: string, itemConstructor?: T): SchemaItem | undefined;
|
|
203
252
|
/**
|
|
204
253
|
* Iterates through the items of each schema known to the context. This includes schemas added to the
|
|
205
254
|
* context using [[SchemaContext.addSchema]]. This does not include schemas that
|
|
206
255
|
* can be located by an ISchemaLocater instance added to the context.
|
|
207
256
|
* Does not include schema items from schemas that are not completely loaded yet.
|
|
208
257
|
*/
|
|
209
|
-
getSchemaItems():
|
|
258
|
+
getSchemaItems(): Iterable<SchemaItem>;
|
|
210
259
|
/**
|
|
211
260
|
* Gets all the Schemas known by the context. This includes schemas added to the
|
|
212
261
|
* context using [[SchemaContext.addSchema]]. This does not include schemas that
|
|
@@ -214,6 +263,6 @@ export declare class SchemaContext implements ISchemaItemLocater {
|
|
|
214
263
|
* include schemas that are partially loaded.
|
|
215
264
|
* @returns An array of Schema objects.
|
|
216
265
|
*/
|
|
217
|
-
getKnownSchemas(): Schema
|
|
266
|
+
getKnownSchemas(): Iterable<Schema>;
|
|
218
267
|
}
|
|
219
268
|
//# sourceMappingURL=Context.d.ts.map
|
package/lib/cjs/Context.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/Context.ts"],"names":[],"mappings":"AAIA,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,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAEjH;;;;;MAKE;IACF,aAAa,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;IAEzH;;;;;;OAMG;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AI7C;;;;;;OAMG;IACI,eAAe,IAAI,QAAQ,CAAC,MAAM,CAAC;CAG3C"}
|
package/lib/cjs/Context.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SchemaContext = exports.SchemaCache = void 0;
|
|
2
4
|
/*---------------------------------------------------------------------------------------------
|
|
3
5
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
6
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
7
|
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SchemaContext = exports.SchemaCache = void 0;
|
|
8
8
|
const ECObjects_1 = require("./ECObjects");
|
|
9
9
|
const Exception_1 = require("./Exception");
|
|
10
|
+
const SchemaItem_1 = require("./Metadata/SchemaItem");
|
|
11
|
+
const SchemaKey_1 = require("./SchemaKey");
|
|
10
12
|
/**
|
|
11
13
|
* @internal
|
|
12
14
|
*/
|
|
@@ -16,6 +18,7 @@ class SchemaMap extends Array {
|
|
|
16
18
|
* @internal
|
|
17
19
|
*/
|
|
18
20
|
class SchemaCache {
|
|
21
|
+
_schema;
|
|
19
22
|
constructor() {
|
|
20
23
|
this._schema = new SchemaMap();
|
|
21
24
|
}
|
|
@@ -164,13 +167,44 @@ exports.SchemaCache = SchemaCache;
|
|
|
164
167
|
* @beta
|
|
165
168
|
*/
|
|
166
169
|
class SchemaContext {
|
|
170
|
+
_locaters;
|
|
171
|
+
_knownSchemas;
|
|
172
|
+
_fallbackLocaterDefined;
|
|
167
173
|
constructor() {
|
|
168
174
|
this._locaters = [];
|
|
169
175
|
this._knownSchemas = new SchemaCache();
|
|
170
176
|
this._locaters.push(this._knownSchemas);
|
|
177
|
+
this._fallbackLocaterDefined = false;
|
|
171
178
|
}
|
|
179
|
+
get locaters() { return this._locaters; }
|
|
180
|
+
/**
|
|
181
|
+
* Adds a locater to the context.
|
|
182
|
+
*
|
|
183
|
+
* If no locaters are defined or a fallback locater is not defined, the new locater is added at the end of the locaters array.
|
|
184
|
+
* If a fallback locater is already defined, the new locater is inserted before the fallback locater.
|
|
185
|
+
*
|
|
186
|
+
* @param locater - The locater to be added.
|
|
187
|
+
*/
|
|
172
188
|
addLocater(locater) {
|
|
173
|
-
this._locaters.
|
|
189
|
+
const insertIndex = (this._locaters.length === 0 || !this._fallbackLocaterDefined) ? this._locaters.length : this._locaters.length - 1;
|
|
190
|
+
this._locaters.splice(insertIndex, 0, locater);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Adds a fallback locater to the context.
|
|
194
|
+
*
|
|
195
|
+
* If a fallback locater is already defined, it replaces the existing one.
|
|
196
|
+
* Otherwise, it adds the new locater to the end of the locaters array and marks the fallback locater as defined.
|
|
197
|
+
*
|
|
198
|
+
* @param locater - The locater to be added as a fallback.
|
|
199
|
+
*/
|
|
200
|
+
addFallbackLocater(locater) {
|
|
201
|
+
if (this._fallbackLocaterDefined) {
|
|
202
|
+
this._locaters[this._locaters.length - 1] = locater;
|
|
203
|
+
}
|
|
204
|
+
else {
|
|
205
|
+
this._locaters.push(locater);
|
|
206
|
+
this._fallbackLocaterDefined = true;
|
|
207
|
+
}
|
|
174
208
|
}
|
|
175
209
|
/**
|
|
176
210
|
* Adds the schema to this context. Use addSchemaPromise instead when asynchronously loading schemas.
|
|
@@ -278,29 +312,45 @@ class SchemaContext {
|
|
|
278
312
|
getCachedSchemaSync(schemaKey, matchType = ECObjects_1.SchemaMatchType.Latest) {
|
|
279
313
|
return this._knownSchemas.getSchemaSync(schemaKey, matchType);
|
|
280
314
|
}
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
315
|
+
async getSchemaItem(schemaNameOrKey, itemNameOrCtor, itemConstructor) {
|
|
316
|
+
let schemaKey;
|
|
317
|
+
if (typeof schemaNameOrKey === "string") {
|
|
318
|
+
const [schemaName, itemName] = SchemaItem_1.SchemaItem.parseFullName(schemaNameOrKey);
|
|
319
|
+
schemaKey = (!schemaName) ? new SchemaKey_1.SchemaKey(itemName) : new SchemaKey_1.SchemaKey(schemaName);
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
schemaKey = schemaNameOrKey.schemaKey;
|
|
323
|
+
}
|
|
324
|
+
const schema = await this.getSchema(schemaKey, ECObjects_1.SchemaMatchType.Latest);
|
|
325
|
+
if (!schema)
|
|
290
326
|
return undefined;
|
|
291
|
-
|
|
327
|
+
if (typeof itemNameOrCtor === "string") // Separate schema and item name arguments with/without an itemConstructor
|
|
328
|
+
return itemConstructor ? schema.getItem(itemNameOrCtor, itemConstructor) : schema.getItem(itemNameOrCtor);
|
|
329
|
+
if (typeof schemaNameOrKey === "string") // Single schema item full name argument with/without an itemConstructor
|
|
330
|
+
return itemNameOrCtor ? schema.lookupItem(schemaNameOrKey, itemNameOrCtor) : schema.lookupItem(schemaNameOrKey);
|
|
331
|
+
// Schema Item Key with/without an itemConstructor
|
|
332
|
+
return itemNameOrCtor ? schema.getItem(schemaNameOrKey.name, itemNameOrCtor) : schema.getItem(schemaNameOrKey.name);
|
|
292
333
|
}
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
334
|
+
getSchemaItemSync(schemaNameOrKey, itemNameOrCtor, itemConstructor) {
|
|
335
|
+
let schemaKey;
|
|
336
|
+
if (typeof schemaNameOrKey === "string") {
|
|
337
|
+
const [schemaName, itemName] = SchemaItem_1.SchemaItem.parseFullName(schemaNameOrKey);
|
|
338
|
+
schemaKey = (!schemaName) ? new SchemaKey_1.SchemaKey(itemName) : new SchemaKey_1.SchemaKey(schemaName);
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
schemaKey = schemaNameOrKey.schemaKey;
|
|
342
|
+
}
|
|
343
|
+
const schema = this.getSchemaSync(schemaKey, ECObjects_1.SchemaMatchType.Latest);
|
|
344
|
+
if (!schema)
|
|
302
345
|
return undefined;
|
|
303
|
-
|
|
346
|
+
// Separate schema and item name arguments with/without an itemConstructor
|
|
347
|
+
if (typeof itemNameOrCtor === "string") {
|
|
348
|
+
return itemConstructor ? schema.getItemSync(itemNameOrCtor, itemConstructor) : schema.getItemSync(itemNameOrCtor);
|
|
349
|
+
}
|
|
350
|
+
if (typeof schemaNameOrKey === "string") // Single schema item full name argument with/without an itemConstructor
|
|
351
|
+
return itemNameOrCtor ? schema.lookupItemSync(schemaNameOrKey, itemNameOrCtor) : schema.lookupItemSync(schemaNameOrKey);
|
|
352
|
+
// Schema Item Key with/without an itemConstructor
|
|
353
|
+
return itemNameOrCtor ? schema.getItemSync(schemaNameOrKey.name, itemNameOrCtor) : schema.getItemSync(schemaNameOrKey.name);
|
|
304
354
|
}
|
|
305
355
|
/**
|
|
306
356
|
* Iterates through the items of each schema known to the context. This includes schemas added to the
|