@itwin/ecschema-metadata 5.9.0-dev.9 → 5.9.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 +24 -1
- package/lib/cjs/Deserialization/Helper.d.ts +1 -1
- package/lib/cjs/Deserialization/Helper.d.ts.map +1 -1
- package/lib/cjs/Deserialization/Helper.js +35 -21
- package/lib/cjs/Deserialization/Helper.js.map +1 -1
- package/lib/cjs/Deserialization/JsonParser.js +7 -7
- package/lib/cjs/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts +3 -2
- package/lib/cjs/Formatting/FormatSetFormatsProvider.d.ts.map +1 -1
- package/lib/cjs/Formatting/FormatSetFormatsProvider.js +7 -6
- package/lib/cjs/Formatting/FormatSetFormatsProvider.js.map +1 -1
- package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts +1 -1
- package/lib/cjs/Formatting/SchemaFormatsProvider.d.ts.map +1 -1
- package/lib/cjs/Formatting/SchemaFormatsProvider.js +6 -5
- package/lib/cjs/Formatting/SchemaFormatsProvider.js.map +1 -1
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +6 -4
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js +2 -2
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.js +2 -2
- package/lib/cjs/Metadata/InvertedUnit.js.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Property.d.ts.map +1 -1
- package/lib/cjs/Metadata/Property.js +6 -3
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +5 -4
- package/lib/cjs/Metadata/RelationshipClass.js.map +1 -1
- package/lib/cjs/Metadata/Schema.js +1 -1
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/Metadata/SchemaItem.js +2 -2
- package/lib/cjs/Metadata/SchemaItem.js.map +1 -1
- package/lib/cjs/Metadata/Unit.js +2 -2
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.d.ts +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitConverter.js +4 -4
- package/lib/cjs/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.d.ts +3 -4
- package/lib/cjs/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js +11 -11
- package/lib/cjs/UnitConversion/UnitTree.js.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts +3 -0
- package/lib/cjs/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js +3 -0
- package/lib/cjs/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/cjs/ecschema-metadata.d.ts +0 -1
- package/lib/cjs/ecschema-metadata.d.ts.map +1 -1
- package/lib/cjs/ecschema-metadata.js +0 -1
- package/lib/cjs/ecschema-metadata.js.map +1 -1
- package/lib/esm/Deserialization/Helper.d.ts +1 -1
- package/lib/esm/Deserialization/Helper.d.ts.map +1 -1
- package/lib/esm/Deserialization/Helper.js +35 -21
- package/lib/esm/Deserialization/Helper.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js +7 -7
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts +3 -2
- package/lib/esm/Formatting/FormatSetFormatsProvider.d.ts.map +1 -1
- package/lib/esm/Formatting/FormatSetFormatsProvider.js +7 -6
- package/lib/esm/Formatting/FormatSetFormatsProvider.js.map +1 -1
- package/lib/esm/Formatting/SchemaFormatsProvider.d.ts +1 -1
- package/lib/esm/Formatting/SchemaFormatsProvider.d.ts.map +1 -1
- package/lib/esm/Formatting/SchemaFormatsProvider.js +6 -5
- package/lib/esm/Formatting/SchemaFormatsProvider.js.map +1 -1
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +6 -4
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts.map +1 -1
- package/lib/esm/Metadata/EntityClass.js +2 -2
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.js +2 -2
- package/lib/esm/Metadata/InvertedUnit.js.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Property.d.ts.map +1 -1
- package/lib/esm/Metadata/Property.js +6 -3
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +5 -4
- package/lib/esm/Metadata/RelationshipClass.js.map +1 -1
- package/lib/esm/Metadata/Schema.js +1 -1
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/Metadata/SchemaItem.js +2 -2
- package/lib/esm/Metadata/SchemaItem.js.map +1 -1
- package/lib/esm/Metadata/Unit.js +2 -2
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConverter.d.ts +1 -1
- package/lib/esm/UnitConversion/UnitConverter.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitConverter.js +1 -1
- package/lib/esm/UnitConversion/UnitConverter.js.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.d.ts +3 -4
- package/lib/esm/UnitConversion/UnitTree.d.ts.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.js +6 -6
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts +3 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.d.ts.map +1 -1
- package/lib/esm/UnitProvider/SchemaUnitProvider.js +3 -0
- package/lib/esm/UnitProvider/SchemaUnitProvider.js.map +1 -1
- package/lib/esm/ecschema-metadata.d.ts +0 -1
- package/lib/esm/ecschema-metadata.d.ts.map +1 -1
- package/lib/esm/ecschema-metadata.js +0 -1
- package/lib/esm/ecschema-metadata.js.map +1 -1
- package/package.json +7 -7
- package/lib/cjs/UnitConversion/Graph.d.ts +0 -35
- package/lib/cjs/UnitConversion/Graph.d.ts.map +0 -1
- package/lib/cjs/UnitConversion/Graph.js +0 -88
- package/lib/cjs/UnitConversion/Graph.js.map +0 -1
- package/lib/cjs/UnitConversion/Parser.d.ts +0 -9
- package/lib/cjs/UnitConversion/Parser.d.ts.map +0 -1
- package/lib/cjs/UnitConversion/Parser.js +0 -42
- package/lib/cjs/UnitConversion/Parser.js.map +0 -1
- package/lib/cjs/UnitConversion/UnitConversion.d.ts +0 -46
- package/lib/cjs/UnitConversion/UnitConversion.d.ts.map +0 -1
- package/lib/cjs/UnitConversion/UnitConversion.js +0 -76
- package/lib/cjs/UnitConversion/UnitConversion.js.map +0 -1
- package/lib/esm/UnitConversion/Graph.d.ts +0 -35
- package/lib/esm/UnitConversion/Graph.d.ts.map +0 -1
- package/lib/esm/UnitConversion/Graph.js +0 -84
- package/lib/esm/UnitConversion/Graph.js.map +0 -1
- package/lib/esm/UnitConversion/Parser.d.ts +0 -9
- package/lib/esm/UnitConversion/Parser.d.ts.map +0 -1
- package/lib/esm/UnitConversion/Parser.js +0 -39
- package/lib/esm/UnitConversion/Parser.js.map +0 -1
- package/lib/esm/UnitConversion/UnitConversion.d.ts +0 -46
- package/lib/esm/UnitConversion/UnitConversion.d.ts.map +0 -1
- package/lib/esm/UnitConversion/UnitConversion.js +0 -72
- package/lib/esm/UnitConversion/UnitConversion.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityClass.js","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAyRH,4DAsBC;AAGD,oEAsBC;AAtUD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAG7D,mCAAkC;AAClC,mCAAgC;AAChC,yCAAuE;AACvE,2DAAwD;AAGxD;;;GAGG;AACH,MAAa,WAAY,SAAQ,eAAO;IACb,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IACrE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,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AAI,6BAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { EntityClassProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parseStrengthDirection, SchemaItemType, StrengthDirection } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { HasMixins, LazyLoadedMixin } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { Mixin } from \"./Mixin\";\nimport { AnyProperty, NavigationProperty, Property } from \"./Property\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Typescript class representation of an ECEntityClass.\n * @public @preview\n */\nexport class EntityClass extends ECClass implements HasMixins {\n public override readonly schemaItemType = EntityClass.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.EntityClass; }\n private _mixins?: LazyLoadedMixin[];\n\n public get mixins(): ReadonlyArray<LazyLoadedMixin> {\n if (!this._mixins)\n return [];\n return this._mixins;\n }\n\n public *getMixinsSync(): Iterable<Mixin> {\n if (!this._mixins)\n return;\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin, Mixin);\n if (mObj) {\n yield mObj;\n }\n }\n }\n\n /**\n *\n * @param mixin\n * @internal\n */\n protected addMixin(mixin: Mixin) {\n if (!this._mixins)\n this._mixins = [];\n\n this.schema.context.classHierarchy.addBaseClass(this.key, mixin.key, true);\n this._mixins.push(new DelayedPromiseWithProps(mixin.key, async () => mixin));\n return;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override async getInheritedProperty(name: string): Promise<AnyProperty | undefined> {\n let inheritedProperty = await super.getInheritedProperty(name);\n\n if (!inheritedProperty && this._mixins) {\n const mixinProps = await Promise.all(this._mixins.map(async (mixin) => (await mixin).getProperty(name)));\n mixinProps.some((prop) => {\n inheritedProperty = prop as AnyProperty;\n return inheritedProperty !== undefined;\n });\n }\n\n return inheritedProperty as AnyProperty | undefined;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override getInheritedPropertySync(name: string): Property | undefined {\n const inheritedProperty = super.getInheritedPropertySync(name);\n if (inheritedProperty)\n return inheritedProperty;\n\n if (!this._mixins) {\n return undefined;\n }\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin);\n if (mObj && ECClass.isECClass(mObj)) {\n const result = mObj.getPropertySync(name, true);\n if (result) {\n return result;\n }\n }\n }\n\n return undefined;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\nprotected override async buildPropertyCache(): Promise<Map<string, Property>> {\n const cache = new Map<string, Property>();\n const baseClass = await this.baseClass;\n if (baseClass) {\n for (const property of await baseClass.getProperties()) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n for (const mixin of this.mixins) {\n const mixinObj = await mixin;\n const mixinProps = mixinObj.getPropertiesSync();\n for (const property of mixinProps) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n const localProps = await this.getProperties(true);\n if (localProps) {\n for (const property of localProps) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n return cache;\n}\n\n /**\n *\n * @param cache\n * @internal\n */\n protected override buildPropertyCacheSync(): Map<string, Property> {\n const cache = new Map<string, Property>();\n const baseClass = this.getBaseClassSync();\n if (baseClass) {\n Array.from(baseClass.getPropertiesSync()).forEach((property) => {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n });\n }\n\n for (const mixin of this.getMixinsSync()) {\n const mixinProps = mixin.getPropertiesSync();\n for (const property of mixinProps) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n const localProps = this.getPropertiesSync(true);\n if (localProps) {\n Array.from(localProps).forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * Save this EntityClass' 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): EntityClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (this.mixins.length > 0)\n schemaJson.mixins = this.mixins.map((mixin) => mixin.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\n for (const lazyMixin of this.mixins) {\n const mixin = await lazyMixin;\n const mixinElement = schemaXml.createElement(\"BaseClass\");\n const mixinName = XmlSerializationUtils.createXmlTypedName(this.schema, mixin.schema, mixin.name);\n mixinElement.textContent = mixinName;\n itemElement.appendChild(mixinElement);\n }\n return itemElement;\n }\n\n public override async fromJSON(entityClassProps: EntityClassProps) {\n this.fromJSONSync(entityClassProps);\n }\n\n public override fromJSONSync(entityClassProps: EntityClassProps) {\n super.fromJSONSync(entityClassProps);\n\n if (undefined !== entityClassProps.mixins) {\n if (!this._mixins)\n this._mixins = [];\n for (const name of entityClassProps.mixins) {\n const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);\n if (!mixinSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n\n if (!this._mixins.find((value) => mixinSchemaItemKey.matchesFullName(value.fullName))) {\n this.schema.context.classHierarchy.addBaseClass(this.key, mixinSchemaItemKey, true);\n this._mixins.push(new DelayedPromiseWithProps<SchemaItemKey, Mixin>(mixinSchemaItemKey,\n async () => {\n const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin);\n if (undefined === mixin)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n return mixin;\n }));\n }\n }\n }\n }\n\n /**\n * Type guard to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is an EntityClass, false otherwise.\n */\n public static isEntityClass(item?: SchemaItem): item is EntityClass {\n if (item && item.schemaItemType === SchemaItemType.EntityClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to EntityClass if it is an EntityClass, undefined otherwise.\n * @internal\n */\n public static assertIsEntityClass(item?: SchemaItem): asserts item is EntityClass {\n if (!this.isEntityClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.EntityClass}' (EntityClass)`);\n }\n}\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 MutableEntityClass extends EntityClass {\n public abstract override addMixin(mixin: Mixin): any;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/** @internal */\nexport async function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n if (await ecClass.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = await ecClass.schema.lookupItem(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n\n/** @internal */\nexport function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n if (ecClass.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = ecClass.schema.lookupItemSync(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${relationship}, is not a valid RelationshipClassInterface.`); // eslint-disable-line @typescript-eslint/no-base-to-string\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"EntityClass.js","sourceRoot":"","sources":["../../../src/Metadata/EntityClass.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAyRH,4DAsBC;AAGD,oEAsBC;AAtUD,sDAA4D;AAE5D,oFAAiF;AACjF,4CAAyF;AACzF,4CAA6D;AAG7D,mCAAkC;AAClC,mCAAgC;AAChC,yCAAuE;AACvE,2DAAwD;AAGxD;;;GAGG;AACH,MAAa,WAAY,SAAQ,eAAO;IACb,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC;IACrE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAC1E,OAAO,CAAqB;IAEpC,IAAW,MAAM;QACf,IAAI,CAAC,IAAI,CAAC,OAAO;YACf,OAAO,EAAE,CAAC;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IAEM,CAAC,aAAa;QACnB,IAAI,CAAC,IAAI,CAAC,OAAO;YACf,OAAO;QAET,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACjC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,aAAK,CAAC,CAAC;YACtD,IAAI,IAAI,EAAE,CAAC;gBACT,MAAM,IAAI,CAAC;YACb,CAAC;QACH,CAAC;IACH,CAAC;IAED;;;;OAIG;IACO,QAAQ,CAAC,KAAY;QAC7B,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CAAC;IAEhJ,IAAI,oBAAmD,CAAC;IACxD,IAAI,OAAO,CAAC,YAAY,CAAC,KAAK,QAAQ,EAAE,CAAC;QACvC,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,YAAY,EAAE,qCAAiB,CAAC,CAAC;IACxF,CAAC;;QACC,oBAAoB,GAAG,YAAY,CAAC;IAEtC,IAAI,CAAC,oBAAoB;QACvB,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,WAAW,EAAE,mCAAmC,OAAO,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,8CAA8C,CAAC,CAAC;IAEhN,IAAI,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,EAAE,CAAC;QACpC,MAAM,YAAY,GAAG,IAAA,kCAAsB,EAAC,SAAS,CAAC,CAAC;QACvD,IAAI,SAAS,KAAK,YAAY;YAC5B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,wBAAwB,EAAE,mCAAmC,SAAS,qCAAqC,CAAC,CAAC;QACtJ,SAAS,GAAG,YAAY,CAAC;IAC3B,CAAC;IAED,MAAM,gBAAgB,GAAG,IAAI,wCAAuB,CAAC,oBAAoB,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;IACjH,OAAO,IAAI,6BAAkB,CAAC,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,SAAS,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\nimport { EntityClassProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { parseStrengthDirection, SchemaItemType, StrengthDirection } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { HasMixins, LazyLoadedMixin } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { ECClass } from \"./Class\";\nimport { Mixin } from \"./Mixin\";\nimport { AnyProperty, NavigationProperty, Property } from \"./Property\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * A Typescript class representation of an ECEntityClass.\n * @public @preview\n */\nexport class EntityClass extends ECClass implements HasMixins {\n public override readonly schemaItemType = EntityClass.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.EntityClass; }\n private _mixins?: LazyLoadedMixin[];\n\n public get mixins(): ReadonlyArray<LazyLoadedMixin> {\n if (!this._mixins)\n return [];\n return this._mixins;\n }\n\n public *getMixinsSync(): Iterable<Mixin> {\n if (!this._mixins)\n return;\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin, Mixin);\n if (mObj) {\n yield mObj;\n }\n }\n }\n\n /**\n *\n * @param mixin\n * @internal\n */\n protected addMixin(mixin: Mixin) {\n if (!this._mixins)\n this._mixins = [];\n\n this.schema.context.classHierarchy.addBaseClass(this.key, mixin.key, true);\n this._mixins.push(new DelayedPromiseWithProps(mixin.key, async () => mixin));\n return;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override async getInheritedProperty(name: string): Promise<AnyProperty | undefined> {\n let inheritedProperty = await super.getInheritedProperty(name);\n\n if (!inheritedProperty && this._mixins) {\n const mixinProps = await Promise.all(this._mixins.map(async (mixin) => (await mixin).getProperty(name)));\n mixinProps.some((prop) => {\n inheritedProperty = prop;\n return inheritedProperty !== undefined;\n });\n }\n\n return inheritedProperty as AnyProperty | undefined;\n }\n\n /**\n * Searches the base class, if one exists, first then any mixins that exist for the property with the name provided.\n * @param name The name of the property to find.\n */\n public override getInheritedPropertySync(name: string): Property | undefined {\n const inheritedProperty = super.getInheritedPropertySync(name);\n if (inheritedProperty)\n return inheritedProperty;\n\n if (!this._mixins) {\n return undefined;\n }\n\n for (const mixin of this._mixins) {\n const mObj = this.schema.lookupItemSync(mixin);\n if (mObj && ECClass.isECClass(mObj)) {\n const result = mObj.getPropertySync(name, true);\n if (result) {\n return result;\n }\n }\n }\n\n return undefined;\n }\n\n /**\n *\n * @param cache\n * @returns\n *\n * @internal\n */\n protected override async buildPropertyCache(): Promise<Map<string, Property>> {\n const cache = new Map<string, Property>();\n const baseClass = await this.baseClass;\n if (baseClass) {\n for (const property of await baseClass.getProperties()) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n for (const mixin of this.mixins) {\n const mixinObj = await mixin;\n const mixinProps = mixinObj.getPropertiesSync();\n for (const property of mixinProps) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n const localProps = await this.getProperties(true);\n if (localProps) {\n for (const property of localProps) {\n cache.set(property.name.toUpperCase(), property);\n }\n }\n return cache;\n }\n\n /**\n *\n * @param cache\n * @internal\n */\n protected override buildPropertyCacheSync(): Map<string, Property> {\n const cache = new Map<string, Property>();\n const baseClass = this.getBaseClassSync();\n if (baseClass) {\n Array.from(baseClass.getPropertiesSync()).forEach((property) => {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n });\n }\n\n for (const mixin of this.getMixinsSync()) {\n const mixinProps = mixin.getPropertiesSync();\n for (const property of mixinProps) {\n if (!cache.has(property.name.toUpperCase()))\n cache.set(property.name.toUpperCase(), property);\n }\n }\n\n const localProps = this.getPropertiesSync(true);\n if (localProps) {\n Array.from(localProps).forEach(property => {\n cache.set(property.name.toUpperCase(), property);\n });\n }\n return cache;\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected async createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n return this.addProperty(await createNavigationProperty(this, name, relationship, direction));\n }\n\n /**\n *\n * @param name\n * @param relationship\n * @param direction\n * @internal\n */\n protected createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n return this.addProperty(createNavigationPropertySync(this, name, relationship, direction));\n }\n\n /**\n * Save this EntityClass' 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): EntityClassProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n if (this.mixins.length > 0)\n schemaJson.mixins = this.mixins.map((mixin) => mixin.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\n for (const lazyMixin of this.mixins) {\n const mixin = await lazyMixin;\n const mixinElement = schemaXml.createElement(\"BaseClass\");\n const mixinName = XmlSerializationUtils.createXmlTypedName(this.schema, mixin.schema, mixin.name);\n mixinElement.textContent = mixinName;\n itemElement.appendChild(mixinElement);\n }\n return itemElement;\n }\n\n public override async fromJSON(entityClassProps: EntityClassProps) {\n this.fromJSONSync(entityClassProps);\n }\n\n public override fromJSONSync(entityClassProps: EntityClassProps) {\n super.fromJSONSync(entityClassProps);\n\n if (undefined !== entityClassProps.mixins) {\n if (!this._mixins)\n this._mixins = [];\n for (const name of entityClassProps.mixins) {\n const mixinSchemaItemKey = this.schema.getSchemaItemKey(name);\n if (!mixinSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n\n if (!this._mixins.find((value) => mixinSchemaItemKey.matchesFullName(value.fullName))) {\n this.schema.context.classHierarchy.addBaseClass(this.key, mixinSchemaItemKey, true);\n this._mixins.push(new DelayedPromiseWithProps<SchemaItemKey, Mixin>(mixinSchemaItemKey,\n async () => {\n const mixin = await this.schema.lookupItem(mixinSchemaItemKey, Mixin);\n if (undefined === mixin)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The ECEntityClass ${this.name} has a mixin (\"${name}\") that cannot be found.`);\n return mixin;\n }));\n }\n }\n }\n }\n\n /**\n * Type guard to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns True if the item is an EntityClass, false otherwise.\n */\n public static isEntityClass(item?: SchemaItem): item is EntityClass {\n if (item && item.schemaItemType === SchemaItemType.EntityClass)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type EntityClass.\n * @param item The SchemaItem to check.\n * @returns The item cast to EntityClass if it is an EntityClass, undefined otherwise.\n * @internal\n */\n public static assertIsEntityClass(item?: SchemaItem): asserts item is EntityClass {\n if (!this.isEntityClass(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.EntityClass}' (EntityClass)`);\n }\n}\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 MutableEntityClass extends EntityClass {\n public abstract override addMixin(mixin: Mixin): any;\n public abstract override createNavigationProperty(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty>;\n public abstract override createNavigationPropertySync(name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n\n/** @internal */\nexport async function createNavigationProperty(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): Promise<NavigationProperty> {\n if (await ecClass.getProperty(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = await ecClass.schema.lookupItem(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${typeof relationship === \"string\" ? relationship : relationship.fullName}, is not a valid RelationshipClassInterface.`);\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n\n/** @internal */\nexport function createNavigationPropertySync(ecClass: ECClass, name: string, relationship: string | RelationshipClass, direction: string | StrengthDirection): NavigationProperty {\n if (ecClass.getPropertySync(name, true))\n throw new ECSchemaError(ECSchemaStatus.DuplicateProperty, `An ECProperty with the name ${name} already exists in the class ${ecClass.name}.`);\n\n let resolvedRelationship: RelationshipClass | undefined;\n if (typeof (relationship) === \"string\") {\n resolvedRelationship = ecClass.schema.lookupItemSync(relationship, RelationshipClass);\n } else\n resolvedRelationship = relationship;\n\n if (!resolvedRelationship)\n throw new ECSchemaError(ECSchemaStatus.InvalidType, `The provided RelationshipClass, ${typeof relationship === \"string\" ? relationship : relationship.fullName}, is not a valid RelationshipClassInterface.`);\n\n if (typeof (direction) === \"string\") {\n const tmpDirection = parseStrengthDirection(direction);\n if (undefined === tmpDirection)\n throw new ECSchemaError(ECSchemaStatus.InvalidStrengthDirection, `The provided StrengthDirection, ${direction}, is not a valid StrengthDirection.`);\n direction = tmpDirection;\n }\n\n const lazyRelationship = new DelayedPromiseWithProps(resolvedRelationship.key, async () => resolvedRelationship);\n return new NavigationProperty(ecClass, name, lazyRelationship, direction);\n}\n"]}
|
|
@@ -54,8 +54,8 @@ class InvertedUnit extends SchemaItem_1.SchemaItem {
|
|
|
54
54
|
*/
|
|
55
55
|
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
56
56
|
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
57
|
-
schemaJson.invertsUnit = this.invertsUnit
|
|
58
|
-
schemaJson.unitSystem = this.unitSystem
|
|
57
|
+
schemaJson.invertsUnit = this.invertsUnit?.fullName ?? "";
|
|
58
|
+
schemaJson.unitSystem = this.unitSystem?.fullName ?? "";
|
|
59
59
|
return schemaJson;
|
|
60
60
|
}
|
|
61
61
|
/** @internal */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvertedUnit.js","sourceRoot":"","sources":["../../../src/Metadata/InvertedUnit.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8C;AAC9C,4CAA6D;AAG7D,6CAA0C;AAC1C,iCAA8B;AAC9B,6CAA0C;AAE1C;;;GAGG;AACH,MAAa,YAAa,SAAQ,uBAAU;IACjB,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC;IACtE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,YAAY,CAAkB,CAAC,WAAW;IAC1C,WAAW,CAAwB,CAAC,WAAW;IAEvD,IAAW,WAAW,KAAiC,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAClF,IAAW,UAAU,KAAuC,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAEtF;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,IAAiB;QAC5C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,YAAY;YAC7D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,oBAAoB,CAAC,IAAiB;QAClD,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YAC5B,MAAM,IA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,CAAC,WAA2B;QAClD,IAAI,CAAC,YAAY,GAAG,WAAW,CAAC;IAClC,CAAC;IAED;;;OAGG;IACO,aAAa,CAAC,UAAgC;QACtD,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;CACF;AA1GD,oCA0GC;AAED;;;GAGG;AACH,MAAsB,mBAAoB,SAAQ,YAAY;CAI7D;AAJD,kDAIC","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 { InvertedUnitProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { LazyLoadedUnit, LazyLoadedUnitSystem } from \"../Interfaces\";\nimport { SchemaItemKey } from \"../SchemaKey\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\nimport { UnitSystem } from \"./UnitSystem\";\n\n/**\n * An InvertedUnit is a specific type of Unit that describes the inverse of a single Unit whose dimensional derivation is unit-less.\n * @public @preview\n */\nexport class InvertedUnit extends SchemaItem {\n public override readonly schemaItemType = InvertedUnit.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.InvertedUnit; }\n private _invertsUnit?: LazyLoadedUnit; // required\n private _unitSystem?: LazyLoadedUnitSystem; // required\n\n public get invertsUnit(): LazyLoadedUnit | undefined { return this._invertsUnit; }\n public get unitSystem(): LazyLoadedUnitSystem | undefined { return this._unitSystem; }\n\n /**\n * Type guard to check if the SchemaItem is of type InvertedUnit.\n * @param item The SchemaItem to check.\n * @returns True if the item is a InvertedUnit, false otherwise.\n */\n public static isInvertedUnit(item?: SchemaItem): item is InvertedUnit {\n if (item && item.schemaItemType === SchemaItemType.InvertedUnit)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type InvertedUnit.\n * @param item The SchemaItem to check.\n * @returns The item cast to InvertedUnit if it is an InvertedUnit, undefined otherwise.\n * @internal\n */\n public static assertIsInvertedUnit(item?: SchemaItem): asserts item is InvertedUnit {\n if (!this.isInvertedUnit(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.InvertedUnit}' (InvertedUnit)`);\n }\n\n /**\n * Save this InvertedUnit'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): InvertedUnitProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.invertsUnit = this.invertsUnit?.fullName ?? \"\";\n schemaJson.unitSystem = this.unitSystem?.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\n const unitSystem = await this.unitSystem;\n if (undefined !== unitSystem) {\n const unitSystemName = XmlSerializationUtils.createXmlTypedName(this.schema, unitSystem.schema, unitSystem.name);\n itemElement.setAttribute(\"unitSystem\", unitSystemName);\n }\n\n const invertsUnit = await this.invertsUnit;\n if (undefined !== invertsUnit) {\n const invertsUnitName = XmlSerializationUtils.createXmlTypedName(this.schema, invertsUnit.schema, invertsUnit.name);\n itemElement.setAttribute(\"invertsUnit\", invertsUnitName);\n }\n\n return itemElement;\n }\n\n public override fromJSONSync(invertedUnitProps: InvertedUnitProps) {\n super.fromJSONSync(invertedUnitProps);\n const unitSchemaItemKey = this.schema.getSchemaItemKey(invertedUnitProps.invertsUnit);\n this._invertsUnit = new DelayedPromiseWithProps<SchemaItemKey, Unit>(unitSchemaItemKey,\n async () => {\n const invertsUnit = await this.schema.lookupItem(unitSchemaItemKey, Unit);\n if (undefined === invertsUnit)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the invertsUnit ${invertedUnitProps.invertsUnit}.`);\n return invertsUnit;\n });\n\n const unitSystemSchemaItemKey = this.schema.getSchemaItemKey(invertedUnitProps.unitSystem);\n if (!unitSystemSchemaItemKey)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unitSystem ${invertedUnitProps.unitSystem}.`);\n this._unitSystem = new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystemSchemaItemKey,\n async () => {\n const unitSystem = await this.schema.lookupItem(unitSystemSchemaItemKey, UnitSystem);\n if (undefined === unitSystem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unitSystem ${invertedUnitProps.unitSystem}.`);\n return unitSystem;\n });\n }\n\n public override async fromJSON(invertedUnitProps: InvertedUnitProps) {\n this.fromJSONSync(invertedUnitProps);\n }\n\n /**\n * @internal\n * Used for schema editing\n */\n protected setInvertsUnit(invertsUnit: LazyLoadedUnit) {\n this._invertsUnit = invertsUnit;\n }\n\n /**\n * @internal\n * Used for schema editing\n */\n protected setUnitSystem(unitSystem: LazyLoadedUnitSystem) {\n this._unitSystem = unitSystem;\n }\n}\n\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableInvertedUnit extends InvertedUnit {\n public abstract override setInvertsUnit(invertsUnit: LazyLoadedUnit): void;\n public abstract override setUnitSystem(unitSystem: LazyLoadedUnitSystem): void;\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -127,7 +127,7 @@ class KindOfQuantity extends SchemaItem_1.SchemaItem {
|
|
|
127
127
|
toJSON(standalone = false, includeSchemaVersion = false) {
|
|
128
128
|
const schemaJson = super.toJSON(standalone, includeSchemaVersion);
|
|
129
129
|
schemaJson.relativeError = this.relativeError;
|
|
130
|
-
schemaJson.persistenceUnit = this.persistenceUnit
|
|
130
|
+
schemaJson.persistenceUnit = this.persistenceUnit?.fullName ?? "";
|
|
131
131
|
if (undefined !== this.presentationFormats && 0 < this.presentationFormats.length)
|
|
132
132
|
schemaJson.presentationUnits = this.presentationFormats.map((format) => format.fullName);
|
|
133
133
|
return schemaJson;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindOfQuantity.js","sourceRoot":"","sources":["../../../src/Metadata/KindOfQuantity.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAE5D,oFAAiF;AACjF,4CAA8C;AAC9C,4CAA6D;AAE7D,qCAAkC;AAClC,iDAA8C;AAC9C,qDAAuE;AACvE,6CAA0C;AAC1C,iCAA8B;AAE9B;;GAEG;AACH,MAAa,cAAe,SAAQ,uBAAU;IACnB,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC;IACxE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,0BAAc,CAAC,cAAc,CAAC,CAAC,CAAC;IAC7E,cAAc,GAAW,GAAG,CAAC;IAC7B,oBAAoB,GAA6C,EAAE,CAAC;IACpE,gBAAgB,CAA2C;IAEnE,4DAA4D;IAC5D,IAAW,yBAAyB,KAAoD,OAAO,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7H,sCAAsC;IACtC,IAAW,mBAAmB,KAA+C,OAAO,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAEhH,uBAAuB;IACvB,IAAW,eAAe,KAA0D,OAAO,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEnH,IAAW,aAAa,KAAK,OAAO,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAE1D;;;;;OAKG;IACO,qBAAqB,CAAC,MAAyC,EAAE,YAAqB,KAAK;QACnG,qCAAqC;QACrC,mEAAmE;QACnE,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,EAA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C;IAEe,KAAK,CAAC,QAAQ,CAAC,mBAAwC;QACrE,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;IACzC,CAAC;IAED;;;OAGG;IACO,gBAAgB,CAAC,aAAqB;QAC9C,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;IACtC,CAAC;IAED;;;OAGG;IACO,kBAAkB,CAAC,KAA0D;QACrF,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAiB;QAC9C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,cAAc;YAC/D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAiB;QACpD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAC9B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,cAAc,oBAAoB,CAAC,CAAC;IAClI,CAAC;CACF;AAhOD,wCAgOC;AACD;;;GAGG;AACH,MAAsB,qBAAsB,SAAQ,cAAc;CAMjE;AAND,sDAMC","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 { KindOfQuantityProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { OverrideFormat, OverrideFormatProps } from \"./OverrideFormat\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\n\n/** A Typescript class representation of a KindOfQuantity.\n * @public @preview\n */\nexport class KindOfQuantity extends SchemaItem {\n public override readonly schemaItemType = KindOfQuantity.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.KindOfQuantity; }\n private _relativeError: number = 1.0;\n private _presentationFormats: Array<LazyLoadedFormat | OverrideFormat> = [];\n private _persistenceUnit?: LazyLoadedUnit | LazyLoadedInvertedUnit;\n\n /** The first presentation format in the list of Formats. */\n public get defaultPresentationFormat(): LazyLoadedFormat | OverrideFormat | undefined { return this.presentationFormats[0]; }\n\n /** A list of presentation formats. */\n public get presentationFormats(): Array<LazyLoadedFormat | OverrideFormat> { return this._presentationFormats; }\n\n /** Persistence unit */\n public get persistenceUnit(): LazyLoadedUnit | LazyLoadedInvertedUnit | undefined { return this._persistenceUnit; }\n\n public get relativeError() { return this._relativeError; }\n\n /**\n *\n * @param format The Format to add to this KindOfQuantity\n * @param isDefault\n * @internal\n */\n protected addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean = false) {\n // TODO: Add some sort of validation?\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (isDefault) ? this._presentationFormats.splice(0, 0, format) : this._presentationFormats.push(format);\n }\n\n /** Creates an OverrideFormat in the context of this KindOfQuantity.\n * @param parent The Format to override.\n * @param precision The precision override\n * @param unitLabelOverrides The list of unit and label overrides.\n * @internal\n */\n protected createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat {\n if (unitLabelOverrides && parent.units && parent.units.length !== unitLabelOverrides.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add presentation format to KindOfQuantity '${this.name}' because the number of unit overrides is inconsistent with the number in the Format '${parent.name}'.`);\n\n if (parent.units && 0 === parent.units.length && unitLabelOverrides && 0 < unitLabelOverrides.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add a presentation format to KindOfQuantity '${this.name}' without any units and no unit overrides.`);\n\n // TODO: Check compatibility of Unit overrides with the persistence unit\n\n return new OverrideFormat(parent, precision, unitLabelOverrides);\n }\n\n private async processPresentationUnits(presentationUnitsJson: string | string[]): Promise<void> {\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\n for (const formatString of presUnitsArr) {\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\n\n const format = await this.schema.lookupItem(presFormatOverride.name, Format);\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\n\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\n continue;\n }\n\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\n if (undefined !== presFormatOverride.unitAndLabels) {\n if (4 < presFormatOverride.unitAndLabels.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n\n unitAndLabels = [];\n for (const unitOverride of presFormatOverride.unitAndLabels) {\n const unitOrInverted = await this.schema.lookupItem(unitOverride[0]);\n\n if(Unit.isUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else if(InvertedUnit.isInvertedUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\n }\n }\n\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\n this.addPresentationFormat(overrideFormat);\n }\n }\n\n private processPresentationUnitsSync(presentationUnitsJson: string | string[]): void {\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\n for (const formatString of presUnitsArr) {\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\n\n const format = this.schema.lookupItemSync(presFormatOverride.name, Format);\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\n\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\n continue;\n }\n\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\n if (undefined !== presFormatOverride.unitAndLabels) {\n if (4 < presFormatOverride.unitAndLabels.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n\n unitAndLabels = [];\n for (const unitOverride of presFormatOverride.unitAndLabels) {\n const unitOrInverted = this.schema.lookupItemSync(unitOverride[0]);\n if(Unit.isUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else if(InvertedUnit.isInvertedUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\n }\n }\n\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\n this.addPresentationFormat(overrideFormat);\n }\n }\n\n /**\n * Save this KindOfQuantity'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): KindOfQuantityProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.relativeError = this.relativeError;\n schemaJson.persistenceUnit = this.persistenceUnit!.fullName;\n if (undefined !== this.presentationFormats && 0 < this.presentationFormats.length)\n schemaJson.presentationUnits = this.presentationFormats.map((format) => format.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\n const persistenceUnit = await this.persistenceUnit;\n if (undefined !== persistenceUnit) {\n const unitName = XmlSerializationUtils.createXmlTypedName(this.schema, persistenceUnit.schema, persistenceUnit.name);\n itemElement.setAttribute(\"persistenceUnit\", unitName);\n }\n\n if (undefined !== this.presentationFormats) {\n const presUnitStrings: string[] = [];\n for(const format of this.presentationFormats) {\n if (!OverrideFormat.isOverrideFormat(format)) {\n const resolvedFormat = await format;\n presUnitStrings.push(XmlSerializationUtils.createXmlTypedName(this.schema, resolvedFormat.schema, format.name));\n continue;\n }\n presUnitStrings.push(format.fullNameXml(this.schema));\n };\n itemElement.setAttribute(\"presentationUnits\", presUnitStrings.join(\";\"));\n }\n itemElement.setAttribute(\"relativeError\", this.relativeError.toString());\n\n return itemElement;\n }\n\n public override fromJSONSync(kindOfQuantityProps: KindOfQuantityProps): void {\n super.fromJSONSync(kindOfQuantityProps);\n this._relativeError = kindOfQuantityProps.relativeError;\n\n const unitItemKey = this.schema.getSchemaItemKey(kindOfQuantityProps.persistenceUnit);\n this._persistenceUnit = new DelayedPromiseWithProps(unitItemKey, async () => {\n const unitItem = await this.schema.lookupItem(unitItemKey, Unit)\n || await this.schema.lookupItem(unitItemKey, InvertedUnit);\n\n if (undefined === unitItem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unit ${kindOfQuantityProps.persistenceUnit}.`);\n\n return unitItem;\n }) as LazyLoadedUnit | LazyLoadedInvertedUnit;\n\n if (undefined !== kindOfQuantityProps.presentationUnits)\n this.processPresentationUnitsSync(kindOfQuantityProps.presentationUnits);\n }\n\n public override async fromJSON(kindOfQuantityProps: KindOfQuantityProps): Promise<void> {\n this.fromJSONSync(kindOfQuantityProps);\n }\n\n /**\n * Used for schema editing.\n * @internal\n */\n protected setRelativeError(relativeError: number): void {\n this._relativeError = relativeError;\n }\n\n /**\n * Used for schema editing.\n * @internal\n */\n protected setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void {\n this._persistenceUnit = value;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type KindOfQuantity.\n * @param item The SchemaItem to check.\n * @returns True if the item is a KindOfQuantity, false otherwise.\n */\n public static isKindOfQuantity(item?: SchemaItem): item is KindOfQuantity {\n if (item && item.schemaItemType === SchemaItemType.KindOfQuantity)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type KindOfQuantity.\n * @param item The SchemaItem to check.\n * @returns The item cast to KindOfQuantity if it is a KindOfQuantity, undefined otherwise.\n * @internal\n */\n public static assertIsKindOfQuantity(item?: SchemaItem): asserts item is KindOfQuantity {\n if (!this.isKindOfQuantity(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.KindOfQuantity}' (KindOfQuantity)`);\n }\n}\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\n public abstract override addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;\n public abstract override setRelativeError(relativeError: number): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"KindO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,CAAC;IAED;;;OAGG;IACO,kBAAkB,CAAC,KAA0D;QACrF,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAC,IAAiB;QAC9C,IAAI,IAAI,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,cAAc;YAC/D,OAAO,IAAI,CAAC;QAEd,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,sBAAsB,CAAC,IAAiB;QACpD,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;YAC9B,MAAM,IAAI,yBAAa,CAAC,0BAAc,CAAC,qBAAqB,EAAE,aAAa,0BAAc,CAAC,cAAc,oBAAoB,CAAC,CAAC;IAClI,CAAC;CACF;AAhOD,wCAgOC;AACD;;;GAGG;AACH,MAAsB,qBAAsB,SAAQ,cAAc;CAMjE;AAND,sDAMC","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 { KindOfQuantityProps } from \"../Deserialization/JsonProps\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\nimport { LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { OverrideFormat, OverrideFormatProps } from \"./OverrideFormat\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\n\n/** A Typescript class representation of a KindOfQuantity.\n * @public @preview\n */\nexport class KindOfQuantity extends SchemaItem {\n public override readonly schemaItemType = KindOfQuantity.schemaItemType;\n /** @internal */\n public static override get schemaItemType() { return SchemaItemType.KindOfQuantity; }\n private _relativeError: number = 1.0;\n private _presentationFormats: Array<LazyLoadedFormat | OverrideFormat> = [];\n private _persistenceUnit?: LazyLoadedUnit | LazyLoadedInvertedUnit;\n\n /** The first presentation format in the list of Formats. */\n public get defaultPresentationFormat(): LazyLoadedFormat | OverrideFormat | undefined { return this.presentationFormats[0]; }\n\n /** A list of presentation formats. */\n public get presentationFormats(): Array<LazyLoadedFormat | OverrideFormat> { return this._presentationFormats; }\n\n /** Persistence unit */\n public get persistenceUnit(): LazyLoadedUnit | LazyLoadedInvertedUnit | undefined { return this._persistenceUnit; }\n\n public get relativeError() { return this._relativeError; }\n\n /**\n *\n * @param format The Format to add to this KindOfQuantity\n * @param isDefault\n * @internal\n */\n protected addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean = false) {\n // TODO: Add some sort of validation?\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n (isDefault) ? this._presentationFormats.splice(0, 0, format) : this._presentationFormats.push(format);\n }\n\n /** Creates an OverrideFormat in the context of this KindOfQuantity.\n * @param parent The Format to override.\n * @param precision The precision override\n * @param unitLabelOverrides The list of unit and label overrides.\n * @internal\n */\n protected createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat {\n if (unitLabelOverrides && parent.units && parent.units.length !== unitLabelOverrides.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add presentation format to KindOfQuantity '${this.name}' because the number of unit overrides is inconsistent with the number in the Format '${parent.name}'.`);\n\n if (parent.units && 0 === parent.units.length && unitLabelOverrides && 0 < unitLabelOverrides.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add a presentation format to KindOfQuantity '${this.name}' without any units and no unit overrides.`);\n\n // TODO: Check compatibility of Unit overrides with the persistence unit\n\n return new OverrideFormat(parent, precision, unitLabelOverrides);\n }\n\n private async processPresentationUnits(presentationUnitsJson: string | string[]): Promise<void> {\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\n for (const formatString of presUnitsArr) {\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\n\n const format = await this.schema.lookupItem(presFormatOverride.name, Format);\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\n\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\n continue;\n }\n\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\n if (undefined !== presFormatOverride.unitAndLabels) {\n if (4 < presFormatOverride.unitAndLabels.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n\n unitAndLabels = [];\n for (const unitOverride of presFormatOverride.unitAndLabels) {\n const unitOrInverted = await this.schema.lookupItem(unitOverride[0]);\n\n if (Unit.isUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else if (InvertedUnit.isInvertedUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\n }\n }\n\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\n this.addPresentationFormat(overrideFormat);\n }\n }\n\n private processPresentationUnitsSync(presentationUnitsJson: string | string[]): void {\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\n for (const formatString of presUnitsArr) {\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\n\n const format = this.schema.lookupItemSync(presFormatOverride.name, Format);\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\n\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\n continue;\n }\n\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\n if (undefined !== presFormatOverride.unitAndLabels) {\n if (4 < presFormatOverride.unitAndLabels.length)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n\n unitAndLabels = [];\n for (const unitOverride of presFormatOverride.unitAndLabels) {\n const unitOrInverted = this.schema.lookupItemSync(unitOverride[0]);\n if (Unit.isUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else if (InvertedUnit.isInvertedUnit(unitOrInverted))\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\n else\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\n }\n }\n\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\n this.addPresentationFormat(overrideFormat);\n }\n }\n\n /**\n * Save this KindOfQuantity'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): KindOfQuantityProps {\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\n schemaJson.relativeError = this.relativeError;\n schemaJson.persistenceUnit = this.persistenceUnit?.fullName ?? \"\";\n if (undefined !== this.presentationFormats && 0 < this.presentationFormats.length)\n schemaJson.presentationUnits = this.presentationFormats.map((format) => format.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\n const persistenceUnit = await this.persistenceUnit;\n if (undefined !== persistenceUnit) {\n const unitName = XmlSerializationUtils.createXmlTypedName(this.schema, persistenceUnit.schema, persistenceUnit.name);\n itemElement.setAttribute(\"persistenceUnit\", unitName);\n }\n\n if (undefined !== this.presentationFormats) {\n const presUnitStrings: string[] = [];\n for (const format of this.presentationFormats) {\n if (!OverrideFormat.isOverrideFormat(format)) {\n const resolvedFormat = await format;\n presUnitStrings.push(XmlSerializationUtils.createXmlTypedName(this.schema, resolvedFormat.schema, format.name));\n continue;\n }\n presUnitStrings.push(format.fullNameXml(this.schema));\n };\n itemElement.setAttribute(\"presentationUnits\", presUnitStrings.join(\";\"));\n }\n itemElement.setAttribute(\"relativeError\", this.relativeError.toString());\n\n return itemElement;\n }\n\n public override fromJSONSync(kindOfQuantityProps: KindOfQuantityProps): void {\n super.fromJSONSync(kindOfQuantityProps);\n this._relativeError = kindOfQuantityProps.relativeError;\n\n const unitItemKey = this.schema.getSchemaItemKey(kindOfQuantityProps.persistenceUnit);\n this._persistenceUnit = new DelayedPromiseWithProps(unitItemKey, async () => {\n const unitItem = await this.schema.lookupItem(unitItemKey, Unit)\n || await this.schema.lookupItem(unitItemKey, InvertedUnit);\n\n if (undefined === unitItem)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unit ${kindOfQuantityProps.persistenceUnit}.`);\n\n return unitItem;\n }) as LazyLoadedUnit | LazyLoadedInvertedUnit;\n\n if (undefined !== kindOfQuantityProps.presentationUnits)\n this.processPresentationUnitsSync(kindOfQuantityProps.presentationUnits);\n }\n\n public override async fromJSON(kindOfQuantityProps: KindOfQuantityProps): Promise<void> {\n this.fromJSONSync(kindOfQuantityProps);\n }\n\n /**\n * Used for schema editing.\n * @internal\n */\n protected setRelativeError(relativeError: number): void {\n this._relativeError = relativeError;\n }\n\n /**\n * Used for schema editing.\n * @internal\n */\n protected setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void {\n this._persistenceUnit = value;\n }\n\n /**\n * Type guard to check if the SchemaItem is of type KindOfQuantity.\n * @param item The SchemaItem to check.\n * @returns True if the item is a KindOfQuantity, false otherwise.\n */\n public static isKindOfQuantity(item?: SchemaItem): item is KindOfQuantity {\n if (item && item.schemaItemType === SchemaItemType.KindOfQuantity)\n return true;\n\n return false;\n }\n\n /**\n * Type assertion to check if the SchemaItem is of type KindOfQuantity.\n * @param item The SchemaItem to check.\n * @returns The item cast to KindOfQuantity if it is a KindOfQuantity, undefined otherwise.\n * @internal\n */\n public static assertIsKindOfQuantity(item?: SchemaItem): asserts item is KindOfQuantity {\n if (!this.isKindOfQuantity(item))\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.KindOfQuantity}' (KindOfQuantity)`);\n }\n}\n/**\n * @internal\n * An abstract class used for schema editing.\n */\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\n public abstract override addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;\n public abstract override setDisplayLabel(displayLabel: string): void;\n public abstract override setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;\n public abstract override setRelativeError(relativeError: number): void;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACe,wBAAwB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,gCAAgC,EACpI,sBAAsB,EAAE,aAAa,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AC,SAAS,EAAE,MAAM;CAGzC;;AAsED,uBAAuB;AACvB,qBAAa,sBAAuB,SAAQ,2BAAqC;IAC/E,gBAAgB;gBACJ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,aAAa,GAAE,aAAqC;IAIhG;;OAEG;IACa,MAAM,IAAI,2BAA2B;CAItD;;AAED,uBAAuB;AACvB,qBAAa,wBAAyB,SAAQ,6BAAuC;gBACvE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB;CAGxE;;AAED,uBAAuB;AACvB,qBAAa,mBAAoB,SAAQ,wBAAkC;IACzE,gBAAgB;gBACJ,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;CAG9D;AAED,uBAAuB;AACvB,MAAM,MAAM,gBAAgB,GAAG,sBAAsB,GAAG,wBAAwB,GAAG,mBAAmB,CAAC;AACvG,uBAAuB;AACvB,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,GAAG,sBAAsB,CAAC;AAC9E,uBAAuB;AACvB,MAAM,MAAM,sBAAsB,GAAG,mBAAmB,GAAG,wBAAwB,CAAC;AACpF,uBAAuB;AACvB,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAAG,mBAAmB,CAAC;AACrE,uBAAuB;AACvB,MAAM,MAAM,WAAW,GAAG,oBAAoB,GAAG,sBAAsB,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAEjH;;;GAGG;AACH,8BAAsB,eAAgB,SAAQ,QAAQ;aAC3B,kBAAkB,CAAC,eAAe,EAAE,eAAe,GAAG,IAAI;CACpF"}
|
|
@@ -428,7 +428,7 @@ class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
428
428
|
*/
|
|
429
429
|
toJSON() {
|
|
430
430
|
const schemaJson = super.toJSON();
|
|
431
|
-
schemaJson.typeName = this.enumeration
|
|
431
|
+
schemaJson.typeName = this.enumeration?.fullName ?? "";
|
|
432
432
|
return schemaJson;
|
|
433
433
|
}
|
|
434
434
|
/** @internal */
|
|
@@ -440,9 +440,10 @@ class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
440
440
|
fromJSONSync(enumerationPropertyProps) {
|
|
441
441
|
super.fromJSONSync(enumerationPropertyProps);
|
|
442
442
|
if (undefined !== enumerationPropertyProps.typeName) {
|
|
443
|
-
|
|
443
|
+
const enumFullName = this.enumeration?.fullName;
|
|
444
|
+
if (enumFullName && !enumFullName.match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName
|
|
444
445
|
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, ``);
|
|
445
|
-
const enumSchemaItemKey = this.class.schema.getSchemaItemKey(
|
|
446
|
+
const enumSchemaItemKey = enumFullName ? this.class.schema.getSchemaItemKey(enumFullName) : undefined;
|
|
446
447
|
if (!enumSchemaItemKey)
|
|
447
448
|
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);
|
|
448
449
|
this._enumeration = new DelayedPromise_1.DelayedPromiseWithProps(enumSchemaItemKey, async () => {
|
|
@@ -457,6 +458,8 @@ class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
457
458
|
async toXml(schemaXml) {
|
|
458
459
|
const itemElement = await super.toXml(schemaXml);
|
|
459
460
|
const enumeration = await this.enumeration;
|
|
461
|
+
if (!enumeration)
|
|
462
|
+
throw new Exception_1.ECSchemaError(Exception_1.ECSchemaStatus.InvalidECJson, `Enumeration not loaded for property ${this.name}.`);
|
|
460
463
|
const enumerationName = XmlSerializationUtils_1.XmlSerializationUtils.createXmlTypedName(this.schema, enumeration.schema, enumeration.name);
|
|
461
464
|
itemElement.setAttribute("typeName", enumerationName);
|
|
462
465
|
return itemElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src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,CAAC;IAC7B,CAAC;CACF;AALD,kDAKC;AAaD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAErD;AAFD,0CAEC","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"]}
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":";AAAA;;;+FAG+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AAoB,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;AALD,kDAKC;AAaD;;;GAGG;AACH,MAAsB,eAAgB,SAAQ,QAAQ;CAErD;AAFD,0CAEC","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;\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 const enumFullName = this.enumeration?.fullName;\n if (enumFullName && !enumFullName.match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\n const enumSchemaItemKey = enumFullName ? this.class.schema.getSchemaItemKey(enumFullName) : undefined;\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 if (!enumeration)\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Enumeration not loaded for property ${this.name}.`);\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"]}
|