@itwin/ecschema-metadata 5.9.0-dev.8 → 5.10.0-dev.1
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 +16 -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/Parser.d.ts.map +1 -1
- package/lib/cjs/UnitConversion/Parser.js +4 -2
- package/lib/cjs/UnitConversion/Parser.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitTree.js +1 -1
- package/lib/cjs/UnitConversion/UnitTree.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/Parser.d.ts.map +1 -1
- package/lib/esm/UnitConversion/Parser.js +4 -2
- package/lib/esm/UnitConversion/Parser.js.map +1 -1
- package/lib/esm/UnitConversion/UnitTree.js +1 -1
- package/lib/esm/UnitConversion/UnitTree.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindOfQuantity.js","sourceRoot":"","sources":["../../../src/Metadata/KindOfQuantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IACnB,cAAc,GAAG,cAAc,CAAC,cAAc,CAAC;IACxE,gBAAgB;IACT,MAAM,KAAc,cAAc,KAAK,OAAO,cAAc,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;IAE7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,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YAE7D,IAAI,SAAS,KAAK,QAAQ;gBACxB,MAAM,IAAI,aAAa,CAAC,cAAc,CAAC,aAAa,EAAE,6BAA6B,mBAAmB,CAAC,eAAe,GAAG,CAAC,CAAC;YAE7H,OAAO,QAAQ,CAAC;QAClB,CAAC,CAA4C,CAAC;QAE9C,IAAI,SAAS,KAAK,mBAAmB,CAAC,iBAAiB;YACrD,IAAI,CAAC,4BAA4B,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAC7E,CAAC;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,cAAc,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,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,cAAc,oBAAoB,CAAC,CAAC;IAClI,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,cAAc;CAMjE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { KindOfQuantityProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\r\nimport { Format } from \"./Format\";\r\nimport { InvertedUnit } from \"./InvertedUnit\";\r\nimport { OverrideFormat, OverrideFormatProps } from \"./OverrideFormat\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { Unit } from \"./Unit\";\r\n\r\n/** A Typescript class representation of a KindOfQuantity.\r\n * @public @preview\r\n */\r\nexport class KindOfQuantity extends SchemaItem {\r\n public override readonly schemaItemType = KindOfQuantity.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.KindOfQuantity; }\r\n private _relativeError: number = 1.0;\r\n private _presentationFormats: Array<LazyLoadedFormat | OverrideFormat> = [];\r\n private _persistenceUnit?: LazyLoadedUnit | LazyLoadedInvertedUnit;\r\n\r\n /** The first presentation format in the list of Formats. */\r\n public get defaultPresentationFormat(): LazyLoadedFormat | OverrideFormat | undefined { return this.presentationFormats[0]; }\r\n\r\n /** A list of presentation formats. */\r\n public get presentationFormats(): Array<LazyLoadedFormat | OverrideFormat> { return this._presentationFormats; }\r\n\r\n /** Persistence unit */\r\n public get persistenceUnit(): LazyLoadedUnit | LazyLoadedInvertedUnit | undefined { return this._persistenceUnit; }\r\n\r\n public get relativeError() { return this._relativeError; }\r\n\r\n /**\r\n *\r\n * @param format The Format to add to this KindOfQuantity\r\n * @param isDefault\r\n * @internal\r\n */\r\n protected addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean = false) {\r\n // TODO: Add some sort of validation?\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n (isDefault) ? this._presentationFormats.splice(0, 0, format) : this._presentationFormats.push(format);\r\n }\r\n\r\n /** Creates an OverrideFormat in the context of this KindOfQuantity.\r\n * @param parent The Format to override.\r\n * @param precision The precision override\r\n * @param unitLabelOverrides The list of unit and label overrides.\r\n * @internal\r\n */\r\n protected createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat {\r\n if (unitLabelOverrides && parent.units && parent.units.length !== unitLabelOverrides.length)\r\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}'.`);\r\n\r\n if (parent.units && 0 === parent.units.length && unitLabelOverrides && 0 < unitLabelOverrides.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add a presentation format to KindOfQuantity '${this.name}' without any units and no unit overrides.`);\r\n\r\n // TODO: Check compatibility of Unit overrides with the persistence unit\r\n\r\n return new OverrideFormat(parent, precision, unitLabelOverrides);\r\n }\r\n\r\n private async processPresentationUnits(presentationUnitsJson: string | string[]): Promise<void> {\r\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\r\n for (const formatString of presUnitsArr) {\r\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\r\n\r\n const format = await this.schema.lookupItem(presFormatOverride.name, Format);\r\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\r\n\r\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\r\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\r\n continue;\r\n }\r\n\r\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\r\n if (undefined !== presFormatOverride.unitAndLabels) {\r\n if (4 < presFormatOverride.unitAndLabels.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n\r\n unitAndLabels = [];\r\n for (const unitOverride of presFormatOverride.unitAndLabels) {\r\n const unitOrInverted = await this.schema.lookupItem(unitOverride[0]);\r\n\r\n if(Unit.isUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else if(InvertedUnit.isInvertedUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\r\n }\r\n }\r\n\r\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\r\n this.addPresentationFormat(overrideFormat);\r\n }\r\n }\r\n\r\n private processPresentationUnitsSync(presentationUnitsJson: string | string[]): void {\r\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\r\n for (const formatString of presUnitsArr) {\r\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\r\n\r\n const format = this.schema.lookupItemSync(presFormatOverride.name, Format);\r\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\r\n\r\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\r\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\r\n continue;\r\n }\r\n\r\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\r\n if (undefined !== presFormatOverride.unitAndLabels) {\r\n if (4 < presFormatOverride.unitAndLabels.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n\r\n unitAndLabels = [];\r\n for (const unitOverride of presFormatOverride.unitAndLabels) {\r\n const unitOrInverted = this.schema.lookupItemSync(unitOverride[0]);\r\n if(Unit.isUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else if(InvertedUnit.isInvertedUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\r\n }\r\n }\r\n\r\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\r\n this.addPresentationFormat(overrideFormat);\r\n }\r\n }\r\n\r\n /**\r\n * Save this KindOfQuantity's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): KindOfQuantityProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.relativeError = this.relativeError;\r\n schemaJson.persistenceUnit = this.persistenceUnit!.fullName;\r\n if (undefined !== this.presentationFormats && 0 < this.presentationFormats.length)\r\n schemaJson.presentationUnits = this.presentationFormats.map((format) => format.fullName);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n const persistenceUnit = await this.persistenceUnit;\r\n if (undefined !== persistenceUnit) {\r\n const unitName = XmlSerializationUtils.createXmlTypedName(this.schema, persistenceUnit.schema, persistenceUnit.name);\r\n itemElement.setAttribute(\"persistenceUnit\", unitName);\r\n }\r\n\r\n if (undefined !== this.presentationFormats) {\r\n const presUnitStrings: string[] = [];\r\n for(const format of this.presentationFormats) {\r\n if (!OverrideFormat.isOverrideFormat(format)) {\r\n const resolvedFormat = await format;\r\n presUnitStrings.push(XmlSerializationUtils.createXmlTypedName(this.schema, resolvedFormat.schema, format.name));\r\n continue;\r\n }\r\n presUnitStrings.push(format.fullNameXml(this.schema));\r\n };\r\n itemElement.setAttribute(\"presentationUnits\", presUnitStrings.join(\";\"));\r\n }\r\n itemElement.setAttribute(\"relativeError\", this.relativeError.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(kindOfQuantityProps: KindOfQuantityProps): void {\r\n super.fromJSONSync(kindOfQuantityProps);\r\n this._relativeError = kindOfQuantityProps.relativeError;\r\n\r\n const unitItemKey = this.schema.getSchemaItemKey(kindOfQuantityProps.persistenceUnit);\r\n this._persistenceUnit = new DelayedPromiseWithProps(unitItemKey, async () => {\r\n const unitItem = await this.schema.lookupItem(unitItemKey, Unit)\r\n || await this.schema.lookupItem(unitItemKey, InvertedUnit);\r\n\r\n if (undefined === unitItem)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unit ${kindOfQuantityProps.persistenceUnit}.`);\r\n\r\n return unitItem;\r\n }) as LazyLoadedUnit | LazyLoadedInvertedUnit;\r\n\r\n if (undefined !== kindOfQuantityProps.presentationUnits)\r\n this.processPresentationUnitsSync(kindOfQuantityProps.presentationUnits);\r\n }\r\n\r\n public override async fromJSON(kindOfQuantityProps: KindOfQuantityProps): Promise<void> {\r\n this.fromJSONSync(kindOfQuantityProps);\r\n }\r\n\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setRelativeError(relativeError: number): void {\r\n this._relativeError = relativeError;\r\n }\r\n\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void {\r\n this._persistenceUnit = value;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type KindOfQuantity.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a KindOfQuantity, false otherwise.\r\n */\r\n public static isKindOfQuantity(item?: SchemaItem): item is KindOfQuantity {\r\n if (item && item.schemaItemType === SchemaItemType.KindOfQuantity)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type KindOfQuantity.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to KindOfQuantity if it is a KindOfQuantity, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsKindOfQuantity(item?: SchemaItem): asserts item is KindOfQuantity {\r\n if (!this.isKindOfQuantity(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.KindOfQuantity}' (KindOfQuantity)`);\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\r\n public abstract override addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;\r\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;\r\n public abstract override setRelativeError(relativeError: number): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"KindOfQuantity.js","sourceRoot":"","sources":["../../../src/Metadata/KindOfQuantity.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CA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qB;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,cAAc,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,aAAa,CAAC,cAAc,CAAC,qBAAqB,EAAE,aAAa,cAAc,CAAC,cAAc,oBAAoB,CAAC,CAAC;IAClI,CAAC;CACF;AACD;;;GAGG;AACH,MAAM,OAAgB,qBAAsB,SAAQ,cAAc;CAMjE","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport { KindOfQuantityProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { LazyLoadedFormat, LazyLoadedInvertedUnit, LazyLoadedUnit } from \"../Interfaces\";\r\nimport { Format } from \"./Format\";\r\nimport { InvertedUnit } from \"./InvertedUnit\";\r\nimport { OverrideFormat, OverrideFormatProps } from \"./OverrideFormat\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { Unit } from \"./Unit\";\r\n\r\n/** A Typescript class representation of a KindOfQuantity.\r\n * @public @preview\r\n */\r\nexport class KindOfQuantity extends SchemaItem {\r\n public override readonly schemaItemType = KindOfQuantity.schemaItemType;\r\n /** @internal */\r\n public static override get schemaItemType() { return SchemaItemType.KindOfQuantity; }\r\n private _relativeError: number = 1.0;\r\n private _presentationFormats: Array<LazyLoadedFormat | OverrideFormat> = [];\r\n private _persistenceUnit?: LazyLoadedUnit | LazyLoadedInvertedUnit;\r\n\r\n /** The first presentation format in the list of Formats. */\r\n public get defaultPresentationFormat(): LazyLoadedFormat | OverrideFormat | undefined { return this.presentationFormats[0]; }\r\n\r\n /** A list of presentation formats. */\r\n public get presentationFormats(): Array<LazyLoadedFormat | OverrideFormat> { return this._presentationFormats; }\r\n\r\n /** Persistence unit */\r\n public get persistenceUnit(): LazyLoadedUnit | LazyLoadedInvertedUnit | undefined { return this._persistenceUnit; }\r\n\r\n public get relativeError() { return this._relativeError; }\r\n\r\n /**\r\n *\r\n * @param format The Format to add to this KindOfQuantity\r\n * @param isDefault\r\n * @internal\r\n */\r\n protected addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean = false) {\r\n // TODO: Add some sort of validation?\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n (isDefault) ? this._presentationFormats.splice(0, 0, format) : this._presentationFormats.push(format);\r\n }\r\n\r\n /** Creates an OverrideFormat in the context of this KindOfQuantity.\r\n * @param parent The Format to override.\r\n * @param precision The precision override\r\n * @param unitLabelOverrides The list of unit and label overrides.\r\n * @internal\r\n */\r\n protected createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat {\r\n if (unitLabelOverrides && parent.units && parent.units.length !== unitLabelOverrides.length)\r\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}'.`);\r\n\r\n if (parent.units && 0 === parent.units.length && unitLabelOverrides && 0 < unitLabelOverrides.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Cannot add a presentation format to KindOfQuantity '${this.name}' without any units and no unit overrides.`);\r\n\r\n // TODO: Check compatibility of Unit overrides with the persistence unit\r\n\r\n return new OverrideFormat(parent, precision, unitLabelOverrides);\r\n }\r\n\r\n private async processPresentationUnits(presentationUnitsJson: string | string[]): Promise<void> {\r\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\r\n for (const formatString of presUnitsArr) {\r\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\r\n\r\n const format = await this.schema.lookupItem(presFormatOverride.name, Format);\r\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\r\n\r\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\r\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\r\n continue;\r\n }\r\n\r\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\r\n if (undefined !== presFormatOverride.unitAndLabels) {\r\n if (4 < presFormatOverride.unitAndLabels.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n\r\n unitAndLabels = [];\r\n for (const unitOverride of presFormatOverride.unitAndLabels) {\r\n const unitOrInverted = await this.schema.lookupItem(unitOverride[0]);\r\n\r\n if (Unit.isUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else if (InvertedUnit.isInvertedUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\r\n }\r\n }\r\n\r\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\r\n this.addPresentationFormat(overrideFormat);\r\n }\r\n }\r\n\r\n private processPresentationUnitsSync(presentationUnitsJson: string | string[]): void {\r\n const presUnitsArr = Array.isArray(presentationUnitsJson) ? presentationUnitsJson : presentationUnitsJson.split(\";\");\r\n for (const formatString of presUnitsArr) {\r\n const presFormatOverride: OverrideFormatProps = OverrideFormat.parseFormatString(formatString);\r\n\r\n const format = this.schema.lookupItemSync(presFormatOverride.name, Format);\r\n if (undefined === format || format.schemaItemType !== SchemaItemType.Format)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate Format '${presFormatOverride.name}' for the presentation unit on KindOfQuantity ${this.fullName}.`);\r\n\r\n if (undefined === presFormatOverride.precision && undefined === presFormatOverride.unitAndLabels) {\r\n this.addPresentationFormat(new DelayedPromiseWithProps(format.key, async () => format));\r\n continue;\r\n }\r\n\r\n let unitAndLabels: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]> | undefined;\r\n if (undefined !== presFormatOverride.unitAndLabels) {\r\n if (4 < presFormatOverride.unitAndLabels.length)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n\r\n unitAndLabels = [];\r\n for (const unitOverride of presFormatOverride.unitAndLabels) {\r\n const unitOrInverted = this.schema.lookupItemSync(unitOverride[0]);\r\n if (Unit.isUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else if (InvertedUnit.isInvertedUnit(unitOrInverted))\r\n unitAndLabels.push([new DelayedPromiseWithProps(unitOrInverted.key, async () => unitOrInverted), unitOverride[1]]);\r\n else\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate SchemaItem ${unitOverride[0]}.`);\r\n }\r\n }\r\n\r\n const overrideFormat = this.createFormatOverride(format, presFormatOverride.precision, unitAndLabels);\r\n this.addPresentationFormat(overrideFormat);\r\n }\r\n }\r\n\r\n /**\r\n * Save this KindOfQuantity's properties to an object for serializing to JSON.\r\n * @param standalone Serialization includes only this object (as opposed to the full schema).\r\n * @param includeSchemaVersion Include the Schema's version information in the serialized object.\r\n */\r\n public override toJSON(standalone: boolean = false, includeSchemaVersion: boolean = false): KindOfQuantityProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.relativeError = this.relativeError;\r\n schemaJson.persistenceUnit = this.persistenceUnit?.fullName ?? \"\";\r\n if (undefined !== this.presentationFormats && 0 < this.presentationFormats.length)\r\n schemaJson.presentationUnits = this.presentationFormats.map((format) => format.fullName);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n\r\n const persistenceUnit = await this.persistenceUnit;\r\n if (undefined !== persistenceUnit) {\r\n const unitName = XmlSerializationUtils.createXmlTypedName(this.schema, persistenceUnit.schema, persistenceUnit.name);\r\n itemElement.setAttribute(\"persistenceUnit\", unitName);\r\n }\r\n\r\n if (undefined !== this.presentationFormats) {\r\n const presUnitStrings: string[] = [];\r\n for (const format of this.presentationFormats) {\r\n if (!OverrideFormat.isOverrideFormat(format)) {\r\n const resolvedFormat = await format;\r\n presUnitStrings.push(XmlSerializationUtils.createXmlTypedName(this.schema, resolvedFormat.schema, format.name));\r\n continue;\r\n }\r\n presUnitStrings.push(format.fullNameXml(this.schema));\r\n };\r\n itemElement.setAttribute(\"presentationUnits\", presUnitStrings.join(\";\"));\r\n }\r\n itemElement.setAttribute(\"relativeError\", this.relativeError.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(kindOfQuantityProps: KindOfQuantityProps): void {\r\n super.fromJSONSync(kindOfQuantityProps);\r\n this._relativeError = kindOfQuantityProps.relativeError;\r\n\r\n const unitItemKey = this.schema.getSchemaItemKey(kindOfQuantityProps.persistenceUnit);\r\n this._persistenceUnit = new DelayedPromiseWithProps(unitItemKey, async () => {\r\n const unitItem = await this.schema.lookupItem(unitItemKey, Unit)\r\n || await this.schema.lookupItem(unitItemKey, InvertedUnit);\r\n\r\n if (undefined === unitItem)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the unit ${kindOfQuantityProps.persistenceUnit}.`);\r\n\r\n return unitItem;\r\n }) as LazyLoadedUnit | LazyLoadedInvertedUnit;\r\n\r\n if (undefined !== kindOfQuantityProps.presentationUnits)\r\n this.processPresentationUnitsSync(kindOfQuantityProps.presentationUnits);\r\n }\r\n\r\n public override async fromJSON(kindOfQuantityProps: KindOfQuantityProps): Promise<void> {\r\n this.fromJSONSync(kindOfQuantityProps);\r\n }\r\n\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setRelativeError(relativeError: number): void {\r\n this._relativeError = relativeError;\r\n }\r\n\r\n /**\r\n * Used for schema editing.\r\n * @internal\r\n */\r\n protected setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void {\r\n this._persistenceUnit = value;\r\n }\r\n\r\n /**\r\n * Type guard to check if the SchemaItem is of type KindOfQuantity.\r\n * @param item The SchemaItem to check.\r\n * @returns True if the item is a KindOfQuantity, false otherwise.\r\n */\r\n public static isKindOfQuantity(item?: SchemaItem): item is KindOfQuantity {\r\n if (item && item.schemaItemType === SchemaItemType.KindOfQuantity)\r\n return true;\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Type assertion to check if the SchemaItem is of type KindOfQuantity.\r\n * @param item The SchemaItem to check.\r\n * @returns The item cast to KindOfQuantity if it is a KindOfQuantity, undefined otherwise.\r\n * @internal\r\n */\r\n public static assertIsKindOfQuantity(item?: SchemaItem): asserts item is KindOfQuantity {\r\n if (!this.isKindOfQuantity(item))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidSchemaItemType, `Expected '${SchemaItemType.KindOfQuantity}' (KindOfQuantity)`);\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableKindOfQuantity extends KindOfQuantity {\r\n public abstract override addPresentationFormat(format: LazyLoadedFormat | OverrideFormat, isDefault: boolean): void;\r\n public abstract override createFormatOverride(parent: Format, precision?: number, unitLabelOverrides?: Array<[LazyLoadedUnit | LazyLoadedInvertedUnit, string | undefined]>): OverrideFormat;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n public abstract override setPersistenceUnit(value: LazyLoadedUnit | LazyLoadedInvertedUnit | undefined): void;\r\n public abstract override setRelativeError(relativeError: number): void;\r\n}\r\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,EAAE,mBAAmB,EAC3D,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAsB,aAAa,EAAyC,iBAAiB,EAA6B,MAAM,cAAc,CAAC;AAEtJ,OAAO,EAAE,QAAQ,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AACnJ,OAAO,EAAE,YAAY,EAA2C,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAElI,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE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AAC;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"}
|
|
@@ -422,7 +422,7 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
422
422
|
*/
|
|
423
423
|
toJSON() {
|
|
424
424
|
const schemaJson = super.toJSON();
|
|
425
|
-
schemaJson.typeName = this.enumeration
|
|
425
|
+
schemaJson.typeName = this.enumeration?.fullName ?? "";
|
|
426
426
|
return schemaJson;
|
|
427
427
|
}
|
|
428
428
|
/** @internal */
|
|
@@ -434,9 +434,10 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
434
434
|
fromJSONSync(enumerationPropertyProps) {
|
|
435
435
|
super.fromJSONSync(enumerationPropertyProps);
|
|
436
436
|
if (undefined !== enumerationPropertyProps.typeName) {
|
|
437
|
-
|
|
437
|
+
const enumFullName = this.enumeration?.fullName;
|
|
438
|
+
if (enumFullName && !enumFullName.match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName
|
|
438
439
|
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);
|
|
439
|
-
const enumSchemaItemKey = this.class.schema.getSchemaItemKey(
|
|
440
|
+
const enumSchemaItemKey = enumFullName ? this.class.schema.getSchemaItemKey(enumFullName) : undefined;
|
|
440
441
|
if (!enumSchemaItemKey)
|
|
441
442
|
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);
|
|
442
443
|
this._enumeration = new DelayedPromiseWithProps(enumSchemaItemKey, async () => {
|
|
@@ -451,6 +452,8 @@ export class EnumerationProperty extends PrimitiveOrEnumPropertyBase {
|
|
|
451
452
|
async toXml(schemaXml) {
|
|
452
453
|
const itemElement = await super.toXml(schemaXml);
|
|
453
454
|
const enumeration = await this.enumeration;
|
|
455
|
+
if (!enumeration)
|
|
456
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Enumeration not loaded for property ${this.name}.`);
|
|
454
457
|
const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration.schema, enumeration.name);
|
|
455
458
|
itemElement.setAttribute("typeName", enumerationName);
|
|
456
459
|
return itemElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,g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,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;QAED;;UAEE;QACQ,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;KACmE,CAAC;AACzE,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAC/E,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,gBAA+B,aAAa,CAAC,OAAO;QAC9F,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CAEF;AAED,uBAAuB;AACvB,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IACnF,YAAY,OAAgB,EAAE,IAAY,EAAE,IAA2B;QACrE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport {\r\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\r\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\r\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { ECName } from \"../ECName\";\r\nimport { ECClass, StructClass } from \"./Class\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport { KindOfQuantity } from \"./KindOfQuantity\";\r\nimport { PropertyCategory } from \"./PropertyCategory\";\r\nimport { type RelationshipClass } from \"./RelationshipClass\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A common abstract class for all ECProperty types.\r\n * @public @preview\r\n */\r\nexport abstract class Property implements CustomAttributeContainerProps {\r\n private _name: ECName;\r\n private _class: AnyClass; // TODO: class seems to be unused?\r\n private _description?: string;\r\n private _label?: string;\r\n private _isReadOnly?: boolean;\r\n private _priority?: number;\r\n private _category?: LazyLoadedPropertyCategory;\r\n private _kindOfQuantity?: LazyLoadedKindOfQuantity;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n\r\n /** @internal */\r\n protected _type: PropertyType;\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n this._class = ecClass as AnyClass;\r\n this._name = new ECName(name);\r\n this._type = type;\r\n }\r\n\r\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\r\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\r\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\r\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\r\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\r\n\r\n public get name() { return this._name.name; }\r\n\r\n public get class() { return this._class; }\r\n\r\n public get label() { return this._label; }\r\n\r\n public get description() { return this._description; }\r\n\r\n public get isReadOnly() { return this._isReadOnly || false; }\r\n\r\n public get priority(): number {\r\n if (this._priority === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.priority;\r\n }\r\n }\r\n\r\n return this._priority || 0;\r\n }\r\n\r\n public get category(): LazyLoadedPropertyCategory | undefined {\r\n if (this._category === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.category;\r\n }\r\n }\r\n\r\n return this._category;\r\n }\r\n\r\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\r\n if (this._kindOfQuantity === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.kindOfQuantity;\r\n }\r\n }\r\n\r\n return this._kindOfQuantity;\r\n }\r\n\r\n public get propertyType() { return this._type; }\r\n\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** Returns the name in the format 'ClassName.PropertyName'. */\r\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\r\n\r\n /** Returns the schema of the class holding the property. */\r\n public get schema(): Schema { return this._class.schema; }\r\n\r\n public getCategorySync(): PropertyCategory | undefined {\r\n if (!this._category) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getCategorySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\r\n }\r\n\r\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\r\n if (!this._kindOfQuantity) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getKindOfQuantitySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\r\n }\r\n\r\n /**\r\n * Save this Property's properties to an object for serializing to JSON.\r\n */\r\n public toJSON(): PropertyProps {\r\n const schemaJson: any = {};\r\n schemaJson.name = this.name;\r\n schemaJson.type = propertyTypeToString(this._type);\r\n if (this.description !== undefined)\r\n schemaJson.description = this.description;\r\n if (this.label !== undefined)\r\n schemaJson.label = this.label;\r\n if (this._isReadOnly !== undefined)\r\n schemaJson.isReadOnly = this._isReadOnly;\r\n if (this._category !== undefined)\r\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\r\n if (this._priority !== undefined)\r\n schemaJson.priority = this._priority;\r\n if (this._kindOfQuantity !== undefined)\r\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public async toXml(schemaXml: Document): Promise<Element> {\r\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\r\n const itemElement = schemaXml.createElement(propType);\r\n itemElement.setAttribute(\"propertyName\", this.name);\r\n if (undefined !== this.description)\r\n itemElement.setAttribute(\"description\", this.description);\r\n if (undefined !== this.label)\r\n itemElement.setAttribute(\"displayLabel\", this.label);\r\n if (undefined !== this.isReadOnly)\r\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\r\n\r\n if (undefined !== this._category) {\r\n const category = await this._category;\r\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\r\n itemElement.setAttribute(\"category\", categoryName);\r\n }\r\n\r\n if (undefined !== this._priority)\r\n itemElement.setAttribute(\"priority\", this._priority.toString());\r\n\r\n if (undefined !== this._kindOfQuantity) {\r\n const kindOfQuantity = await this._kindOfQuantity;\r\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\r\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public fromJSONSync(propertyProps: PropertyProps) {\r\n if (undefined !== propertyProps.label) {\r\n this._label = propertyProps.label;\r\n }\r\n\r\n if (undefined !== propertyProps.description) {\r\n this._description = propertyProps.description;\r\n }\r\n\r\n if (undefined !== propertyProps.priority) {\r\n this._priority = propertyProps.priority;\r\n }\r\n\r\n if (undefined !== propertyProps.isReadOnly) {\r\n this._isReadOnly = propertyProps.isReadOnly;\r\n }\r\n\r\n if (undefined !== propertyProps.category) {\r\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\r\n if (!propertyCategorySchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\r\n async () => {\r\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\r\n if (undefined === category)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n return category;\r\n });\r\n }\r\n\r\n if (undefined !== propertyProps.kindOfQuantity) {\r\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\r\n if (!koqSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\r\n async () => {\r\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\r\n if (undefined === koq)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n return koq;\r\n });\r\n }\r\n }\r\n\r\n public async fromJSON(propertyProps: PropertyProps) {\r\n this.fromJSONSync(propertyProps);\r\n }\r\n\r\n /** @internal */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /** @internal */\r\n protected setName(name: ECName) {\r\n this._name = name;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setDescription(description: string) {\r\n this._description = description;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setLabel(label: string) {\r\n this._label = label;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setIsReadOnly(isReadOnly: boolean) {\r\n this._isReadOnly = isReadOnly;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setPriority(priority: number) {\r\n this._priority = priority;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setCategory(category: LazyLoadedPropertyCategory) {\r\n this._category = category;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\r\n this._kindOfQuantity = kindOfQuantity;\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n let baseCustomAttributes;\r\n if (undefined !== baseProperty)\r\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\r\n if (undefined !== baseCustomAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\r\n }\r\n\r\n return customAttributes;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public static isProperty(object: any): object is AnyProperty {\r\n const property = object as Property;\r\n\r\n return property !== undefined && property.class !== undefined && property.name !== undefined\r\n && property.propertyType !== undefined;\r\n }\r\n}\r\n\r\n\r\n\r\n/** @public @preview */\r\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\r\n /** @internal */\r\n protected _extendedTypeName?: string;\r\n /** @internal */\r\n protected _minLength?: number;\r\n /** @internal */\r\n protected _maxLength?: number;\r\n /** @internal */\r\n protected _minValue?: number;\r\n /** @internal */\r\n protected _maxValue?: number;\r\n\r\n public get extendedTypeName() { return this._extendedTypeName; }\r\n public get minLength() { return this._minLength; }\r\n public get maxLength() { return this._maxLength; }\r\n public get minValue() { return this._minValue; }\r\n public get maxValue() { return this._maxValue; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n super(ecClass, name, type);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\r\n const schemaJson = super.toJSON() as any;\r\n if (this.extendedTypeName !== undefined)\r\n schemaJson.extendedTypeName = this.extendedTypeName;\r\n if (this._minLength !== undefined)\r\n schemaJson.minLength = this.minLength;\r\n if (this._maxLength !== undefined)\r\n schemaJson.maxLength = this.maxLength;\r\n if (this._minValue !== undefined)\r\n schemaJson.minValue = this.minValue;\r\n if (this._maxValue !== undefined)\r\n schemaJson.maxValue = this.maxValue;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n if (undefined !== this.extendedTypeName)\r\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\r\n if (undefined !== this.minValue)\r\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\r\n if (undefined !== this.maxValue)\r\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\r\n if (undefined !== this.minLength)\r\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\r\n if (undefined !== this.maxLength)\r\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n super.fromJSONSync(propertyBaseProps);\r\n\r\n if (undefined !== propertyBaseProps.minLength) {\r\n this._minLength = propertyBaseProps.minLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxLength) {\r\n this._maxLength = propertyBaseProps.maxLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.minValue) {\r\n this._minValue = propertyBaseProps.minValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxValue) {\r\n this._maxValue = propertyBaseProps.maxValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.extendedTypeName) {\r\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\r\n }\r\n }\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setExtendedTypeName(extendedTypeName: string) {\r\n this._extendedTypeName = extendedTypeName;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinLength(minLength: number) {\r\n this._minLength = minLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxLength(maxLength: number) {\r\n this._maxLength = maxLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinValue(minValue: number) {\r\n this._minValue = minValue;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxValue(maxValue: number) {\r\n this._maxValue = maxValue;\r\n }\r\n\r\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n this.fromJSONSync(propertyBaseProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\r\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\r\n }\r\n\r\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\r\n super.fromJSONSync(primitivePropertyProps);\r\n if (undefined !== primitivePropertyProps.typeName) {\r\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\r\n this.fromJSONSync(primitivePropertyProps);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitivePropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\r\n return itemElement;\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\r\n /** @internal */\r\n protected _enumeration?: LazyLoadedEnumeration;\r\n\r\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\r\n\r\n /**\r\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): EnumerationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.enumeration!.fullName;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n // TODO: Should we allow specifying the backing type?\r\n super(ecClass, name, PropertyType.Integer_Enumeration);\r\n this._enumeration = type;\r\n }\r\n\r\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\r\n super.fromJSONSync(enumerationPropertyProps);\r\n if (undefined !== enumerationPropertyProps.typeName) {\r\n if (!(this.enumeration!.fullName).match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n const enumSchemaItemKey = this.class.schema.getSchemaItemKey(this.enumeration!.fullName);\r\n if (!enumSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\r\n async () => {\r\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\r\n if (undefined === enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n return enumeration;\r\n });\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const enumeration = await this.enumeration;\r\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration!.schema, enumeration!.name);\r\n itemElement.setAttribute(\"typeName\", enumerationName);\r\n return itemElement;\r\n }\r\n\r\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\r\n this.fromJSONSync(enumerationPropertyProps);\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructProperty extends Property {\r\n /** @internal */\r\n protected _structClass: StructClass;\r\n\r\n public get structClass(): StructClass { return this._structClass; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, PropertyType.Struct);\r\n this._structClass = type;\r\n }\r\n\r\n /**\r\n * Save this StructProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): StructPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.structClass.fullName;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\r\n itemElement.setAttribute(\"typeName\", structClassName);\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\r\n super.fromJSONSync(structPropertyProps);\r\n if (undefined !== structPropertyProps.typeName) {\r\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\r\n this.fromJSONSync(structPropertyProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class NavigationProperty extends Property {\r\n /** @internal */\r\n protected _relationshipClass: LazyLoadedRelationshipClass;\r\n /** @internal */\r\n protected _direction: StrengthDirection;\r\n\r\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\r\n\r\n public getRelationshipClassSync(): RelationshipClass | undefined {\r\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\r\n return undefined;\r\n\r\n // We cannot use the type guard here to avoid a circular dependency\r\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\r\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\r\n }\r\n\r\n public get direction() { return this._direction; }\r\n\r\n /**\r\n * Save this NavigationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): NavigationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.relationshipName = this.relationshipClass.fullName;\r\n schemaJson.direction = strengthDirectionToString(this.direction);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const relationshipClass = await this.relationshipClass;\r\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\r\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\r\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\r\n\r\n return itemElement;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\r\n super(ecClass, name, PropertyType.Navigation);\r\n this._relationshipClass = relationship;\r\n\r\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\r\n }\r\n}\r\n\r\ntype Constructor<T> = new (...args: any[]) => T;\r\n\r\n// TODO: Consolidate all of the INT32_MAX variables.\r\nconst INT32_MAX = 2147483647;\r\n\r\n/** @public @preview */\r\nexport abstract class ArrayProperty extends Property {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs?: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\r\n return class extends Base {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n constructor(...args: any[]) {\r\n super(...args);\r\n this._type = PropertyTypeUtils.asArray(this.propertyType);\r\n }\r\n\r\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n super.fromJSONSync(arrayPropertyProps);\r\n if (undefined !== arrayPropertyProps.minOccurs) {\r\n this._minOccurs = arrayPropertyProps.minOccurs;\r\n }\r\n\r\n if (undefined !== arrayPropertyProps.maxOccurs) {\r\n this._maxOccurs = arrayPropertyProps.maxOccurs;\r\n }\r\n }\r\n\r\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n this.fromJSONSync(arrayPropertyProps);\r\n }\r\n\r\n /**\r\n * Save this ArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): ArrayPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.minOccurs = this.minOccurs;\r\n if (this.maxOccurs !== undefined)\r\n schemaJson.maxOccurs = this.maxOccurs;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\r\n if (this.maxOccurs)\r\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\r\n};\r\n\r\n/** @public @preview */\r\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, primitiveType);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveArrayPropertyProps {\r\n return super.toJSON();\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\r\n/** @public @preview */\r\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\r\n/** @public @preview */\r\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableProperty extends Property {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"Property.js","sourceRoot":"","sources":["../../../src/Metadata/Property.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAK5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,qBAAqB,EAAE,cAAc,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAC;AACtJ,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEzF,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EAAsE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAClI,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;;GAGG;AACH,MAAM,OAAgB,QAAQ;IACpB,KAAK,CAAS;IACd,MAAM,CAAW,CAAC,kCAAkC;IACpD,YAAY,CAAU;IACtB,MAAM,CAAU;IAChB,WAAW,CAAW;IACtB,SAAS,CAAU;IACnB,SAAS,CAA8B;IACvC,eAAe,CAA4B;IAC3C,iBAAiB,CAAgC;IAEzD,gBAAgB;IACN,KAAK,C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,YAAY,CAAC,SAAiB;YACtC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC9B,CAAC;KACmE,CAAC;AACzE,CAAC,CAAC;AAEF,uBAAuB;AACvB,MAAM,OAAO,sBAAuB,SAAQ,kBAAkB,CAAC,iBAAiB,CAAC;IAC/E,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,gBAA+B,aAAa,CAAC,OAAO;QAC9F,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,aAAa,CAAC,CAAC;IACtC,CAAC;IAED;;OAEG;IACa,MAAM;QACpB,OAAO,KAAK,CAAC,MAAM,EAAE,CAAC;IACxB,CAAC;CAEF;AAED,uBAAuB;AACvB,MAAM,OAAO,wBAAyB,SAAQ,kBAAkB,CAAC,mBAAmB,CAAC;IACnF,YAAY,OAAgB,EAAE,IAAY,EAAE,IAA2B;QACrE,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAED,uBAAuB;AACvB,MAAM,OAAO,mBAAoB,SAAQ,kBAAkB,CAAC,cAAc,CAAC;IACzE,gBAAgB;IAChB,YAAY,OAAgB,EAAE,IAAY,EAAE,IAAiB;QAC3D,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7B,CAAC;CACF;AAaD;;;GAGG;AACH,MAAM,OAAgB,eAAgB,SAAQ,QAAQ;CAErD","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Metadata\r\n */\r\n\r\nimport { DelayedPromiseWithProps } from \"../DelayedPromise\";\r\nimport {\r\n ArrayPropertyProps, EnumerationPropertyProps, NavigationPropertyProps, PrimitiveArrayPropertyProps, PrimitiveOrEnumPropertyBaseProps,\r\n PrimitivePropertyProps, PropertyProps, StructPropertyProps,\r\n} from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { parsePrimitiveType, PrimitiveType, primitiveTypeToString, SchemaItemType, StrengthDirection, strengthDirectionToString } from \"../ECObjects\";\r\nimport { ECSchemaError, ECSchemaStatus } from \"../Exception\";\r\nimport { AnyClass, LazyLoadedEnumeration, LazyLoadedKindOfQuantity, LazyLoadedPropertyCategory, LazyLoadedRelationshipClass } from \"../Interfaces\";\r\nimport { PropertyType, propertyTypeToString, PropertyTypeUtils } from \"../PropertyTypes\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { ECName } from \"../ECName\";\r\nimport { ECClass, StructClass } from \"./Class\";\r\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\r\nimport { Enumeration } from \"./Enumeration\";\r\nimport { KindOfQuantity } from \"./KindOfQuantity\";\r\nimport { PropertyCategory } from \"./PropertyCategory\";\r\nimport { type RelationshipClass } from \"./RelationshipClass\";\r\nimport { Schema } from \"./Schema\";\r\n\r\n/**\r\n * A common abstract class for all ECProperty types.\r\n * @public @preview\r\n */\r\nexport abstract class Property implements CustomAttributeContainerProps {\r\n private _name: ECName;\r\n private _class: AnyClass; // TODO: class seems to be unused?\r\n private _description?: string;\r\n private _label?: string;\r\n private _isReadOnly?: boolean;\r\n private _priority?: number;\r\n private _category?: LazyLoadedPropertyCategory;\r\n private _kindOfQuantity?: LazyLoadedKindOfQuantity;\r\n private _customAttributes?: Map<string, CustomAttribute>;\r\n\r\n /** @internal */\r\n protected _type: PropertyType;\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n this._class = ecClass;\r\n this._name = new ECName(name);\r\n this._type = type;\r\n }\r\n\r\n public isArray(): this is AnyArrayProperty { return PropertyTypeUtils.isArray(this._type); }\r\n public isPrimitive(): this is AnyPrimitiveProperty { return PropertyTypeUtils.isPrimitive(this._type); }\r\n public isStruct(): this is AnyStructProperty { return PropertyTypeUtils.isStruct(this._type); }\r\n public isEnumeration(): this is AnyEnumerationProperty { return PropertyTypeUtils.isEnumeration(this._type); }\r\n public isNavigation(): this is NavigationProperty { return PropertyTypeUtils.isNavigation(this._type); }\r\n\r\n public get name() { return this._name.name; }\r\n\r\n public get class() { return this._class; }\r\n\r\n public get label() { return this._label; }\r\n\r\n public get description() { return this._description; }\r\n\r\n public get isReadOnly() { return this._isReadOnly || false; }\r\n\r\n public get priority(): number {\r\n if (this._priority === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.priority;\r\n }\r\n }\r\n\r\n return this._priority || 0;\r\n }\r\n\r\n public get category(): LazyLoadedPropertyCategory | undefined {\r\n if (this._category === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.category;\r\n }\r\n }\r\n\r\n return this._category;\r\n }\r\n\r\n public get kindOfQuantity(): LazyLoadedKindOfQuantity | undefined {\r\n if (this._kindOfQuantity === undefined) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.kindOfQuantity;\r\n }\r\n }\r\n\r\n return this._kindOfQuantity;\r\n }\r\n\r\n public get propertyType() { return this._type; }\r\n\r\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\r\n\r\n /** Returns the name in the format 'ClassName.PropertyName'. */\r\n public get fullName(): string { return `${this._class.name}.${this.name}`; }\r\n\r\n /** Returns the schema of the class holding the property. */\r\n public get schema(): Schema { return this._class.schema; }\r\n\r\n public getCategorySync(): PropertyCategory | undefined {\r\n if (!this._category) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getCategorySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._category, PropertyCategory);\r\n }\r\n\r\n public getKindOfQuantitySync(): KindOfQuantity | undefined {\r\n if (!this._kindOfQuantity) {\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n if (undefined !== baseProperty) {\r\n return baseProperty.getKindOfQuantitySync();\r\n }\r\n\r\n return undefined;\r\n }\r\n\r\n return this.class.schema.lookupItemSync(this._kindOfQuantity, KindOfQuantity);\r\n }\r\n\r\n /**\r\n * Save this Property's properties to an object for serializing to JSON.\r\n */\r\n public toJSON(): PropertyProps {\r\n const schemaJson: any = {};\r\n schemaJson.name = this.name;\r\n schemaJson.type = propertyTypeToString(this._type);\r\n if (this.description !== undefined)\r\n schemaJson.description = this.description;\r\n if (this.label !== undefined)\r\n schemaJson.label = this.label;\r\n if (this._isReadOnly !== undefined)\r\n schemaJson.isReadOnly = this._isReadOnly;\r\n if (this._category !== undefined)\r\n schemaJson.category = this._category.fullName; // needs to be fully qualified name\r\n if (this._priority !== undefined)\r\n schemaJson.priority = this._priority;\r\n if (this._kindOfQuantity !== undefined)\r\n schemaJson.kindOfQuantity = this._kindOfQuantity.fullName;\r\n const customAttributes = serializeCustomAttributes(this.customAttributes);\r\n if (customAttributes !== undefined)\r\n schemaJson.customAttributes = customAttributes;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public async toXml(schemaXml: Document): Promise<Element> {\r\n const propType = `EC${propertyTypeToString(this._type)}`.replace(\"Primitive\", \"\");\r\n const itemElement = schemaXml.createElement(propType);\r\n itemElement.setAttribute(\"propertyName\", this.name);\r\n if (undefined !== this.description)\r\n itemElement.setAttribute(\"description\", this.description);\r\n if (undefined !== this.label)\r\n itemElement.setAttribute(\"displayLabel\", this.label);\r\n if (undefined !== this.isReadOnly)\r\n itemElement.setAttribute(\"readOnly\", String(this.isReadOnly));\r\n\r\n if (undefined !== this._category) {\r\n const category = await this._category;\r\n const categoryName = XmlSerializationUtils.createXmlTypedName(this.schema, category.schema, category.name);\r\n itemElement.setAttribute(\"category\", categoryName);\r\n }\r\n\r\n if (undefined !== this._priority)\r\n itemElement.setAttribute(\"priority\", this._priority.toString());\r\n\r\n if (undefined !== this._kindOfQuantity) {\r\n const kindOfQuantity = await this._kindOfQuantity;\r\n const kindOfQuantityName = XmlSerializationUtils.createXmlTypedName(this.schema, kindOfQuantity.schema, kindOfQuantity.name);\r\n itemElement.setAttribute(\"kindOfQuantity\", kindOfQuantityName);\r\n }\r\n\r\n if (this._customAttributes) {\r\n const caContainerElement = schemaXml.createElement(\"ECCustomAttributes\");\r\n for (const [name, attribute] of this._customAttributes) {\r\n const caElement = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this.schema);\r\n caContainerElement.appendChild(caElement);\r\n }\r\n itemElement.appendChild(caContainerElement);\r\n }\r\n\r\n return itemElement;\r\n }\r\n\r\n public fromJSONSync(propertyProps: PropertyProps) {\r\n if (undefined !== propertyProps.label) {\r\n this._label = propertyProps.label;\r\n }\r\n\r\n if (undefined !== propertyProps.description) {\r\n this._description = propertyProps.description;\r\n }\r\n\r\n if (undefined !== propertyProps.priority) {\r\n this._priority = propertyProps.priority;\r\n }\r\n\r\n if (undefined !== propertyProps.isReadOnly) {\r\n this._isReadOnly = propertyProps.isReadOnly;\r\n }\r\n\r\n if (undefined !== propertyProps.category) {\r\n const propertyCategorySchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.category);\r\n if (!propertyCategorySchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n this._category = new DelayedPromiseWithProps<SchemaItemKey, PropertyCategory>(propertyCategorySchemaItemKey,\r\n async () => {\r\n const category = await this.class.schema.lookupItem(propertyCategorySchemaItemKey, PropertyCategory);\r\n if (undefined === category)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'category' (\"${propertyProps.category}\") that cannot be found.`);\r\n return category;\r\n });\r\n }\r\n\r\n if (undefined !== propertyProps.kindOfQuantity) {\r\n const koqSchemaItemKey = this.class.schema.getSchemaItemKey(propertyProps.kindOfQuantity);\r\n if (!koqSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n this._kindOfQuantity = new DelayedPromiseWithProps<SchemaItemKey, KindOfQuantity>(koqSchemaItemKey,\r\n async () => {\r\n const koq = await this.class.schema.lookupItem(koqSchemaItemKey, KindOfQuantity);\r\n if (undefined === koq)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `The Property ${this.name} has a 'kindOfQuantity' (\"${propertyProps.kindOfQuantity}\") that cannot be found.`);\r\n return koq;\r\n });\r\n }\r\n }\r\n\r\n public async fromJSON(propertyProps: PropertyProps) {\r\n this.fromJSONSync(propertyProps);\r\n }\r\n\r\n /** @internal */\r\n protected addCustomAttribute(customAttribute: CustomAttribute) {\r\n if (!this._customAttributes)\r\n this._customAttributes = new Map<string, CustomAttribute>();\r\n\r\n this._customAttributes.set(customAttribute.className, customAttribute);\r\n }\r\n\r\n /** @internal */\r\n protected setName(name: ECName) {\r\n this._name = name;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setDescription(description: string) {\r\n this._description = description;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setLabel(label: string) {\r\n this._label = label;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setIsReadOnly(isReadOnly: boolean) {\r\n this._isReadOnly = isReadOnly;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setPriority(priority: number) {\r\n this._priority = priority;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setCategory(category: LazyLoadedPropertyCategory) {\r\n this._category = category;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setKindOfQuantity(kindOfQuantity: LazyLoadedKindOfQuantity) {\r\n this._kindOfQuantity = kindOfQuantity;\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base\r\n * This is the async version of getCustomAttributesSync()\r\n */\r\n public async getCustomAttributes(): Promise<CustomAttributeSet> {\r\n return this.getCustomAttributesSync();\r\n }\r\n\r\n /**\r\n * Retrieve all custom attributes in the current property and its base.\r\n */\r\n public getCustomAttributesSync(): CustomAttributeSet {\r\n let customAttributes: Map<string, CustomAttribute> | undefined = this._customAttributes;\r\n if (undefined === customAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>();\r\n }\r\n\r\n const baseProperty = this.class.getInheritedPropertySync(this.name);\r\n let baseCustomAttributes;\r\n if (undefined !== baseProperty)\r\n baseCustomAttributes = baseProperty.getCustomAttributesSync();\r\n if (undefined !== baseCustomAttributes) {\r\n customAttributes = new Map<string, CustomAttribute>([...baseCustomAttributes, ...customAttributes]);\r\n }\r\n\r\n return customAttributes;\r\n }\r\n /**\r\n * @internal\r\n */\r\n public static isProperty(object: any): object is AnyProperty {\r\n const property = object as Property;\r\n\r\n return property !== undefined && property.class !== undefined && property.name !== undefined\r\n && property.propertyType !== undefined;\r\n }\r\n}\r\n\r\n\r\n\r\n/** @public @preview */\r\nexport abstract class PrimitiveOrEnumPropertyBase extends Property {\r\n /** @internal */\r\n protected _extendedTypeName?: string;\r\n /** @internal */\r\n protected _minLength?: number;\r\n /** @internal */\r\n protected _maxLength?: number;\r\n /** @internal */\r\n protected _minValue?: number;\r\n /** @internal */\r\n protected _maxValue?: number;\r\n\r\n public get extendedTypeName() { return this._extendedTypeName; }\r\n public get minLength() { return this._minLength; }\r\n public get maxLength() { return this._maxLength; }\r\n public get minValue() { return this._minValue; }\r\n public get maxValue() { return this._maxValue; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: PropertyType) {\r\n super(ecClass, name, type);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveOrEnumPropertyBase's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveOrEnumPropertyBaseProps {\r\n const schemaJson = super.toJSON() as any;\r\n if (this.extendedTypeName !== undefined)\r\n schemaJson.extendedTypeName = this.extendedTypeName;\r\n if (this._minLength !== undefined)\r\n schemaJson.minLength = this.minLength;\r\n if (this._maxLength !== undefined)\r\n schemaJson.maxLength = this.maxLength;\r\n if (this._minValue !== undefined)\r\n schemaJson.minValue = this.minValue;\r\n if (this._maxValue !== undefined)\r\n schemaJson.maxValue = this.maxValue;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n if (undefined !== this.extendedTypeName)\r\n itemElement.setAttribute(\"extendedTypeName\", this.extendedTypeName);\r\n if (undefined !== this.minValue)\r\n itemElement.setAttribute(\"minimumValue\", this.minValue.toString());\r\n if (undefined !== this.maxValue)\r\n itemElement.setAttribute(\"maximumValue\", this.maxValue.toString());\r\n if (undefined !== this.minLength)\r\n itemElement.setAttribute(\"minimumLength\", this.minLength.toString());\r\n if (undefined !== this.maxLength)\r\n itemElement.setAttribute(\"maximumLength\", this.maxLength.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n super.fromJSONSync(propertyBaseProps);\r\n\r\n if (undefined !== propertyBaseProps.minLength) {\r\n this._minLength = propertyBaseProps.minLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxLength) {\r\n this._maxLength = propertyBaseProps.maxLength;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.minValue) {\r\n this._minValue = propertyBaseProps.minValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.maxValue) {\r\n this._maxValue = propertyBaseProps.maxValue;\r\n }\r\n\r\n if (undefined !== propertyBaseProps.extendedTypeName) {\r\n this._extendedTypeName = propertyBaseProps.extendedTypeName;\r\n }\r\n }\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setExtendedTypeName(extendedTypeName: string) {\r\n this._extendedTypeName = extendedTypeName;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinLength(minLength: number) {\r\n this._minLength = minLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxLength(maxLength: number) {\r\n this._maxLength = maxLength;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinValue(minValue: number) {\r\n this._minValue = minValue;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxValue(maxValue: number) {\r\n this._maxValue = maxValue;\r\n }\r\n\r\n public override async fromJSON(propertyBaseProps: PrimitiveOrEnumPropertyBaseProps) {\r\n this.fromJSONSync(propertyBaseProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class PrimitiveProperty extends PrimitiveOrEnumPropertyBase {\r\n public get primitiveType(): PrimitiveType { return PropertyTypeUtils.getPrimitiveType(this.propertyType); }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, PropertyTypeUtils.fromPrimitiveType(primitiveType));\r\n }\r\n\r\n public override fromJSONSync(primitivePropertyProps: PrimitivePropertyProps) {\r\n super.fromJSONSync(primitivePropertyProps);\r\n if (undefined !== primitivePropertyProps.typeName) {\r\n if (this.primitiveType !== parsePrimitiveType(primitivePropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(primitivePropertyProps: PrimitivePropertyProps) {\r\n this.fromJSONSync(primitivePropertyProps);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitivePropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = primitiveTypeToString(this.primitiveType);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"typeName\", primitiveTypeToString(this.primitiveType));\r\n return itemElement;\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationProperty extends PrimitiveOrEnumPropertyBase {\r\n /** @internal */\r\n protected _enumeration?: LazyLoadedEnumeration;\r\n\r\n public get enumeration(): LazyLoadedEnumeration | undefined { return this._enumeration; }\r\n\r\n /**\r\n * Save this EnumerationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): EnumerationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.enumeration?.fullName ?? \"\";\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n // TODO: Should we allow specifying the backing type?\r\n super(ecClass, name, PropertyType.Integer_Enumeration);\r\n this._enumeration = type;\r\n }\r\n\r\n public override fromJSONSync(enumerationPropertyProps: EnumerationPropertyProps) {\r\n super.fromJSONSync(enumerationPropertyProps);\r\n if (undefined !== enumerationPropertyProps.typeName) {\r\n const enumFullName = this.enumeration?.fullName;\r\n if (enumFullName && !enumFullName.match(enumerationPropertyProps.typeName)) // need to match {schema}.{version}.{itemName} on typeName\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n const enumSchemaItemKey = enumFullName ? this.class.schema.getSchemaItemKey(enumFullName) : undefined;\r\n if (!enumSchemaItemKey)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n this._enumeration = new DelayedPromiseWithProps<SchemaItemKey, Enumeration>(enumSchemaItemKey,\r\n async () => {\r\n const enumeration = await this.class.schema.lookupItem(enumSchemaItemKey, Enumeration);\r\n if (undefined === enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the enumeration ${enumerationPropertyProps.typeName}.`);\r\n return enumeration;\r\n });\r\n }\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const enumeration = await this.enumeration;\r\n if (!enumeration)\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Enumeration not loaded for property ${this.name}.`);\r\n const enumerationName = XmlSerializationUtils.createXmlTypedName(this.schema, enumeration.schema, enumeration.name);\r\n itemElement.setAttribute(\"typeName\", enumerationName);\r\n return itemElement;\r\n }\r\n\r\n public override async fromJSON(enumerationPropertyProps: EnumerationPropertyProps) {\r\n this.fromJSONSync(enumerationPropertyProps);\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructProperty extends Property {\r\n /** @internal */\r\n protected _structClass: StructClass;\r\n\r\n public get structClass(): StructClass { return this._structClass; }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, PropertyType.Struct);\r\n this._structClass = type;\r\n }\r\n\r\n /**\r\n * Save this StructProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): StructPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.typeName = this.structClass.fullName;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const structClassName = XmlSerializationUtils.createXmlTypedName(this.schema, this.structClass.schema, this.structClass.name);\r\n itemElement.setAttribute(\"typeName\", structClassName);\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(structPropertyProps: StructPropertyProps) {\r\n super.fromJSONSync(structPropertyProps);\r\n if (undefined !== structPropertyProps.typeName) {\r\n if (!this.structClass.key.matchesFullName(structPropertyProps.typeName))\r\n throw new ECSchemaError(ECSchemaStatus.InvalidECJson, ``);\r\n }\r\n }\r\n\r\n public override async fromJSON(structPropertyProps: StructPropertyProps) {\r\n this.fromJSONSync(structPropertyProps);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class NavigationProperty extends Property {\r\n /** @internal */\r\n protected _relationshipClass: LazyLoadedRelationshipClass;\r\n /** @internal */\r\n protected _direction: StrengthDirection;\r\n\r\n public get relationshipClass(): LazyLoadedRelationshipClass { return this._relationshipClass; }\r\n\r\n public getRelationshipClassSync(): RelationshipClass | undefined {\r\n if (!this._relationshipClass) // eslint-disable-line @typescript-eslint/no-misused-promises\r\n return undefined;\r\n\r\n // We cannot use the type guard here to avoid a circular dependency\r\n const result = this.class.schema.lookupItemSync(this._relationshipClass);\r\n return result?.schemaItemType === SchemaItemType.RelationshipClass ? result as RelationshipClass : undefined\r\n }\r\n\r\n public get direction() { return this._direction; }\r\n\r\n /**\r\n * Save this NavigationProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): NavigationPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.relationshipName = this.relationshipClass.fullName;\r\n schemaJson.direction = strengthDirectionToString(this.direction);\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n const relationshipClass = await this.relationshipClass;\r\n const relationshipClassName = XmlSerializationUtils.createXmlTypedName(this.schema, relationshipClass.schema, relationshipClass.name);\r\n itemElement.setAttribute(\"relationshipName\", relationshipClassName);\r\n itemElement.setAttribute(\"direction\", strengthDirectionToString(this.direction));\r\n\r\n return itemElement;\r\n }\r\n\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, relationship: LazyLoadedRelationshipClass, direction?: StrengthDirection) {\r\n super(ecClass, name, PropertyType.Navigation);\r\n this._relationshipClass = relationship;\r\n\r\n this._direction = (direction !== undefined) ? direction : StrengthDirection.Forward;\r\n }\r\n}\r\n\r\ntype Constructor<T> = new (...args: any[]) => T;\r\n\r\n// TODO: Consolidate all of the INT32_MAX variables.\r\nconst INT32_MAX = 2147483647;\r\n\r\n/** @public @preview */\r\nexport abstract class ArrayProperty extends Property {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs?: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n}\r\n\r\n// eslint-disable-next-line @typescript-eslint/naming-convention\r\nconst ArrayPropertyMixin = <T extends Constructor<Property>>(Base: T) => {\r\n return class extends Base {\r\n /** @internal */\r\n protected _minOccurs: number = 0;\r\n /** @internal */\r\n protected _maxOccurs: number = INT32_MAX;\r\n\r\n public get minOccurs() { return this._minOccurs; }\r\n public get maxOccurs() { return this._maxOccurs; }\r\n\r\n constructor(...args: any[]) {\r\n super(...args);\r\n this._type = PropertyTypeUtils.asArray(this.propertyType);\r\n }\r\n\r\n public override fromJSONSync(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n super.fromJSONSync(arrayPropertyProps);\r\n if (undefined !== arrayPropertyProps.minOccurs) {\r\n this._minOccurs = arrayPropertyProps.minOccurs;\r\n }\r\n\r\n if (undefined !== arrayPropertyProps.maxOccurs) {\r\n this._maxOccurs = arrayPropertyProps.maxOccurs;\r\n }\r\n }\r\n\r\n public override async fromJSON(arrayPropertyProps: PrimitiveArrayPropertyProps) {\r\n this.fromJSONSync(arrayPropertyProps);\r\n }\r\n\r\n /**\r\n * Save this ArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): ArrayPropertyProps {\r\n const schemaJson = super.toJSON() as any;\r\n schemaJson.minOccurs = this.minOccurs;\r\n if (this.maxOccurs !== undefined)\r\n schemaJson.maxOccurs = this.maxOccurs;\r\n return schemaJson;\r\n }\r\n\r\n /** @internal */\r\n public override async toXml(schemaXml: Document): Promise<Element> {\r\n const itemElement = await super.toXml(schemaXml);\r\n itemElement.setAttribute(\"minOccurs\", this.minOccurs.toString());\r\n if (this.maxOccurs)\r\n itemElement.setAttribute(\"maxOccurs\", this.maxOccurs.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMinOccurs(minOccurs: number) {\r\n this._minOccurs = minOccurs;\r\n }\r\n\r\n /**\r\n * @internal Used in schema editing.\r\n */\r\n protected setMaxOccurs(maxOccurs: number) {\r\n this._maxOccurs = maxOccurs;\r\n }\r\n } as Constructor<Property> as typeof Base & Constructor<ArrayProperty>;\r\n};\r\n\r\n/** @public @preview */\r\nexport class PrimitiveArrayProperty extends ArrayPropertyMixin(PrimitiveProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, primitiveType: PrimitiveType = PrimitiveType.Integer) {\r\n super(ecClass, name, primitiveType);\r\n }\r\n\r\n /**\r\n * Save this PrimitiveArrayProperty's properties to an object for serializing to JSON.\r\n */\r\n public override toJSON(): PrimitiveArrayPropertyProps {\r\n return super.toJSON();\r\n }\r\n\r\n}\r\n\r\n/** @public @preview */\r\nexport class EnumerationArrayProperty extends ArrayPropertyMixin(EnumerationProperty) {\r\n constructor(ecClass: ECClass, name: string, type: LazyLoadedEnumeration) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport class StructArrayProperty extends ArrayPropertyMixin(StructProperty) {\r\n /** @internal */\r\n constructor(ecClass: ECClass, name: string, type: StructClass) {\r\n super(ecClass, name, type);\r\n }\r\n}\r\n\r\n/** @public @preview */\r\nexport type AnyArrayProperty = PrimitiveArrayProperty | EnumerationArrayProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyPrimitiveProperty = PrimitiveProperty | PrimitiveArrayProperty;\r\n/** @public @preview */\r\nexport type AnyEnumerationProperty = EnumerationProperty | EnumerationArrayProperty;\r\n/** @public @preview */\r\nexport type AnyStructProperty = StructProperty | StructArrayProperty;\r\n/** @public @preview */\r\nexport type AnyProperty = AnyPrimitiveProperty | AnyEnumerationProperty | AnyStructProperty | NavigationProperty;\r\n\r\n/**\r\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\r\n * @internal\r\n */\r\nexport abstract class MutableProperty extends Property {\r\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\r\n}\r\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RelationshipClass.d.ts","sourceRoot":"","sources":["../../../src/Metadata/RelationshipClass.ts"],"names":[],"mappings":"AAIA;;GAEG;AAIH,OAAO,EAAE,sBAAsB,EAAE,2BAA2B,EAAE,MAAM,8BAA8B,CAAC;AAEnG,OAAO,EACL,eAAe,EAAyC,eAAe,EAAE,cAAc,EAAE,iBAAiB,EACxF,YAAY,EAC/B,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,qCAAqC,EAAE,MAAM,eAAe,CAAC;AAEtE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,6BAA6B,EAAE,kBAAkB,EAA6B,MAAM,mBAAmB,CAAC;AAGlI,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,OAAO;IAC5C,SAAyB,cAAc,iBAAoC;IAC3E,gBAAgB;IAChB,WAA2B,cAAc,mBAA+C;IACxF,gBAAgB;IAChB,SAAS,CAAC,SAAS,EAAE,YAAY,CAAC;IAClC,gBAAgB;IAChB,SAAS,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IAChD,gBAAgB;IAChB,SAAS,CAAC,OAAO,EAAE,sBAAsB,CAAC;IAC1C,gBAAgB;IAChB,SAAS,CAAC,OAAO,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gBACJ,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;WAKpC,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAmBpE,MAAM,CAAC,GAAG,EAAE,wBAAwB,GAAG,OAAO;IAI9C,QAAQ,IAAI,MAAM;CAG1B;AAED;;;GAGG;AACH,8BAAsB,wBAAyB,SAAQ,iBAAiB;IACtE,IAAoB,MAAM,IAA4B,6BAA6B,CAAG;IACtF,IAAoB,MAAM,IAA4B,6BAA6B,CAAG;aAC7D,WAAW,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;aACzC,oBAAoB,CAAC,SAAS,EAAE,iBAAiB,GAAG,IAAI;aACxD,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;aACpJ,4BAA4B,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,iBAAiB,GAAG,kBAAkB;aAC/I,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -277,14 +277,15 @@ export class RelationshipConstraint {
|
|
|
277
277
|
this._multiplicity = parsedMultiplicity;
|
|
278
278
|
const relClassSchema = this.relationshipClass.schema;
|
|
279
279
|
if (undefined !== relationshipConstraintProps.abstractConstraint) {
|
|
280
|
-
const
|
|
280
|
+
const abstractConstraint = relationshipConstraintProps.abstractConstraint;
|
|
281
|
+
const abstractConstraintSchemaItemKey = relClassSchema.getSchemaItemKey(abstractConstraint);
|
|
281
282
|
if (!abstractConstraintSchemaItemKey)
|
|
282
|
-
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${
|
|
283
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${abstractConstraint}.`);
|
|
283
284
|
this.setAbstractConstraint(new DelayedPromiseWithProps(abstractConstraintSchemaItemKey, async () => {
|
|
284
|
-
const tempAbstractConstraint = await relClassSchema.lookupItem(
|
|
285
|
+
const tempAbstractConstraint = await relClassSchema.lookupItem(abstractConstraint);
|
|
285
286
|
if (undefined === tempAbstractConstraint ||
|
|
286
287
|
(!EntityClass.isEntityClass(tempAbstractConstraint) && !Mixin.isMixin(tempAbstractConstraint) && !RelationshipClass.isRelationshipClass(tempAbstractConstraint)))
|
|
287
|
-
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${
|
|
288
|
+
throw new ECSchemaError(ECSchemaStatus.InvalidECJson, `Unable to locate the abstractConstraint ${abstractConstraint}.`);
|
|
288
289
|
return tempAbstractConstraint;
|
|
289
290
|
}));
|
|
290
291
|
}
|