@itwin/ecschema-metadata 5.9.0-dev.15 → 5.9.0-dev.16
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/Deserialization/JsonParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlParser.js.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/cjs/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/cjs/ECObjects.js.map +1 -1
- package/lib/cjs/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/cjs/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/Metadata/EntityClass.js.map +1 -1
- package/lib/cjs/Metadata/Property.js.map +1 -1
- package/lib/cjs/Metadata/Schema.js.map +1 -1
- package/lib/cjs/SchemaPartVisitorDelegate.js.map +1 -1
- package/lib/esm/Deserialization/JsonParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlParser.js.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.d.ts.map +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js +1 -1
- package/lib/esm/Deserialization/XmlSerializationUtils.js.map +1 -1
- package/lib/esm/ECObjects.js.map +1 -1
- package/lib/esm/IncrementalLoading/ECSqlSchemaLocater.js.map +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js +1 -1
- package/lib/esm/IncrementalLoading/IncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/Metadata/EntityClass.js.map +1 -1
- package/lib/esm/Metadata/Property.js.map +1 -1
- package/lib/esm/Metadata/Schema.js.map +1 -1
- package/lib/esm/SchemaPartVisitorDelegate.js.map +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SchemaPartVisitor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oBACpC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,UAAyB,CAAC,CAAC;gBAChE,MAAM;YACR,KAAK,cAAc,CAAC,IAAI;gBACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa;oBAC7B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAkB,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,cAAc,CAAC,UAAU;gBAC5B,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB;oBACnC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAwB,CAAC,CAAC;gBAC9D,MAAM;QACV,CAAC;IACH,CAAC;CACF","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\nimport { SchemaItemType } from \"./ECObjects\";\nimport { AnyClass, AnyECType } from \"./Interfaces\";\nimport { ECClass, StructClass } from \"./Metadata/Class\";\nimport { Constant } from \"./Metadata/Constant\";\nimport { CustomAttributeContainerProps } from \"./Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nimport { EntityClass } from \"./Metadata/EntityClass\";\nimport { Enumeration } from \"./Metadata/Enumeration\";\nimport { Format } from \"./Metadata/Format\";\nimport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nimport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nimport { Mixin } from \"./Metadata/Mixin\";\nimport { Phenomenon } from \"./Metadata/Phenomenon\";\nimport { AnyProperty, Property } from \"./Metadata/Property\";\nimport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nimport { RelationshipClass, RelationshipConstraint } from \"./Metadata/RelationshipClass\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\nimport { Unit } from \"./Metadata/Unit\";\nimport { UnitSystem } from \"./Metadata/UnitSystem\";\n\n/**\n * Interface to allow schema traversal/deserialization workflows to visit\n * each part, item, class, etc. that exists in a given schema.\n * @public @preview\n */\nexport interface ISchemaPartVisitor {\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n /* async */ visitEmptySchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n visitEmptySchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n /* async */ visitFullSchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n visitFullSchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n /* async */ visitSchemaItem?: (schemaItem: SchemaItem) => Promise<void>;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n visitSchemaItemSync?: (schemaItem: SchemaItem) => void;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n /* async */ visitClass?: (ecClass: AnyClass) => Promise<void>;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n visitClassSync?: (ecClass: AnyClass) => void;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n /* async */ visitProperty?: (property: AnyProperty) => Promise<void>;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n visitPropertySync?: (property: AnyProperty) => void;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n /* async */ visitEntityClass?: (entityClass: EntityClass) => Promise<void>;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n visitEntityClassSync?: (entityClass: EntityClass) => void;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n /* async */ visitStructClass?: (structClass: StructClass) => Promise<void>;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n visitStructClassSync?: (structClass: StructClass) => void;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n /* async */ visitMixin?: (mixin: Mixin) => Promise<void>;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n visitMixinSync?: (mixin: Mixin) => void;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n /* async */ visitRelationshipClass?: (relationshipClass: RelationshipClass) => Promise<void>;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n visitRelationshipClassSync?: (relationshipClass: RelationshipClass) => void;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n /* async */ visitRelationshipConstraint?: (relationshipConstraint: RelationshipConstraint) => Promise<void>;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n visitRelationshipConstraintSync?: (relationshipConstraint: RelationshipConstraint) => void;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n /* async */ visitCustomAttributeClass?: (customAttributeClass: CustomAttributeClass) => Promise<void>;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n visitCustomAttributeClassSync?: (customAttributeClass: CustomAttributeClass) => void;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n /* async */ visitCustomAttributeContainer?: (customAttributeContainer: CustomAttributeContainerProps) => Promise<void>;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n visitCustomAttributeContainerSync?: (customAttributeContainer: CustomAttributeContainerProps) => void;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n /* async */ visitEnumeration?: (enumeration: Enumeration) => Promise<void>;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n visitEnumerationSync?: (enumeration: Enumeration) => void;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n /* async */ visitKindOfQuantity?: (koq: KindOfQuantity) => Promise<void>;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n visitKindOfQuantitySync?: (koq: KindOfQuantity) => void;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n /* async */ visitPropertyCategory?: (category: PropertyCategory) => Promise<void>;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n visitPropertyCategorySync?: (category: PropertyCategory) => void;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n /* async */ visitFormat?: (format: Format) => Promise<void>;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n visitFormatSync?: (format: Format) => void;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n /* async */ visitUnit?: (unit: Unit) => Promise<void>;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n visitUnitSync?: (unit: Unit) => void;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n /* async */ visitInvertedUnit?: (invertedUnit: InvertedUnit) => Promise<void>;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n visitInvertedUnitSync?: (invertedUnit: InvertedUnit) => void;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n /* async */ visitUnitSystem?: (unitSystem: UnitSystem) => Promise<void>;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n visitUnitSystemSync?: (unitSystem: UnitSystem) => void;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n /* async */ visitPhenomenon?: (phenomena: Phenomenon) => Promise<void>;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n visitPhenomenonSync?: (phenomena: Phenomenon) => void;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n /* async */ visitConstant?: (constant: Constant) => Promise<void>;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n visitConstantSync?: (constant: Constant) => void;\n}\n\nfunction isCustomAttributeContainer(object: any): object is CustomAttributeContainerProps {\n return \"customAttributes\" in object;\n}\n\n/**\n * A helper class to call methods on the provided [[ISchemaPartVisitor]].\n * @public @preview\n */\nexport class SchemaPartVisitorDelegate {\n private _visitor: ISchemaPartVisitor;\n\n constructor(visitor: ISchemaPartVisitor) {\n this._visitor = visitor;\n }\n\n /**\n * Calls (async) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public async visitSchema(schema: Schema, fullSchema: boolean = true): Promise<void> {\n if (!fullSchema && this._visitor.visitEmptySchema)\n await this._visitor.visitEmptySchema(schema);\n\n if (fullSchema && this._visitor.visitFullSchema)\n await this._visitor.visitFullSchema(schema);\n }\n\n /**\n * Calls (synchronously) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public visitSchemaSync(schema: Schema, fullSchema: boolean = true): void {\n if (!fullSchema && this._visitor.visitEmptySchemaSync)\n this._visitor.visitEmptySchemaSync(schema);\n\n if (fullSchema && this._visitor.visitFullSchemaSync)\n this._visitor.visitFullSchemaSync(schema);\n }\n\n /**\n * Calls (async) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public async visitSchemaPart(schemaPart: AnyECType): Promise<void> {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n await this.visitSchemaItem(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitProperty) {\n await this._visitor.visitProperty(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraint) {\n await this._visitor.visitRelationshipConstraint(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainer) {\n await this._visitor.visitCustomAttributeContainer(schemaPart);\n }\n }\n\n /**\n * Calls (synchronously) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public visitSchemaPartSync(schemaPart: AnyECType): void {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n this.visitSchemaItemSync(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitPropertySync) {\n this._visitor.visitPropertySync(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraintSync) {\n this._visitor.visitRelationshipConstraintSync(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainerSync)\n this._visitor.visitCustomAttributeContainerSync(schemaPart);\n }\n\n private async visitSchemaItem(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItem)\n await this._visitor.visitSchemaItem(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClass)\n await this._visitor.visitClass(schemaItem as AnyClass);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstant)\n await this._visitor.visitConstant(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClass)\n await this._visitor.visitCustomAttributeClass(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClass)\n await this._visitor.visitEntityClass(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumeration)\n await this._visitor.visitEnumeration(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormat)\n await this._visitor.visitFormat(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnit)\n await this._visitor.visitInvertedUnit(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantity)\n await this._visitor.visitKindOfQuantity(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixin)\n await this._visitor.visitMixin(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenon)\n await this._visitor.visitPhenomenon(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategory)\n await this._visitor.visitPropertyCategory(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClass)\n await this._visitor.visitRelationshipClass(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClass)\n await this._visitor.visitStructClass(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnit)\n await this._visitor.visitUnit(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystem)\n await this._visitor.visitUnitSystem(schemaItem as UnitSystem);\n break;\n }\n }\n\n private visitSchemaItemSync(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItemSync)\n this._visitor.visitSchemaItemSync(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClassSync)\n this._visitor.visitClassSync(schemaItem as AnyClass);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstantSync)\n this._visitor.visitConstantSync(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClassSync)\n this._visitor.visitCustomAttributeClassSync(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClassSync)\n this._visitor.visitEntityClassSync(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumerationSync)\n this._visitor.visitEnumerationSync(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormatSync)\n this._visitor.visitFormatSync(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnitSync)\n this._visitor.visitInvertedUnitSync(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantitySync)\n this._visitor.visitKindOfQuantitySync(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixinSync)\n this._visitor.visitMixinSync(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenonSync)\n this._visitor.visitPhenomenonSync(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategorySync)\n this._visitor.visitPropertyCategorySync(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClassSync)\n this._visitor.visitRelationshipClassSync(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClassSync)\n this._visitor.visitStructClassSync(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnitSync)\n this._visitor.visitUnitSync(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystemSync)\n this._visitor.visitUnitSystemSync(schemaItem as UnitSystem);\n break;\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"SchemaPartVisitorDelegate.js","sourceRoot":"","sources":["../../src/SchemaPartVisitorDelegate.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAe,MAAM,kBAAkB,CAAC;AAWxD,OAAO,EAAe,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAqB,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAEzF,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AA2QnD,SAAS,0BAA0B,CAAC,MAAW;IAC7C,OAAO,kBAAkB,IAAI,MAAM,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,OAAO,yBAAyB;IAC5B,QAAQ,CAAqB;IAErC,YAAY,OAA2B;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,WAAW,CAAC,MAAc,EAAE,aAAsB,IAAI;QACjE,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,gBAAgB;YAC/C,MAAM,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAE/C,IAAI,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe;YAC7C,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACI,eAAe,CAAC,MAAc,EAAE,aAAsB,IAAI;QAC/D,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB;YACnD,IAAI,CAAC,Q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,QAAQ,CAAC,0BAA0B;oBAC1C,IAAI,CAAC,QAAQ,CAAC,0BAA0B,CAAC,UAA+B,CAAC,CAAC;gBAC5E,MAAM;YACR,KAAK,cAAc,CAAC,WAAW;gBAC7B,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB;oBACpC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,UAAyB,CAAC,CAAC;gBAChE,MAAM;YACR,KAAK,cAAc,CAAC,IAAI;gBACtB,IAAI,IAAI,CAAC,QAAQ,CAAC,aAAa;oBAC7B,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,UAAkB,CAAC,CAAC;gBAClD,MAAM;YACR,KAAK,cAAc,CAAC,UAAU;gBAC5B,IAAI,IAAI,CAAC,QAAQ,CAAC,mBAAmB;oBACnC,IAAI,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;gBAChD,MAAM;QACV,CAAC;IACH,CAAC;CACF","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\nimport { SchemaItemType } from \"./ECObjects\";\nimport { AnyClass, AnyECType } from \"./Interfaces\";\nimport { ECClass, StructClass } from \"./Metadata/Class\";\nimport { Constant } from \"./Metadata/Constant\";\nimport { CustomAttributeContainerProps } from \"./Metadata/CustomAttribute\";\nimport { CustomAttributeClass } from \"./Metadata/CustomAttributeClass\";\nimport { EntityClass } from \"./Metadata/EntityClass\";\nimport { Enumeration } from \"./Metadata/Enumeration\";\nimport { Format } from \"./Metadata/Format\";\nimport { InvertedUnit } from \"./Metadata/InvertedUnit\";\nimport { KindOfQuantity } from \"./Metadata/KindOfQuantity\";\nimport { Mixin } from \"./Metadata/Mixin\";\nimport { Phenomenon } from \"./Metadata/Phenomenon\";\nimport { AnyProperty, Property } from \"./Metadata/Property\";\nimport { PropertyCategory } from \"./Metadata/PropertyCategory\";\nimport { RelationshipClass, RelationshipConstraint } from \"./Metadata/RelationshipClass\";\nimport { Schema } from \"./Metadata/Schema\";\nimport { SchemaItem } from \"./Metadata/SchemaItem\";\nimport { Unit } from \"./Metadata/Unit\";\nimport { UnitSystem } from \"./Metadata/UnitSystem\";\n\n/**\n * Interface to allow schema traversal/deserialization workflows to visit\n * each part, item, class, etc. that exists in a given schema.\n * @public @preview\n */\nexport interface ISchemaPartVisitor {\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n /* async */ visitEmptySchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a partially loaded schema. During deserialization, this would\n * be after a schema and all its references are deserialized, but _before_\n * any of its items or custom attributes have been deserialized.\n * @param schema A partially-loaded Schema.\n */\n visitEmptySchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n /* async */ visitFullSchema?: (schema: Schema) => Promise<void>;\n\n /**\n * Called for a fully loaded schema.\n * @param schema A fully-loaded Schema.\n */\n visitFullSchemaSync?: (schema: Schema) => void;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n /* async */ visitSchemaItem?: (schemaItem: SchemaItem) => Promise<void>;\n\n /**\n * Called for each [[SchemaItem]] instance.\n * @param schemaItem a SchemaItem object.\n */\n visitSchemaItemSync?: (schemaItem: SchemaItem) => void;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n /* async */ visitClass?: (ecClass: AnyClass) => Promise<void>;\n\n /**\n * Called for each [[AnyClass]] instance.\n * @param ecClass an ECClass object.\n */\n visitClassSync?: (ecClass: AnyClass) => void;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n /* async */ visitProperty?: (property: AnyProperty) => Promise<void>;\n\n /**\n * Called for each [[AnyProperty]] instance of an ECClass.\n * @param property an AnyProperty object.\n */\n visitPropertySync?: (property: AnyProperty) => void;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n /* async */ visitEntityClass?: (entityClass: EntityClass) => Promise<void>;\n\n /**\n * Called for each [[EntityClass]] instance.\n * @param entityClass an EntityClass object.\n */\n visitEntityClassSync?: (entityClass: EntityClass) => void;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n /* async */ visitStructClass?: (structClass: StructClass) => Promise<void>;\n\n /**\n * Called for each [[StructClass]] instance.\n * @param structClass a StructClass object.\n */\n visitStructClassSync?: (structClass: StructClass) => void;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n /* async */ visitMixin?: (mixin: Mixin) => Promise<void>;\n\n /**\n * Called for each [[Mixin]] instance.\n * @param mixin a Mixin object.\n */\n visitMixinSync?: (mixin: Mixin) => void;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n /* async */ visitRelationshipClass?: (relationshipClass: RelationshipClass) => Promise<void>;\n\n /**\n * Called for each [[RelationshipClass]] instance.\n * @param relationshipClass a RelationshipClass object.\n */\n visitRelationshipClassSync?: (relationshipClass: RelationshipClass) => void;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n /* async */ visitRelationshipConstraint?: (relationshipConstraint: RelationshipConstraint) => Promise<void>;\n\n /**\n * Called for each [[RelationshipConstraint]] of each RelationshipClass.\n * @param relationshipConstraint a RelationshipConstraint object.\n */\n visitRelationshipConstraintSync?: (relationshipConstraint: RelationshipConstraint) => void;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n /* async */ visitCustomAttributeClass?: (customAttributeClass: CustomAttributeClass) => Promise<void>;\n\n /**\n * Called for each [[CustomAttributeClass]] instance.\n * @param customAttributeClass a CustomAttributeClass object.\n */\n visitCustomAttributeClassSync?: (customAttributeClass: CustomAttributeClass) => void;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n /* async */ visitCustomAttributeContainer?: (customAttributeContainer: CustomAttributeContainerProps) => Promise<void>;\n\n /**\n * Called for each CustomAttribute container in the schema.\n * @param customAttributeContainer a CustomAttributeContainerProps object.\n */\n visitCustomAttributeContainerSync?: (customAttributeContainer: CustomAttributeContainerProps) => void;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n /* async */ visitEnumeration?: (enumeration: Enumeration) => Promise<void>;\n\n /**\n * Called for each [[Enumeration]] instance.\n * @param enumeration an Enumeration object.\n */\n visitEnumerationSync?: (enumeration: Enumeration) => void;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n /* async */ visitKindOfQuantity?: (koq: KindOfQuantity) => Promise<void>;\n\n /**\n * Called for each [[KindOfQuantity]] instance.\n * @param koq a KindOfQuantity object.\n */\n visitKindOfQuantitySync?: (koq: KindOfQuantity) => void;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n /* async */ visitPropertyCategory?: (category: PropertyCategory) => Promise<void>;\n\n /**\n * Called for each [[PropertyCategory]] instance.\n * @param category a PropertyCategory object.\n */\n visitPropertyCategorySync?: (category: PropertyCategory) => void;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n /* async */ visitFormat?: (format: Format) => Promise<void>;\n\n /**\n * Called for each [[Format]] instance.\n * @param format a Format object.\n */\n visitFormatSync?: (format: Format) => void;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n /* async */ visitUnit?: (unit: Unit) => Promise<void>;\n\n /**\n * Called for each [[Unit]] instance.\n * @param unit a Unit object.\n */\n visitUnitSync?: (unit: Unit) => void;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n /* async */ visitInvertedUnit?: (invertedUnit: InvertedUnit) => Promise<void>;\n\n /**\n * Called for each [[InvertedUnit]] instance.\n * @param invertedUnit an InvertedUnit object.\n */\n visitInvertedUnitSync?: (invertedUnit: InvertedUnit) => void;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n /* async */ visitUnitSystem?: (unitSystem: UnitSystem) => Promise<void>;\n\n /**\n * Called for each [[UnitSystem]] instance.\n * @param unitSystem a UnitSystem object.\n */\n visitUnitSystemSync?: (unitSystem: UnitSystem) => void;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n /* async */ visitPhenomenon?: (phenomena: Phenomenon) => Promise<void>;\n\n /**\n * Called for each [[Phenomenon]] instance.\n * @param phenomena a Phenomenon object.\n */\n visitPhenomenonSync?: (phenomena: Phenomenon) => void;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n /* async */ visitConstant?: (constant: Constant) => Promise<void>;\n\n /**\n * Called for each [[Constant]] instance.\n * @param constant a Constant object.\n */\n visitConstantSync?: (constant: Constant) => void;\n}\n\nfunction isCustomAttributeContainer(object: any): object is CustomAttributeContainerProps {\n return \"customAttributes\" in object;\n}\n\n/**\n * A helper class to call methods on the provided [[ISchemaPartVisitor]].\n * @public @preview\n */\nexport class SchemaPartVisitorDelegate {\n private _visitor: ISchemaPartVisitor;\n\n constructor(visitor: ISchemaPartVisitor) {\n this._visitor = visitor;\n }\n\n /**\n * Calls (async) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public async visitSchema(schema: Schema, fullSchema: boolean = true): Promise<void> {\n if (!fullSchema && this._visitor.visitEmptySchema)\n await this._visitor.visitEmptySchema(schema);\n\n if (fullSchema && this._visitor.visitFullSchema)\n await this._visitor.visitFullSchema(schema);\n }\n\n /**\n * Calls (synchronously) visitEmptySchema or visitFullSchema on the configured [[ISchemaPartVisitor]].\n * @param schema The schema to pass to the visitor.\n * @param fullSchema Indicates if the schema is partially or fully-loaded.\n */\n public visitSchemaSync(schema: Schema, fullSchema: boolean = true): void {\n if (!fullSchema && this._visitor.visitEmptySchemaSync)\n this._visitor.visitEmptySchemaSync(schema);\n\n if (fullSchema && this._visitor.visitFullSchemaSync)\n this._visitor.visitFullSchemaSync(schema);\n }\n\n /**\n * Calls (async) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public async visitSchemaPart(schemaPart: AnyECType): Promise<void> {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n await this.visitSchemaItem(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitProperty) {\n await this._visitor.visitProperty(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraint) {\n await this._visitor.visitRelationshipConstraint(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainer) {\n await this._visitor.visitCustomAttributeContainer(schemaPart);\n }\n }\n\n /**\n * Calls (synchronously) the appropriate visit methods on the configured [[ISchemaPartVisitor]]\n * based on the type of the part specified.\n * @param schemaPart The schema part to pass to the visitor methods.\n */\n public visitSchemaPartSync(schemaPart: AnyECType): void {\n if (SchemaItem.isSchemaItem(schemaPart)) {\n this.visitSchemaItemSync(schemaPart);\n } else if (Property.isProperty(schemaPart) && this._visitor.visitPropertySync) {\n this._visitor.visitPropertySync(schemaPart);\n } else if (RelationshipConstraint.isRelationshipConstraint(schemaPart) && this._visitor.visitRelationshipConstraintSync) {\n this._visitor.visitRelationshipConstraintSync(schemaPart);\n }\n\n if (isCustomAttributeContainer(schemaPart) && this._visitor.visitCustomAttributeContainerSync)\n this._visitor.visitCustomAttributeContainerSync(schemaPart);\n }\n\n private async visitSchemaItem(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItem)\n await this._visitor.visitSchemaItem(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClass)\n await this._visitor.visitClass(schemaItem);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstant)\n await this._visitor.visitConstant(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClass)\n await this._visitor.visitCustomAttributeClass(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClass)\n await this._visitor.visitEntityClass(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumeration)\n await this._visitor.visitEnumeration(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormat)\n await this._visitor.visitFormat(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnit)\n await this._visitor.visitInvertedUnit(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantity)\n await this._visitor.visitKindOfQuantity(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixin)\n await this._visitor.visitMixin(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenon)\n await this._visitor.visitPhenomenon(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategory)\n await this._visitor.visitPropertyCategory(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClass)\n await this._visitor.visitRelationshipClass(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClass)\n await this._visitor.visitStructClass(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnit)\n await this._visitor.visitUnit(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystem)\n await this._visitor.visitUnitSystem(schemaItem);\n break;\n }\n }\n\n private visitSchemaItemSync(schemaItem: SchemaItem) {\n if (this._visitor.visitSchemaItemSync)\n this._visitor.visitSchemaItemSync(schemaItem);\n\n if (ECClass.isECClass(schemaItem) && this._visitor.visitClassSync)\n this._visitor.visitClassSync(schemaItem);\n\n switch (schemaItem.schemaItemType) {\n case SchemaItemType.Constant:\n if (this._visitor.visitConstantSync)\n this._visitor.visitConstantSync(schemaItem as Constant);\n break;\n case SchemaItemType.CustomAttributeClass:\n if (this._visitor.visitCustomAttributeClassSync)\n this._visitor.visitCustomAttributeClassSync(schemaItem as CustomAttributeClass);\n break;\n case SchemaItemType.EntityClass:\n if (this._visitor.visitEntityClassSync)\n this._visitor.visitEntityClassSync(schemaItem as EntityClass);\n break;\n case SchemaItemType.Enumeration:\n if (this._visitor.visitEnumerationSync)\n this._visitor.visitEnumerationSync(schemaItem as Enumeration);\n break;\n case SchemaItemType.Format:\n if (this._visitor.visitFormatSync)\n this._visitor.visitFormatSync(schemaItem as Format);\n break;\n case SchemaItemType.InvertedUnit:\n if (this._visitor.visitInvertedUnitSync)\n this._visitor.visitInvertedUnitSync(schemaItem as InvertedUnit);\n break;\n case SchemaItemType.KindOfQuantity:\n if (this._visitor.visitKindOfQuantitySync)\n this._visitor.visitKindOfQuantitySync(schemaItem as KindOfQuantity);\n break;\n case SchemaItemType.Mixin:\n if (this._visitor.visitMixinSync)\n this._visitor.visitMixinSync(schemaItem as Mixin);\n break;\n case SchemaItemType.Phenomenon:\n if (this._visitor.visitPhenomenonSync)\n this._visitor.visitPhenomenonSync(schemaItem as Phenomenon);\n break;\n case SchemaItemType.PropertyCategory:\n if (this._visitor.visitPropertyCategorySync)\n this._visitor.visitPropertyCategorySync(schemaItem as PropertyCategory);\n break;\n case SchemaItemType.RelationshipClass:\n if (this._visitor.visitRelationshipClassSync)\n this._visitor.visitRelationshipClassSync(schemaItem as RelationshipClass);\n break;\n case SchemaItemType.StructClass:\n if (this._visitor.visitStructClassSync)\n this._visitor.visitStructClassSync(schemaItem as StructClass);\n break;\n case SchemaItemType.Unit:\n if (this._visitor.visitUnitSync)\n this._visitor.visitUnitSync(schemaItem as Unit);\n break;\n case SchemaItemType.UnitSystem:\n if (this._visitor.visitUnitSystemSync)\n this._visitor.visitUnitSystemSync(schemaItem);\n break;\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/ecschema-metadata",
|
|
3
|
-
"version": "5.9.0-dev.
|
|
3
|
+
"version": "5.9.0-dev.16",
|
|
4
4
|
"description": "ECObjects core concepts in typescript",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "lib/cjs/ecschema-metadata.js",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"rimraf": "^6.0.1",
|
|
42
42
|
"typescript": "~5.6.2",
|
|
43
43
|
"vitest": "^3.0.6",
|
|
44
|
-
"@itwin/build-tools": "5.9.0-dev.
|
|
45
|
-
"@itwin/core-
|
|
46
|
-
"@itwin/core-
|
|
44
|
+
"@itwin/build-tools": "5.9.0-dev.16",
|
|
45
|
+
"@itwin/core-bentley": "5.9.0-dev.16",
|
|
46
|
+
"@itwin/core-quantity": "5.9.0-dev.16"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@itwin/core-bentley": "5.9.0-dev.
|
|
50
|
-
"@itwin/core-quantity": "5.9.0-dev.
|
|
49
|
+
"@itwin/core-bentley": "5.9.0-dev.16",
|
|
50
|
+
"@itwin/core-quantity": "5.9.0-dev.16"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "npm run -s build:cjs && npm run -s build:esm",
|