@itwin/ecschema-metadata 5.0.0-dev.32 → 5.0.0-dev.34
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/lib/cjs/Constants.js +20 -20
- package/lib/cjs/Constants.js.map +1 -1
- package/lib/cjs/DelayedPromise.js +1 -1
- package/lib/cjs/DelayedPromise.js.map +1 -1
- package/lib/cjs/Metadata/Class.d.ts +1 -2
- package/lib/cjs/Metadata/Class.d.ts.map +1 -1
- package/lib/cjs/Metadata/Class.js +2 -2
- package/lib/cjs/Metadata/Class.js.map +1 -1
- package/lib/cjs/Metadata/Constant.d.ts +1 -1
- package/lib/cjs/Metadata/Constant.d.ts.map +1 -1
- package/lib/cjs/Metadata/Constant.js.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts +2 -4
- package/lib/cjs/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/CustomAttributeClass.js +4 -4
- package/lib/cjs/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.d.ts +2 -4
- 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/Enumeration.d.ts +1 -1
- package/lib/cjs/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/cjs/Metadata/Enumeration.js.map +1 -1
- package/lib/cjs/Metadata/Format.d.ts +1 -1
- package/lib/cjs/Metadata/Format.d.ts.map +1 -1
- package/lib/cjs/Metadata/Format.js.map +1 -1
- package/lib/cjs/Metadata/InvertedUnit.d.ts +1 -3
- package/lib/cjs/Metadata/InvertedUnit.d.ts.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.d.ts +1 -3
- package/lib/cjs/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/cjs/Metadata/KindOfQuantity.js +6 -6
- package/lib/cjs/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts +1 -1
- package/lib/cjs/Metadata/Mixin.d.ts.map +1 -1
- package/lib/cjs/Metadata/Mixin.js.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts +1 -1
- package/lib/cjs/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/cjs/Metadata/Phenomenon.js.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts +1 -1
- package/lib/cjs/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/cjs/Metadata/PropertyCategory.js.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts +1 -1
- package/lib/cjs/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/cjs/Metadata/RelationshipClass.js +4 -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/Unit.d.ts +1 -1
- package/lib/cjs/Metadata/Unit.d.ts.map +1 -1
- package/lib/cjs/Metadata/Unit.js.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.d.ts +1 -3
- package/lib/cjs/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/cjs/Metadata/UnitSystem.js +2 -2
- package/lib/cjs/Metadata/UnitSystem.js.map +1 -1
- package/lib/cjs/UnitConversion/UnitConversion.js +2 -2
- package/lib/cjs/UnitConversion/UnitConversion.js.map +1 -1
- package/lib/esm/Constants.js +20 -20
- package/lib/esm/Constants.js.map +1 -1
- package/lib/esm/DelayedPromise.js +1 -1
- package/lib/esm/DelayedPromise.js.map +1 -1
- package/lib/esm/Metadata/Class.d.ts +1 -2
- package/lib/esm/Metadata/Class.d.ts.map +1 -1
- package/lib/esm/Metadata/Class.js +2 -2
- package/lib/esm/Metadata/Class.js.map +1 -1
- package/lib/esm/Metadata/Constant.d.ts +1 -1
- package/lib/esm/Metadata/Constant.d.ts.map +1 -1
- package/lib/esm/Metadata/Constant.js.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.d.ts +2 -4
- package/lib/esm/Metadata/CustomAttributeClass.d.ts.map +1 -1
- package/lib/esm/Metadata/CustomAttributeClass.js +4 -4
- package/lib/esm/Metadata/CustomAttributeClass.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.d.ts +2 -4
- 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/Enumeration.d.ts +1 -1
- package/lib/esm/Metadata/Enumeration.d.ts.map +1 -1
- package/lib/esm/Metadata/Enumeration.js.map +1 -1
- package/lib/esm/Metadata/Format.d.ts +1 -1
- package/lib/esm/Metadata/Format.d.ts.map +1 -1
- package/lib/esm/Metadata/Format.js.map +1 -1
- package/lib/esm/Metadata/InvertedUnit.d.ts +1 -3
- package/lib/esm/Metadata/InvertedUnit.d.ts.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.d.ts +1 -3
- package/lib/esm/Metadata/KindOfQuantity.d.ts.map +1 -1
- package/lib/esm/Metadata/KindOfQuantity.js +6 -6
- package/lib/esm/Metadata/KindOfQuantity.js.map +1 -1
- package/lib/esm/Metadata/Mixin.d.ts +1 -1
- package/lib/esm/Metadata/Mixin.d.ts.map +1 -1
- package/lib/esm/Metadata/Mixin.js.map +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts +1 -1
- package/lib/esm/Metadata/Phenomenon.d.ts.map +1 -1
- package/lib/esm/Metadata/Phenomenon.js.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts +1 -1
- package/lib/esm/Metadata/PropertyCategory.d.ts.map +1 -1
- package/lib/esm/Metadata/PropertyCategory.js.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts +1 -1
- package/lib/esm/Metadata/RelationshipClass.d.ts.map +1 -1
- package/lib/esm/Metadata/RelationshipClass.js +4 -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/Unit.d.ts +1 -1
- package/lib/esm/Metadata/Unit.d.ts.map +1 -1
- package/lib/esm/Metadata/Unit.js.map +1 -1
- package/lib/esm/Metadata/UnitSystem.d.ts +1 -3
- package/lib/esm/Metadata/UnitSystem.d.ts.map +1 -1
- package/lib/esm/Metadata/UnitSystem.js +2 -2
- package/lib/esm/Metadata/UnitSystem.js.map +1 -1
- package/lib/esm/UnitConversion/UnitConversion.js +2 -2
- package/lib/esm/UnitConversion/UnitConversion.js.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA4E;AAC5E,8DAA2D;AAE3D,4DAAyD;AACzD,oFAAiF;AAEjF,4CAA+D;AAE/D,4CAAmE;AACnE,sCAAmC;AACnC,mCAA+C;AAC/C,yCAAsC;AACtC,uDAAkI;AAClI,iEAA8D;AAC9D,+CAA4C;AAC5C,+CAA4C;AAC5C,qCAAkC;AAClC,iDAA8C;AAC9C,qDAAkD;AAClD,mCAAgC;AAChC,6CAA0C;AAC1C,yDAAsD;AACtD,2DAAwD;AACxD,6CAA0C;AAC1C,iCAA8B;AAC9B,6CAA0C;AAE1C,MAAM,iBAAiB,GAAG,qDAAqD,CAAC;AAChF,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;AAE5E;;GAEG;AACH,MAAa,MAAM;IAkCjB,gBAAgB;IAChB,YAAY,OAAsB,EAAE,SAA8B,EAAE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QAAQ,CAAC,KAAa;QAC9B,IAAI,CAAC,eAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YAC5B,MAAM,IAAI,0BAAc,CAAC,2BAAe,CAAC,aAAa,EAAE,wCAAwC,CAAC,CAAC;QACpG,CAAC;QACD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;;AA/tBH,wBAguBC;AA/tBgB,4BAAqB,GAAG,KAAK,CAAC;AAiuB/C;;;;;GAKG;AACH,MAAsB,aAAc,SAAQ,MAAM;CAuCjD;AAvCD,sCAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaContext } from \"../Context\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { JsonParser } from \"../Deserialization/JsonParser\";\nimport { SchemaProps } from \"../Deserialization/JsonProps\";\nimport { XmlParser } from \"../Deserialization/XmlParser\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { ECClassModifier, PrimitiveType } from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { AnyClass, AnySchemaItem, SchemaInfo } from \"../Interfaces\";\nimport { ECVersion, SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { Constant } from \"./Constant\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { CustomAttributeClass } from \"./CustomAttributeClass\";\nimport { EntityClass } from \"./EntityClass\";\nimport { Enumeration } from \"./Enumeration\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { Mixin } from \"./Mixin\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\nimport { UnitSystem } from \"./UnitSystem\";\n\nconst SCHEMAURL3_2_JSON = \"https://dev.bentley.com/json_schemas/ec/32/ecschema\";\nconst SCHEMAURL3_2_XML = \"http://www.bentley.com/schemas/Bentley.ECXML.3.2\";\n\n/**\n * @beta\n */\nexport class Schema implements CustomAttributeContainerProps {\n private static _currentECSpecVersion = \"3.2\";\n private _context: SchemaContext;\n protected _schemaKey?: SchemaKey;\n protected _alias?: string;\n protected _label?: string;\n protected _description?: string;\n public readonly references: Schema[];\n private readonly _items: Map<string, SchemaItem>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _originalECSpecMajorVersion?: number;\n private _originalECSpecMinorVersion?: number;\n /**\n * Constructs an empty Schema with the given name and version in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param name The schema's name\n * @param readVersion The integer read (major) version of the schema\n * @param writeVersion The integer write version of the schema\n * @param minorVersion The integer minor version of the schema\n */\n constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);\n /**\n * Constructs an empty Schema with the given key in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param key A SchemaKey that uniquely identifies the schema\n */\n constructor(context: SchemaContext, key: SchemaKey, alias: string);\n /**\n * Constructs an empty Schema (without a SchemaKey) in the provided context.\n * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @internal\n */\n constructor(context: SchemaContext);\n /** @internal */\n constructor(context: SchemaContext, nameOrKey?: SchemaKey | string, alias?: string, readVer?: number, writeVer?: number, minorVer?: number) {\n this._schemaKey = (typeof (nameOrKey) === \"string\") ? new SchemaKey(nameOrKey, new ECVersion(readVer as number, writeVer, minorVer)) : nameOrKey;\n this._context = context;\n this.references = [];\n this._items = new Map<string, SchemaItem>();\n\n if (alias !== undefined && ECName.validate(alias)) {\n this._alias = alias;\n } else if (nameOrKey !== undefined) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n }\n\n this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;\n this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;\n }\n\n public get schemaKey() {\n if (undefined === this._schemaKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this._schemaKey;\n }\n\n public get name() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.name;\n }\n\n public get readVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.readVersion;\n }\n\n public get writeVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.writeVersion;\n }\n\n public get minorVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.minorVersion;\n }\n\n public get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }\n public get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }\n public static get currentECSpecMajorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[0], 10); }\n public static get currentECSpecMinorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[1], 10); }\n\n public get alias() {\n if (this._alias === undefined || this._alias === null) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n } else { return this._alias; }\n }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the schema name. */\n public get fullName() { return this.schemaKey.name; }\n\n /** Returns the schema. */\n public get schema(): Schema { return this; }\n\n /** Returns the schema context this schema is within. */\n public get context(): SchemaContext { return this._context; }\n\n /**\n * Returns a SchemaItemKey given the item name and the schema it belongs to\n * @param fullName fully qualified name {Schema name}.{Item Name}\n */\n public getSchemaItemKey(fullName: string): SchemaItemKey {\n const [schemaName, itemName] = SchemaItem.parseFullName(fullName);\n let schemaKey = this.schemaKey;\n if (this.name !== schemaName) {\n const newSchemaRef = this.getReferenceSync(schemaName);\n if (undefined === newSchemaRef)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);\n schemaKey = newSchemaRef.schemaKey;\n }\n return new SchemaItemKey(itemName, schemaKey);\n }\n\n protected addItem<T extends SchemaItem>(item: T): void {\n if (undefined !== this.getItemSync(item.name))\n throw new ECObjectsError(ECObjectsStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);\n\n this._items.set(item.name.toUpperCase(), item);\n }\n\n /**\n * @alpha\n */\n protected createClass<T extends AnyClass>(type: (new (_schema: Schema, _name: string, _modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T {\n const item = new type(this, name, modifier);\n this.addItem(item);\n return item;\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected async deleteClass(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (ECClass.isECClass(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected deleteClassSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (ECClass.isECClass(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected async deleteSchemaItem(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (SchemaItem.isSchemaItem(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected deleteSchemaItemSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (SchemaItem.isSchemaItem(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * @alpha\n */\n protected createItem<T extends AnySchemaItem>(type: (new (_schema: Schema, _name: string) => T), name: string): T {\n const item = new type(this, name);\n this.addItem(item);\n return item;\n }\n\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /**\n * Creates a EntityClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass> {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /**\n * Creates a Mixin with the provided name in this schema.\n * @param name\n */\n protected async createMixinClass(name: string): Promise<Mixin> { return this.createClass<Mixin>(Mixin, name); }\n protected createMixinClassSync(name: string): Mixin { return this.createClass<Mixin>(Mixin, name); }\n\n /**\n * Creates a StructClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass> {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /**\n * Creates a CustomAttributeClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass> {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /**\n * Creates a RelationshipClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass> {\n return this.createRelationshipClassSync(name, modifier);\n }\n\n protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass {\n return this.createClass<RelationshipClass>(RelationshipClass, name, modifier);\n }\n\n /**\n * Creates an Enumeration with the provided name in this schema.\n * @param name\n */\n protected async createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration> {\n return this.createEnumerationSync(name, primitiveType);\n }\n\n protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration {\n const item = new Enumeration(this, name, primitiveType);\n this.addItem(item);\n return item;\n }\n\n /**\n * Creates an KindOfQuantity with the provided name in this schema.\n * @param name\n */\n protected async createKindOfQuantity(name: string): Promise<KindOfQuantity> {\n return this.createKindOfQuantitySync(name);\n }\n\n protected createKindOfQuantitySync(name: string): KindOfQuantity {\n return this.createItem<KindOfQuantity>(KindOfQuantity, name);\n }\n\n /**\n * Creates a Constant with the provided name in this schema.\n * @param name\n */\n protected async createConstant(name: string): Promise<Constant> {\n return this.createItem<Constant>(Constant, name);\n }\n\n protected createConstantSync(name: string): Constant {\n return this.createItem<Constant>(Constant, name);\n }\n\n /**\n * Creates a Inverted Unit with the provided name in this schema.\n * @param name\n */\n protected async createInvertedUnit(name: string): Promise<InvertedUnit> {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n protected createInvertedUnitSync(name: string): InvertedUnit {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /**\n * Creates an Format with the provided name in this schema.\n * @param name\n */\n protected async createFormat(name: string): Promise<Format> {\n return this.createItem<Format>(Format, name);\n }\n\n protected createFormatSync(name: string): Format {\n return this.createItem<Format>(Format, name);\n }\n\n /**\n * Creates a UnitSystem with the provided name in this schema.\n * @param name\n */\n protected async createUnitSystem(name: string): Promise<UnitSystem> {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n protected createUnitSystemSync(name: string): UnitSystem {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /**\n * Creates a Phenomenon with the provided name in this schema.\n * @param name\n */\n protected async createPhenomenon(name: string): Promise<Phenomenon> {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n protected createPhenomenonSync(name: string): Phenomenon {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /**\n * Creates a Unit with the provided name in this schema.\n * @param name\n */\n protected async createUnit(name: string): Promise<Unit> {\n return this.createItem<Unit>(Unit, name);\n }\n\n protected createUnitSync(name: string): Unit {\n return this.createItem<Unit>(Unit, name);\n }\n\n /**\n * Creates an PropertyCategory with the provided name in this schema.\n * @param name\n */\n protected async createPropertyCategory(name: string): Promise<PropertyCategory> {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n protected createPropertyCategorySync(name: string): PropertyCategory {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n /**\n *\n * @param refSchema\n */\n protected async addReference(refSchema: Schema): Promise<void> {\n // TODO validation of reference schema. For now just adding\n this.addReferenceSync(refSchema);\n }\n\n protected addReferenceSync(refSchema: Schema): void {\n this.references.push(refSchema);\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setContext(context: SchemaContext): void {\n this._context = context;\n }\n\n /**\n * Sets the version of the SchemaKey identifying the schema.\n * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.\n */\n public setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void {\n if (!this._schemaKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);\n\n const newVersion = new ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);\n this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public async getItem<T extends SchemaItem>(name: string): Promise<T | undefined> {\n // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version\n return this.getItemSync<T>(name);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public getItemSync<T extends SchemaItem>(name: string): T | undefined {\n // Case-insensitive search\n return this._items.get(name.toUpperCase()) as T;\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public async lookupItem<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): Promise<T | undefined> {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return this.getItem<T>(itemName);\n }\n\n const refSchema = await this.getReference(schemaName);\n if (!refSchema)\n return undefined;\n\n return refSchema.getItem<T>(itemName);\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public lookupItemSync<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): T | undefined {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return this.getItemSync<T>(itemName);\n }\n\n const refSchema = this.getReferenceSync(schemaName);\n if (!refSchema)\n return undefined;\n\n return refSchema.getItemSync<T>(itemName);\n }\n\n public getItems<T extends AnySchemaItem>(): IterableIterator<T> {\n if (!this._items)\n return new Map<string, SchemaItem>().values() as IterableIterator<T>;\n\n return this._items.values() as IterableIterator<T>;\n }\n\n public *getClasses(): IterableIterator<ECClass> {\n for (const [, value] of this._items) {\n if (ECClass.isECClass(value))\n yield value;\n }\n }\n\n public async getReference<T extends Schema>(refSchemaName: string): Promise<T | undefined> {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase()) as T;\n }\n\n public getReferenceNameByAlias(alias: string): string | undefined {\n if (this.references.length === 0)\n return undefined;\n\n const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);\n return schema ? schema.name : undefined;\n }\n\n public getReferenceSync<T extends Schema>(refSchemaName: string): T | undefined {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase()) as T;\n }\n\n /**\n * Save this Schema's properties to an object for serializing to JSON.\n */\n public toJSON(): SchemaProps {\n if (!this.isECSpecVersionSupported())\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaJson: { [value: string]: any } = {};\n schemaJson.$schema = SCHEMAURL3_2_JSON; // $schema is required\n schemaJson.name = this.name; // name is required\n schemaJson.version = this.schemaKey.version.toString(true);\n schemaJson.alias = this.alias; // alias is required\n if (undefined !== this.label) // label is optional\n schemaJson.label = this.label;\n if (undefined !== this.description) // description is optional\n schemaJson.description = this.description;\n if (undefined !== this.references && this.references.length > 0) // references is optional\n schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n if (this._items.size > 0) {\n schemaJson.items = {};\n this._items.forEach((schemaItem: SchemaItem) => {\n schemaJson.items[schemaItem.name] = schemaItem.toJSON(false, true);\n });\n }\n return schemaJson as SchemaProps;\n }\n\n /**\n * Converts the schema to a DOM XML Document.\n * @param schemaXml An empty DOM document to which the schema will be written\n */\n public async toXml(schemaXml: Document): Promise<Document> {\n if (!this.isECSpecVersionSupported())\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaMetadata = schemaXml.createElement(\"ECSchema\");\n schemaMetadata.setAttribute(\"xmlns\", SCHEMAURL3_2_XML);\n schemaMetadata.setAttribute(\"version\", this.schemaKey.version.toString());\n schemaMetadata.setAttribute(\"schemaName\", this.name);\n schemaMetadata.setAttribute(\"alias\", this.alias ? this.alias : \"\");\n if (undefined !== this.label)\n schemaMetadata.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.description)\n schemaMetadata.setAttribute(\"description\", this.description);\n\n // Map used for CA serialization\n const refSchemaMap = new Map<string, string>();\n\n this.references.forEach(({ name, schemaKey, alias }) => {\n const schemaRef = schemaXml.createElement(\"ECSchemaReference\");\n schemaRef.setAttribute(\"name\", name);\n schemaRef.setAttribute(\"version\", schemaKey.version.toString());\n schemaRef.setAttribute(\"alias\", alias ? alias : \"\");\n schemaMetadata.appendChild(schemaRef);\n refSchemaMap.set(name, schemaKey.version.toString());\n });\n\n if (this._customAttributes) {\n const parentElem = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElem = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);\n parentElem.appendChild(caElem);\n }\n schemaMetadata.appendChild(parentElem);\n }\n\n for (const [, item] of this._items) {\n const itemXml = await item.toXml(schemaXml);\n schemaMetadata.appendChild(itemXml);\n }\n\n schemaXml.appendChild(schemaMetadata);\n return schemaXml;\n }\n\n // Check if the ECSpecVersion read-version is greater than the current ECSpecVersion supported.\n // If a specific ECSpecVersion is given, check against that version.\n // If no argument is given, check against the original ECSpecVersion of the schema.\n private isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck?: number): boolean {\n // If argument is supplied, check the argument against the current ECSpecVersion supported\n if (ecSpecMajorVersionToCheck !== undefined)\n return (Schema.currentECSpecMajorVersion >= ecSpecMajorVersionToCheck);\n\n // If argument is not supplied, check against the original ECSpecVersion of the schema\n if (this.originalECSpecMajorVersion === undefined)\n return false;\n return (Schema.currentECSpecMajorVersion >= this.originalECSpecMajorVersion);\n }\n\n // Check if the full ECSpecVersion is greater than the current ECSpecVersion supported.\n // If a specific ECSpecVersion is given, check against that version.\n // If no argument is given, check against the original ECSpecVersion of the schema.\n private isECSpecVersionSupported(ecSpecMajorVersionToCheck?: number, ecSpecMinorVersionToCheck?: number): boolean {\n // If arguments are supplied, check the arguments against the current ECSpecVersion supported\n if (ecSpecMajorVersionToCheck !== undefined && ecSpecMinorVersionToCheck !== undefined) {\n if (!this.isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck))\n return false;\n return (Schema.currentECSpecMinorVersion >= ecSpecMinorVersionToCheck);\n }\n // If arguments are not supplied, check against the original ECSpecVersion of the schema\n if (!this.isECSpecMajorVersionSupported() || this.originalECSpecMinorVersion === undefined)\n return false;\n return (Schema.currentECSpecMinorVersion >= this.originalECSpecMinorVersion);\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public fromJSONSync(schemaProps: SchemaProps) {\n if (undefined === this._schemaKey) {\n const schemaName = schemaProps.name;\n const version = ECVersion.fromString(schemaProps.version);\n this._schemaKey = new SchemaKey(schemaName, version);\n } else {\n if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);\n if (this.schemaKey.version.compare(ECVersion.fromString(schemaProps.version)))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);\n }\n\n if (schemaProps.$schema.match(`https://dev\\\\.bentley\\\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\\\\.([0-9]+)`) == null)\n throw new ECObjectsError(ECObjectsStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);\n\n // The schema props have not been parsed. Parse the ECXml version from the $schema attribute\n let ecVersion: ECSpecVersion;\n if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {\n ecVersion = ((schemaProps.$schema.search(\"ECXML\") !== -1) ? XmlParser.parseXmlNamespace(schemaProps.$schema) : JsonParser.parseJSUri(schemaProps.$schema)) as ECSpecVersion;\n } else {\n ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion } as ECSpecVersion;\n }\n\n this._originalECSpecMajorVersion = ecVersion?.readVersion;\n this._originalECSpecMinorVersion = ecVersion?.writeVersion;\n\n if (!this.isECSpecMajorVersionSupported(ecVersion?.readVersion))\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECVersion and cannot be loaded.`);\n\n if (ECName.validate(schemaProps.alias)) {\n this._alias = schemaProps.alias;\n } else {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);\n }\n\n if (undefined !== schemaProps.label)\n this._label = schemaProps.label;\n\n if (undefined !== schemaProps.description)\n this._description = schemaProps.description;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public async fromJSON(schemaProps: SchemaProps) {\n this.fromJSONSync(schemaProps);\n }\n\n /**\n * Completely loads the SchemaInfo from the input json and starts loading the entire schema. The complete schema can be retrieved from the\n * schema context using the getCachedSchema method\n */\n public static async startLoadingFromJson(jsonObj: object | string, context: SchemaContext): Promise<SchemaInfo> {\n const schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n return reader.readSchemaInfo(schema, rawSchema);\n }\n\n public static async fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema> {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = await reader.readSchema(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * Completely loads the Schema from the input json. The schema is cached in the schema context.\n */\n public static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = reader.readSchemaSync(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * @internal\n */\n public static isSchema(object: any): object is Schema {\n const schema = object as Schema;\n\n return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setDisplayLabel(displayLabel: string) {\n this._label = displayLabel;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setAlias(alias: string) {\n if (!ECName.validate(alias)) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECName, \"The specified schema alias is invalid.\");\n }\n this._alias = alias;\n }\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\n * would prevent this class from extending Schema.\n * @internal\n */\nexport abstract class MutableSchema extends Schema {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\n public abstract override createMixinClass(name: string): Promise<Mixin>;\n public abstract override createMixinClassSync(name: string): Mixin;\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\n public abstract override createUnit(name: string): Promise<Unit>;\n public abstract override createUnitSync(name: string): Unit;\n public abstract override createConstant(name: string): Promise<Constant>;\n public abstract override createConstantSync(name: string): Constant;\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\n public abstract override createPhenomenonSync(name: string): Phenomenon;\n public abstract override createFormat(name: string): Promise<Format>;\n public abstract override createFormatSync(name: string): Format;\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\n public abstract override createUnitSystemSync(name: string): UnitSystem;\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\n public abstract override addItem<T extends SchemaItem>(item: T): void;\n public abstract override addReference(refSchema: Schema): Promise<void>;\n public abstract override addReferenceSync(refSchema: Schema): void;\n public abstract override setContext(schemaContext: SchemaContext): void;\n public abstract override deleteClass(name: string): Promise<void>;\n public abstract override deleteClassSync(name: string): void;\n public abstract override deleteSchemaItem(name: string): Promise<void>;\n public abstract override deleteSchemaItemSync(name: string): void;\n public abstract override setAlias(alias: string): void;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"Schema.js","sourceRoot":"","sources":["../../../src/Metadata/Schema.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,sDAA4E;AAC5E,8DAA2D;AAE3D,4DAAyD;AACzD,oFAAiF;AAEjF,4CAA+D;AAE/D,4CAAmE;AACnE,sCAAmC;AACnC,mCAA+C;AAC/C,yCAAsC;AACtC,uDAAkI;AAClI,iEAA8D;AAC9D,+CAA4C;AAC5C,+CAA4C;AAC5C,qCAAkC;AAClC,iDAA8C;AAC9C,qDAAkD;AAClD,mCAAgC;AAChC,6CAA0C;AAC1C,yDAAsD;AACtD,2DAAwD;AACxD,6CAA0C;AAC1C,iCAA8B;AAC9B,6CAA0C;AAE1C,MAAM,iBAAiB,GAAG,qDAAqD,CAAC;AAChF,MAAM,gBAAgB,GAAG,kDAAkD,CAAC;AAE5E;;GAEG;AACH,MAAa,MAAM;aACF,0BAAqB,GAAG,KAAK,CAAC;IAiC7C,gBAAgB;IAChB,YAAY,OAAsB,EAAE,SAA8B,EAAE,KAAc,EAAE,OAAgB,EAAE,QAAiB,EAAE,QAAiB;QACxI,IAAI,CAAC,UAAU,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,qBAAS,CAAC,SAAS,EAAE,IAAI,qBAAS,CAAC,OAAiB,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACjJ,IAAI,CAAC,QAAQ,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AuCjD;AAvCD,sCAuCC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaContext } from \"../Context\";\nimport { ECSpecVersion, SchemaReadHelper } from \"../Deserialization/Helper\";\nimport { JsonParser } from \"../Deserialization/JsonParser\";\nimport { SchemaProps } from \"../Deserialization/JsonProps\";\nimport { XmlParser } from \"../Deserialization/XmlParser\";\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\nimport { ECClassModifier, PrimitiveType } from \"../ECObjects\";\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\nimport { AnyClass, AnySchemaItem, SchemaInfo } from \"../Interfaces\";\nimport { ECVersion, SchemaItemKey, SchemaKey } from \"../SchemaKey\";\nimport { ECName } from \"../ECName\";\nimport { ECClass, StructClass } from \"./Class\";\nimport { Constant } from \"./Constant\";\nimport { CustomAttribute, CustomAttributeContainerProps, CustomAttributeSet, serializeCustomAttributes } from \"./CustomAttribute\";\nimport { CustomAttributeClass } from \"./CustomAttributeClass\";\nimport { EntityClass } from \"./EntityClass\";\nimport { Enumeration } from \"./Enumeration\";\nimport { Format } from \"./Format\";\nimport { InvertedUnit } from \"./InvertedUnit\";\nimport { KindOfQuantity } from \"./KindOfQuantity\";\nimport { Mixin } from \"./Mixin\";\nimport { Phenomenon } from \"./Phenomenon\";\nimport { PropertyCategory } from \"./PropertyCategory\";\nimport { RelationshipClass } from \"./RelationshipClass\";\nimport { SchemaItem } from \"./SchemaItem\";\nimport { Unit } from \"./Unit\";\nimport { UnitSystem } from \"./UnitSystem\";\n\nconst SCHEMAURL3_2_JSON = \"https://dev.bentley.com/json_schemas/ec/32/ecschema\";\nconst SCHEMAURL3_2_XML = \"http://www.bentley.com/schemas/Bentley.ECXML.3.2\";\n\n/**\n * @beta\n */\nexport class Schema implements CustomAttributeContainerProps {\n private static _currentECSpecVersion = \"3.2\";\n private _context: SchemaContext;\n protected _schemaKey?: SchemaKey;\n protected _alias?: string;\n protected _label?: string;\n protected _description?: string;\n public readonly references: Schema[];\n private readonly _items: Map<string, SchemaItem>;\n private _customAttributes?: Map<string, CustomAttribute>;\n private _originalECSpecMajorVersion?: number;\n private _originalECSpecMinorVersion?: number;\n /**\n * Constructs an empty Schema with the given name and version in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param name The schema's name\n * @param readVersion The integer read (major) version of the schema\n * @param writeVersion The integer write version of the schema\n * @param minorVersion The integer minor version of the schema\n */\n constructor(context: SchemaContext, name: string, alias: string, readVersion: number, writeVersion: number, minorVersion: number);\n /**\n * Constructs an empty Schema with the given key in the provided context.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @param key A SchemaKey that uniquely identifies the schema\n */\n constructor(context: SchemaContext, key: SchemaKey, alias: string);\n /**\n * Constructs an empty Schema (without a SchemaKey) in the provided context.\n * This should only be used when the schema name and version will be deserialized (via `fromJson()`) immediately after this Schema is instantiated.\n * @param context The SchemaContext that will control the lifetime of the schema\n * @internal\n */\n constructor(context: SchemaContext);\n /** @internal */\n constructor(context: SchemaContext, nameOrKey?: SchemaKey | string, alias?: string, readVer?: number, writeVer?: number, minorVer?: number) {\n this._schemaKey = (typeof (nameOrKey) === \"string\") ? new SchemaKey(nameOrKey, new ECVersion(readVer as number, writeVer, minorVer)) : nameOrKey;\n this._context = context;\n this.references = [];\n this._items = new Map<string, SchemaItem>();\n\n if (alias !== undefined && ECName.validate(alias)) {\n this._alias = alias;\n } else if (nameOrKey !== undefined) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n }\n\n this._originalECSpecMajorVersion = Schema.currentECSpecMajorVersion;\n this._originalECSpecMinorVersion = Schema.currentECSpecMinorVersion;\n }\n\n public get schemaKey() {\n if (undefined === this._schemaKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this._schemaKey;\n }\n\n public get name() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.name;\n }\n\n public get readVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.readVersion;\n }\n\n public get writeVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.writeVersion;\n }\n\n public get minorVersion() {\n if (this._schemaKey === undefined)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The schema has an invalid or missing SchemaKey.`);\n return this.schemaKey.minorVersion;\n }\n\n public get originalECSpecMajorVersion() { return this._originalECSpecMajorVersion; }\n public get originalECSpecMinorVersion() { return this._originalECSpecMinorVersion; }\n public static get currentECSpecMajorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[0], 10); }\n public static get currentECSpecMinorVersion(): number { return parseInt(Schema._currentECSpecVersion.split(\".\")[1], 10); }\n\n public get alias() {\n if (this._alias === undefined || this._alias === null) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not have the required 'alias' attribute.`);\n } else { return this._alias; }\n }\n\n public get label() { return this._label; }\n\n public get description() { return this._description; }\n\n public get customAttributes(): CustomAttributeSet | undefined { return this._customAttributes; }\n\n /** Returns the schema name. */\n public get fullName() { return this.schemaKey.name; }\n\n /** Returns the schema. */\n public get schema(): Schema { return this; }\n\n /** Returns the schema context this schema is within. */\n public get context(): SchemaContext { return this._context; }\n\n /**\n * Returns a SchemaItemKey given the item name and the schema it belongs to\n * @param fullName fully qualified name {Schema name}.{Item Name}\n */\n public getSchemaItemKey(fullName: string): SchemaItemKey {\n const [schemaName, itemName] = SchemaItem.parseFullName(fullName);\n let schemaKey = this.schemaKey;\n if (this.name !== schemaName) {\n const newSchemaRef = this.getReferenceSync(schemaName);\n if (undefined === newSchemaRef)\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to find the referenced SchemaItem ${itemName}.`);\n schemaKey = newSchemaRef.schemaKey;\n }\n return new SchemaItemKey(itemName, schemaKey);\n }\n\n protected addItem<T extends SchemaItem>(item: T): void {\n if (undefined !== this.getItemSync(item.name))\n throw new ECObjectsError(ECObjectsStatus.DuplicateItem, `The SchemaItem ${item.name} cannot be added to the schema ${this.name} because it already exists`);\n\n this._items.set(item.name.toUpperCase(), item);\n }\n\n /**\n * @alpha\n */\n protected createClass<T extends AnyClass>(type: (new (_schema: Schema, _name: string, _modifier?: ECClassModifier) => T), name: string, modifier?: ECClassModifier): T {\n const item = new type(this, name, modifier);\n this.addItem(item);\n return item;\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected async deleteClass(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (ECClass.isECClass(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a class from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected deleteClassSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (ECClass.isECClass(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected async deleteSchemaItem(name: string): Promise<void> {\n const schemaItem = await this.getItem(name);\n if (SchemaItem.isSchemaItem(schemaItem)) {\n this._items.delete(name.toUpperCase());\n }\n }\n\n /**\n * Deletes a SchemaItem from within this schema.\n * @param name the local (unqualified) class name, lookup is case-insensitive\n * @alpha\n */\n protected deleteSchemaItemSync(name: string): void {\n const schemaItem = this.getItemSync(name);\n if (SchemaItem.isSchemaItem(schemaItem))\n this._items.delete(name.toUpperCase());\n }\n\n /**\n * @alpha\n */\n protected createItem<T extends AnySchemaItem>(type: (new (_schema: Schema, _name: string) => T), name: string): T {\n const item = new type(this, name);\n this.addItem(item);\n return item;\n }\n\n protected addCustomAttribute(customAttribute: CustomAttribute) {\n if (!this._customAttributes)\n this._customAttributes = new Map<string, CustomAttribute>();\n\n this._customAttributes.set(customAttribute.className, customAttribute);\n }\n\n /**\n * Creates a EntityClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass> {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n protected createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass {\n return this.createClass<EntityClass>(EntityClass, name, modifier);\n }\n\n /**\n * Creates a Mixin with the provided name in this schema.\n * @param name\n */\n protected async createMixinClass(name: string): Promise<Mixin> { return this.createClass<Mixin>(Mixin, name); }\n protected createMixinClassSync(name: string): Mixin { return this.createClass<Mixin>(Mixin, name); }\n\n /**\n * Creates a StructClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass> {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n protected createStructClassSync(name: string, modifier?: ECClassModifier): StructClass {\n return this.createClass<StructClass>(StructClass, name, modifier);\n }\n\n /**\n * Creates a CustomAttributeClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass> {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n protected createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass {\n return this.createClass<CustomAttributeClass>(CustomAttributeClass, name, modifier);\n }\n\n /**\n * Creates a RelationshipClass with the provided name in this schema.\n * @param name\n * @param modifier\n */\n protected async createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass> {\n return this.createRelationshipClassSync(name, modifier);\n }\n\n protected createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass {\n return this.createClass<RelationshipClass>(RelationshipClass, name, modifier);\n }\n\n /**\n * Creates an Enumeration with the provided name in this schema.\n * @param name\n */\n protected async createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration> {\n return this.createEnumerationSync(name, primitiveType);\n }\n\n protected createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration {\n const item = new Enumeration(this, name, primitiveType);\n this.addItem(item);\n return item;\n }\n\n /**\n * Creates an KindOfQuantity with the provided name in this schema.\n * @param name\n */\n protected async createKindOfQuantity(name: string): Promise<KindOfQuantity> {\n return this.createKindOfQuantitySync(name);\n }\n\n protected createKindOfQuantitySync(name: string): KindOfQuantity {\n return this.createItem<KindOfQuantity>(KindOfQuantity, name);\n }\n\n /**\n * Creates a Constant with the provided name in this schema.\n * @param name\n */\n protected async createConstant(name: string): Promise<Constant> {\n return this.createItem<Constant>(Constant, name);\n }\n\n protected createConstantSync(name: string): Constant {\n return this.createItem<Constant>(Constant, name);\n }\n\n /**\n * Creates a Inverted Unit with the provided name in this schema.\n * @param name\n */\n protected async createInvertedUnit(name: string): Promise<InvertedUnit> {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n protected createInvertedUnitSync(name: string): InvertedUnit {\n return this.createItem<InvertedUnit>(InvertedUnit, name);\n }\n\n /**\n * Creates an Format with the provided name in this schema.\n * @param name\n */\n protected async createFormat(name: string): Promise<Format> {\n return this.createItem<Format>(Format, name);\n }\n\n protected createFormatSync(name: string): Format {\n return this.createItem<Format>(Format, name);\n }\n\n /**\n * Creates a UnitSystem with the provided name in this schema.\n * @param name\n */\n protected async createUnitSystem(name: string): Promise<UnitSystem> {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n protected createUnitSystemSync(name: string): UnitSystem {\n return this.createItem<UnitSystem>(UnitSystem, name);\n }\n\n /**\n * Creates a Phenomenon with the provided name in this schema.\n * @param name\n */\n protected async createPhenomenon(name: string): Promise<Phenomenon> {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n protected createPhenomenonSync(name: string): Phenomenon {\n return this.createItem<Phenomenon>(Phenomenon, name);\n }\n\n /**\n * Creates a Unit with the provided name in this schema.\n * @param name\n */\n protected async createUnit(name: string): Promise<Unit> {\n return this.createItem<Unit>(Unit, name);\n }\n\n protected createUnitSync(name: string): Unit {\n return this.createItem<Unit>(Unit, name);\n }\n\n /**\n * Creates an PropertyCategory with the provided name in this schema.\n * @param name\n */\n protected async createPropertyCategory(name: string): Promise<PropertyCategory> {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n\n protected createPropertyCategorySync(name: string): PropertyCategory {\n return this.createItem<PropertyCategory>(PropertyCategory, name);\n }\n /**\n *\n * @param refSchema\n */\n protected async addReference(refSchema: Schema): Promise<void> {\n // TODO validation of reference schema. For now just adding\n this.addReferenceSync(refSchema);\n }\n\n protected addReferenceSync(refSchema: Schema): void {\n this.references.push(refSchema);\n }\n\n /**\n * @alpha Used for schema editing.\n */\n protected setContext(context: SchemaContext): void {\n this._context = context;\n }\n\n /**\n * Sets the version of the SchemaKey identifying the schema.\n * @param readVersion The read version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param writeVersion The write version of the schema. If undefined, the value from the existing SchemaKey will be used.\n * @param minorVersion The minor version of the schema. If undefined, the value from the existing SchemaKey will be used.\n */\n public setVersion(readVersion?: number, writeVersion?: number, minorVersion?: number): void {\n if (!this._schemaKey)\n throw new ECObjectsError(ECObjectsStatus.InvalidSchemaKey, `The schema '${this.name}' has an invalid SchemaKey.`);\n\n const newVersion = new ECVersion(readVersion ?? this._schemaKey.readVersion, writeVersion ?? this._schemaKey.writeVersion, minorVersion ?? this._schemaKey.minorVersion);\n this._schemaKey = new SchemaKey(this._schemaKey.name, newVersion);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public async getItem<T extends SchemaItem>(name: string): Promise<T | undefined> {\n // this method exists so we can rewire it later when we load partial schemas, for now it is identical to the sync version\n return this.getItemSync<T>(name);\n }\n\n /**\n * Gets an item from within this schema. To get by full name use lookupItem instead.\n * @param key the local (unqualified) name, lookup is case-insensitive\n */\n public getItemSync<T extends SchemaItem>(name: string): T | undefined {\n // Case-insensitive search\n return this._items.get(name.toUpperCase()) as T;\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public async lookupItem<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): Promise<T | undefined> {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return this.getItem<T>(itemName);\n }\n\n const refSchema = await this.getReference(schemaName);\n if (!refSchema)\n return undefined;\n\n return refSchema.getItem<T>(itemName);\n }\n\n /**\n * Attempts to find a schema item within this schema or a (directly) referenced schema\n * @param key The full name or a SchemaItemKey identifying the desired item.\n */\n public lookupItemSync<T extends SchemaItem>(key: Readonly<SchemaItemKey> | string): T | undefined {\n let schemaName, itemName: string;\n if (typeof (key) === \"string\") {\n [schemaName, itemName] = SchemaItem.parseFullName(key);\n } else {\n itemName = key.name;\n schemaName = key.schemaName;\n }\n\n if (!schemaName || schemaName.toUpperCase() === this.name.toUpperCase()) {\n return this.getItemSync<T>(itemName);\n }\n\n const refSchema = this.getReferenceSync(schemaName);\n if (!refSchema)\n return undefined;\n\n return refSchema.getItemSync<T>(itemName);\n }\n\n public getItems<T extends AnySchemaItem>(): IterableIterator<T> {\n if (!this._items)\n return new Map<string, SchemaItem>().values() as IterableIterator<T>;\n\n return this._items.values() as IterableIterator<T>;\n }\n\n public *getClasses(): IterableIterator<ECClass> {\n for (const [, value] of this._items) {\n if (ECClass.isECClass(value))\n yield value;\n }\n }\n\n public async getReference<T extends Schema>(refSchemaName: string): Promise<T | undefined> {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase()) as T;\n }\n\n public getReferenceNameByAlias(alias: string): string | undefined {\n if (this.references.length === 0)\n return undefined;\n\n const schema = this.references.find((ref) => ref.alias ? ref.alias.toLowerCase() === alias.toLowerCase() : false);\n return schema ? schema.name : undefined;\n }\n\n public getReferenceSync<T extends Schema>(refSchemaName: string): T | undefined {\n if (this.references.length === 0)\n return undefined;\n\n return this.references.find((ref) => ref.name.toLowerCase() === refSchemaName.toLowerCase()) as T;\n }\n\n /**\n * Save this Schema's properties to an object for serializing to JSON.\n */\n public toJSON(): SchemaProps {\n if (!this.isECSpecVersionSupported())\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaJson: { [value: string]: any } = {};\n schemaJson.$schema = SCHEMAURL3_2_JSON; // $schema is required\n schemaJson.name = this.name; // name is required\n schemaJson.version = this.schemaKey.version.toString(true);\n schemaJson.alias = this.alias; // alias is required\n if (undefined !== this.label) // label is optional\n schemaJson.label = this.label;\n if (undefined !== this.description) // description is optional\n schemaJson.description = this.description;\n if (undefined !== this.references && this.references.length > 0) // references is optional\n schemaJson.references = this.references.map(({ name, schemaKey }) => ({ name, version: schemaKey.version.toString() }));\n\n const customAttributes = serializeCustomAttributes(this.customAttributes);\n if (undefined !== customAttributes)\n schemaJson.customAttributes = customAttributes;\n if (this._items.size > 0) {\n schemaJson.items = {};\n this._items.forEach((schemaItem: SchemaItem) => {\n schemaJson.items[schemaItem.name] = schemaItem.toJSON(false, true);\n });\n }\n return schemaJson as SchemaProps;\n }\n\n /**\n * Converts the schema to a DOM XML Document.\n * @param schemaXml An empty DOM document to which the schema will be written\n */\n public async toXml(schemaXml: Document): Promise<Document> {\n if (!this.isECSpecVersionSupported())\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECSpecVersion and cannot be serialized.`);\n\n const schemaMetadata = schemaXml.createElement(\"ECSchema\");\n schemaMetadata.setAttribute(\"xmlns\", SCHEMAURL3_2_XML);\n schemaMetadata.setAttribute(\"version\", this.schemaKey.version.toString());\n schemaMetadata.setAttribute(\"schemaName\", this.name);\n schemaMetadata.setAttribute(\"alias\", this.alias ? this.alias : \"\");\n if (undefined !== this.label)\n schemaMetadata.setAttribute(\"displayLabel\", this.label);\n if (undefined !== this.description)\n schemaMetadata.setAttribute(\"description\", this.description);\n\n // Map used for CA serialization\n const refSchemaMap = new Map<string, string>();\n\n this.references.forEach(({ name, schemaKey, alias }) => {\n const schemaRef = schemaXml.createElement(\"ECSchemaReference\");\n schemaRef.setAttribute(\"name\", name);\n schemaRef.setAttribute(\"version\", schemaKey.version.toString());\n schemaRef.setAttribute(\"alias\", alias ? alias : \"\");\n schemaMetadata.appendChild(schemaRef);\n refSchemaMap.set(name, schemaKey.version.toString());\n });\n\n if (this._customAttributes) {\n const parentElem = schemaXml.createElement(\"ECCustomAttributes\");\n for (const [name, attribute] of this._customAttributes) {\n const caElem = await XmlSerializationUtils.writeCustomAttribute(name, attribute, schemaXml, this);\n parentElem.appendChild(caElem);\n }\n schemaMetadata.appendChild(parentElem);\n }\n\n for (const [, item] of this._items) {\n const itemXml = await item.toXml(schemaXml);\n schemaMetadata.appendChild(itemXml);\n }\n\n schemaXml.appendChild(schemaMetadata);\n return schemaXml;\n }\n\n // Check if the ECSpecVersion read-version is greater than the current ECSpecVersion supported.\n // If a specific ECSpecVersion is given, check against that version.\n // If no argument is given, check against the original ECSpecVersion of the schema.\n private isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck?: number): boolean {\n // If argument is supplied, check the argument against the current ECSpecVersion supported\n if (ecSpecMajorVersionToCheck !== undefined)\n return (Schema.currentECSpecMajorVersion >= ecSpecMajorVersionToCheck);\n\n // If argument is not supplied, check against the original ECSpecVersion of the schema\n if (this.originalECSpecMajorVersion === undefined)\n return false;\n return (Schema.currentECSpecMajorVersion >= this.originalECSpecMajorVersion);\n }\n\n // Check if the full ECSpecVersion is greater than the current ECSpecVersion supported.\n // If a specific ECSpecVersion is given, check against that version.\n // If no argument is given, check against the original ECSpecVersion of the schema.\n private isECSpecVersionSupported(ecSpecMajorVersionToCheck?: number, ecSpecMinorVersionToCheck?: number): boolean {\n // If arguments are supplied, check the arguments against the current ECSpecVersion supported\n if (ecSpecMajorVersionToCheck !== undefined && ecSpecMinorVersionToCheck !== undefined) {\n if (!this.isECSpecMajorVersionSupported(ecSpecMajorVersionToCheck))\n return false;\n return (Schema.currentECSpecMinorVersion >= ecSpecMinorVersionToCheck);\n }\n // If arguments are not supplied, check against the original ECSpecVersion of the schema\n if (!this.isECSpecMajorVersionSupported() || this.originalECSpecMinorVersion === undefined)\n return false;\n return (Schema.currentECSpecMinorVersion >= this.originalECSpecMinorVersion);\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public fromJSONSync(schemaProps: SchemaProps) {\n if (undefined === this._schemaKey) {\n const schemaName = schemaProps.name;\n const version = ECVersion.fromString(schemaProps.version);\n this._schemaKey = new SchemaKey(schemaName, version);\n } else {\n if (schemaProps.name.toLowerCase() !== this.name.toLowerCase())\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} does not match the provided name, '${schemaProps.name}'.`);\n if (this.schemaKey.version.compare(ECVersion.fromString(schemaProps.version)))\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${this.name} has the version '${this.schemaKey.version}' that does not match the provided version '${schemaProps.version}'.`);\n }\n\n if (schemaProps.$schema.match(`https://dev\\\\.bentley\\\\.com/json_schemas/ec/([0-9]+)/ecschema`) == null && schemaProps.$schema.match(`http://www\\\\.bentley\\\\.com/schemas/Bentley\\\\.ECXML\\\\.([0-9]+)`) == null)\n throw new ECObjectsError(ECObjectsStatus.MissingSchemaUrl, `The Schema '${this.name}' has an unsupported namespace '${schemaProps.$schema}'.`);\n\n // The schema props have not been parsed. Parse the ECXml version from the $schema attribute\n let ecVersion: ECSpecVersion;\n if (schemaProps.ecSpecMajorVersion === undefined || schemaProps.ecSpecMinorVersion === undefined) {\n ecVersion = ((schemaProps.$schema.search(\"ECXML\") !== -1) ? XmlParser.parseXmlNamespace(schemaProps.$schema) : JsonParser.parseJSUri(schemaProps.$schema)) as ECSpecVersion;\n } else {\n ecVersion = { readVersion: schemaProps.ecSpecMajorVersion, writeVersion: schemaProps.ecSpecMinorVersion } as ECSpecVersion;\n }\n\n this._originalECSpecMajorVersion = ecVersion?.readVersion;\n this._originalECSpecMinorVersion = ecVersion?.writeVersion;\n\n if (!this.isECSpecMajorVersionSupported(ecVersion?.readVersion))\n throw new ECObjectsError(ECObjectsStatus.NewerECSpecVersion, `The Schema '${this.name}' has an unsupported ECVersion and cannot be loaded.`);\n\n if (ECName.validate(schemaProps.alias)) {\n this._alias = schemaProps.alias;\n } else {\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Schema ${schemaProps.name} does not have the required 'alias' attribute.`);\n }\n\n if (undefined !== schemaProps.label)\n this._label = schemaProps.label;\n\n if (undefined !== schemaProps.description)\n this._description = schemaProps.description;\n }\n\n /**\n * Loads the schema header (name, version alias, label and description) from the input SchemaProps\n */\n public async fromJSON(schemaProps: SchemaProps) {\n this.fromJSONSync(schemaProps);\n }\n\n /**\n * Completely loads the SchemaInfo from the input json and starts loading the entire schema. The complete schema can be retrieved from the\n * schema context using the getCachedSchema method\n */\n public static async startLoadingFromJson(jsonObj: object | string, context: SchemaContext): Promise<SchemaInfo> {\n const schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n return reader.readSchemaInfo(schema, rawSchema);\n }\n\n public static async fromJson(jsonObj: object | string, context: SchemaContext): Promise<Schema> {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = await reader.readSchema(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * Completely loads the Schema from the input json. The schema is cached in the schema context.\n */\n public static fromJsonSync(jsonObj: object | string, context: SchemaContext): Schema {\n let schema: Schema = new Schema(context);\n\n const reader = new SchemaReadHelper(JsonParser, context);\n const rawSchema = typeof jsonObj === \"string\" ? JSON.parse(jsonObj) : jsonObj;\n schema = reader.readSchemaSync(schema, rawSchema);\n\n return schema;\n }\n\n /**\n * @internal\n */\n public static isSchema(object: any): object is Schema {\n const schema = object as Schema;\n\n return schema !== undefined && schema.schemaKey !== undefined && schema.context !== undefined;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setDisplayLabel(displayLabel: string) {\n this._label = displayLabel;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setDescription(description: string) {\n this._description = description;\n }\n\n /**\n * @alpha\n * Used for schema editing.\n */\n protected setAlias(alias: string) {\n if (!ECName.validate(alias)) {\n throw new ECObjectsError(ECObjectsStatus.InvalidECName, \"The specified schema alias is invalid.\");\n }\n this._alias = alias;\n }\n}\n\n/**\n * Hackish approach that works like a \"friend class\" so we can access protected members without making them public.\n * We cannot put this into Helper.ts and make it non-export, because we are importing Helper.ts from this file, and the circular import\n * would prevent this class from extending Schema.\n * @internal\n */\nexport abstract class MutableSchema extends Schema {\n public abstract override addCustomAttribute(customAttribute: CustomAttribute): void;\n public abstract override createEntityClass(name: string, modifier?: ECClassModifier): Promise<EntityClass>;\n public abstract override createEntityClassSync(name: string, modifier?: ECClassModifier): EntityClass;\n public abstract override createMixinClass(name: string): Promise<Mixin>;\n public abstract override createMixinClassSync(name: string): Mixin;\n public abstract override createStructClass(name: string, modifier?: ECClassModifier): Promise<StructClass>;\n public abstract override createStructClassSync(name: string, modifier?: ECClassModifier): StructClass;\n public abstract override createCustomAttributeClass(name: string, modifier?: ECClassModifier): Promise<CustomAttributeClass>;\n public abstract override createCustomAttributeClassSync(name: string, modifier?: ECClassModifier): CustomAttributeClass;\n public abstract override createRelationshipClass(name: string, modifier?: ECClassModifier): Promise<RelationshipClass>;\n public abstract override createRelationshipClassSync(name: string, modifier?: ECClassModifier): RelationshipClass;\n public abstract override createEnumeration(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Promise<Enumeration>;\n public abstract override createEnumerationSync(name: string, primitiveType?: PrimitiveType.Integer | PrimitiveType.String): Enumeration;\n public abstract override createKindOfQuantity(name: string): Promise<KindOfQuantity>;\n public abstract override createKindOfQuantitySync(name: string): KindOfQuantity;\n public abstract override createUnit(name: string): Promise<Unit>;\n public abstract override createUnitSync(name: string): Unit;\n public abstract override createConstant(name: string): Promise<Constant>;\n public abstract override createConstantSync(name: string): Constant;\n public abstract override createInvertedUnit(name: string): Promise<InvertedUnit>;\n public abstract override createInvertedUnitSync(name: string): InvertedUnit;\n public abstract override createPhenomenon(name: string): Promise<Phenomenon>;\n public abstract override createPhenomenonSync(name: string): Phenomenon;\n public abstract override createFormat(name: string): Promise<Format>;\n public abstract override createFormatSync(name: string): Format;\n public abstract override createUnitSystem(name: string): Promise<UnitSystem>;\n public abstract override createUnitSystemSync(name: string): UnitSystem;\n public abstract override createPropertyCategory(name: string): Promise<PropertyCategory>;\n public abstract override createPropertyCategorySync(name: string): PropertyCategory;\n public abstract override addItem<T extends SchemaItem>(item: T): void;\n public abstract override addReference(refSchema: Schema): Promise<void>;\n public abstract override addReferenceSync(refSchema: Schema): void;\n public abstract override setContext(schemaContext: SchemaContext): void;\n public abstract override deleteClass(name: string): Promise<void>;\n public abstract override deleteClassSync(name: string): void;\n public abstract override deleteSchemaItem(name: string): Promise<void>;\n public abstract override deleteSchemaItemSync(name: string): void;\n public abstract override setAlias(alias: string): void;\n}\n"]}
|
|
@@ -12,7 +12,7 @@ import { SchemaItem } from "./SchemaItem";
|
|
|
12
12
|
* @beta
|
|
13
13
|
*/
|
|
14
14
|
export declare class Unit extends SchemaItem {
|
|
15
|
-
readonly schemaItemType
|
|
15
|
+
readonly schemaItemType = SchemaItemType.Unit;
|
|
16
16
|
protected _phenomenon?: LazyLoadedPhenomenon;
|
|
17
17
|
protected _unitSystem?: LazyLoadedUnitSystem;
|
|
18
18
|
protected _definition: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Unit.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;;GAIG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,SAAyB,cAAc,
|
|
1
|
+
{"version":3,"file":"Unit.d.ts","sourceRoot":"","sources":["../../../src/Metadata/Unit.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAEnE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;;;GAIG;AACH,qBAAa,IAAK,SAAQ,UAAU;IAClC,SAAyB,cAAc,uBAAuB;IAC9D,SAAS,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC7C,SAAS,CAAC,WAAW,CAAC,EAAE,oBAAoB,CAAC;IAC7C,SAA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U,CAAC;IAChC,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;CACF;AApKD,oBAoKC;AACD;;;GAGG;AACH,MAAsB,WAAY,SAAQ,IAAI;CAK7C;AALD,kCAKC","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 { SchemaItemUnitProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { LazyLoadedPhenomenon, LazyLoadedUnitSystem } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { UnitSystem } from \"./UnitSystem\";\r\n\r\n/**\r\n * An abstract class that adds the ability to define Units and everything that goes with them, within an ECSchema as a\r\n * first-class concept is to allow the iModel to not be dependent on any hard-coded Units\r\n * @beta\r\n */\r\nexport class Unit extends SchemaItem {\r\n public override readonly schemaItemType!: SchemaItemType.Unit;\r\n protected _phenomenon?: LazyLoadedPhenomenon;\r\n protected _unitSystem?: LazyLoadedUnitSystem;\r\n protected _definition: string;\r\n protected _numerator?: number;\r\n protected _denominator?: number;\r\n protected _offset?: number;\r\n\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this.schemaItemType = SchemaItemType.Unit;\r\n this._definition = \"\";\r\n }\r\n\r\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\r\n public get unitSystem(): LazyLoadedUnitSystem | undefined { return this._unitSystem; }\r\n public get definition(): string { return this._definition; }\r\n public get numerator(): number { return this._numerator ?? 1.0; }\r\n public get offset(): number { return this._offset ?? 0.0; }\r\n public get denominator(): number { return this._denominator ?? 1.0; }\r\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\r\n public get hasOffset(): boolean { return (this._offset !== undefined); }\r\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\r\n\r\n /**\r\n * Returns true if a conversion can be calculated between the input units\r\n * @alpha\r\n */\r\n public static async areCompatible(unitA: Unit, unitB: Unit): Promise<boolean> {\r\n const unitAPhenomenon = await unitA.phenomenon;\r\n const unitBPhenomenon = await unitB.phenomenon;\r\n\r\n if (!unitAPhenomenon || !unitBPhenomenon || !unitAPhenomenon.key.matches(unitBPhenomenon.key))\r\n return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * @alpha\r\n */\r\n public static isUnit(object: any): object is Unit {\r\n return SchemaItem.isSchemaItem(object) && object.schemaItemType === SchemaItemType.Unit;\r\n }\r\n\r\n /**\r\n * Save this Unit'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): SchemaItemUnitProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.phenomenon = this.phenomenon!.fullName;\r\n schemaJson.unitSystem = this.unitSystem!.fullName;\r\n schemaJson.definition = this.definition;\r\n if (this.hasNumerator)\r\n schemaJson.numerator = this.numerator;\r\n if (this.hasDenominator)\r\n schemaJson.denominator = this.denominator;\r\n if (this.hasOffset)\r\n schemaJson.offset = this.offset;\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 phenomenon = await this.phenomenon;\r\n if (undefined !== phenomenon) {\r\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\r\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\r\n }\r\n\r\n const unitSystem = await this.unitSystem;\r\n if (undefined !== unitSystem) {\r\n const unitSystemName = XmlSerializationUtils.createXmlTypedName(this.schema, unitSystem.schema, unitSystem.name);\r\n itemElement.setAttribute(\"unitSystem\", unitSystemName);\r\n }\r\n\r\n itemElement.setAttribute(\"definition\", this.definition);\r\n if (this.hasNumerator)\r\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\r\n if (this.hasDenominator)\r\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\r\n if (this.hasOffset)\r\n itemElement.setAttribute(\"offset\", this.offset.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(unitProps: SchemaItemUnitProps) {\r\n super.fromJSONSync(unitProps);\r\n\r\n const phenomenonSchemaItemKey = this.schema.getSchemaItemKey(unitProps.phenomenon);\r\n if (!phenomenonSchemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${unitProps.phenomenon}.`);\r\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(phenomenonSchemaItemKey,\r\n async () => {\r\n const phenom = await this.schema.lookupItem<Phenomenon>(phenomenonSchemaItemKey);\r\n if (undefined === phenom)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${unitProps.phenomenon}.`);\r\n return phenom;\r\n });\r\n\r\n const unitSystemSchemaItemKey = this.schema.getSchemaItemKey(unitProps.unitSystem);\r\n if (!unitSystemSchemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the unitSystem ${unitProps.unitSystem}.`);\r\n this._unitSystem = new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystemSchemaItemKey,\r\n async () => {\r\n const unitSystem = await this.schema.lookupItem<UnitSystem>(unitSystemSchemaItemKey);\r\n if (undefined === unitSystem)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the unitSystem ${unitProps.unitSystem}.`);\r\n return unitSystem;\r\n });\r\n\r\n if (this._definition !== \"\" && unitProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = unitProps.definition;\r\n\r\n if (undefined !== unitProps.numerator) {\r\n if (unitProps.numerator !== this._numerator)\r\n this._numerator = unitProps.numerator;\r\n }\r\n\r\n if (undefined !== unitProps.denominator) {\r\n if (unitProps.denominator !== this._denominator)\r\n this._denominator = unitProps.denominator;\r\n }\r\n\r\n if (undefined !== unitProps.offset) {\r\n if (unitProps.offset !== this._offset)\r\n this._offset = unitProps.offset;\r\n }\r\n }\r\n\r\n public override async fromJSON(unitProps: SchemaItemUnitProps) {\r\n this.fromJSONSync(unitProps);\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\r\n this._phenomenon = phenomenon;\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setUnitSystem(unitSystem: LazyLoadedUnitSystem) {\r\n this._unitSystem = unitSystem;\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableUnit extends Unit {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): Promise<void>;\r\n public abstract override setUnitSystem(unitSystem: LazyLoadedUnitSystem): Promise<void>;\r\n public abstract override setDefinition(definition: string): Promise<void>;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|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IAAI,IAAI,CAAC,WAAW,KAAK,EAAE;YAC9B,IAAI,CAAC,WAAW,GAAG,SAAS,CAAC,UAAU,CAAC;QAE1C,IAAI,SAAS,KAAK,SAAS,CAAC,SAAS,EAAE,CAAC;YACtC,IAAI,SAAS,CAAC,SAAS,KAAK,IAAI,CAAC,UAAU;gBACzC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,SAAS,CAAC;QAC1C,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,CAAC,WAAW,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,WAAW,KAAK,IAAI,CAAC,YAAY;gBAC7C,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,WAAW,CAAC;QAC9C,CAAC;QAED,IAAI,SAAS,KAAK,SAAS,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,SAAS,CAAC,MAAM,KAAK,IAAI,CAAC,OAAO;gBACnC,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC;QACpC,CAAC;IACH,CAAC;IAEe,KAAK,CAAC,QAAQ,CAAC,SAA8B;QAC3D,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,CAAC,UAAgC;QAC5D,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,CAAC,UAAgC;QAC5D,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;IAED;;;OAGG;IACO,KAAK,CAAC,aAAa,CAAC,UAAkB;QAC9C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAChC,CAAC;CACF;AAnKD,oBAmKC;AACD;;;GAGG;AACH,MAAsB,WAAY,SAAQ,IAAI;CAK7C;AALD,kCAKC","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 { SchemaItemUnitProps } from \"../Deserialization/JsonProps\";\r\nimport { XmlSerializationUtils } from \"../Deserialization/XmlSerializationUtils\";\r\nimport { SchemaItemType } from \"../ECObjects\";\r\nimport { ECObjectsError, ECObjectsStatus } from \"../Exception\";\r\nimport { LazyLoadedPhenomenon, LazyLoadedUnitSystem } from \"../Interfaces\";\r\nimport { SchemaItemKey } from \"../SchemaKey\";\r\nimport { Phenomenon } from \"./Phenomenon\";\r\nimport { Schema } from \"./Schema\";\r\nimport { SchemaItem } from \"./SchemaItem\";\r\nimport { UnitSystem } from \"./UnitSystem\";\r\n\r\n/**\r\n * An abstract class that adds the ability to define Units and everything that goes with them, within an ECSchema as a\r\n * first-class concept is to allow the iModel to not be dependent on any hard-coded Units\r\n * @beta\r\n */\r\nexport class Unit extends SchemaItem {\r\n public override readonly schemaItemType = SchemaItemType.Unit;\r\n protected _phenomenon?: LazyLoadedPhenomenon;\r\n protected _unitSystem?: LazyLoadedUnitSystem;\r\n protected _definition: string;\r\n protected _numerator?: number;\r\n protected _denominator?: number;\r\n protected _offset?: number;\r\n\r\n constructor(schema: Schema, name: string) {\r\n super(schema, name);\r\n this._definition = \"\";\r\n }\r\n\r\n public get phenomenon(): LazyLoadedPhenomenon | undefined { return this._phenomenon; }\r\n public get unitSystem(): LazyLoadedUnitSystem | undefined { return this._unitSystem; }\r\n public get definition(): string { return this._definition; }\r\n public get numerator(): number { return this._numerator ?? 1.0; }\r\n public get offset(): number { return this._offset ?? 0.0; }\r\n public get denominator(): number { return this._denominator ?? 1.0; }\r\n public get hasNumerator(): boolean { return (this._numerator !== undefined); }\r\n public get hasOffset(): boolean { return (this._offset !== undefined); }\r\n public get hasDenominator(): boolean { return (this._denominator !== undefined); }\r\n\r\n /**\r\n * Returns true if a conversion can be calculated between the input units\r\n * @alpha\r\n */\r\n public static async areCompatible(unitA: Unit, unitB: Unit): Promise<boolean> {\r\n const unitAPhenomenon = await unitA.phenomenon;\r\n const unitBPhenomenon = await unitB.phenomenon;\r\n\r\n if (!unitAPhenomenon || !unitBPhenomenon || !unitAPhenomenon.key.matches(unitBPhenomenon.key))\r\n return false;\r\n return true;\r\n }\r\n\r\n /**\r\n * @alpha\r\n */\r\n public static isUnit(object: any): object is Unit {\r\n return SchemaItem.isSchemaItem(object) && object.schemaItemType === SchemaItemType.Unit;\r\n }\r\n\r\n /**\r\n * Save this Unit'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): SchemaItemUnitProps {\r\n const schemaJson = super.toJSON(standalone, includeSchemaVersion) as any;\r\n schemaJson.phenomenon = this.phenomenon!.fullName;\r\n schemaJson.unitSystem = this.unitSystem!.fullName;\r\n schemaJson.definition = this.definition;\r\n if (this.hasNumerator)\r\n schemaJson.numerator = this.numerator;\r\n if (this.hasDenominator)\r\n schemaJson.denominator = this.denominator;\r\n if (this.hasOffset)\r\n schemaJson.offset = this.offset;\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 phenomenon = await this.phenomenon;\r\n if (undefined !== phenomenon) {\r\n const phenomenonName = XmlSerializationUtils.createXmlTypedName(this.schema, phenomenon.schema, phenomenon.name);\r\n itemElement.setAttribute(\"phenomenon\", phenomenonName);\r\n }\r\n\r\n const unitSystem = await this.unitSystem;\r\n if (undefined !== unitSystem) {\r\n const unitSystemName = XmlSerializationUtils.createXmlTypedName(this.schema, unitSystem.schema, unitSystem.name);\r\n itemElement.setAttribute(\"unitSystem\", unitSystemName);\r\n }\r\n\r\n itemElement.setAttribute(\"definition\", this.definition);\r\n if (this.hasNumerator)\r\n itemElement.setAttribute(\"numerator\", this.numerator.toString());\r\n if (this.hasDenominator)\r\n itemElement.setAttribute(\"denominator\", this.denominator.toString());\r\n if (this.hasOffset)\r\n itemElement.setAttribute(\"offset\", this.offset.toString());\r\n\r\n return itemElement;\r\n }\r\n\r\n public override fromJSONSync(unitProps: SchemaItemUnitProps) {\r\n super.fromJSONSync(unitProps);\r\n\r\n const phenomenonSchemaItemKey = this.schema.getSchemaItemKey(unitProps.phenomenon);\r\n if (!phenomenonSchemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${unitProps.phenomenon}.`);\r\n this._phenomenon = new DelayedPromiseWithProps<SchemaItemKey, Phenomenon>(phenomenonSchemaItemKey,\r\n async () => {\r\n const phenom = await this.schema.lookupItem<Phenomenon>(phenomenonSchemaItemKey);\r\n if (undefined === phenom)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the phenomenon ${unitProps.phenomenon}.`);\r\n return phenom;\r\n });\r\n\r\n const unitSystemSchemaItemKey = this.schema.getSchemaItemKey(unitProps.unitSystem);\r\n if (!unitSystemSchemaItemKey)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the unitSystem ${unitProps.unitSystem}.`);\r\n this._unitSystem = new DelayedPromiseWithProps<SchemaItemKey, UnitSystem>(unitSystemSchemaItemKey,\r\n async () => {\r\n const unitSystem = await this.schema.lookupItem<UnitSystem>(unitSystemSchemaItemKey);\r\n if (undefined === unitSystem)\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `Unable to locate the unitSystem ${unitProps.unitSystem}.`);\r\n return unitSystem;\r\n });\r\n\r\n if (this._definition !== \"\" && unitProps.definition.toLowerCase() !== this._definition.toLowerCase())\r\n throw new ECObjectsError(ECObjectsStatus.InvalidECJson, `The Unit ${this.name} has an invalid 'definition' attribute.`);\r\n else if (this._definition === \"\")\r\n this._definition = unitProps.definition;\r\n\r\n if (undefined !== unitProps.numerator) {\r\n if (unitProps.numerator !== this._numerator)\r\n this._numerator = unitProps.numerator;\r\n }\r\n\r\n if (undefined !== unitProps.denominator) {\r\n if (unitProps.denominator !== this._denominator)\r\n this._denominator = unitProps.denominator;\r\n }\r\n\r\n if (undefined !== unitProps.offset) {\r\n if (unitProps.offset !== this._offset)\r\n this._offset = unitProps.offset;\r\n }\r\n }\r\n\r\n public override async fromJSON(unitProps: SchemaItemUnitProps) {\r\n this.fromJSONSync(unitProps);\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setPhenomenon(phenomenon: LazyLoadedPhenomenon) {\r\n this._phenomenon = phenomenon;\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setUnitSystem(unitSystem: LazyLoadedUnitSystem) {\r\n this._unitSystem = unitSystem;\r\n }\r\n\r\n /**\r\n * @alpha\r\n * Used for schema editing.\r\n */\r\n protected async setDefinition(definition: string) {\r\n this._definition = definition;\r\n }\r\n}\r\n/**\r\n * @internal\r\n * An abstract class used for schema editing.\r\n */\r\nexport abstract class MutableUnit extends Unit {\r\n public abstract override setPhenomenon(phenomenon: LazyLoadedPhenomenon): Promise<void>;\r\n public abstract override setUnitSystem(unitSystem: LazyLoadedUnitSystem): Promise<void>;\r\n public abstract override setDefinition(definition: string): Promise<void>;\r\n public abstract override setDisplayLabel(displayLabel: string): void;\r\n}\r\n"]}
|
|
@@ -2,14 +2,12 @@
|
|
|
2
2
|
* @module Metadata
|
|
3
3
|
*/
|
|
4
4
|
import { SchemaItemType } from "../ECObjects";
|
|
5
|
-
import { Schema } from "./Schema";
|
|
6
5
|
import { SchemaItem } from "./SchemaItem";
|
|
7
6
|
/**
|
|
8
7
|
* @beta
|
|
9
8
|
*/
|
|
10
9
|
export declare class UnitSystem extends SchemaItem {
|
|
11
|
-
readonly schemaItemType
|
|
12
|
-
constructor(schema: Schema, name: string);
|
|
10
|
+
readonly schemaItemType = SchemaItemType.UnitSystem;
|
|
13
11
|
}
|
|
14
12
|
/**
|
|
15
13
|
* @internal
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitSystem.d.ts","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"UnitSystem.d.ts","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C;;GAEG;AACH,qBAAa,UAAW,SAAQ,UAAU;IACxC,SAAyB,cAAc,6BAA6B;CACrE;AAED;;;GAGG;AACH,8BAAsB,iBAAkB,SAAQ,UAAU;aAC/B,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;CACrE"}
|
|
@@ -14,8 +14,8 @@ const SchemaItem_1 = require("./SchemaItem");
|
|
|
14
14
|
* @beta
|
|
15
15
|
*/
|
|
16
16
|
class UnitSystem extends SchemaItem_1.SchemaItem {
|
|
17
|
-
constructor(
|
|
18
|
-
super(
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
19
|
this.schemaItemType = ECObjects_1.SchemaItemType.UnitSystem;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;
|
|
1
|
+
{"version":3,"file":"UnitSystem.js","sourceRoot":"","sources":["../../../src/Metadata/UnitSystem.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,4CAA8C;AAC9C,6CAA0C;AAE1C;;GAEG;AACH,MAAa,UAAW,SAAQ,uBAAU;IAA1C;;QAC2B,mBAAc,GAAG,0BAAc,CAAC,UAAU,CAAC;IACtE,CAAC;CAAA;AAFD,gCAEC;AAED;;;GAGG;AACH,MAAsB,iBAAkB,SAAQ,UAAU;CAEzD;AAFD,8CAEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Metadata\n */\n\nimport { SchemaItemType } from \"../ECObjects\";\nimport { SchemaItem } from \"./SchemaItem\";\n\n/**\n * @beta\n */\nexport class UnitSystem extends SchemaItem {\n public override readonly schemaItemType = SchemaItemType.UnitSystem;\n}\n\n/**\n * @internal\n * Used for schema editing.\n */\nexport abstract class MutableUnitSystem extends UnitSystem {\n public abstract override setDisplayLabel(displayLabel: string): void;\n}\n"]}
|
|
@@ -58,6 +58,8 @@ class UnitConversion {
|
|
|
58
58
|
return new UnitConversion(this.factor ** power, 0.0);
|
|
59
59
|
throw new Error("Cannot raise map with non-zero offset");
|
|
60
60
|
}
|
|
61
|
+
/** @internal */
|
|
62
|
+
static { this.identity = new UnitConversion(); }
|
|
61
63
|
/**
|
|
62
64
|
* Returns UnitConversion with unit's numerator and denominator in factor and unit's offset in offset for reducing
|
|
63
65
|
* @internal
|
|
@@ -69,6 +71,4 @@ class UnitConversion {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
exports.UnitConversion = UnitConversion;
|
|
72
|
-
/** @internal */
|
|
73
|
-
UnitConversion.identity = new UnitConversion();
|
|
74
74
|
//# sourceMappingURL=UnitConversion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UnitConversion.js","sourceRoot":"","sources":["../../../src/UnitConversion/UnitConversion.ts"],"names":[],"mappings":";;;AAMA,4CAA8C;AAC9C,wDAAmD;AAEnD;;;GAGG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ACtE,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAElE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,KAAa;QACxB,IAAI,IAAA,2BAAW,EAAC,KAAK,EAAE,GAAG,CAAC;YACzB,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;aACjD,IAAI,IAAA,2BAAW,EAAC,KAAK,EAAE,GAAG,CAAC;YAC9B,OAAO,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAEtC,IAAI,IAAA,2BAAW,EAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;YAC/B,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,MAAM,IAAI,KAAK,EAAE,GAAG,CAAC,CAAC;QAEvD,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAC3D,CAAC;IAED,gBAAgB;aACF,aAAQ,GAAG,IAAI,cAAc,EAAE,CAAC;IAE9C;;;OAGG;IACI,MAAM,CAAC,IAAI,CAAC,IAAqB;QACtC,IAAI,IAAI,CAAC,cAAc,KAAK,0BAAc,CAAC,IAAI;YAC7C,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAE7E,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC;IACpE,CAAC;;AAxEH,wCAyEC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\nimport { Constant } from \"../Metadata/Constant\";\nimport { Unit } from \"../Metadata/Unit\";\nimport { SchemaItemType } from \"../ECObjects\";\nimport { almostEqual } from \"@itwin/core-quantity\";\n\n/**\n * Class used for storing calculated conversion between two Units [[UnitConverter.calculateConversion]] and converting values from one Unit to another [[UnitConverter.evaluate]]\n * @internal\n */\nexport class UnitConversion {\n constructor(public readonly factor: number = 1.0, public readonly offset: number = 0.0) {}\n\n /**\n * Converts x using UnitConversion\n * @param x Input magnitude to be converted\n * @returns Output magnitude after conversion\n */\n public evaluate(x: number): number {\n return this.factor * x + this.offset;\n }\n\n /**\n * Used to invert source's UnitConversion so that it can be composed with target's UnitConversion cleanly\n * @internal\n */\n public inverse(): UnitConversion {\n const inverseFactor = 1.0 / this.factor;\n return new UnitConversion(inverseFactor, -this.offset * inverseFactor);\n }\n\n /**\n * Combines two UnitConversions\n * Used to combine source's UnitConversion and target's UnitConversion for a final UnitConversion that can be evaluated\n * @internal\n */\n public compose(conversion: UnitConversion): UnitConversion {\n return new UnitConversion(\n this.factor * conversion.factor,\n conversion.factor * this.offset + conversion.offset,\n );\n }\n\n /**\n * Multiples two UnitConversions together to calculate factor during reducing\n * @internal\n */\n public multiply(conversion: UnitConversion): UnitConversion {\n if (almostEqual(conversion.offset, 0.0) && almostEqual(this.offset, 0.0))\n return new UnitConversion(this.factor * conversion.factor, 0.0);\n\n throw new Error(\"Cannot multiply two maps with non-zero offsets\");\n }\n\n /**\n * Raise UnitConversion's factor with power exponent to calculate factor during reducing\n * @internal\n */\n public raise(power: number): UnitConversion {\n if (almostEqual(power, 1.0))\n return new UnitConversion(this.factor, this.offset);\n else if (almostEqual(power, 0.0))\n return new UnitConversion(1.0, 0.0);\n\n if (almostEqual(this.offset, 0.0))\n return new UnitConversion(this.factor ** power, 0.0);\n\n throw new Error(\"Cannot raise map with non-zero offset\");\n }\n\n /** @internal */\n public static identity = new UnitConversion();\n\n /**\n * Returns UnitConversion with unit's numerator and denominator in factor and unit's offset in offset for reducing\n * @internal\n */\n public static from(unit: Unit | Constant): UnitConversion {\n if (unit.schemaItemType === SchemaItemType.Unit)\n return new UnitConversion(unit.denominator / unit.numerator, -unit.offset);\n\n return new UnitConversion(unit.denominator / unit.numerator, 0.0);\n }\n}\n"]}
|
package/lib/esm/Constants.js
CHANGED
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
8
|
export class ECStringConstants {
|
|
9
|
+
// Relationship End
|
|
10
|
+
static { this.RELATIONSHIP_END_SOURCE = "Source"; }
|
|
11
|
+
static { this.RELATIONSHIP_END_TARGET = "Target"; }
|
|
12
|
+
// Container Type
|
|
13
|
+
static { this.CONTAINERTYPE_SCHEMA = "Schema"; }
|
|
14
|
+
static { this.CONTAINERTYPE_ENTITYCLASS = "EntityClass"; }
|
|
15
|
+
static { this.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass"; }
|
|
16
|
+
static { this.CONTAINERTYPE_STRUCTCLASS = "StructClass"; }
|
|
17
|
+
static { this.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass"; }
|
|
18
|
+
static { this.CONTAINERTYPE_ANYCLASS = "AnyClass"; }
|
|
19
|
+
static { this.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty"; }
|
|
20
|
+
static { this.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty"; }
|
|
21
|
+
static { this.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty"; }
|
|
22
|
+
static { this.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty"; }
|
|
23
|
+
static { this.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty"; }
|
|
24
|
+
static { this.CONTAINERTYPE_ANYPROPERTY = "AnyProperty"; }
|
|
25
|
+
static { this.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint"; }
|
|
26
|
+
static { this.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint"; }
|
|
27
|
+
static { this.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint"; }
|
|
28
|
+
static { this.CONTAINERTYPE_ANY = "Any"; }
|
|
9
29
|
}
|
|
10
|
-
// Relationship End
|
|
11
|
-
ECStringConstants.RELATIONSHIP_END_SOURCE = "Source";
|
|
12
|
-
ECStringConstants.RELATIONSHIP_END_TARGET = "Target";
|
|
13
|
-
// Container Type
|
|
14
|
-
ECStringConstants.CONTAINERTYPE_SCHEMA = "Schema";
|
|
15
|
-
ECStringConstants.CONTAINERTYPE_ENTITYCLASS = "EntityClass";
|
|
16
|
-
ECStringConstants.CONTAINERTYPE_CUSTOMATTRIBUTECLASS = "CustomAttributeClass";
|
|
17
|
-
ECStringConstants.CONTAINERTYPE_STRUCTCLASS = "StructClass";
|
|
18
|
-
ECStringConstants.CONTAINERTYPE_RELATIONSHIPCLASS = "RelationshipClass";
|
|
19
|
-
ECStringConstants.CONTAINERTYPE_ANYCLASS = "AnyClass";
|
|
20
|
-
ECStringConstants.CONTAINERTYPE_PRIMITIVEPROPERTY = "PrimitiveProperty";
|
|
21
|
-
ECStringConstants.CONTAINERTYPE_STRUCTPROPERTY = "StructProperty";
|
|
22
|
-
ECStringConstants.CONTAINERTYPE_PRIMITIVEARRAYPROPERTY = "ArrayProperty";
|
|
23
|
-
ECStringConstants.CONTAINERTYPE_STRUCTARRAYPROPERTY = "StructArrayProperty";
|
|
24
|
-
ECStringConstants.CONTAINERTYPE_NAVIGATIONPROPERTY = "NavigationProperty";
|
|
25
|
-
ECStringConstants.CONTAINERTYPE_ANYPROPERTY = "AnyProperty";
|
|
26
|
-
ECStringConstants.CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT = "SourceRelationshipConstraint";
|
|
27
|
-
ECStringConstants.CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT = "TargetRelationshipConstraint";
|
|
28
|
-
ECStringConstants.CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT = "AnyRelationshipConstraint";
|
|
29
|
-
ECStringConstants.CONTAINERTYPE_ANY = "Any";
|
|
30
30
|
//# sourceMappingURL=Constants.js.map
|
package/lib/esm/Constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,MAAM,OAAO,iBAAiB
|
|
1
|
+
{"version":3,"file":"Constants.js","sourceRoot":"","sources":["../../src/Constants.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAC5B,mBAAmB;aACI,4BAAuB,GAAW,QAAQ,CAAC;aAC3C,4BAAuB,GAAW,QAAQ,CAAC;IAElE,iBAAiB;aACM,yBAAoB,GAAW,QAAQ,CAAC;aACxC,8BAAyB,GAAW,aAAa,CAAC;aAClD,uCAAkC,GAAW,sBAAsB,CAAC;aACpE,8BAAyB,GAAW,aAAa,CAAC;aAClD,oCAA+B,GAAW,mBAAmB,CAAC;aAC9D,2BAAsB,GAAW,UAAU,CAAC;aAE5C,oCAA+B,GAAW,mBAAmB,CAAC;aAC9D,iCAA4B,GAAW,gBAAgB,CAAC;aACxD,yCAAoC,GAAW,eAAe,CAAC;aAC/D,sCAAiC,GAAW,qBAAqB,CAAC;aAClE,qCAAgC,GAAW,oBAAoB,CAAC;aAChE,8BAAyB,GAAW,aAAa,CAAC;aAElD,+CAA0C,GAAW,8BAA8B,CAAC;aACpF,+CAA0C,GAAW,8BAA8B,CAAC;aACpF,4CAAuC,GAAW,2BAA2B,CAAC;aAE9E,sBAAiB,GAAW,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/**\n * @internal\n */\nexport class ECStringConstants {\n // Relationship End\n public static readonly RELATIONSHIP_END_SOURCE: string = \"Source\";\n public static readonly RELATIONSHIP_END_TARGET: string = \"Target\";\n\n // Container Type\n public static readonly CONTAINERTYPE_SCHEMA: string = \"Schema\";\n public static readonly CONTAINERTYPE_ENTITYCLASS: string = \"EntityClass\";\n public static readonly CONTAINERTYPE_CUSTOMATTRIBUTECLASS: string = \"CustomAttributeClass\";\n public static readonly CONTAINERTYPE_STRUCTCLASS: string = \"StructClass\";\n public static readonly CONTAINERTYPE_RELATIONSHIPCLASS: string = \"RelationshipClass\";\n public static readonly CONTAINERTYPE_ANYCLASS: string = \"AnyClass\";\n\n public static readonly CONTAINERTYPE_PRIMITIVEPROPERTY: string = \"PrimitiveProperty\";\n public static readonly CONTAINERTYPE_STRUCTPROPERTY: string = \"StructProperty\";\n public static readonly CONTAINERTYPE_PRIMITIVEARRAYPROPERTY: string = \"ArrayProperty\";\n public static readonly CONTAINERTYPE_STRUCTARRAYPROPERTY: string = \"StructArrayProperty\";\n public static readonly CONTAINERTYPE_NAVIGATIONPROPERTY: string = \"NavigationProperty\";\n public static readonly CONTAINERTYPE_ANYPROPERTY: string = \"AnyProperty\";\n\n public static readonly CONTAINERTYPE_SOURCERELATIONSHIPCONSTRAINT: string = \"SourceRelationshipConstraint\";\n public static readonly CONTAINERTYPE_TARGETRELATIONSHIPCONSTRAINT: string = \"TargetRelationshipConstraint\";\n public static readonly CONTAINERTYPE_ANYRELATIONSHIPCONSTRAINT: string = \"AnyRelationshipConstraint\";\n\n public static readonly CONTAINERTYPE_ANY: string = \"Any\";\n}\n"]}
|
|
@@ -28,6 +28,7 @@ var _a;
|
|
|
28
28
|
* @beta
|
|
29
29
|
*/
|
|
30
30
|
export class DelayedPromise {
|
|
31
|
+
static { _a = Symbol.toStringTag; }
|
|
31
32
|
/**
|
|
32
33
|
* Constructs a DelayedPromise object.
|
|
33
34
|
* @param startCallback The asynchronous callback to execute when this DelayedPromise should be "started".
|
|
@@ -67,7 +68,6 @@ export class DelayedPromise {
|
|
|
67
68
|
return this.start().finally(onFinally);
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
_a = Symbol.toStringTag;
|
|
71
71
|
// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.
|
|
72
72
|
// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>
|
|
73
73
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAc;
|
|
1
|
+
{"version":3,"file":"DelayedPromise.js","sourceRoot":"","sources":["../../src/DelayedPromise.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;;AAEH;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,OAAO,cAAc;kBAeR,MAAM,CAAC,WAAW;IAbnC;;;OAGG;IACH,YAAY,aAA+B;QAQ3C,qGAAqG;QACrF,QAAoB,GAAG,SAAkB,CAAC;QARxD,IAAI,OAA+B,CAAC;QACpC,IAAI,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE;YACtB,OAAO,GAAG,OAAO,IAAI,aAAa,EAAE,CAAC;YACrC,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;IACJ,CAAC;IAUD;;;;;OAKG;IACI,KAAK,CAAC,IAAI,CAAiC,WAAiF,EAAE,UAAmF;QACtN,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,KAAK,CAAkB,UAAiF;QACnH,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAC,SAA2C;QAC9D,OAAO,IAAI,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACzC,CAAC;CACF;AAgCD,wGAAwG;AACxG,+HAA+H;AAC/H;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAyD,SAAQ,cAAwB;IAC/H,YAAY,KAAa,EAAE,EAA2B;QACpD,KAAK,CAAC,EAAE,CAAC,CAAC;QAEV,MAAM,OAAO,GAAG;YACd,GAAG,EAAE,CAAC,MAAc,EAAE,IAAY,EAAE,EAAE;gBACpC,OAAO,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAkB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAoB,CAAC,CAAC;YAClF,CAAC;SACF,CAAC;QAEF,OAAO,IAAI,KAAK,CAAC,KAAK,EAAE,OAAO,CAAgD,CAAC;IAClF,CAAC;CACF,CAAuC,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Utils\n */\n\n/**\n * Similar to a normal Promise, a DelayedPromise represents the eventual completion (or failure)\n * and resulting value of an asynchronous operation ***that has not yet started***.\n *\n * The asynchronous operation behind a DelayedPromise will start when any of the following occurs:\n * - The DelayedPromise is `await`ed.\n * - A callback is attached via `.then()` or `.catch(() => { })`.\n * - The asynchronous operation is explicitly started via `.start()`\n *\n * Just as normal Promises will never return to their pending state once fulfilled or rejected,\n * a DelayedPromise will never re-execute its asynchronous operation more than **once**.\n *\n * Ultimately, a DelayedPromise is nothing more than some syntactic sugar that allows you to\n * represent an (asynchronously) lazily-loaded value as an instance property instead of a method.\n * You could also accomplish something similar by defining an async function as a property getter.\n * However, since a property defined as a DelayedPromise will not start simply by being accessed,\n * additional (non-lazily-loaded) \"nested\" properties can be added.\n *\n * [!alert text=\"*Remember:* Unlike regular Promises in JavaScript, DelayedPromises represent processes that **may not** already be happening.\" kind=\"warning\"]\n * @beta\n */\nexport class DelayedPromise<T> implements Promise<T> {\n\n /**\n * Constructs a DelayedPromise object.\n * @param startCallback The asynchronous callback to execute when this DelayedPromise should be \"started\".\n */\n constructor(startCallback: () => Promise<T>) {\n let pending: Promise<T> | undefined;\n this.start = async () => {\n pending = pending || startCallback();\n return pending;\n };\n }\n\n // We need this in order to fulfill the Promise interface defined in lib.es2015.symbol.wellknown.d.ts\n public readonly [Symbol.toStringTag] = \"Promise\" as const;\n\n /**\n * Explicitly starts the asynchronous operation behind this DelayedPromise (if it hasn't started already).\n */\n public start: () => Promise<T>;\n\n /**\n * Attaches callbacks for the resolution and/or rejection of the Promise.\n * @param onfulfilled The callback to execute when the Promise is resolved.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of which ever callback is executed.\n */\n public async then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | undefined | null): Promise<TResult1 | TResult2> {\n return this.start().then(onfulfilled, onrejected);\n }\n\n /**\n * Attaches a callback for only the rejection of the Promise.\n * @param onrejected The callback to execute when the Promise is rejected.\n * @return A Promise for the completion of the callback.\n */\n public async catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | undefined | null): Promise<T | TResult> {\n return this.start().catch(onrejected);\n }\n\n /**\n * Attaches a callback for only the finally clause of the Promise.\n * @param onrejected The callback to execute when the Promise is finalized.\n * @return A Promise for the completion of the callback.\n */\n public async finally(onFinally?: (() => void) | undefined | null): Promise<T> {\n return this.start().finally(onFinally);\n }\n}\n\n// This keeps us from accidentally overriding one of DelayedPromise's methods in the DelayedPromiseWithProps constructor\n/**\n * @beta\n */\nexport interface NoDelayedPromiseMethods {\n [propName: string]: any;\n start?: never;\n then?: never;\n catch?: never;\n}\n\n// See definition of DelayedPromiseWithProps below\n/**\n * @beta\n */\nexport interface DelayedPromiseWithPropsConstructor {\n\n /**\n * Constructs a DelayedPromiseWithProps object, which is at once both:\n * - A DelayedPromise object representing the eventual completion (or failure)\n * of an asynchronous operation returning a value of type `TPayload`\n * - _and_ a readonly \"wrapper\" around an instance of type `TProps`\n *\n * @param props An object with properties and methods that will be accessible\n * as if they were readonly properties of the DelayedPromiseWithProps object being constructed.\n * @param startCallback The asynchronous callback to execute when as soon as this DelayedPromise should be \"started\".\n */\n new <TProps extends NoDelayedPromiseMethods, TPayload>(props: TProps, startCallback: () => Promise<TPayload>): Readonly<TProps> & DelayedPromise<TPayload>; // eslint-disable-line @typescript-eslint/prefer-function-type\n}\n\n// Because the property getters that wrap `props` are dynamically added, TypeScript isn't aware of them.\n// So by defining this as a class _expression_, we can cast the constructed type to Readonly<TProps> & DelayedPromise<TPayload>\n/**\n * @beta\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const DelayedPromiseWithProps = (class <TProps extends NoDelayedPromiseMethods, TPayload> extends DelayedPromise<TPayload> {\n constructor(props: TProps, cb: () => Promise<TPayload>) {\n super(cb);\n\n const handler = {\n get: (target: TProps, name: string) => {\n return (name in this) ? this[name as keyof this] : target[name as keyof TProps];\n },\n };\n\n return new Proxy(props, handler) as Readonly<TProps> & DelayedPromise<TPayload>;\n }\n}) as DelayedPromiseWithPropsConstructor;\n\n/* eslint-disable @typescript-eslint/no-redeclare */\n\n/** Define the type of a DelayedPromiseWithProps instance\n * @beta\n */\nexport type DelayedPromiseWithProps<TProps, TPayload> = Readonly<TProps> & DelayedPromise<TPayload>;\n"]}
|
|
@@ -205,8 +205,7 @@ export declare abstract class ECClass extends SchemaItem implements CustomAttrib
|
|
|
205
205
|
* @beta
|
|
206
206
|
*/
|
|
207
207
|
export declare class StructClass extends ECClass {
|
|
208
|
-
readonly schemaItemType
|
|
209
|
-
constructor(schema: Schema, name: string, modifier?: ECClassModifier);
|
|
208
|
+
readonly schemaItemType = SchemaItemType.StructClass;
|
|
210
209
|
}
|
|
211
210
|
/**
|
|
212
211
|
* @internal
|