@itwin/ecschema-metadata 5.0.0-dev.11 → 5.0.0-dev.110
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 +61 -1
- package/lib/cjs/Constants.d.ts +8 -0
- package/lib/cjs/Constants.d.ts.map +1 -1
- package/lib/cjs/Constants.js +30 -21
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/Context.d.ts +85 -36
- package/lib/cjs/Context.d.ts.map +1 -1
- package/lib/cjs/Context.js +79 -29
- package/lib/cjs/Context.js.map +1 -1
- package/lib/cjs/DelayedPromise.d.ts +9 -8
- package/lib/cjs/DelayedPromise.d.ts.map +1 -1
- package/lib/cjs/DelayedPromise.js +8 -6
- 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 +35 -26
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js +153 -150
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +47 -33
- package/lib/cjs/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.js +3 -3
- package/lib/cjs/Deserialization/JsonProps.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js +60 -52
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts +0 -5
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +8 -17
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.d.ts +2 -2
- package/lib/cjs/ECName.js +5 -4
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +41 -9
- package/lib/cjs/ECObjects.d.ts.map +1 -1
- package/lib/cjs/ECObjects.js +78 -24
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Exception.d.ts +4 -4
- package/lib/cjs/Exception.d.ts.map +1 -1
- package/lib/cjs/Exception.js +61 -60
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +35 -32
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +179 -32
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +290 -88
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +26 -10
- package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
- package/lib/cjs/Metadata/Constant.js +38 -10
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.d.ts +2 -2
- package/lib/cjs/Metadata/CustomAttribute.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttribute.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +21 -7
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +28 -8
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +40 -11
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +72 -34
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts +30 -10
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js +41 -13
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +65 -17
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js +107 -22
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +19 -10
- package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js +32 -15
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +38 -18
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +90 -40
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +31 -4
- package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
- package/lib/cjs/Metadata/Mixin.js +42 -8
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.d.ts +12 -12
- package/lib/cjs/Metadata/OverrideFormat.d.ts.map +1 -1
- package/lib/cjs/Metadata/OverrideFormat.js +36 -19
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +24 -3
- package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js +32 -3
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts +47 -25
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +128 -49
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +20 -4
- package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js +31 -4
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +63 -27
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +100 -43
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +167 -41
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +211 -111
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +19 -19
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +23 -21
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.d.ts +24 -21
- package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
- package/lib/cjs/Metadata/Unit.js +40 -24
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +17 -4
- package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js +24 -4
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/PropertyTypes.d.ts +11 -11
- package/lib/cjs/PropertyTypes.d.ts.map +1 -1
- package/lib/cjs/PropertyTypes.js +28 -20
- package/lib/cjs/PropertyTypes.js.map +1 -1
- package/lib/cjs/SchemaFormatsProvider.d.ts +39 -0
- package/lib/cjs/SchemaFormatsProvider.d.ts.map +1 -0
- package/lib/cjs/SchemaFormatsProvider.js +146 -0
- package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
- package/lib/cjs/SchemaJsonLocater.d.ts +8 -8
- package/lib/cjs/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/cjs/SchemaJsonLocater.js +7 -7
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.d.ts +13 -7
- package/lib/cjs/SchemaKey.d.ts.map +1 -1
- package/lib/cjs/SchemaKey.js +22 -12
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +5 -5
- package/lib/cjs/SchemaLoader.d.ts.map +1 -1
- package/lib/cjs/SchemaLoader.js +5 -4
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
- package/lib/cjs/SchemaPartVisitorDelegate.js +2 -1
- 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/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 -0
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js +1 -0
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/cjs/utils/SchemaGraph.js +5 -6
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Constants.d.ts +8 -0
- package/lib/esm/Constants.d.ts.map +1 -1
- package/lib/esm/Constants.js +29 -20
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/Context.d.ts +85 -36
- package/lib/esm/Context.d.ts.map +1 -1
- package/lib/esm/Context.js +78 -28
- package/lib/esm/Context.js.map +1 -1
- package/lib/esm/DelayedPromise.d.ts +9 -8
- package/lib/esm/DelayedPromise.d.ts.map +1 -1
- package/lib/esm/DelayedPromise.js +8 -6
- 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 +36 -27
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js +154 -151
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/JsonProps.d.ts +47 -33
- package/lib/esm/Deserialization/JsonProps.d.ts.map +1 -1
- package/lib/esm/Deserialization/JsonProps.js +3 -3
- package/lib/esm/Deserialization/JsonProps.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js +61 -53
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts +0 -5
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +9 -18
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECName.d.ts +2 -2
- package/lib/esm/ECName.js +6 -5
- package/lib/esm/ECName.js.map +1 -1
- package/lib/esm/ECObjects.d.ts +41 -9
- package/lib/esm/ECObjects.d.ts.map +1 -1
- package/lib/esm/ECObjects.js +77 -24
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/Exception.d.ts +4 -4
- package/lib/esm/Exception.d.ts.map +1 -1
- package/lib/esm/Exception.js +59 -58
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +35 -32
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +179 -32
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +292 -90
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Constant.d.ts +26 -10
- package/lib/esm/Metadata/Constant.d.ts.map +1 -1
- package/lib/esm/Metadata/Constant.js +39 -11
- package/lib/esm/Metadata/Constant.js.map +1 -1
- package/lib/esm/Metadata/CustomAttribute.d.ts +2 -2
- package/lib/esm/Metadata/CustomAttribute.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttribute.js.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +21 -7
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +29 -9
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +40 -11
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +73 -35
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Enumeration.d.ts +30 -10
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/esm/Metadata/Enumeration.js +42 -14
- package/lib/esm/Metadata/Enumeration.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +65 -17
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js +108 -23
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.d.ts +19 -10
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.js +33 -16
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.d.ts +38 -18
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +91 -41
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Mixin.d.ts +31 -4
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
- package/lib/esm/Metadata/Mixin.js +44 -10
- package/lib/esm/Metadata/Mixin.js.map +1 -1
- package/lib/esm/Metadata/OverrideFormat.d.ts +12 -12
- package/lib/esm/Metadata/OverrideFormat.d.ts.map +1 -1
- package/lib/esm/Metadata/OverrideFormat.js +37 -20
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts +24 -3
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/esm/Metadata/Phenomenon.js +33 -4
- package/lib/esm/Metadata/Phenomenon.js.map +1 -1
- package/lib/esm/Metadata/Property.d.ts +47 -25
- package/lib/esm/Metadata/Property.d.ts.map +1 -1
- package/lib/esm/Metadata/Property.js +130 -51
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts +20 -4
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.js +31 -4
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts +63 -27
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +102 -45
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
- package/lib/esm/Metadata/Schema.d.ts +167 -41
- package/lib/esm/Metadata/Schema.d.ts.map +1 -1
- package/lib/esm/Metadata/Schema.js +212 -112
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.d.ts +19 -19
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +25 -23
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/Metadata/Unit.d.ts +24 -21
- package/lib/esm/Metadata/Unit.d.ts.map +1 -1
- package/lib/esm/Metadata/Unit.js +41 -25
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/Metadata/UnitSystem.d.ts +17 -4
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/esm/Metadata/UnitSystem.js +24 -4
- package/lib/esm/Metadata/UnitSystem.js.map +1 -1
- package/lib/esm/PropertyTypes.d.ts +11 -11
- package/lib/esm/PropertyTypes.d.ts.map +1 -1
- package/lib/esm/PropertyTypes.js +29 -21
- package/lib/esm/PropertyTypes.js.map +1 -1
- package/lib/esm/SchemaFormatsProvider.d.ts +39 -0
- package/lib/esm/SchemaFormatsProvider.d.ts.map +1 -0
- package/lib/esm/SchemaFormatsProvider.js +142 -0
- package/lib/esm/SchemaFormatsProvider.js.map +1 -0
- package/lib/esm/SchemaJsonLocater.d.ts +8 -8
- package/lib/esm/SchemaJsonLocater.d.ts.map +1 -1
- package/lib/esm/SchemaJsonLocater.js +7 -7
- package/lib/esm/SchemaJsonLocater.js.map +1 -1
- package/lib/esm/SchemaKey.d.ts +13 -7
- package/lib/esm/SchemaKey.d.ts.map +1 -1
- package/lib/esm/SchemaKey.js +23 -13
- package/lib/esm/SchemaKey.js.map +1 -1
- package/lib/esm/SchemaLoader.d.ts +5 -5
- package/lib/esm/SchemaLoader.d.ts.map +1 -1
- package/lib/esm/SchemaLoader.js +6 -5
- package/lib/esm/SchemaLoader.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
- package/lib/esm/SchemaPartVisitorDelegate.js +2 -1
- 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/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 -0
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js +1 -0
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/lib/esm/utils/SchemaGraph.js +6 -7
- package/lib/esm/utils/SchemaGraph.js.map +1 -1
- package/package.json +16 -14
|
@@ -6,12 +6,15 @@ import { SchemaItemType } from "../ECObjects";
|
|
|
6
6
|
import { Schema } from "./Schema";
|
|
7
7
|
import { SchemaItem } from "./SchemaItem";
|
|
8
8
|
/**
|
|
9
|
-
* @
|
|
9
|
+
* @public @preview
|
|
10
10
|
*/
|
|
11
11
|
export declare class PropertyCategory extends SchemaItem {
|
|
12
|
-
readonly schemaItemType: SchemaItemType
|
|
13
|
-
|
|
12
|
+
readonly schemaItemType: SchemaItemType;
|
|
13
|
+
/** @internal */
|
|
14
|
+
static get schemaItemType(): SchemaItemType;
|
|
15
|
+
private _priority;
|
|
14
16
|
get priority(): number;
|
|
17
|
+
/** @internal */
|
|
15
18
|
constructor(schema: Schema, name: string);
|
|
16
19
|
/**
|
|
17
20
|
* Save this PropertyCategory's properties to an object for serializing to JSON.
|
|
@@ -24,10 +27,23 @@ export declare class PropertyCategory extends SchemaItem {
|
|
|
24
27
|
fromJSONSync(propertyCategoryProps: PropertyCategoryProps): void;
|
|
25
28
|
fromJSON(propertyCategoryProps: PropertyCategoryProps): Promise<void>;
|
|
26
29
|
/**
|
|
27
|
-
* @alpha
|
|
28
30
|
* Used for schema editing.
|
|
31
|
+
* @internal
|
|
29
32
|
*/
|
|
30
33
|
protected setPriority(priority: number): void;
|
|
34
|
+
/**
|
|
35
|
+
* Type guard to check if the SchemaItem is of type PropertyCategory.
|
|
36
|
+
* @param item The SchemaItem to check.
|
|
37
|
+
* @returns True if the item is a PropertyCategory, false otherwise.
|
|
38
|
+
*/
|
|
39
|
+
static isPropertyCategory(item?: SchemaItem): item is PropertyCategory;
|
|
40
|
+
/**
|
|
41
|
+
* Type assertion to check if the SchemaItem is of type PropertyCategory.
|
|
42
|
+
* @param item The SchemaItem to check.
|
|
43
|
+
* @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory;
|
|
31
47
|
}
|
|
32
48
|
/**
|
|
33
49
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategory.d.ts","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{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
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.MutablePropertyCategory = exports.PropertyCategory = void 0;
|
|
11
11
|
const ECObjects_1 = require("../ECObjects");
|
|
12
|
+
const Exception_1 = require("../Exception");
|
|
12
13
|
const SchemaItem_1 = require("./SchemaItem");
|
|
13
14
|
/**
|
|
14
|
-
* @
|
|
15
|
+
* @public @preview
|
|
15
16
|
*/
|
|
16
17
|
class PropertyCategory extends SchemaItem_1.SchemaItem {
|
|
17
|
-
|
|
18
|
+
schemaItemType = PropertyCategory.schemaItemType;
|
|
19
|
+
/** @internal */
|
|
20
|
+
static get schemaItemType() { return ECObjects_1.SchemaItemType.PropertyCategory; }
|
|
21
|
+
_priority;
|
|
22
|
+
get priority() {
|
|
23
|
+
return this._priority;
|
|
24
|
+
}
|
|
25
|
+
/** @internal */
|
|
18
26
|
constructor(schema, name) {
|
|
19
27
|
super(schema, name);
|
|
20
|
-
this.schemaItemType = ECObjects_1.SchemaItemType.PropertyCategory;
|
|
21
28
|
this._priority = 0;
|
|
22
29
|
}
|
|
23
30
|
/**
|
|
@@ -44,12 +51,32 @@ class PropertyCategory extends SchemaItem_1.SchemaItem {
|
|
|
44
51
|
this.fromJSONSync(propertyCategoryProps);
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
|
-
* @alpha
|
|
48
54
|
* Used for schema editing.
|
|
55
|
+
* @internal
|
|
49
56
|
*/
|
|
50
57
|
setPriority(priority) {
|
|
51
58
|
this._priority = priority;
|
|
52
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Type guard to check if the SchemaItem is of type PropertyCategory.
|
|
62
|
+
* @param item The SchemaItem to check.
|
|
63
|
+
* @returns True if the item is a PropertyCategory, false otherwise.
|
|
64
|
+
*/
|
|
65
|
+
static isPropertyCategory(item) {
|
|
66
|
+
if (item && item.schemaItemType === ECObjects_1.SchemaItemType.PropertyCategory)
|
|
67
|
+
return true;
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Type assertion to check if the SchemaItem is of type PropertyCategory.
|
|
72
|
+
* @param item The SchemaItem to check.
|
|
73
|
+
* @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
static assertIsPropertyCategory(item) {
|
|
77
|
+
if (!this.isPropertyCategory(item))
|
|
78
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaItemType, `Expected '${ECObjects_1.SchemaItemType.PropertyCategory}' (PropertyCategory)`);
|
|
79
|
+
}
|
|
53
80
|
}
|
|
54
81
|
exports.PropertyCategory = PropertyCategory;
|
|
55
82
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAA8C;
|
|
1
|
+
{"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,4CAA8C;AAC9C,4CAA6D;AAE7D,6CAA0C;AAE1C;;GAEG;AACH,MAAa,gBAAiB,SAAQ,uBAAU;IACrB,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IAC1E,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC/E,SAAS,CAAS;IAE1B,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,gBAAgB;IAChB,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;IACrB,CAAC;IAED;;;;OAIG;IACa,MAAM,CAAC,aAAsB,K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;;;GAGG;AACH,MAAsB,uBAAwB,SAAQ,gBAAgB;CAGrE;AAHD,0DAGC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { PropertyCategoryProps } from \"../Deserialization/JsonProps\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\n\r\n/**\r\n * @public @preview\r\n */\r\nexport class PropertyCategory extends SchemaItem {\r\n public override readonly schemaItemType = PropertyCategory.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.PropertyCategory; }\r\n private _priority: number;\r\n\r\n public get priority() {\r\n return this._priority;\r\n }\r\n\r\n /** @internal */\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this._priority = 0;\r\n }\r\n\r\n /**\r\n * Save this PropertyCategory's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PropertyCategoryProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.priority = this.priority;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"priority\", this.priority.toString());\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(propertyCategoryProps: PropertyCategoryProps) {\r\n super.fromJSONSync(propertyCategoryProps);\r\n this._priority = propertyCategoryProps.priority;\r\n }\r\n\r\n public override async fromJSON(propertyCategoryProps: PropertyCategoryProps) {\r\n this.fromJSONSync(propertyCategoryProps);\r\n }\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setPriority(priority: number) {\r\n this._priority = priority;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type PropertyCategory.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a PropertyCategory, false otherwise.\r\n */\r\n public static isPropertyCategory(item?: SchemaItem): item is PropertyCategory {\r\n if (item && item.schemaItemType === SchemaItemType.PropertyCategory)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type PropertyCategory.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory {\r\n if (!this.isPropertyCategory(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.PropertyCategory}' (PropertyCategory)`);\r\n }\r\n}\r\n\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutablePropertyCategory extends PropertyCategory {\r\n public abstract override setPriority(priority: number): void;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|
@@ -6,21 +6,26 @@ import { ECClassModifier, RelationshipEnd, SchemaItemType, StrengthDirection, St
|
|
|
6
6
|
import { LazyLoadedRelationshipConstraintClass } from "../Interfaces";
|
|
7
7
|
import { ECClass } from "./Class";
|
|
8
8
|
import { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet } from "./CustomAttribute";
|
|
9
|
-
import { EntityClass } from "./EntityClass";
|
|
10
|
-
import { Mixin } from "./Mixin";
|
|
11
9
|
import { NavigationProperty } from "./Property";
|
|
12
10
|
import { Schema } from "./Schema";
|
|
11
|
+
import { SchemaItem } from "./SchemaItem";
|
|
13
12
|
/**
|
|
14
13
|
* A Typescript class representation of a ECRelationshipClass.
|
|
15
|
-
* @
|
|
14
|
+
* @public @preview
|
|
16
15
|
*/
|
|
17
16
|
export declare class RelationshipClass extends ECClass {
|
|
18
|
-
readonly
|
|
19
|
-
|
|
17
|
+
readonly schemaItemType: SchemaItemType;
|
|
18
|
+
/** @internal */
|
|
19
|
+
static get schemaItemType(): SchemaItemType;
|
|
20
|
+
/** @internal */
|
|
20
21
|
protected _strength: StrengthType;
|
|
22
|
+
/** @internal */
|
|
21
23
|
protected _strengthDirection: StrengthDirection;
|
|
24
|
+
/** @internal */
|
|
22
25
|
protected _source: RelationshipConstraint;
|
|
26
|
+
/** @internal */
|
|
23
27
|
protected _target: RelationshipConstraint;
|
|
28
|
+
/** @internal */
|
|
24
29
|
constructor(schema: Schema, name: string, modifier?: ECClassModifier);
|
|
25
30
|
get strength(): StrengthType;
|
|
26
31
|
get strengthDirection(): StrengthDirection;
|
|
@@ -31,23 +36,25 @@ export declare class RelationshipClass extends ECClass {
|
|
|
31
36
|
* @param name
|
|
32
37
|
* @param relationship
|
|
33
38
|
* @param direction
|
|
39
|
+
* @internal
|
|
34
40
|
*/
|
|
35
41
|
protected createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;
|
|
42
|
+
/** @internal */
|
|
36
43
|
protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;
|
|
37
44
|
/**
|
|
38
|
-
* @
|
|
45
|
+
* @internal Used for schema editing.
|
|
39
46
|
*/
|
|
40
47
|
protected setStrength(strength: StrengthType): void;
|
|
41
48
|
/**
|
|
42
|
-
* @
|
|
49
|
+
* @internal Used for schema editing.
|
|
43
50
|
*/
|
|
44
51
|
protected setStrengthDirection(direction: StrengthDirection): void;
|
|
45
52
|
/**
|
|
46
|
-
* @
|
|
53
|
+
* @internal Used for schema editing.
|
|
47
54
|
*/
|
|
48
55
|
protected setSourceConstraint(source: RelationshipConstraint): void;
|
|
49
56
|
/**
|
|
50
|
-
* @
|
|
57
|
+
* @internal Used for schema editing.
|
|
51
58
|
*/
|
|
52
59
|
protected setTargetConstraint(target: RelationshipConstraint): void;
|
|
53
60
|
/**
|
|
@@ -60,38 +67,47 @@ export declare class RelationshipClass extends ECClass {
|
|
|
60
67
|
toXml(schemaXml: Document): Promise<Element>;
|
|
61
68
|
fromJSONSync(relationshipClassProps: RelationshipClassProps): void;
|
|
62
69
|
fromJSON(relationshipClassProps: RelationshipClassProps): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* Type guard to check if the SchemaItem is of type RelationshipClass.
|
|
72
|
+
* @param item The SchemaItem to check.
|
|
73
|
+
* @returns True if the item is a RelationshipClass, false otherwise.
|
|
74
|
+
*/
|
|
75
|
+
static isRelationshipClass(item?: SchemaItem): item is RelationshipClass;
|
|
76
|
+
/**
|
|
77
|
+
* Type assertion to check if the SchemaItem is of type RelationshipClass.
|
|
78
|
+
* @param item The SchemaItem to check.
|
|
79
|
+
* @returns The item cast to RelationshipClass if it is a RelationshipClass, undefined otherwise.
|
|
80
|
+
* @internal
|
|
81
|
+
*/
|
|
82
|
+
static assertIsRelationshipClass(item?: SchemaItem): asserts item is RelationshipClass;
|
|
63
83
|
}
|
|
64
84
|
/**
|
|
65
85
|
* A Typescript class representation of a ECRelationshipConstraint.
|
|
66
|
-
* @
|
|
86
|
+
* @public @preview
|
|
67
87
|
*/
|
|
68
88
|
export declare class RelationshipConstraint implements CustomAttributeContainerProps {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
89
|
+
private _abstractConstraint?;
|
|
90
|
+
private _relationshipClass;
|
|
91
|
+
private _relationshipEnd;
|
|
92
|
+
private _multiplicity?;
|
|
93
|
+
private _polymorphic?;
|
|
94
|
+
private _roleLabel?;
|
|
95
|
+
private _constraintClasses?;
|
|
76
96
|
private _customAttributes?;
|
|
97
|
+
/** @internal */
|
|
77
98
|
constructor(relClass: RelationshipClass, relEnd: RelationshipEnd, roleLabel?: string, polymorphic?: boolean);
|
|
78
99
|
get multiplicity(): RelationshipMultiplicity;
|
|
79
|
-
protected set multiplicity(multiplicity: RelationshipMultiplicity);
|
|
80
100
|
get polymorphic(): boolean;
|
|
81
|
-
protected set polymorphic(polymorphic: boolean);
|
|
82
101
|
get roleLabel(): string | undefined;
|
|
83
|
-
|
|
84
|
-
get constraintClasses(): LazyLoadedRelationshipConstraintClass[] | undefined;
|
|
102
|
+
get constraintClasses(): ReadonlyArray<LazyLoadedRelationshipConstraintClass> | undefined;
|
|
85
103
|
get relationshipClass(): RelationshipClass;
|
|
86
104
|
get relationshipEnd(): RelationshipEnd;
|
|
87
|
-
protected set relationshipEnd(relationshipEnd: RelationshipEnd);
|
|
88
105
|
get customAttributes(): CustomAttributeSet | undefined;
|
|
89
106
|
/** Returns the constraint name, ie. 'RelationshipName.Source/Target' */
|
|
90
107
|
get fullName(): string;
|
|
91
108
|
/** Returns the schema of the RelationshipClass. */
|
|
92
109
|
get schema(): Schema;
|
|
93
110
|
get abstractConstraint(): LazyLoadedRelationshipConstraintClass | undefined;
|
|
94
|
-
set abstractConstraint(abstractConstraint: LazyLoadedRelationshipConstraintClass | undefined);
|
|
95
111
|
/**
|
|
96
112
|
* True if this RelationshipConstraint is the Source relationship end.
|
|
97
113
|
*/
|
|
@@ -99,13 +115,16 @@ export declare class RelationshipConstraint implements CustomAttributeContainerP
|
|
|
99
115
|
/**
|
|
100
116
|
* Adds the provided class as a constraint class to this constraint.
|
|
101
117
|
* @param constraint The class to add as a constraint class.
|
|
102
|
-
|
|
103
|
-
|
|
118
|
+
* @internal
|
|
119
|
+
*/
|
|
120
|
+
addClass(constraint: LazyLoadedRelationshipConstraintClass): void;
|
|
104
121
|
/**
|
|
105
122
|
* Removes the provided class as a constraint class from this constraint.
|
|
106
123
|
* @param constraint The class to add as a constraint class.
|
|
124
|
+
*
|
|
125
|
+
* @internal
|
|
107
126
|
*/
|
|
108
|
-
protected removeClass(constraint:
|
|
127
|
+
protected removeClass(constraint: LazyLoadedRelationshipConstraintClass): void;
|
|
109
128
|
/**
|
|
110
129
|
* Save this RelationshipConstraint's properties to an object for serializing to JSON.
|
|
111
130
|
*/
|
|
@@ -130,7 +149,18 @@ export declare class RelationshipConstraint implements CustomAttributeContainerP
|
|
|
130
149
|
* @internal
|
|
131
150
|
*/
|
|
132
151
|
static isRelationshipConstraint(object: any): object is RelationshipConstraint;
|
|
152
|
+
/** @internal */
|
|
133
153
|
protected addCustomAttribute(customAttribute: CustomAttribute): void;
|
|
154
|
+
/** @internal */
|
|
155
|
+
protected setRoleLabel(roleLabel: string | undefined): void;
|
|
156
|
+
/** @internal */
|
|
157
|
+
protected setRelationshipEnd(relationshipEnd: RelationshipEnd): void;
|
|
158
|
+
/** @internal */
|
|
159
|
+
protected setPolymorphic(polymorphic: boolean): void;
|
|
160
|
+
/** @internal */
|
|
161
|
+
protected setMultiplicity(multiplicity: RelationshipMultiplicity): void;
|
|
162
|
+
/** @internal */
|
|
163
|
+
protected setAbstractConstraint(abstractConstraint: LazyLoadedRelationshipConstraintClass | undefined): void;
|
|
134
164
|
}
|
|
135
165
|
/**
|
|
136
166
|
* Hackish approach that works like a "friend class" so we can access protected members without making them public.
|
|
@@ -138,9 +168,14 @@ export declare class RelationshipConstraint implements CustomAttributeContainerP
|
|
|
138
168
|
*/
|
|
139
169
|
export declare abstract class MutableRelationshipConstraint extends RelationshipConstraint {
|
|
140
170
|
abstract addCustomAttribute(customAttribute: CustomAttribute): void;
|
|
171
|
+
abstract setRoleLabel(roleLabel: string | undefined): void;
|
|
172
|
+
abstract setRelationshipEnd(relationshipEnd: RelationshipEnd): void;
|
|
173
|
+
abstract setPolymorphic(polymorphic: boolean): void;
|
|
174
|
+
abstract setMultiplicity(multiplicity: RelationshipMultiplicity): void;
|
|
175
|
+
abstract setAbstractConstraint(abstractConstraint: LazyLoadedRelationshipConstraintClass | undefined): void;
|
|
141
176
|
}
|
|
142
177
|
/**
|
|
143
|
-
* @
|
|
178
|
+
* @public @preview
|
|
144
179
|
*/
|
|
145
180
|
export declare class RelationshipMultiplicity {
|
|
146
181
|
static readonly zeroOne: RelationshipMultiplicity;
|
|
@@ -149,6 +184,7 @@ export declare class RelationshipMultiplicity {
|
|
|
149
184
|
static readonly oneMany: RelationshipMultiplicity;
|
|
150
185
|
readonly lowerLimit: number;
|
|
151
186
|
readonly upperLimit: number;
|
|
187
|
+
/** @internal */
|
|
152
188
|
constructor(lowerLimit: number, upperLimit: number);
|
|
153
189
|
static fromString(str: string): RelationshipMultiplicity | undefined;
|
|
154
190
|
equals(rhs: RelationshipMultiplicity): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/RelationshipClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EACL,eAAe,EAAyC,eAAe,EAAE,cAAc,EAAE,iBAAiB,EACxF,YAAY,EAC/B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qCAAqC,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"RelationshipClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/RelationshipClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EACL,eAAe,EAAyC,eAAe,EAAE,cAAc,EAAE,iBAAiB,EACxF,YAAY,EAC/B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qCAAqC,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,OAA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AE,iBAAiB,GAAG,IAAI;aACxD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;aACpJ,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,kBAAkB;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -16,15 +16,27 @@ const Exception_1 = require("../Exception");
|
|
|
16
16
|
const Class_1 = require("./Class");
|
|
17
17
|
const CustomAttribute_1 = require("./CustomAttribute");
|
|
18
18
|
const EntityClass_1 = require("./EntityClass");
|
|
19
|
+
const Mixin_1 = require("./Mixin");
|
|
19
20
|
const SchemaItem_1 = require("./SchemaItem");
|
|
20
21
|
/**
|
|
21
22
|
* A Typescript class representation of a ECRelationshipClass.
|
|
22
|
-
* @
|
|
23
|
+
* @public @preview
|
|
23
24
|
*/
|
|
24
25
|
class RelationshipClass extends Class_1.ECClass {
|
|
26
|
+
schemaItemType = RelationshipClass.schemaItemType;
|
|
27
|
+
/** @internal */
|
|
28
|
+
static get schemaItemType() { return ECObjects_1.SchemaItemType.RelationshipClass; }
|
|
29
|
+
/** @internal */
|
|
30
|
+
_strength;
|
|
31
|
+
/** @internal */
|
|
32
|
+
_strengthDirection;
|
|
33
|
+
/** @internal */
|
|
34
|
+
_source;
|
|
35
|
+
/** @internal */
|
|
36
|
+
_target;
|
|
37
|
+
/** @internal */
|
|
25
38
|
constructor(schema, name, modifier) {
|
|
26
39
|
super(schema, name, modifier);
|
|
27
|
-
this.schemaItemType = ECObjects_1.SchemaItemType.RelationshipClass;
|
|
28
40
|
this._strengthDirection = ECObjects_1.StrengthDirection.Forward;
|
|
29
41
|
this._strength = ECObjects_1.StrengthType.Referencing;
|
|
30
42
|
this._source = new RelationshipConstraint(this, ECObjects_1.RelationshipEnd.Source);
|
|
@@ -39,33 +51,35 @@ class RelationshipClass extends Class_1.ECClass {
|
|
|
39
51
|
* @param name
|
|
40
52
|
* @param relationship
|
|
41
53
|
* @param direction
|
|
54
|
+
* @internal
|
|
42
55
|
*/
|
|
43
56
|
async createNavigationProperty(name, relationship, direction) {
|
|
44
57
|
return this.addProperty(await (0, EntityClass_1.createNavigationProperty)(this, name, relationship, direction));
|
|
45
58
|
}
|
|
59
|
+
/** @internal */
|
|
46
60
|
createNavigationPropertySync(name, relationship, direction) {
|
|
47
61
|
return this.addProperty((0, EntityClass_1.createNavigationPropertySync)(this, name, relationship, direction));
|
|
48
62
|
}
|
|
49
63
|
/**
|
|
50
|
-
* @
|
|
64
|
+
* @internal Used for schema editing.
|
|
51
65
|
*/
|
|
52
66
|
setStrength(strength) {
|
|
53
67
|
this._strength = strength;
|
|
54
68
|
}
|
|
55
69
|
/**
|
|
56
|
-
* @
|
|
70
|
+
* @internal Used for schema editing.
|
|
57
71
|
*/
|
|
58
72
|
setStrengthDirection(direction) {
|
|
59
73
|
this._strengthDirection = direction;
|
|
60
74
|
}
|
|
61
75
|
/**
|
|
62
|
-
* @
|
|
76
|
+
* @internal Used for schema editing.
|
|
63
77
|
*/
|
|
64
78
|
setSourceConstraint(source) {
|
|
65
79
|
this._source = source;
|
|
66
80
|
}
|
|
67
81
|
/**
|
|
68
|
-
* @
|
|
82
|
+
* @internal Used for schema editing.
|
|
69
83
|
*/
|
|
70
84
|
setTargetConstraint(target) {
|
|
71
85
|
this._target = target;
|
|
@@ -99,24 +113,53 @@ class RelationshipClass extends Class_1.ECClass {
|
|
|
99
113
|
if (Helper_1.SchemaReadHelper.isECSpecVersionNewer({ readVersion: relationshipClassProps.originalECSpecMajorVersion, writeVersion: relationshipClassProps.originalECSpecMinorVersion }))
|
|
100
114
|
strength = ECObjects_1.StrengthType.Referencing;
|
|
101
115
|
else
|
|
102
|
-
throw new Exception_1.
|
|
116
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strength' attribute. '${relationshipClassProps.strength}' is not a valid StrengthType.`);
|
|
103
117
|
}
|
|
104
118
|
const strengthDirection = (0, ECObjects_1.parseStrengthDirection)(relationshipClassProps.strengthDirection);
|
|
105
119
|
if (undefined === strengthDirection)
|
|
106
|
-
throw new Exception_1.
|
|
120
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidStrength, `The RelationshipClass ${this.fullName} has an invalid 'strengthDirection' attribute. '${relationshipClassProps.strengthDirection}' is not a valid StrengthDirection.`);
|
|
107
121
|
this._strength = strength;
|
|
108
122
|
this._strengthDirection = strengthDirection;
|
|
109
123
|
}
|
|
110
124
|
async fromJSON(relationshipClassProps) {
|
|
111
125
|
this.fromJSONSync(relationshipClassProps);
|
|
112
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Type guard to check if the SchemaItem is of type RelationshipClass.
|
|
129
|
+
* @param item The SchemaItem to check.
|
|
130
|
+
* @returns True if the item is a RelationshipClass, false otherwise.
|
|
131
|
+
*/
|
|
132
|
+
static isRelationshipClass(item) {
|
|
133
|
+
if (item && item.schemaItemType === ECObjects_1.SchemaItemType.RelationshipClass)
|
|
134
|
+
return true;
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Type assertion to check if the SchemaItem is of type RelationshipClass.
|
|
139
|
+
* @param item The SchemaItem to check.
|
|
140
|
+
* @returns The item cast to RelationshipClass if it is a RelationshipClass, undefined otherwise.
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
static assertIsRelationshipClass(item) {
|
|
144
|
+
if (!this.isRelationshipClass(item))
|
|
145
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidSchemaItemType, `Expected '${ECObjects_1.SchemaItemType.RelationshipClass}' (RelationshipClass)`);
|
|
146
|
+
}
|
|
113
147
|
}
|
|
114
148
|
exports.RelationshipClass = RelationshipClass;
|
|
115
149
|
/**
|
|
116
150
|
* A Typescript class representation of a ECRelationshipConstraint.
|
|
117
|
-
* @
|
|
151
|
+
* @public @preview
|
|
118
152
|
*/
|
|
119
153
|
class RelationshipConstraint {
|
|
154
|
+
_abstractConstraint;
|
|
155
|
+
_relationshipClass;
|
|
156
|
+
_relationshipEnd;
|
|
157
|
+
_multiplicity;
|
|
158
|
+
_polymorphic;
|
|
159
|
+
_roleLabel;
|
|
160
|
+
_constraintClasses;
|
|
161
|
+
_customAttributes;
|
|
162
|
+
/** @internal */
|
|
120
163
|
constructor(relClass, relEnd, roleLabel, polymorphic) {
|
|
121
164
|
this._relationshipEnd = relEnd;
|
|
122
165
|
if (polymorphic)
|
|
@@ -128,23 +171,11 @@ class RelationshipConstraint {
|
|
|
128
171
|
this._roleLabel = roleLabel;
|
|
129
172
|
}
|
|
130
173
|
get multiplicity() { return this._multiplicity ?? RelationshipMultiplicity.zeroOne; }
|
|
131
|
-
set multiplicity(multiplicity) {
|
|
132
|
-
this._multiplicity = multiplicity;
|
|
133
|
-
}
|
|
134
174
|
get polymorphic() { return this._polymorphic ?? false; }
|
|
135
|
-
set polymorphic(polymorphic) {
|
|
136
|
-
this._polymorphic = polymorphic;
|
|
137
|
-
}
|
|
138
175
|
get roleLabel() { return this._roleLabel; }
|
|
139
|
-
set roleLabel(roleLabel) {
|
|
140
|
-
this._roleLabel = roleLabel;
|
|
141
|
-
}
|
|
142
176
|
get constraintClasses() { return this._constraintClasses; }
|
|
143
177
|
get relationshipClass() { return this._relationshipClass; }
|
|
144
178
|
get relationshipEnd() { return this._relationshipEnd; }
|
|
145
|
-
set relationshipEnd(relationshipEnd) {
|
|
146
|
-
this._relationshipEnd = relationshipEnd;
|
|
147
|
-
}
|
|
148
179
|
get customAttributes() { return this._customAttributes; }
|
|
149
180
|
/** Returns the constraint name, ie. 'RelationshipName.Source/Target' */
|
|
150
181
|
get fullName() { return `${this._relationshipClass.name}:${this.isSource ? "Source" : "Target"}`; }
|
|
@@ -157,9 +188,6 @@ class RelationshipConstraint {
|
|
|
157
188
|
return this.constraintClasses[0];
|
|
158
189
|
return this._abstractConstraint;
|
|
159
190
|
}
|
|
160
|
-
set abstractConstraint(abstractConstraint) {
|
|
161
|
-
this._abstractConstraint = abstractConstraint;
|
|
162
|
-
}
|
|
163
191
|
/**
|
|
164
192
|
* True if this RelationshipConstraint is the Source relationship end.
|
|
165
193
|
*/
|
|
@@ -167,18 +195,21 @@ class RelationshipConstraint {
|
|
|
167
195
|
/**
|
|
168
196
|
* Adds the provided class as a constraint class to this constraint.
|
|
169
197
|
* @param constraint The class to add as a constraint class.
|
|
170
|
-
|
|
198
|
+
* @internal
|
|
199
|
+
*/
|
|
171
200
|
addClass(constraint) {
|
|
172
201
|
// TODO: Ensure we don't start mixing constraint class types
|
|
173
202
|
// TODO: Check that this class is or subclasses abstract constraint?
|
|
174
203
|
if (!this._constraintClasses)
|
|
175
204
|
this._constraintClasses = [];
|
|
176
205
|
// TODO: Handle relationship constraints
|
|
177
|
-
this._constraintClasses.push(
|
|
206
|
+
this._constraintClasses.push(constraint);
|
|
178
207
|
}
|
|
179
208
|
/**
|
|
180
209
|
* Removes the provided class as a constraint class from this constraint.
|
|
181
210
|
* @param constraint The class to add as a constraint class.
|
|
211
|
+
*
|
|
212
|
+
* @internal
|
|
182
213
|
*/
|
|
183
214
|
removeClass(constraint) {
|
|
184
215
|
if (undefined === this._constraintClasses)
|
|
@@ -246,29 +277,31 @@ class RelationshipConstraint {
|
|
|
246
277
|
this._polymorphic = relationshipConstraintProps.polymorphic;
|
|
247
278
|
const parsedMultiplicity = RelationshipMultiplicity.fromString(relationshipConstraintProps.multiplicity);
|
|
248
279
|
if (!parsedMultiplicity)
|
|
249
|
-
throw new Exception_1.
|
|
280
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidMultiplicity, ``);
|
|
250
281
|
this._multiplicity = parsedMultiplicity;
|
|
251
282
|
const relClassSchema = this.relationshipClass.schema;
|
|
252
283
|
if (undefined !== relationshipConstraintProps.abstractConstraint) {
|
|
253
284
|
const abstractConstraintSchemaItemKey = relClassSchema.getSchemaItemKey(relationshipConstraintProps.abstractConstraint);
|
|
254
285
|
if (!abstractConstraintSchemaItemKey)
|
|
255
|
-
throw new Exception_1.
|
|
256
|
-
this.
|
|
286
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);
|
|
287
|
+
this.setAbstractConstraint(new DelayedPromise_1.DelayedPromiseWithProps(abstractConstraintSchemaItemKey, async () => {
|
|
257
288
|
const tempAbstractConstraint = await relClassSchema.lookupItem(relationshipConstraintProps.abstractConstraint);
|
|
258
|
-
if (undefined === tempAbstractConstraint
|
|
259
|
-
|
|
289
|
+
if (undefined === tempAbstractConstraint ||
|
|
290
|
+
(!EntityClass_1.EntityClass.isEntityClass(tempAbstractConstraint) && !Mixin_1.Mixin.isMixin(tempAbstractConstraint) && !RelationshipClass.isRelationshipClass(tempAbstractConstraint)))
|
|
291
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${relationshipConstraintProps.abstractConstraint}.`);
|
|
260
292
|
return tempAbstractConstraint;
|
|
261
|
-
});
|
|
293
|
+
}));
|
|
262
294
|
}
|
|
263
295
|
const loadEachConstraint = (constraintClassName) => {
|
|
264
296
|
const tempConstraintClass = relClassSchema.lookupItemSync(constraintClassName);
|
|
265
|
-
if (!tempConstraintClass
|
|
266
|
-
|
|
297
|
+
if (!tempConstraintClass ||
|
|
298
|
+
(!EntityClass_1.EntityClass.isEntityClass(tempConstraintClass) && !Mixin_1.Mixin.isMixin(tempConstraintClass) && !RelationshipClass.isRelationshipClass(tempConstraintClass)))
|
|
299
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, ``);
|
|
267
300
|
return tempConstraintClass;
|
|
268
301
|
};
|
|
269
302
|
for (const constraintClassName of relationshipConstraintProps.constraintClasses) {
|
|
270
303
|
const constraintClass = loadEachConstraint(constraintClassName);
|
|
271
|
-
this.addClass(constraintClass);
|
|
304
|
+
this.addClass(new DelayedPromise_1.DelayedPromiseWithProps(constraintClass.key, async () => constraintClass));
|
|
272
305
|
}
|
|
273
306
|
}
|
|
274
307
|
async fromJSON(relationshipConstraintProps) {
|
|
@@ -326,15 +359,36 @@ class RelationshipConstraint {
|
|
|
326
359
|
* @internal
|
|
327
360
|
*/
|
|
328
361
|
static isRelationshipConstraint(object) {
|
|
329
|
-
const
|
|
330
|
-
return
|
|
331
|
-
&&
|
|
362
|
+
const relationshipConstraint = object;
|
|
363
|
+
return relationshipConstraint !== undefined && relationshipConstraint.polymorphic !== undefined && relationshipConstraint.multiplicity !== undefined
|
|
364
|
+
&& relationshipConstraint.relationshipEnd !== undefined && relationshipConstraint._relationshipClass !== undefined;
|
|
332
365
|
}
|
|
366
|
+
/** @internal */
|
|
333
367
|
addCustomAttribute(customAttribute) {
|
|
334
368
|
if (!this._customAttributes)
|
|
335
369
|
this._customAttributes = new Map();
|
|
336
370
|
this._customAttributes.set(customAttribute.className, customAttribute);
|
|
337
371
|
}
|
|
372
|
+
/** @internal */
|
|
373
|
+
setRoleLabel(roleLabel) {
|
|
374
|
+
this._roleLabel = roleLabel;
|
|
375
|
+
}
|
|
376
|
+
/** @internal */
|
|
377
|
+
setRelationshipEnd(relationshipEnd) {
|
|
378
|
+
this._relationshipEnd = relationshipEnd;
|
|
379
|
+
}
|
|
380
|
+
/** @internal */
|
|
381
|
+
setPolymorphic(polymorphic) {
|
|
382
|
+
this._polymorphic = polymorphic;
|
|
383
|
+
}
|
|
384
|
+
/** @internal */
|
|
385
|
+
setMultiplicity(multiplicity) {
|
|
386
|
+
this._multiplicity = multiplicity;
|
|
387
|
+
}
|
|
388
|
+
/** @internal */
|
|
389
|
+
setAbstractConstraint(abstractConstraint) {
|
|
390
|
+
this._abstractConstraint = abstractConstraint;
|
|
391
|
+
}
|
|
338
392
|
}
|
|
339
393
|
exports.RelationshipConstraint = RelationshipConstraint;
|
|
340
394
|
/**
|
|
@@ -346,9 +400,16 @@ class MutableRelationshipConstraint extends RelationshipConstraint {
|
|
|
346
400
|
exports.MutableRelationshipConstraint = MutableRelationshipConstraint;
|
|
347
401
|
const INT32_MAX = 2147483647;
|
|
348
402
|
/**
|
|
349
|
-
* @
|
|
403
|
+
* @public @preview
|
|
350
404
|
*/
|
|
351
405
|
class RelationshipMultiplicity {
|
|
406
|
+
static zeroOne = new RelationshipMultiplicity(0, 1);
|
|
407
|
+
static zeroMany = new RelationshipMultiplicity(0, INT32_MAX);
|
|
408
|
+
static oneOne = new RelationshipMultiplicity(1, 1);
|
|
409
|
+
static oneMany = new RelationshipMultiplicity(1, INT32_MAX);
|
|
410
|
+
lowerLimit;
|
|
411
|
+
upperLimit;
|
|
412
|
+
/** @internal */
|
|
352
413
|
constructor(lowerLimit, upperLimit) {
|
|
353
414
|
this.lowerLimit = lowerLimit;
|
|
354
415
|
this.upperLimit = upperLimit;
|
|
@@ -377,10 +438,6 @@ class RelationshipMultiplicity {
|
|
|
377
438
|
}
|
|
378
439
|
}
|
|
379
440
|
exports.RelationshipMultiplicity = RelationshipMultiplicity;
|
|
380
|
-
RelationshipMultiplicity.zeroOne = new RelationshipMultiplicity(0, 1);
|
|
381
|
-
RelationshipMultiplicity.zeroMany = new RelationshipMultiplicity(0, INT32_MAX);
|
|
382
|
-
RelationshipMultiplicity.oneOne = new RelationshipMultiplicity(1, 1);
|
|
383
|
-
RelationshipMultiplicity.oneMany = new RelationshipMultiplicity(1, INT32_MAX);
|
|
384
441
|
/**
|
|
385
442
|
* @internal
|
|
386
443
|
* An abstract class used for schema editing.
|