@itwin/ecschema-metadata 5.0.0-dev.99 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +61 -1
- package/lib/cjs/Context.d.ts +4 -4
- package/lib/cjs/Context.d.ts.map +1 -1
- package/lib/cjs/Context.js +7 -7
- 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 +2 -2
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
- package/lib/cjs/Deserialization/Helper.js +27 -26
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js +150 -150
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/JsonProps.d.ts +34 -34
- 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.js +49 -49
- 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 +6 -11
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECName.d.ts +2 -2
- package/lib/cjs/ECName.js +4 -4
- package/lib/cjs/ECName.js.map +1 -1
- package/lib/cjs/ECObjects.d.ts +24 -12
- package/lib/cjs/ECObjects.d.ts.map +1 -1
- package/lib/cjs/ECObjects.js +48 -25
- 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 +60 -60
- package/lib/cjs/Exception.js.map +1 -1
- package/lib/cjs/Interfaces.d.ts +30 -34
- package/lib/cjs/Interfaces.d.ts.map +1 -1
- package/lib/cjs/Interfaces.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +107 -19
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +127 -47
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +12 -9
- package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
- package/lib/cjs/Metadata/Constant.js +12 -9
- 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 +6 -4
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +8 -6
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +20 -3
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +32 -14
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts +16 -9
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js +20 -13
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +32 -24
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js +47 -27
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +11 -7
- package/lib/cjs/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js +16 -10
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.d.ts +24 -15
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +54 -29
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +16 -3
- package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
- package/lib/cjs/Metadata/Mixin.js +20 -7
- 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 +27 -19
- package/lib/cjs/Metadata/OverrideFormat.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +10 -2
- package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js +11 -3
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts +46 -28
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +46 -22
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +6 -3
- package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js +12 -5
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +48 -25
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +54 -34
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.d.ts +50 -28
- package/lib/cjs/Metadata/Schema.d.ts.map +1 -1
- package/lib/cjs/Metadata/Schema.js +64 -42
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.d.ts +10 -19
- package/lib/cjs/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +12 -20
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.d.ts +17 -21
- package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
- package/lib/cjs/Metadata/Unit.js +20 -22
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +3 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js +4 -2
- 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 +172 -0
- package/lib/cjs/SchemaFormatsProvider.js.map +1 -0
- package/lib/cjs/SchemaJsonLocater.d.ts +5 -5
- package/lib/cjs/SchemaJsonLocater.js +4 -4
- package/lib/cjs/SchemaJsonLocater.js.map +1 -1
- package/lib/cjs/SchemaKey.d.ts +6 -6
- package/lib/cjs/SchemaKey.d.ts.map +1 -1
- package/lib/cjs/SchemaKey.js +9 -9
- package/lib/cjs/SchemaKey.js.map +1 -1
- package/lib/cjs/SchemaLoader.d.ts +3 -3
- package/lib/cjs/SchemaLoader.js +4 -4
- package/lib/cjs/SchemaLoader.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.d.ts +2 -2
- package/lib/cjs/SchemaPartVisitorDelegate.js +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +2 -1
- 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 +3 -3
- package/lib/cjs/utils/SchemaGraph.js.map +1 -1
- package/lib/esm/Context.d.ts +4 -4
- package/lib/esm/Context.d.ts.map +1 -1
- package/lib/esm/Context.js +8 -8
- 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 +2 -2
- package/lib/esm/DelayedPromise.js.map +1 -1
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
- package/lib/esm/Deserialization/Helper.js +28 -27
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js +151 -151
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/JsonProps.d.ts +34 -34
- 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.js +50 -50
- 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 +7 -12
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECName.d.ts +2 -2
- package/lib/esm/ECName.js +5 -5
- package/lib/esm/ECName.js.map +1 -1
- package/lib/esm/ECObjects.d.ts +24 -12
- package/lib/esm/ECObjects.d.ts.map +1 -1
- package/lib/esm/ECObjects.js +49 -26
- 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 +58 -58
- package/lib/esm/Exception.js.map +1 -1
- package/lib/esm/Interfaces.d.ts +30 -34
- package/lib/esm/Interfaces.d.ts.map +1 -1
- package/lib/esm/Interfaces.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +107 -19
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +128 -48
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Constant.d.ts +12 -9
- package/lib/esm/Metadata/Constant.d.ts.map +1 -1
- package/lib/esm/Metadata/Constant.js +13 -10
- 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 +6 -4
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +9 -7
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +20 -3
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +33 -15
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Enumeration.d.ts +16 -9
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/esm/Metadata/Enumeration.js +21 -14
- package/lib/esm/Metadata/Enumeration.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +32 -24
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js +48 -28
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.d.ts +11 -7
- package/lib/esm/Metadata/InvertedUnit.d.ts.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.js +17 -11
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.d.ts +24 -15
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +55 -30
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Mixin.d.ts +16 -3
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
- package/lib/esm/Metadata/Mixin.js +21 -8
- 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 +28 -20
- package/lib/esm/Metadata/OverrideFormat.js.map +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts +10 -2
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/esm/Metadata/Phenomenon.js +12 -4
- package/lib/esm/Metadata/Phenomenon.js.map +1 -1
- package/lib/esm/Metadata/Property.d.ts +46 -28
- package/lib/esm/Metadata/Property.d.ts.map +1 -1
- package/lib/esm/Metadata/Property.js +47 -23
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts +6 -3
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.js +13 -6
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts +48 -25
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +55 -35
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
- package/lib/esm/Metadata/Schema.d.ts +50 -28
- package/lib/esm/Metadata/Schema.d.ts.map +1 -1
- package/lib/esm/Metadata/Schema.js +65 -43
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.d.ts +10 -19
- package/lib/esm/Metadata/SchemaItem.d.ts.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +13 -21
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/Metadata/Unit.d.ts +17 -21
- package/lib/esm/Metadata/Unit.d.ts.map +1 -1
- package/lib/esm/Metadata/Unit.js +21 -23
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/Metadata/UnitSystem.d.ts +3 -1
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/esm/Metadata/UnitSystem.js +5 -3
- 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 +168 -0
- package/lib/esm/SchemaFormatsProvider.js.map +1 -0
- package/lib/esm/SchemaJsonLocater.d.ts +5 -5
- package/lib/esm/SchemaJsonLocater.js +4 -4
- package/lib/esm/SchemaJsonLocater.js.map +1 -1
- package/lib/esm/SchemaKey.d.ts +6 -6
- package/lib/esm/SchemaKey.d.ts.map +1 -1
- package/lib/esm/SchemaKey.js +10 -10
- package/lib/esm/SchemaKey.js.map +1 -1
- package/lib/esm/SchemaLoader.d.ts +3 -3
- package/lib/esm/SchemaLoader.js +5 -5
- package/lib/esm/SchemaLoader.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.d.ts +2 -2
- package/lib/esm/SchemaPartVisitorDelegate.js +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +2 -1
- 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 +4 -4
- package/lib/esm/utils/SchemaGraph.js.map +1 -1
- package/package.json +12 -6
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import { DelayedPromiseWithProps } from "../DelayedPromise";
|
|
9
9
|
import { XmlSerializationUtils } from "../Deserialization/XmlSerializationUtils";
|
|
10
10
|
import { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from "../ECObjects";
|
|
11
|
-
import {
|
|
11
|
+
import { ECSchemaError, ECSchemaStatus } from "../Exception";
|
|
12
12
|
import { PropertyType, propertyTypeToString, PropertyTypeUtils } from "../PropertyTypes";
|
|
13
13
|
import { ECName } from "../ECName";
|
|
14
14
|
import { serializeCustomAttributes } from "./CustomAttribute";
|
|
@@ -17,11 +17,10 @@ import { KindOfQuantity } from "./KindOfQuantity";
|
|
|
17
17
|
import { PropertyCategory } from "./PropertyCategory";
|
|
18
18
|
/**
|
|
19
19
|
* A common abstract class for all ECProperty types.
|
|
20
|
-
* @
|
|
20
|
+
* @public @preview
|
|
21
21
|
*/
|
|
22
22
|
export class Property {
|
|
23
23
|
_name;
|
|
24
|
-
_type;
|
|
25
24
|
_class; // TODO: class seems to be unused?
|
|
26
25
|
_description;
|
|
27
26
|
_label;
|
|
@@ -30,6 +29,9 @@ export class Property {
|
|
|
30
29
|
_category;
|
|
31
30
|
_kindOfQuantity;
|
|
32
31
|
_customAttributes;
|
|
32
|
+
/** @internal */
|
|
33
|
+
_type;
|
|
34
|
+
/** @internal */
|
|
33
35
|
constructor(ecClass, name, type) {
|
|
34
36
|
this._class = ecClass;
|
|
35
37
|
this._name = new ECName(name);
|
|
@@ -171,22 +173,22 @@ export class Property {
|
|
|
171
173
|
if (undefined !== propertyProps.category) {
|
|
172
174
|
const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);
|
|
173
175
|
if (!propertyCategorySchemaItemKey)
|
|
174
|
-
throw new
|
|
176
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' ("${propertyProps.category}") that cannot be found.`);
|
|
175
177
|
this._category = new DelayedPromiseWithProps(propertyCategorySchemaItemKey, async () => {
|
|
176
178
|
const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);
|
|
177
179
|
if (undefined === category)
|
|
178
|
-
throw new
|
|
180
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' ("${propertyProps.category}") that cannot be found.`);
|
|
179
181
|
return category;
|
|
180
182
|
});
|
|
181
183
|
}
|
|
182
184
|
if (undefined !== propertyProps.kindOfQuantity) {
|
|
183
185
|
const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);
|
|
184
186
|
if (!koqSchemaItemKey)
|
|
185
|
-
throw new
|
|
187
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' ("${propertyProps.kindOfQuantity}") that cannot be found.`);
|
|
186
188
|
this._kindOfQuantity = new DelayedPromiseWithProps(koqSchemaItemKey, async () => {
|
|
187
189
|
const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);
|
|
188
190
|
if (undefined === koq)
|
|
189
|
-
throw new
|
|
191
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' ("${propertyProps.kindOfQuantity}") that cannot be found.`);
|
|
190
192
|
return koq;
|
|
191
193
|
});
|
|
192
194
|
}
|
|
@@ -194,11 +196,13 @@ export class Property {
|
|
|
194
196
|
async fromJSON(propertyProps) {
|
|
195
197
|
this.fromJSONSync(propertyProps);
|
|
196
198
|
}
|
|
199
|
+
/** @internal */
|
|
197
200
|
addCustomAttribute(customAttribute) {
|
|
198
201
|
if (!this._customAttributes)
|
|
199
202
|
this._customAttributes = new Map();
|
|
200
203
|
this._customAttributes.set(customAttribute.className, customAttribute);
|
|
201
204
|
}
|
|
205
|
+
/** @internal */
|
|
202
206
|
setName(name) {
|
|
203
207
|
this._name = name;
|
|
204
208
|
}
|
|
@@ -271,18 +275,24 @@ export class Property {
|
|
|
271
275
|
&& property.propertyType !== undefined;
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
|
-
/** @
|
|
278
|
+
/** @public @preview */
|
|
275
279
|
export class PrimitiveOrEnumPropertyBase extends Property {
|
|
280
|
+
/** @internal */
|
|
276
281
|
_extendedTypeName;
|
|
282
|
+
/** @internal */
|
|
277
283
|
_minLength;
|
|
284
|
+
/** @internal */
|
|
278
285
|
_maxLength;
|
|
286
|
+
/** @internal */
|
|
279
287
|
_minValue;
|
|
288
|
+
/** @internal */
|
|
280
289
|
_maxValue;
|
|
281
290
|
get extendedTypeName() { return this._extendedTypeName; }
|
|
282
291
|
get minLength() { return this._minLength; }
|
|
283
292
|
get maxLength() { return this._maxLength; }
|
|
284
293
|
get minValue() { return this._minValue; }
|
|
285
294
|
get maxValue() { return this._maxValue; }
|
|
295
|
+
/** @internal */
|
|
286
296
|
constructor(ecClass, name, type) {
|
|
287
297
|
super(ecClass, name, type);
|
|
288
298
|
}
|
|
@@ -370,9 +380,10 @@ export class PrimitiveOrEnumPropertyBase extends Property {
|
|
|
370
380
|
this.fromJSONSync(propertyBaseProps);
|
|
371
381
|
}
|
|
372
382
|
}
|
|
373
|
-
/** @
|
|
383
|
+
/** @public @preview */
|
|
374
384
|
export class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {
|
|
375
|
-
get primitiveType() { return PropertyTypeUtils.getPrimitiveType(this.
|
|
385
|
+
get primitiveType() { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }
|
|
386
|
+
/** @internal */
|
|
376
387
|
constructor(ecClass, name, primitiveType = PrimitiveType.Integer) {
|
|
377
388
|
super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));
|
|
378
389
|
}
|
|
@@ -380,7 +391,7 @@ export class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
380
391
|
super.fromJSONSync(primitivePropertyProps);
|
|
381
392
|
if (undefined !== primitivePropertyProps.typeName) {
|
|
382
393
|
if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))
|
|
383
|
-
throw new
|
|
394
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);
|
|
384
395
|
}
|
|
385
396
|
}
|
|
386
397
|
async fromJSON(primitivePropertyProps) {
|
|
@@ -401,8 +412,9 @@ export class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
401
412
|
return itemElement;
|
|
402
413
|
}
|
|
403
414
|
}
|
|
404
|
-
/** @
|
|
415
|
+
/** @public @preview */
|
|
405
416
|
export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
417
|
+
/** @internal */
|
|
406
418
|
_enumeration;
|
|
407
419
|
get enumeration() { return this._enumeration; }
|
|
408
420
|
/**
|
|
@@ -413,6 +425,7 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
413
425
|
schemaJson.typeName = this.enumeration.fullName;
|
|
414
426
|
return schemaJson;
|
|
415
427
|
}
|
|
428
|
+
/** @internal */
|
|
416
429
|
constructor(ecClass, name, type) {
|
|
417
430
|
// TODO: Should we allow specifying the backing type?
|
|
418
431
|
super(ecClass, name, PropertyType.Integer_Enumeration);
|
|
@@ -422,14 +435,14 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
422
435
|
super.fromJSONSync(enumerationPropertyProps);
|
|
423
436
|
if (undefined !== enumerationPropertyProps.typeName) {
|
|
424
437
|
if (!(this.enumeration.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName
|
|
425
|
-
throw new
|
|
438
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);
|
|
426
439
|
const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration.fullName);
|
|
427
440
|
if (!enumSchemaItemKey)
|
|
428
|
-
throw new
|
|
441
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);
|
|
429
442
|
this._enumeration = new DelayedPromiseWithProps(enumSchemaItemKey, async () => {
|
|
430
443
|
const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);
|
|
431
444
|
if (undefined === enumeration)
|
|
432
|
-
throw new
|
|
445
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);
|
|
433
446
|
return enumeration;
|
|
434
447
|
});
|
|
435
448
|
}
|
|
@@ -446,10 +459,12 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
446
459
|
this.fromJSONSync(enumerationPropertyProps);
|
|
447
460
|
}
|
|
448
461
|
}
|
|
449
|
-
/** @
|
|
462
|
+
/** @public @preview */
|
|
450
463
|
export class StructProperty extends Property {
|
|
464
|
+
/** @internal */
|
|
451
465
|
_structClass;
|
|
452
466
|
get structClass() { return this._structClass; }
|
|
467
|
+
/** @internal */
|
|
453
468
|
constructor(ecClass, name, type) {
|
|
454
469
|
super(ecClass, name, PropertyType.Struct);
|
|
455
470
|
this._structClass = type;
|
|
@@ -473,16 +488,18 @@ export class StructProperty extends Property {
|
|
|
473
488
|
super.fromJSONSync(structPropertyProps);
|
|
474
489
|
if (undefined !== structPropertyProps.typeName) {
|
|
475
490
|
if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))
|
|
476
|
-
throw new
|
|
491
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);
|
|
477
492
|
}
|
|
478
493
|
}
|
|
479
494
|
async fromJSON(structPropertyProps) {
|
|
480
495
|
this.fromJSONSync(structPropertyProps);
|
|
481
496
|
}
|
|
482
497
|
}
|
|
483
|
-
/** @
|
|
498
|
+
/** @public @preview */
|
|
484
499
|
export class NavigationProperty extends Property {
|
|
500
|
+
/** @internal */
|
|
485
501
|
_relationshipClass;
|
|
502
|
+
/** @internal */
|
|
486
503
|
_direction;
|
|
487
504
|
get relationshipClass() { return this._relationshipClass; }
|
|
488
505
|
getRelationshipClassSync() {
|
|
@@ -511,6 +528,7 @@ export class NavigationProperty extends Property {
|
|
|
511
528
|
itemElement.setAttribute("direction", strengthDirectionToString(this.direction));
|
|
512
529
|
return itemElement;
|
|
513
530
|
}
|
|
531
|
+
/** @internal */
|
|
514
532
|
constructor(ecClass, name, relationship, direction) {
|
|
515
533
|
super(ecClass, name, PropertyType.Navigation);
|
|
516
534
|
this._relationshipClass = relationship;
|
|
@@ -519,9 +537,11 @@ export class NavigationProperty extends Property {
|
|
|
519
537
|
}
|
|
520
538
|
// TODO: Consolidate all of the INT32_MAX variables.
|
|
521
539
|
const INT32_MAX = 2147483647;
|
|
522
|
-
/** @
|
|
540
|
+
/** @public @preview */
|
|
523
541
|
export class ArrayProperty extends Property {
|
|
542
|
+
/** @internal */
|
|
524
543
|
_minOccurs = 0;
|
|
544
|
+
/** @internal */
|
|
525
545
|
_maxOccurs = INT32_MAX;
|
|
526
546
|
get minOccurs() { return this._minOccurs; }
|
|
527
547
|
get maxOccurs() { return this._maxOccurs; }
|
|
@@ -541,13 +561,15 @@ export class ArrayProperty extends Property {
|
|
|
541
561
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
542
562
|
const ArrayPropertyMixin = (Base) => {
|
|
543
563
|
return class extends Base {
|
|
564
|
+
/** @internal */
|
|
544
565
|
_minOccurs = 0;
|
|
566
|
+
/** @internal */
|
|
545
567
|
_maxOccurs = INT32_MAX;
|
|
546
568
|
get minOccurs() { return this._minOccurs; }
|
|
547
569
|
get maxOccurs() { return this._maxOccurs; }
|
|
548
570
|
constructor(...args) {
|
|
549
571
|
super(...args);
|
|
550
|
-
this._type = PropertyTypeUtils.asArray(this.
|
|
572
|
+
this._type = PropertyTypeUtils.asArray(this.propertyType);
|
|
551
573
|
}
|
|
552
574
|
fromJSONSync(arrayPropertyProps) {
|
|
553
575
|
super.fromJSONSync(arrayPropertyProps);
|
|
@@ -593,8 +615,9 @@ const ArrayPropertyMixin = (Base) => {
|
|
|
593
615
|
}
|
|
594
616
|
};
|
|
595
617
|
};
|
|
596
|
-
/** @
|
|
618
|
+
/** @public @preview */
|
|
597
619
|
export class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {
|
|
620
|
+
/** @internal */
|
|
598
621
|
constructor(ecClass, name, primitiveType = PrimitiveType.Integer) {
|
|
599
622
|
super(ecClass, name, primitiveType);
|
|
600
623
|
}
|
|
@@ -605,14 +628,15 @@ export class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty
|
|
|
605
628
|
return super.toJSON();
|
|
606
629
|
}
|
|
607
630
|
}
|
|
608
|
-
/** @
|
|
631
|
+
/** @public @preview */
|
|
609
632
|
export class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {
|
|
610
633
|
constructor(ecClass, name, type) {
|
|
611
634
|
super(ecClass, name, type);
|
|
612
635
|
}
|
|
613
636
|
}
|
|
614
|
-
/** @
|
|
637
|
+
/** @public @preview */
|
|
615
638
|
export class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {
|
|
639
|
+
/** @internal */
|
|
616
640
|
constructor(ecClass, name, type) {
|
|
617
641
|
super(ecClass, name, type);
|
|
618
642
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,cAAc,EAA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ED;;WAEG;QACO,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;QAED;;UAEE;QACQ,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;KACmE,CAAC;AACzE,CAAC,CAAC;AAEF,YAAY;AACZ,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAC/E,YAAY,OAAgB,EAAE,IAAY,EAAE,gBAA+B,aAAa,CAAC,OAAO;QAC9F,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CAEF;AAED,YAAY;AACZ,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IACnF,YAAY,OAAgB,EAAE,IAAY,EAAE,IAA2B;QACrE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,YAAY;AACZ,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport {\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\n} from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { Enumeration } from \"./Enumeration\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { type RelationshipClass } from \"./RelationshipClass\";\nimport { Schema } from \"./Schema\";\n\n/**\n * A common abstract class for all ECProperty types.\n * @beta\n */\nexport abstract class Property implements CustomAttributeContainerProps {\n protected _name: ECName;\n protected _type: PropertyType;\n\n protected _class: AnyClass; // TODO: class seems to be unused?\n protected _description?: string;\n protected _label?: string;\n protected _isReadOnly?: boolean;\n protected _priority?: number;\n protected _category?: LazyLoadedPropertyCategory;\n protected _kindOfQuantity?: LazyLoadedKindOfQuantity;\n private _customAttributes?: Map<string, CustomAttribute>;\n\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n this._class = ecClass as AnyClass;\n this._name = new ECName(name);\n this._type = type;\n }\n\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\n\n public get name() { return this._name.name; }\n\n public get class() { return this._class; }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get isReadOnly() { return this._isReadOnly || false; }\n\n public get priority(): number {\n if (this._priority === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.priority;\n }\n }\n\n return this._priority || 0;\n }\n\n public get category(): LazyLoadedPropertyCategory | undefined {\n if (this._category === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.category;\n }\n }\n\n return this._category;\n }\n\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\n if (this._kindOfQuantity === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.kindOfQuantity;\n }\n }\n\n return this._kindOfQuantity;\n }\n\n public get propertyType() { return this._type; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the name in the format 'ClassName.PropertyName'. */\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\n\n /** Returns the schema of the class holding the property. */\n public get schema(): Schema { return this._class.schema; }\n\n public getCategorySync(): PropertyCategory | undefined {\n if (!this._category){\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty){\n return baseProperty.getCategorySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\n }\n\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\n if (!this._kindOfQuantity){\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty){\n return baseProperty.getKindOfQuantitySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\n }\n\n /**\n * Save this Property's properties to an object for serializing to JSON.\n */\n public toJSON(): PropertyProps {\n const schemaJson: any = {};\n schemaJson.name = this.name;\n schemaJson.type = propertyTypeToString(this._type);\n if (this.description !== undefined)\n schemaJson.description = this.description;\n if (this.label !== undefined)\n schemaJson.label = this.label;\n if (this._isReadOnly !== undefined)\n schemaJson.isReadOnly = this._isReadOnly;\n if (this._category !== undefined)\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\n if (this._priority !== undefined)\n schemaJson.priority = this._priority;\n if (this._kindOfQuantity !== undefined)\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (customAttributes !== undefined)\n schemaJson.customAttributes = customAttributes;\n return schemaJson;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\n const itemElement = schemaXml.createElement(propType);\n itemElement.setAttribute(\"propertyName\", this.name);\n if (undefined !== this.description)\n itemElement.setAttribute(\"description\", this.description);\n if (undefined !== this.label)\n itemElement.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.isReadOnly)\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\n\n if (undefined !== this._category) {\n const category = await this._category;\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\n itemElement.setAttribute(\"category\", categoryName);\n }\n\n if (undefined !== this._priority)\n itemElement.setAttribute(\"priority\", this._priority.toString());\n\n if (undefined !== this._kindOfQuantity) {\n const kindOfQuantity = await this._kindOfQuantity;\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public fromJSONSync(propertyProps: PropertyProps) {\n if (undefined !== propertyProps.label) {\n this._label = propertyProps.label;\n }\n\n if (undefined !== propertyProps.description) {\n this._description = propertyProps.description;\n }\n\n if (undefined !== propertyProps.priority) {\n this._priority = propertyProps.priority;\n }\n\n if (undefined !== propertyProps.isReadOnly) {\n this._isReadOnly = propertyProps.isReadOnly;\n }\n\n if (undefined !== propertyProps.category) {\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\n if (!propertyCategorySchemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\n async () => {\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\n if (undefined === category)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n return category;\n });\n }\n\n if (undefined !== propertyProps.kindOfQuantity) {\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\n if (!koqSchemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\n async () => {\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\n if (undefined === koq)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n return koq;\n });\n }\n }\n\n public async fromJSON(propertyProps: PropertyProps) {\n this.fromJSONSync(propertyProps);\n }\n\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n protected setName(name: ECName) {\n this._name = name;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setLabel(label: string) {\n this._label = label;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setIsReadOnly(isReadOnly: boolean) {\n this._isReadOnly = isReadOnly;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setPriority(priority: number) {\n this._priority = priority;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setCategory(category: LazyLoadedPropertyCategory) {\n this._category = category;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\n this._kindOfQuantity = kindOfQuantity;\n }\n\n /**\n * Retrieve all custom attributes in the current property and its base\n * This is the async version of getCustomAttributesSync()\n */\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\n return this.getCustomAttributesSync();\n }\n\n /**\n * Retrieve all custom attributes in the current property and its base.\n */\n public getCustomAttributesSync(): CustomAttributeSet {\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\n if (undefined === customAttributes) {\n customAttributes = new Map<string, CustomAttribute>();\n }\n\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n let baseCustomAttributes;\n if (undefined !== baseProperty)\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\n if (undefined !== baseCustomAttributes) {\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\n }\n\n return customAttributes;\n }\n /**\n * @internal\n */\n public static isProperty(object: any): object is AnyProperty {\n const property = object as Property;\n\n return property !== undefined && property.class !== undefined && property.name !== undefined\n && property.propertyType !== undefined;\n }\n}\n\n/** A callback function to process properties of an Entity\n * @beta\n */\nexport type PropertyHandler = (name: string, property: Property) => void;\n\n/** @beta */\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\n protected _extendedTypeName?: string;\n protected _minLength?: number;\n protected _maxLength?: number;\n protected _minValue?: number;\n protected _maxValue?: number;\n\n public get extendedTypeName() { return this._extendedTypeName; }\n public get minLength() { return this._minLength; }\n public get maxLength() { return this._maxLength; }\n public get minValue() { return this._minValue; }\n public get maxValue() { return this._maxValue; }\n\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n super(ecClass, name, type);\n }\n\n /**\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\n const schemaJson = super.toJSON() as any;\n if (this.extendedTypeName !== undefined)\n schemaJson.extendedTypeName = this.extendedTypeName;\n if (this._minLength !== undefined)\n schemaJson.minLength = this.minLength;\n if (this._maxLength !== undefined)\n schemaJson.maxLength = this.maxLength;\n if (this._minValue !== undefined)\n schemaJson.minValue = this.minValue;\n if (this._maxValue !== undefined)\n schemaJson.maxValue = this.maxValue;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n if (undefined !== this.extendedTypeName)\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\n if (undefined !== this.minValue)\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\n if (undefined !== this.maxValue)\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\n if (undefined !== this.minLength)\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\n if (undefined !== this.maxLength)\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\n\n return itemElement;\n }\n\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n super.fromJSONSync(propertyBaseProps);\n\n if (undefined !== propertyBaseProps.minLength) {\n this._minLength = propertyBaseProps.minLength;\n }\n\n if (undefined !== propertyBaseProps.maxLength) {\n this._maxLength = propertyBaseProps.maxLength;\n }\n\n if (undefined !== propertyBaseProps.minValue) {\n this._minValue = propertyBaseProps.minValue;\n }\n\n if (undefined !== propertyBaseProps.maxValue) {\n this._maxValue = propertyBaseProps.maxValue;\n }\n\n if (undefined !== propertyBaseProps.extendedTypeName) {\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\n }\n }\n /**\n * @internal Used in schema editing.\n */\n protected setExtendedTypeName(extendedTypeName: string) {\n this._extendedTypeName = extendedTypeName;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinLength(minLength: number) {\n this._minLength = minLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxLength(maxLength: number) {\n this._maxLength = maxLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinValue(minValue: number) {\n this._minValue = minValue;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxValue(maxValue: number) {\n this._maxValue = maxValue;\n }\n\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n this.fromJSONSync(propertyBaseProps);\n }\n}\n\n/** @beta */\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this._type); }\n\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\n }\n\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\n super.fromJSONSync(primitivePropertyProps);\n if (undefined !== primitivePropertyProps.typeName) {\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\n this.fromJSONSync(primitivePropertyProps);\n }\n\n /**\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitivePropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\n return itemElement;\n }\n}\n\n/** @beta */\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\n protected _enumeration?: LazyLoadedEnumeration;\n\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\n\n /**\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): EnumerationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.enumeration!.fullName;\n return schemaJson;\n }\n\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n // TODO: Should we allow specifying the backing type?\n super(ecClass, name, PropertyType.Integer_Enumeration);\n this._enumeration = type;\n }\n\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\n super.fromJSONSync(enumerationPropertyProps);\n if (undefined !== enumerationPropertyProps.typeName) {\n if (!(this.enumeration!.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, ``);\n const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration!.fullName);\n if (!enumSchemaItemKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\n async () => {\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\n if (undefined === enumeration)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n return enumeration;\n });\n }\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const enumeration = await this.enumeration;\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration!.schema, enumeration!.name);\n itemElement.setAttribute(\"typeName\", enumerationName);\n return itemElement;\n }\n\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\n this.fromJSONSync(enumerationPropertyProps);\n }\n\n}\n\n/** @beta */\nexport class StructProperty extends Property {\n protected _structClass: StructClass;\n\n public get structClass(): StructClass { return this._structClass; }\n\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, PropertyType.Struct);\n this._structClass = type;\n }\n\n /**\n * Save this StructProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): StructPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.structClass.fullName;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\n itemElement.setAttribute(\"typeName\", structClassName);\n return itemElement;\n }\n\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\n super.fromJSONSync(structPropertyProps);\n if (undefined !== structPropertyProps.typeName) {\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\n this.fromJSONSync(structPropertyProps);\n }\n}\n\n/** @beta */\nexport class NavigationProperty extends Property {\n protected _relationshipClass: LazyLoadedRelationshipClass;\n protected _direction: StrengthDirection;\n\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\n\n public getRelationshipClassSync(): RelationshipClass | undefined {\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\n return undefined;\n\n // We cannot use the type guard here to avoid a circular dependency\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\n }\n\n public get direction() { return this._direction; }\n\n /**\n * Save this NavigationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): NavigationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.relationshipName = this.relationshipClass.fullName;\n schemaJson.direction = strengthDirectionToString(this.direction);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const relationshipClass = await this.relationshipClass;\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\n\n return itemElement;\n }\n\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\n super(ecClass, name, PropertyType.Navigation);\n this._relationshipClass = relationship;\n\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\n }\n}\n\ntype Constructor<T> = new (...args: any[]) => T;\n\n// TODO: Consolidate all of the INT32_MAX variables.\nconst INT32_MAX = 2147483647;\n\n/** @beta */\nexport abstract class ArrayProperty extends Property {\n protected _minOccurs: number = 0;\n protected _maxOccurs?: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\n return class extends Base {\n protected _minOccurs: number = 0;\n protected _maxOccurs: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n constructor(...args: any[]) {\n super(...args);\n this._type = PropertyTypeUtils.asArray(this._type);\n }\n\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n super.fromJSONSync(arrayPropertyProps);\n if (undefined !== arrayPropertyProps.minOccurs) {\n this._minOccurs = arrayPropertyProps.minOccurs;\n }\n\n if (undefined !== arrayPropertyProps.maxOccurs) {\n this._maxOccurs = arrayPropertyProps.maxOccurs;\n }\n }\n\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n this.fromJSONSync(arrayPropertyProps);\n }\n\n /**\n * Save this ArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): ArrayPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.minOccurs = this.minOccurs;\n if (this.maxOccurs !== undefined)\n schemaJson.maxOccurs = this.maxOccurs;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\n if (this.maxOccurs)\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\n\n return itemElement;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\n};\n\n/** @beta */\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, primitiveType);\n }\n\n /**\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveArrayPropertyProps {\n return super.toJSON();\n }\n\n}\n\n/** @beta */\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n super(ecClass, name, type);\n }\n}\n\n/** @beta */\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, type);\n }\n}\n\n/** @beta */\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\n/** @beta */\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\n/** @beta */\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\n/** @beta */\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\n/** @beta */\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableProperty extends Property {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC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AAC;QAED;;WAEG;QACO,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;QAED;;UAEE;QACQ,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;KACmE,CAAC;AACzE,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAC/E,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,gBAA+B,aAAa,CAAC,OAAO;QAC9F,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CAEF;AAED,uBAAuB;AACvB,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IACnF,YAAY,OAAgB,EAAE,IAAY,EAAE,IAA2B;QACrE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport {\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\n} from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { Enumeration } from \"./Enumeration\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { type RelationshipClass } from \"./RelationshipClass\";\nimport { Schema } from \"./Schema\";\n\n/**\n * A common abstract class for all ECProperty types.\n * @public @preview\n */\nexport abstract class Property implements CustomAttributeContainerProps {\n private _name: ECName;\n private _class: AnyClass; // TODO: class seems to be unused?\n private _description?: string;\n private _label?: string;\n private _isReadOnly?: boolean;\n private _priority?: number;\n private _category?: LazyLoadedPropertyCategory;\n private _kindOfQuantity?: LazyLoadedKindOfQuantity;\n private _customAttributes?: Map<string, CustomAttribute>;\n\n /** @internal */\n protected _type: PropertyType;\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n this._class = ecClass as AnyClass;\n this._name = new ECName(name);\n this._type = type;\n }\n\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\n\n public get name() { return this._name.name; }\n\n public get class() { return this._class; }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get isReadOnly() { return this._isReadOnly || false; }\n\n public get priority(): number {\n if (this._priority === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.priority;\n }\n }\n\n return this._priority || 0;\n }\n\n public get category(): LazyLoadedPropertyCategory | undefined {\n if (this._category === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.category;\n }\n }\n\n return this._category;\n }\n\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\n if (this._kindOfQuantity === undefined) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.kindOfQuantity;\n }\n }\n\n return this._kindOfQuantity;\n }\n\n public get propertyType() { return this._type; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the name in the format 'ClassName.PropertyName'. */\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\n\n /** Returns the schema of the class holding the property. */\n public get schema(): Schema { return this._class.schema; }\n\n public getCategorySync(): PropertyCategory | undefined {\n if (!this._category) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.getCategorySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\n }\n\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\n if (!this._kindOfQuantity) {\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n if (undefined !== baseProperty) {\n return baseProperty.getKindOfQuantitySync();\n }\n\n return undefined;\n }\n\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\n }\n\n /**\n * Save this Property's properties to an object for serializing to JSON.\n */\n public toJSON(): PropertyProps {\n const schemaJson: any = {};\n schemaJson.name = this.name;\n schemaJson.type = propertyTypeToString(this._type);\n if (this.description !== undefined)\n schemaJson.description = this.description;\n if (this.label !== undefined)\n schemaJson.label = this.label;\n if (this._isReadOnly !== undefined)\n schemaJson.isReadOnly = this._isReadOnly;\n if (this._category !== undefined)\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\n if (this._priority !== undefined)\n schemaJson.priority = this._priority;\n if (this._kindOfQuantity !== undefined)\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (customAttributes !== undefined)\n schemaJson.customAttributes = customAttributes;\n return schemaJson;\n }\n\n /** @internal */\n public async toXml(schemaXml: Document): Promise<Element> {\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\n const itemElement = schemaXml.createElement(propType);\n itemElement.setAttribute(\"propertyName\", this.name);\n if (undefined !== this.description)\n itemElement.setAttribute(\"description\", this.description);\n if (undefined !== this.label)\n itemElement.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.isReadOnly)\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\n\n if (undefined !== this._category) {\n const category = await this._category;\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\n itemElement.setAttribute(\"category\", categoryName);\n }\n\n if (undefined !== this._priority)\n itemElement.setAttribute(\"priority\", this._priority.toString());\n\n if (undefined !== this._kindOfQuantity) {\n const kindOfQuantity = await this._kindOfQuantity;\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\n }\n\n if (this._customAttributes) {\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\n caContainerElement.appendChild(caElement);\n }\n itemElement.appendChild(caContainerElement);\n }\n\n return itemElement;\n }\n\n public fromJSONSync(propertyProps: PropertyProps) {\n if (undefined !== propertyProps.label) {\n this._label = propertyProps.label;\n }\n\n if (undefined !== propertyProps.description) {\n this._description = propertyProps.description;\n }\n\n if (undefined !== propertyProps.priority) {\n this._priority = propertyProps.priority;\n }\n\n if (undefined !== propertyProps.isReadOnly) {\n this._isReadOnly = propertyProps.isReadOnly;\n }\n\n if (undefined !== propertyProps.category) {\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\n if (!propertyCategorySchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\n async () => {\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\n if (undefined === category)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\n return category;\n });\n }\n\n if (undefined !== propertyProps.kindOfQuantity) {\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\n if (!koqSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\n async () => {\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\n if (undefined === koq)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\n return koq;\n });\n }\n }\n\n public async fromJSON(propertyProps: PropertyProps) {\n this.fromJSONSync(propertyProps);\n }\n\n /** @internal */\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /** @internal */\n protected setName(name: ECName) {\n this._name = name;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setLabel(label: string) {\n this._label = label;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setIsReadOnly(isReadOnly: boolean) {\n this._isReadOnly = isReadOnly;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setPriority(priority: number) {\n this._priority = priority;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setCategory(category: LazyLoadedPropertyCategory) {\n this._category = category;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\n this._kindOfQuantity = kindOfQuantity;\n }\n\n /**\n * Retrieve all custom attributes in the current property and its base\n * This is the async version of getCustomAttributesSync()\n */\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\n return this.getCustomAttributesSync();\n }\n\n /**\n * Retrieve all custom attributes in the current property and its base.\n */\n public getCustomAttributesSync(): CustomAttributeSet {\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\n if (undefined === customAttributes) {\n customAttributes = new Map<string, CustomAttribute>();\n }\n\n const baseProperty = this.class.getInheritedPropertySync(this.name);\n let baseCustomAttributes;\n if (undefined !== baseProperty)\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\n if (undefined !== baseCustomAttributes) {\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\n }\n\n return customAttributes;\n }\n /**\n * @internal\n */\n public static isProperty(object: any): object is AnyProperty {\n const property = object as Property;\n\n return property !== undefined && property.class !== undefined && property.name !== undefined\n && property.propertyType !== undefined;\n }\n}\n\n\n\n/** @public @preview */\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\n /** @internal */\n protected _extendedTypeName?: string;\n /** @internal */\n protected _minLength?: number;\n /** @internal */\n protected _maxLength?: number;\n /** @internal */\n protected _minValue?: number;\n /** @internal */\n protected _maxValue?: number;\n\n public get extendedTypeName() { return this._extendedTypeName; }\n public get minLength() { return this._minLength; }\n public get maxLength() { return this._maxLength; }\n public get minValue() { return this._minValue; }\n public get maxValue() { return this._maxValue; }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\n super(ecClass, name, type);\n }\n\n /**\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\n const schemaJson = super.toJSON() as any;\n if (this.extendedTypeName !== undefined)\n schemaJson.extendedTypeName = this.extendedTypeName;\n if (this._minLength !== undefined)\n schemaJson.minLength = this.minLength;\n if (this._maxLength !== undefined)\n schemaJson.maxLength = this.maxLength;\n if (this._minValue !== undefined)\n schemaJson.minValue = this.minValue;\n if (this._maxValue !== undefined)\n schemaJson.maxValue = this.maxValue;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n if (undefined !== this.extendedTypeName)\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\n if (undefined !== this.minValue)\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\n if (undefined !== this.maxValue)\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\n if (undefined !== this.minLength)\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\n if (undefined !== this.maxLength)\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\n\n return itemElement;\n }\n\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n super.fromJSONSync(propertyBaseProps);\n\n if (undefined !== propertyBaseProps.minLength) {\n this._minLength = propertyBaseProps.minLength;\n }\n\n if (undefined !== propertyBaseProps.maxLength) {\n this._maxLength = propertyBaseProps.maxLength;\n }\n\n if (undefined !== propertyBaseProps.minValue) {\n this._minValue = propertyBaseProps.minValue;\n }\n\n if (undefined !== propertyBaseProps.maxValue) {\n this._maxValue = propertyBaseProps.maxValue;\n }\n\n if (undefined !== propertyBaseProps.extendedTypeName) {\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\n }\n }\n /**\n * @internal Used in schema editing.\n */\n protected setExtendedTypeName(extendedTypeName: string) {\n this._extendedTypeName = extendedTypeName;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinLength(minLength: number) {\n this._minLength = minLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxLength(maxLength: number) {\n this._maxLength = maxLength;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinValue(minValue: number) {\n this._minValue = minValue;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxValue(maxValue: number) {\n this._maxValue = maxValue;\n }\n\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\n this.fromJSONSync(propertyBaseProps);\n }\n}\n\n/** @public @preview */\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\n }\n\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\n super.fromJSONSync(primitivePropertyProps);\n if (undefined !== primitivePropertyProps.typeName) {\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\n this.fromJSONSync(primitivePropertyProps);\n }\n\n /**\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitivePropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\n return itemElement;\n }\n}\n\n/** @public @preview */\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\n /** @internal */\n protected _enumeration?: LazyLoadedEnumeration;\n\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\n\n /**\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): EnumerationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.enumeration!.fullName;\n return schemaJson;\n }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n // TODO: Should we allow specifying the backing type?\n super(ecClass, name, PropertyType.Integer_Enumeration);\n this._enumeration = type;\n }\n\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\n super.fromJSONSync(enumerationPropertyProps);\n if (undefined !== enumerationPropertyProps.typeName) {\n if (!(this.enumeration!.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration!.fullName);\n if (!enumSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\n async () => {\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\n if (undefined === enumeration)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\n return enumeration;\n });\n }\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const enumeration = await this.enumeration;\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration!.schema, enumeration!.name);\n itemElement.setAttribute(\"typeName\", enumerationName);\n return itemElement;\n }\n\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\n this.fromJSONSync(enumerationPropertyProps);\n }\n\n}\n\n/** @public @preview */\nexport class StructProperty extends Property {\n /** @internal */\n protected _structClass: StructClass;\n\n public get structClass(): StructClass { return this._structClass; }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, PropertyType.Struct);\n this._structClass = type;\n }\n\n /**\n * Save this StructProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): StructPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.typeName = this.structClass.fullName;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\n itemElement.setAttribute(\"typeName\", structClassName);\n return itemElement;\n }\n\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\n super.fromJSONSync(structPropertyProps);\n if (undefined !== structPropertyProps.typeName) {\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n }\n }\n\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\n this.fromJSONSync(structPropertyProps);\n }\n}\n\n/** @public @preview */\nexport class NavigationProperty extends Property {\n /** @internal */\n protected _relationshipClass: LazyLoadedRelationshipClass;\n /** @internal */\n protected _direction: StrengthDirection;\n\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\n\n public getRelationshipClassSync(): RelationshipClass | undefined {\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\n return undefined;\n\n // We cannot use the type guard here to avoid a circular dependency\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\n }\n\n public get direction() { return this._direction; }\n\n /**\n * Save this NavigationProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): NavigationPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.relationshipName = this.relationshipClass.fullName;\n schemaJson.direction = strengthDirectionToString(this.direction);\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n const relationshipClass = await this.relationshipClass;\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\n\n return itemElement;\n }\n\n /** @internal */\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\n super(ecClass, name, PropertyType.Navigation);\n this._relationshipClass = relationship;\n\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\n }\n}\n\ntype Constructor<T> = new (...args: any[]) => T;\n\n// TODO: Consolidate all of the INT32_MAX variables.\nconst INT32_MAX = 2147483647;\n\n/** @public @preview */\nexport abstract class ArrayProperty extends Property {\n /** @internal */\n protected _minOccurs: number = 0;\n /** @internal */\n protected _maxOccurs?: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\n return class extends Base {\n /** @internal */\n protected _minOccurs: number = 0;\n /** @internal */\n protected _maxOccurs: number = INT32_MAX;\n\n public get minOccurs() { return this._minOccurs; }\n public get maxOccurs() { return this._maxOccurs; }\n\n constructor(...args: any[]) {\n super(...args);\n this._type = PropertyTypeUtils.asArray(this.propertyType);\n }\n\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n super.fromJSONSync(arrayPropertyProps);\n if (undefined !== arrayPropertyProps.minOccurs) {\n this._minOccurs = arrayPropertyProps.minOccurs;\n }\n\n if (undefined !== arrayPropertyProps.maxOccurs) {\n this._maxOccurs = arrayPropertyProps.maxOccurs;\n }\n }\n\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\n this.fromJSONSync(arrayPropertyProps);\n }\n\n /**\n * Save this ArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): ArrayPropertyProps {\n const schemaJson = super.toJSON() as any;\n schemaJson.minOccurs = this.minOccurs;\n if (this.maxOccurs !== undefined)\n schemaJson.maxOccurs = this.maxOccurs;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\n if (this.maxOccurs)\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\n\n return itemElement;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMinOccurs(minOccurs: number) {\n this._minOccurs = minOccurs;\n }\n\n /**\n * @internal Used in schema editing.\n */\n protected setMaxOccurs(maxOccurs: number) {\n this._maxOccurs = maxOccurs;\n }\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\n};\n\n/** @public @preview */\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\n /** @internal */\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\n super(ecClass, name, primitiveType);\n }\n\n /**\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\n */\n public override toJSON(): PrimitiveArrayPropertyProps {\n return super.toJSON();\n }\n\n}\n\n/** @public @preview */\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\n super(ecClass, name, type);\n }\n}\n\n/** @public @preview */\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\n /** @internal */\n constructor(ecClass: ECClass, name: string, type: StructClass) {\n super(ecClass, name, type);\n }\n}\n\n/** @public @preview */\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\n/** @public @preview */\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\n/** @public @preview */\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\n/** @public @preview */\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\n/** @public @preview */\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * @internal\n */\nexport abstract class MutableProperty extends Property {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n}\n"]}
|
|
@@ -6,13 +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
12
|
readonly schemaItemType: SchemaItemType;
|
|
13
|
+
/** @internal */
|
|
13
14
|
static get schemaItemType(): SchemaItemType;
|
|
14
|
-
|
|
15
|
+
private _priority;
|
|
15
16
|
get priority(): number;
|
|
17
|
+
/** @internal */
|
|
16
18
|
constructor(schema: Schema, name: string);
|
|
17
19
|
/**
|
|
18
20
|
* Save this PropertyCategory's properties to an object for serializing to JSON.
|
|
@@ -25,8 +27,8 @@ export declare class PropertyCategory extends SchemaItem {
|
|
|
25
27
|
fromJSONSync(propertyCategoryProps: PropertyCategoryProps): void;
|
|
26
28
|
fromJSON(propertyCategoryProps: PropertyCategoryProps): Promise<void>;
|
|
27
29
|
/**
|
|
28
|
-
* @alpha
|
|
29
30
|
* Used for schema editing.
|
|
31
|
+
* @internal
|
|
30
32
|
*/
|
|
31
33
|
protected setPriority(priority: number): void;
|
|
32
34
|
/**
|
|
@@ -39,6 +41,7 @@ export declare class PropertyCategory extends SchemaItem {
|
|
|
39
41
|
* Type assertion to check if the SchemaItem is of type PropertyCategory.
|
|
40
42
|
* @param item The SchemaItem to check.
|
|
41
43
|
* @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.
|
|
44
|
+
* @internal
|
|
42
45
|
*/
|
|
43
46
|
static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory;
|
|
44
47
|
}
|
|
@@ -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;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,UAAU;IAC9C,SAAyB,cAAc,iBAAmC;IAC1E,WAA2B,cAAc,mBAA8C;IACvF,
|
|
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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
import { SchemaItem } from "./SchemaItem";
|
|
11
11
|
/**
|
|
12
|
-
* @
|
|
12
|
+
* @public @preview
|
|
13
13
|
*/
|
|
14
14
|
export class PropertyCategory extends SchemaItem {
|
|
15
15
|
schemaItemType = PropertyCategory.schemaItemType;
|
|
16
|
+
/** @internal */
|
|
16
17
|
static get schemaItemType() { return SchemaItemType.PropertyCategory; }
|
|
17
18
|
_priority;
|
|
18
|
-
get priority() {
|
|
19
|
+
get priority() {
|
|
20
|
+
return this._priority;
|
|
21
|
+
}
|
|
22
|
+
/** @internal */
|
|
19
23
|
constructor(schema, name) {
|
|
20
24
|
super(schema, name);
|
|
21
25
|
this._priority = 0;
|
|
@@ -44,8 +48,8 @@ export class PropertyCategory extends SchemaItem {
|
|
|
44
48
|
this.fromJSONSync(propertyCategoryProps);
|
|
45
49
|
}
|
|
46
50
|
/**
|
|
47
|
-
* @alpha
|
|
48
51
|
* Used for schema editing.
|
|
52
|
+
* @internal
|
|
49
53
|
*/
|
|
50
54
|
setPriority(priority) {
|
|
51
55
|
this._priority = priority;
|
|
@@ -56,16 +60,19 @@ export class PropertyCategory extends SchemaItem {
|
|
|
56
60
|
* @returns True if the item is a PropertyCategory, false otherwise.
|
|
57
61
|
*/
|
|
58
62
|
static isPropertyCategory(item) {
|
|
59
|
-
|
|
63
|
+
if (item && item.schemaItemType === SchemaItemType.PropertyCategory)
|
|
64
|
+
return true;
|
|
65
|
+
return false;
|
|
60
66
|
}
|
|
61
67
|
/**
|
|
62
68
|
* Type assertion to check if the SchemaItem is of type PropertyCategory.
|
|
63
69
|
* @param item The SchemaItem to check.
|
|
64
70
|
* @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.
|
|
71
|
+
* @internal
|
|
65
72
|
*/
|
|
66
73
|
static assertIsPropertyCategory(item) {
|
|
67
74
|
if (!this.isPropertyCategory(item))
|
|
68
|
-
throw new
|
|
75
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.PropertyCategory}' (PropertyCategory)`);
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"PropertyCategory.js","sourceRoot":"","sources":["../../../src/Metadata/PropertyCategory.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IACrB,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC;IAC1E,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,cAAc,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,KAAK,EAAE,uBAAgC,KAAK;QACvF,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,oBAAoB,CAAQ,CAAC;QACzE,UAAU,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,gBAAgB;IACA,KAAK,CAAC,KAAK,CAAC,SAAmB;QAC7C,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACjD,WAAW,CAAC,YAAY,CAAC,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/D,OAAO,WAAW,CAAC;IACrB,CAAC;IAEe,YAAY,CAAC,qBAA4C;QACvE,KAAK,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;QAC1C,IAAI,CAAC,SAAS,GAAG,qBAAqB,CAAC,QAAQ,CAAC;IAClD,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,qBAA4C;QACzE,IAAI,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAC3C,CAAC;IACD;;;OAGG;IACO,WAAW,CAAC,QAAgB;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,kBAAkB,CAAC,IAAiB;QAChD,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,cAAc,CAAC,gBAAgB;YACjE,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,wBAAwB,CAAC,IAAiB;QACtD,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC;YAChC,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,gBAAgB,sBAAsB,CAAC,CAAC;IACtI,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAgB,uBAAwB,SAAQ,gBAAgB;CAGrE","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { PropertyCategoryProps } from \"../Deserialization/JsonProps\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { Schema } from \"./Schema\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * @public @preview\n */\nexport class PropertyCategory extends SchemaItem {\n public override readonly schemaItemType = PropertyCategory.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.PropertyCategory; }\n private _priority: number;\n\n public get priority() {\n return this._priority;\n }\n\n /** @internal */\n constructor(schema: Schema, name: string) {\n super(schema, name);\n this._priority = 0;\n }\n\n /**\n * Save this PropertyCategory's properties to an object for serializing to JSON.\n * @param standalone Serialization includes only this object (as opposed to the full schema).\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\n */\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): PropertyCategoryProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.priority = this.priority;\n return schemaJson;\n }\n\n /** @internal */\n public override async toXml(schemaXml: Document): Promise<Element> {\n const itemElement = await super.toXml(schemaXml);\n itemElement.setAttribute(\"priority\", this.priority.toString());\n return itemElement;\n }\n\n public override fromJSONSync(propertyCategoryProps: PropertyCategoryProps) {\n super.fromJSONSync(propertyCategoryProps);\n this._priority = propertyCategoryProps.priority;\n }\n\n public override async fromJSON(propertyCategoryProps: PropertyCategoryProps) {\n this.fromJSONSync(propertyCategoryProps);\n }\n /**\n * Used for schema editing.\n * @internal\n */\n protected setPriority(priority: number) {\n this._priority = priority;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type PropertyCategory.\n * @param item The SchemaItem to check.\n * @returns True if the item is a PropertyCategory, false otherwise.\n */\n public static isPropertyCategory(item?: SchemaItem): item is PropertyCategory {\n if (item && item.schemaItemType === SchemaItemType.PropertyCategory)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type PropertyCategory.\n * @param item The SchemaItem to check.\n * @returns The item cast to PropertyCategory if it is a PropertyCategory, undefined otherwise.\n * @internal\n */\n public static assertIsPropertyCategory(item?: SchemaItem): asserts item is PropertyCategory {\n if (!this.isPropertyCategory(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.PropertyCategory}' (PropertyCategory)`);\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutablePropertyCategory extends PropertyCategory {\n public abstract override setPriority(priority: number): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|