@itwin/core-backend 5.13.0-dev.8 → 5.14.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +5 -0
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +13 -3
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +3 -3
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +2 -2
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts.map +1 -1
- package/lib/cjs/EditTxn.js +1 -0
- package/lib/cjs/EditTxn.js.map +1 -1
- package/lib/cjs/Element.d.ts +48 -12
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +120 -24
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +30 -15
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +51 -15
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/Model.d.ts +5 -5
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/PropertyStore.js +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +37 -9
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +125 -6
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SynchronousChannel.d.ts +62 -0
- package/lib/cjs/SynchronousChannel.d.ts.map +1 -0
- package/lib/cjs/SynchronousChannel.js +11 -0
- package/lib/cjs/SynchronousChannel.js.map +1 -0
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +44 -4
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +72 -14
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +6 -6
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts +22 -7
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +104 -36
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +25 -10
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +1 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +1 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.d.ts +22 -0
- package/lib/cjs/internal/IntegrityCheck.d.ts.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.js +13 -0
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/NoReservations.d.ts +6 -0
- package/lib/cjs/internal/NoReservations.d.ts.map +1 -0
- package/lib/cjs/internal/NoReservations.js +21 -0
- package/lib/cjs/internal/NoReservations.js.map +1 -0
- package/lib/cjs/internal/SchemaSyncReservations.d.ts +4 -0
- package/lib/cjs/internal/SchemaSyncReservations.d.ts.map +1 -0
- package/lib/cjs/internal/SchemaSyncReservations.js +118 -0
- package/lib/cjs/internal/SchemaSyncReservations.js.map +1 -0
- package/lib/cjs/internal/Symbols.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +5 -0
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +13 -3
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +3 -3
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +2 -2
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/EditTxn.d.ts.map +1 -1
- package/lib/esm/EditTxn.js +1 -0
- package/lib/esm/EditTxn.js.map +1 -1
- package/lib/esm/Element.d.ts +48 -12
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +121 -25
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +30 -15
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +52 -16
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/Model.d.ts +5 -5
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/PropertyStore.js +1 -1
- package/lib/esm/PropertyStore.js.map +1 -1
- package/lib/esm/SchemaSync.d.ts +37 -9
- package/lib/esm/SchemaSync.d.ts.map +1 -1
- package/lib/esm/SchemaSync.js +127 -8
- package/lib/esm/SchemaSync.js.map +1 -1
- package/lib/esm/SynchronousChannel.d.ts +62 -0
- package/lib/esm/SynchronousChannel.d.ts.map +1 -0
- package/lib/esm/SynchronousChannel.js +9 -0
- package/lib/esm/SynchronousChannel.js.map +1 -0
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +44 -4
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +72 -14
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +6 -6
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts +22 -7
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +104 -36
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +25 -10
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/core-backend.d.ts +1 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +1 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.d.ts +22 -0
- package/lib/esm/internal/IntegrityCheck.d.ts.map +1 -1
- package/lib/esm/internal/IntegrityCheck.js +13 -0
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/NoReservations.d.ts +6 -0
- package/lib/esm/internal/NoReservations.d.ts.map +1 -0
- package/lib/esm/internal/NoReservations.js +18 -0
- package/lib/esm/internal/NoReservations.js.map +1 -0
- package/lib/esm/internal/SchemaSyncReservations.d.ts +4 -0
- package/lib/esm/internal/SchemaSyncReservations.d.ts.map +1 -0
- package/lib/esm/internal/SchemaSyncReservations.js +115 -0
- package/lib/esm/internal/SchemaSyncReservations.js.map +1 -0
- package/lib/esm/internal/Symbols.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +8 -3
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +178 -2
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +48 -18
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +177 -0
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/ecdb/QueryReaders.test.js +2 -16
- package/lib/esm/test/ecdb/QueryReaders.test.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js +2 -2
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +80 -2
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/imodel/IModelECSql.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelECSql.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelECSql.test.js +367 -0
- package/lib/esm/test/imodel/IModelECSql.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelElements.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelElements.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelElements.test.js +969 -0
- package/lib/esm/test/imodel/IModelElements.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.js +539 -0
- package/lib/esm/test/imodel/IModelGeolocation.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.js +499 -0
- package/lib/esm/test/imodel/IModelLifecycle.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelMetadata.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelMetadata.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelMetadata.test.js +274 -0
- package/lib/esm/test/imodel/IModelMetadata.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelModels.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelModels.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelModels.test.js +357 -0
- package/lib/esm/test/imodel/IModelModels.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelRelationships.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelRelationships.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelRelationships.test.js +407 -0
- package/lib/esm/test/imodel/IModelRelationships.test.js.map +1 -0
- package/lib/esm/test/imodel/IModelTestFixtures.d.ts +53 -0
- package/lib/esm/test/imodel/IModelTestFixtures.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelTestFixtures.js +107 -0
- package/lib/esm/test/imodel/IModelTestFixtures.js.map +1 -0
- package/lib/esm/test/imodel/IModelViews.test.d.ts +2 -0
- package/lib/esm/test/imodel/IModelViews.test.d.ts.map +1 -0
- package/lib/esm/test/imodel/IModelViews.test.js +199 -0
- package/lib/esm/test/imodel/IModelViews.test.js.map +1 -0
- package/lib/esm/test/index.d.ts +0 -1
- package/lib/esm/test/index.d.ts.map +1 -1
- package/lib/esm/test/index.js +0 -1
- package/lib/esm/test/index.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +8 -26
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts +2 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js +263 -0
- package/lib/esm/test/standalone/DgnDomainMergeConflict.test.js.map +1 -0
- package/lib/esm/test/standalone/GeometryStream.test.js +1 -3
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.d.ts.map +1 -1
- package/lib/esm/test/standalone/IModelWrite.test.js +78 -1
- package/lib/esm/test/standalone/IModelWrite.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +29 -10
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +23 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -1
- package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts +2 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.js +221 -0
- package/lib/esm/test/standalone/SchemaSyncDb.test.js.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts +2 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js +459 -0
- package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js.map +1 -0
- package/lib/esm/test/standalone/SnapshotDb.test.js +1 -0
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/lib/esm/test/standalone/TxnManager.test.js +108 -8
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/package.json +13 -16
- package/lib/esm/test/RevisionUtility.d.ts +0 -33
- package/lib/esm/test/RevisionUtility.d.ts.map +0 -1
- package/lib/esm/test/RevisionUtility.js +0 -52
- package/lib/esm/test/RevisionUtility.js.map +0 -1
- package/lib/esm/test/imodel/IModel.test.d.ts +0 -2
- package/lib/esm/test/imodel/IModel.test.d.ts.map +0 -1
- package/lib/esm/test/imodel/IModel.test.js +0 -3277
- package/lib/esm/test/imodel/IModel.test.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextAnnotationElement.js","sourceRoot":"","sources":["../../../src/annotations/TextAnnotationElement.ts"],"names":[],"mappings":";AAAA;;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,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;;AAnMH,kDAoMC","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 Elements\r\n */\r\n\r\nimport { AnnotationTextStyleProps, BisCodeSpec, Code, CodeProps, CodeScopeProps, CodeSpec, ECVersionString, ElementGeometry, ElementGeometryBuilderParams, EntityReferenceSet, Placement2d, Placement2dProps, Placement3d, Placement3dProps, PlacementProps, TextAnnotation, TextAnnotation2dProps, TextAnnotation3dProps, TextAnnotationProps, TextStyleSettings, TextStyleSettingsProps, traverseTextBlockComponent, VersionedJSON } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { AnnotationElement2d, DefinitionElement, Drawing, GraphicalElement3d, OnElementIdArg, OnElementPropsArg } from \"../Element\";\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { layoutTextBlock, TextStyleResolver } from \"./TextBlockLayout\";\r\nimport { appendTextAnnotationGeometry } from \"./TextAnnotationGeometry\";\r\nimport { ElementDrivesTextAnnotation, TextAnnotationUsesTextStyleByDefault, TextBlockAndId } from \"./ElementDrivesTextAnnotation\";\r\nimport { IModelElementCloneContext } from \"../IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"../Entity\";\r\n\r\nimport * as semver from \"semver\";\r\n\r\n\r\n/** The version of the JSON stored in `TextAnnotation2d/3dProps.textAnnotationData` used by the code.\r\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\r\n * @internal\r\n*/\r\nexport const TEXT_ANNOTATION_JSON_VERSION = \"1.0.0\";\r\n\r\nfunction validateAndMigrateVersionedJSON<T>(\r\n json: string,\r\n currentVersion: ECVersionString,\r\n migrate: (old: VersionedJSON<T>) => T\r\n): VersionedJSON<T> | undefined {\r\n let parsed;\r\n try {\r\n parsed = JSON.parse(json) as VersionedJSON<T>;\r\n } catch {\r\n return undefined;\r\n }\r\n\r\n const version = parsed.version;\r\n if (typeof version !== \"string\" || !semver.valid(version))\r\n throw new Error(\"JSON version is missing or invalid.\");\r\n\r\n if (typeof parsed.data !== \"object\" || parsed.data === null)\r\n throw new Error(\"JSON data is missing or invalid.\");\r\n\r\n // Newer\r\n if (semver.gt(version, currentVersion))\r\n throw new Error(`JSON version ${parsed.version} is newer than supported version ${currentVersion}. Application update required to understand data.`);\r\n\r\n // Older\r\n if (semver.lt(version, currentVersion)) {\r\n parsed.data = migrate(parsed);\r\n parsed.version = currentVersion;\r\n }\r\n\r\n return parsed;\r\n}\r\n\r\nfunction migrateTextAnnotationData(oldData: VersionedJSON<TextAnnotationProps>): TextAnnotationProps {\r\n if (oldData.version === TEXT_ANNOTATION_JSON_VERSION) return oldData.data;\r\n\r\n // Place migration logic here.\r\n\r\n throw new Error(`Migration for textAnnotationData from version ${oldData.version} to ${TEXT_ANNOTATION_JSON_VERSION} failed.`);\r\n}\r\n\r\n/** Parses, validates, and potentially migrates the text annotation data from a JSON string.\r\n * @internal\r\n */\r\nexport function parseTextAnnotationData(json: string | undefined): VersionedJSON<TextAnnotationProps> | undefined {\r\n if (!json) return undefined;\r\n\r\n return validateAndMigrateVersionedJSON<TextAnnotationProps>(json, TEXT_ANNOTATION_JSON_VERSION, migrateTextAnnotationData);\r\n}\r\n\r\nfunction getElementGeometryBuilderParams(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, _placementProps: PlacementProps, annotationProps?: TextAnnotationProps, textStyleId?: Id64String, _subCategory?: Id64String): ElementGeometryBuilderParams {\r\n const textBlock = TextAnnotation.fromJSON(annotationProps).textBlock;\r\n const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: textStyleId ?? \"\", iModel });\r\n const layout = layoutTextBlock({ iModel, textBlock, textStyleResolver });\r\n const builder = new ElementGeometry.Builder();\r\n let scaleFactor = 1;\r\n const element = iModel.elements.getElement(modelId);\r\n if (element instanceof Drawing)\r\n scaleFactor = element.scaleFactor;\r\n appendTextAnnotationGeometry({ layout, textStyleResolver, scaleFactor, annotationProps: annotationProps ?? {}, builder, categoryId });\r\n\r\n return { entryArray: builder.entries };\r\n}\r\n\r\n/** Arguments supplied when creating a [[TextAnnotation2d]].\r\n * @beta\r\n */\r\nexport interface TextAnnotation2dCreateArgs {\r\n /** The category ID for the annotation. */\r\n category: Id64String;\r\n /** The model ID where the annotation will be placed. */\r\n model: Id64String;\r\n /** The placement properties for the annotation. */\r\n placement: Placement2dProps;\r\n /** The default text style ID for the annotation. */\r\n defaultTextStyleId?: Id64String;\r\n /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation2d`. Essentially an empty element if not provided. */\r\n textAnnotationProps?: TextAnnotationProps;\r\n /** Optional code for the element. */\r\n code?: CodeProps;\r\n}\r\n\r\n/** Arguments supplied when creating a [[TextAnnotation3d]].\r\n * @beta\r\n */\r\nexport interface TextAnnotation3dCreateArgs {\r\n /** The category ID for the annotation. */\r\n category: Id64String;\r\n /** The model ID where the annotation will be placed. */\r\n model: Id64String;\r\n /** The placement properties for the annotation. */\r\n placement: Placement3dProps;\r\n /** The default text style ID for the annotation. */\r\n defaultTextStyleId?: Id64String;\r\n /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation3d`. Essentially an empty element if not provided. */\r\n textAnnotationProps?: TextAnnotationProps;\r\n /** Optional code for the element. */\r\n code?: CodeProps;\r\n}\r\n\r\n/** An element that displays textual content within a 2d model.\r\n * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed.\r\n * @see [[setAnnotation]] to change the textual content.\r\n * @public @preview\r\n */\r\nexport class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnnotation */ {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation2d\"; }\r\n /**\r\n * The default [[AnnotationTextStyle]] used by the TextAnnotation2d.\r\n * @beta\r\n */\r\n public defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;\r\n /** The data associated with the text annotation. */\r\n private _textAnnotationProps?: TextAnnotationProps;\r\n\r\n /** Extract the textual content, if present.\r\n * @see [[setAnnotation]] to change it.\r\n */\r\n public getAnnotation(): TextAnnotation | undefined {\r\n return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;\r\n }\r\n\r\n /** Change the textual content of the `TextAnnotation2d`.\r\n * @see [[getAnnotation]] to extract the current annotation.\r\n * @param annotation The new annotation\r\n */\r\n public setAnnotation(annotation: TextAnnotation) {\r\n this._textAnnotationProps = annotation.toJSON();\r\n }\r\n\r\n protected constructor(props: TextAnnotation2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.defaultTextStyle) {\r\n this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);\r\n }\r\n this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;\r\n }\r\n\r\n /** Creates a new instance of `TextAnnotation2d` from its JSON representation. */\r\n public static fromJSON(props: TextAnnotation2dProps, iModel: IModelDb): TextAnnotation2d {\r\n return new TextAnnotation2d(props, iModel);\r\n }\r\n\r\n /**\r\n * Converts the current `TextAnnotation2d` instance to its JSON representation.\r\n * It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): TextAnnotation2dProps {\r\n const props = super.toJSON() as TextAnnotation2dProps;\r\n props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;\r\n if (this._textAnnotationProps) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Creates a new `TextAnnotation2d` instance with the specified properties.\r\n * @param iModelDb The iModel.\r\n * @param arg The arguments for creating the TextAnnotation2d.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextAnnotation2dCreateArgs): TextAnnotation2d {\r\n const elementProps: TextAnnotation2dProps = {\r\n classFullName: this.classFullName,\r\n textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,\r\n defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,\r\n placement: arg.placement,\r\n model: arg.model,\r\n category: arg.category,\r\n code: arg.code ?? Code.createEmpty(),\r\n };\r\n return new this(elementProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation2d on insert and validates version.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation2d on update and validates version.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).\r\n * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.\r\n * Also, validates the version of the text annotation data and migrates it if necessary.\r\n * @beta\r\n */\r\n protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void {\r\n const props = arg.props as TextAnnotation2dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);\r\n if (!props.elementGeometryBuilderParams && textAnnotationData) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement2d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);\r\n }\r\n }\r\n\r\n /**\r\n * TextAnnotation2d custom HandledProps include 'textAnnotationData'.\r\n * @inheritdoc\r\n * @internal\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"textAnnotationData\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * TextAnnotation2d deserializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): TextAnnotation2dProps {\r\n const elProps = super.deserialize(props) as TextAnnotation2dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);\r\n if (textAnnotationData) {\r\n elProps.textAnnotationData = JSON.stringify(textAnnotationData);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * TextAnnotation2d serializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: TextAnnotation2dProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.textAnnotationData !== undefined) {\r\n inst.textAnnotationData = props.textAnnotationData;\r\n }\r\n return inst;\r\n }\r\n\r\n /** @internal */\r\n public getTextBlocks(): Iterable<TextBlockAndId> {\r\n return getTextBlocks(this);\r\n }\r\n\r\n /** @internal */\r\n public updateTextBlocks(textBlocks: TextBlockAndId[]): void {\r\n return updateTextBlocks(this, textBlocks);\r\n }\r\n\r\n /** @internal */\r\n public static override onInserted(arg: OnElementIdArg): void {\r\n super.onInserted(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n /** @internal */\r\n public static override onUpdated(arg: OnElementIdArg): void {\r\n super.onUpdated(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n collectReferenceIds(this, referenceIds);\r\n }\r\n\r\n /** @internal */\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: TextAnnotation2dProps, dstProps: TextAnnotation2dProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n\r\n const srcElem = TextAnnotation2d.fromJSON(srcProps, context.sourceDb);\r\n ElementDrivesTextAnnotation.remapFields(srcElem, context);\r\n const anno = srcElem.getAnnotation();\r\n dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;\r\n\r\n return remapTextStyle(context, srcElem, dstProps);\r\n }\r\n}\r\n\r\n/** An element that displays textual content within a 3d model.\r\n * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed.\r\n * @see [[setAnnotation]] to change the textual content.\r\n * @public @preview\r\n */\r\nexport class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnnotation */ {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation3d\"; }\r\n /**\r\n * The default [[AnnotationTextStyle]] used by the TextAnnotation3d.\r\n * @beta\r\n */\r\n public defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;\r\n /** The data associated with the text annotation. */\r\n private _textAnnotationProps?: TextAnnotationProps;\r\n\r\n /** Extract the textual content, if present.\r\n * @see [[setAnnotation]] to change it.\r\n */\r\n public getAnnotation(): TextAnnotation | undefined {\r\n return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;\r\n }\r\n\r\n /** Change the textual content of the `TextAnnotation3d`.\r\n * @see [[getAnnotation]] to extract the current annotation.\r\n * @param annotation The new annotation\r\n */\r\n public setAnnotation(annotation: TextAnnotation) {\r\n this._textAnnotationProps = annotation.toJSON();\r\n }\r\n\r\n protected constructor(props: TextAnnotation3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.defaultTextStyle) {\r\n this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);\r\n }\r\n this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;\r\n }\r\n\r\n /** Creates a new instance of `TextAnnotation3d` from its JSON representation. */\r\n public static fromJSON(props: TextAnnotation3dProps, iModel: IModelDb): TextAnnotation3d {\r\n return new TextAnnotation3d(props, iModel);\r\n }\r\n\r\n /**\r\n * Converts the current `TextAnnotation3d` instance to its JSON representation.\r\n * It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): TextAnnotation3dProps {\r\n const props = super.toJSON() as TextAnnotation3dProps;\r\n props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;\r\n if (this._textAnnotationProps) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Creates a new `TextAnnotation3d` instance with the specified properties.\r\n * @param iModelDb The iModel.\r\n * @param arg The arguments for creating the TextAnnotation3d.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextAnnotation3dCreateArgs): TextAnnotation3d {\r\n const elementProps: TextAnnotation3dProps = {\r\n classFullName: this.classFullName,\r\n textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,\r\n defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,\r\n placement: arg.placement,\r\n model: arg.model,\r\n category: arg.category,\r\n code: arg.code ?? Code.createEmpty(),\r\n };\r\n return new this(elementProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation3d on insert and validates version..\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation3d on update and validates version..\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).\r\n * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.\r\n * Also, validates the version of the text annotation data and migrates it if necessary.\r\n * @beta\r\n */\r\n protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void {\r\n const props = arg.props as TextAnnotation3dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);\r\n if (!props.elementGeometryBuilderParams && textAnnotationData) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement3d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);\r\n }\r\n }\r\n\r\n /**\r\n * TextAnnotation3d custom HandledProps include 'textAnnotationData'.\r\n * @inheritdoc\r\n * @internal\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"textAnnotationData\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * TextAnnotation3d deserializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): TextAnnotation3dProps {\r\n const elProps = super.deserialize(props) as TextAnnotation3dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);\r\n if (textAnnotationData) {\r\n elProps.textAnnotationData = JSON.stringify(textAnnotationData);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * TextAnnotation3d serializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: TextAnnotation3dProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.textAnnotationData !== undefined) {\r\n inst.textAnnotationData = props.textAnnotationData;\r\n }\r\n return inst;\r\n }\r\n\r\n /** @internal */\r\n public getTextBlocks(): Iterable<TextBlockAndId> {\r\n return getTextBlocks(this);\r\n }\r\n\r\n /** @internal */\r\n public updateTextBlocks(textBlocks: TextBlockAndId[]): void {\r\n return updateTextBlocks(this, textBlocks);\r\n }\r\n\r\n /** @internal */\r\n public static override onInserted(arg: OnElementIdArg): void {\r\n super.onInserted(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n /** @internal */\r\n public static override onUpdated(arg: OnElementIdArg): void {\r\n super.onUpdated(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n collectReferenceIds(this, referenceIds);\r\n }\r\n\r\n /** @internal */\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: TextAnnotation3dProps, dstProps: TextAnnotation3dProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n\r\n const srcElem = TextAnnotation3d.fromJSON(srcProps, context.sourceDb);\r\n ElementDrivesTextAnnotation.remapFields(srcElem, context);\r\n const anno = srcElem.getAnnotation();\r\n dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;\r\n\r\n return remapTextStyle(context, srcElem, dstProps);\r\n }\r\n}\r\n\r\nasync function remapTextStyle(\r\n context: IModelElementCloneContext,\r\n srcElem: TextAnnotation2d | TextAnnotation3d,\r\n dstProps: TextAnnotation2dProps | TextAnnotation3dProps\r\n): Promise<void> {\r\n const dstStyleId = await AnnotationTextStyle.remapTextStyleId(srcElem.defaultTextStyle?.id ?? Id64.invalid, context);\r\n dstProps.defaultTextStyle = Id64.isValid(dstStyleId) ? new TextAnnotationUsesTextStyleByDefault(dstStyleId).toJSON() : undefined;\r\n}\r\n\r\nfunction collectReferenceIds(elem: TextAnnotation2d | TextAnnotation3d, referenceIds: EntityReferenceSet): void {\r\n const style = elem.defaultTextStyle?.id;\r\n if (style && Id64.isValidId64(style)) {\r\n referenceIds.addElement(style);\r\n }\r\n\r\n const block = elem.getAnnotation()?.textBlock;\r\n if (block) {\r\n for (const { child } of traverseTextBlockComponent(block)) {\r\n if (child.type === \"field\") {\r\n const hostId = child.propertyHost.elementId;\r\n if (Id64.isValidId64(hostId)) {\r\n referenceIds.addElement(hostId);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction getTextBlocks(elem: TextAnnotation2d | TextAnnotation3d): Iterable<TextBlockAndId> {\r\n const annotation = elem.getAnnotation();\r\n return annotation ? [{ textBlock: annotation.textBlock, id: undefined }] : [];\r\n}\r\n\r\nfunction updateTextBlocks(elem: TextAnnotation2d | TextAnnotation3d, textBlocks: TextBlockAndId[]): void {\r\n assert(textBlocks.length === 1);\r\n assert(textBlocks[0].id === undefined);\r\n\r\n const annotation = elem.getAnnotation();\r\n if (!annotation) {\r\n // We must obtain the TextBlockAndId from the element in the first place, so the only way we could end up here is if\r\n // somebody removed the text annotation after we called getTextBlocks. That's gotta be a mistake.\r\n throw new Error(\"Text annotation element has no text\");\r\n }\r\n\r\n annotation.textBlock = textBlocks[0].textBlock;\r\n\r\n elem.setAnnotation(annotation);\r\n}\r\n\r\n/** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.\r\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\r\n * @internal\r\n*/\r\n// 1.0.1 - Added terminatorShapes for leaders\r\n// 1.0.2 - Changed margins to be fractions of text height instead of absolute values\r\nexport const TEXT_STYLE_SETTINGS_JSON_VERSION = \"1.0.2\";\r\n\r\nfunction migrateTextStyleSettings(oldData: VersionedJSON<TextStyleSettingsProps>): TextStyleSettingsProps {\r\n if (oldData.version === TEXT_STYLE_SETTINGS_JSON_VERSION) return oldData.data;\r\n\r\n // Migrate from 1.0.0 to 1.0.1\r\n if (oldData.data.leader && !oldData.data.leader.terminatorShape) {\r\n oldData.data.leader.terminatorShape = TextStyleSettings.defaultProps.leader.terminatorShape;\r\n }\r\n // Migrate from 1.0.1 to 1.0.2.\r\n if (oldData.version === \"1.0.1\") {\r\n // In 1.0.2, margins are specified as a fraction of text height instead of absolute values.\r\n const textHeight = oldData.data.textHeight ?? TextStyleSettings.defaultProps.textHeight;\r\n const margins = oldData.data.margins ?? TextStyleSettings.defaultProps.margins;\r\n oldData.data.margins = {\r\n top: (margins.top ?? TextStyleSettings.defaultProps.margins.top) / textHeight,\r\n bottom: (margins.bottom ?? TextStyleSettings.defaultProps.margins.bottom) / textHeight,\r\n left: (margins.left ?? TextStyleSettings.defaultProps.margins.left) / textHeight,\r\n right: (margins.right ?? TextStyleSettings.defaultProps.margins.right) / textHeight,\r\n };\r\n }\r\n return oldData.data;\r\n\r\n}\r\n\r\n/** Arguments supplied when creating an [[AnnotationTextStyle]].\r\n * @beta\r\n */\r\nexport interface TextStyleCreateArgs {\r\n /** The ID of the [[DefinitionModel]]. */\r\n definitionModelId: Id64String;\r\n /** The name to assign to the [[AnnotationTextStyle]]. */\r\n name: string;\r\n /** Optional text style settings used to create the [[AnnotationTextStyle]]. Default settings will be used if not provided. */\r\n settings?: TextStyleSettingsProps;\r\n /** Optional description for the [[AnnotationTextStyle]]. */\r\n description?: string;\r\n}\r\n\r\n/**\r\n * The definition element that holds text style information.\r\n * The style is stored as a [TextStyleSettings]($common).\r\n * @beta\r\n */\r\nexport class AnnotationTextStyle extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"AnnotationTextStyle\"; }\r\n /**\r\n * Optional text describing the `AnnotationTextStyle`.\r\n */\r\n public description?: string;\r\n /**\r\n * The text style settings for the `AnnotationTextStyle`.\r\n * @see [[TextStyleSettings]] for more information.\r\n */\r\n public settings: TextStyleSettings;\r\n\r\n protected constructor(props: AnnotationTextStyleProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description;\r\n const settingsProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);\r\n this.settings = TextStyleSettings.fromJSON(settingsProps?.data);\r\n }\r\n\r\n /**\r\n * Creates a Code for an `AnnotationTextStyle` given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n *\r\n * @param iModel - The IModelDb.\r\n * @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.\r\n * @param name - The AnnotationTextStyle name.\r\n * @beta\r\n */\r\n public static createCode(iModel: IModelDb, definitionModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.annotationTextStyle);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: name });\r\n }\r\n\r\n /**\r\n * Creates a new instance of `AnnotationTextStyle` with the specified properties.\r\n *\r\n * @param iModelDb - The iModelDb.\r\n * @param arg - The arguments for creating the AnnotationTextStyle.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextStyleCreateArgs): AnnotationTextStyle {\r\n const props: AnnotationTextStyleProps = {\r\n classFullName: this.classFullName,\r\n model: arg.definitionModelId,\r\n code: this.createCode(iModelDb, arg.definitionModelId, arg.name).toJSON(),\r\n description: arg.description,\r\n settings: arg.settings ? JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: arg.settings }) : undefined,\r\n }\r\n return new this(props, iModelDb);\r\n }\r\n\r\n /**\r\n * Converts the current `AnnotationTextStyle` instance to its JSON representation.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): AnnotationTextStyleProps {\r\n const props = super.toJSON() as AnnotationTextStyleProps;\r\n props.description = this.description;\r\n props.settings = JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: this.settings.toJSON() });\r\n return props;\r\n }\r\n\r\n /** Creates a new instance of `AnnotationTextStyle` from its JSON representation. */\r\n public static fromJSON(props: AnnotationTextStyleProps, iModel: IModelDb): AnnotationTextStyle {\r\n return new AnnotationTextStyle(props, iModel);\r\n }\r\n\r\n /**\r\n * Validates that the AnnotationTextStyle's settings are valid before insert.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateSettings(arg.props);\r\n }\r\n\r\n /**\r\n * Validates that the AnnotationTextStyle's settings are valid before update.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateSettings(arg.props);\r\n }\r\n\r\n private static validateSettings(props: AnnotationTextStyleProps): void {\r\n const settingProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);\r\n if (!settingProps) return;\r\n const settings = TextStyleSettings.fromJSON(settingProps.data);\r\n const errors = settings.getValidationErrors();\r\n if (errors.length > 0) {\r\n throw new Error(`Invalid AnnotationTextStyle settings: ${errors.join(\", \")}`);\r\n }\r\n }\r\n\r\n /**\r\n * AnnotationTextStyle custom HandledProps include 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"settings\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * AnnotationTextStyle deserializes 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): AnnotationTextStyleProps {\r\n const elProps = super.deserialize(props) as AnnotationTextStyleProps;\r\n const settings = this.parseTextStyleSettings(props.row.settings);\r\n if (settings) {\r\n elProps.settings = JSON.stringify(settings);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * AnnotationTextStyle serializes 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: AnnotationTextStyleProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.settings !== undefined) {\r\n inst.settings = props.settings;\r\n }\r\n return inst;\r\n }\r\n\r\n /** Parses, validates, and potentially migrates the text style settings data from a JSON string. */\r\n private static parseTextStyleSettings(json: string | undefined): VersionedJSON<TextStyleSettingsProps> | undefined {\r\n if (!json) return undefined;\r\n return validateAndMigrateVersionedJSON<TextStyleSettingsProps>(json, TEXT_STYLE_SETTINGS_JSON_VERSION, migrateTextStyleSettings);\r\n }\r\n\r\n /** When copying an element from one iModel to another, returns the Id of the AnnotationTextStyle in the `context`'s target iModel\r\n * corresponding to `sourceTextStyleId`, or [Id64.invalid]($bentley) if no corresponding text style exists.\r\n * If a text style with the same [Code]($common) exists in the target iModel, the style Id will be remapped to refer to that style.\r\n * Otherwise, a copy of the style will be imported into the target iModel and its element Id returned.\r\n * Implementations of [[ITextAnnotation]] should invoke this function when implementing their [[Element.onCloned]] method.\r\n * @throws Error if an attempt to import the text style failed.\r\n */\r\n public static async remapTextStyleId(sourceTextStyleId: Id64String, context: IModelElementCloneContext): Promise<Id64String> {\r\n // No remapping necessary if there's no text style or we're not copying to a different iModel.\r\n if (!Id64.isValid(sourceTextStyleId) || !context.isBetweenIModels) {\r\n return sourceTextStyleId;\r\n }\r\n\r\n // If the style's already been remapped, we're finished.\r\n let dstStyleId: Id64String | undefined = context.findTargetElementId(sourceTextStyleId);\r\n if (Id64.isValid(dstStyleId)) {\r\n return dstStyleId;\r\n }\r\n\r\n // Look up the style. It really ought to exist.\r\n const srcStyle = context.sourceDb.elements.tryGetElement<AnnotationTextStyle>(sourceTextStyleId);\r\n if (!srcStyle) {\r\n return Id64.invalid;\r\n }\r\n\r\n // If a style with the same code exists in the target iModel, remap to that one.\r\n dstStyleId = context.targetDb.elements.queryElementIdByCode(srcStyle.code);\r\n if (undefined !== dstStyleId) {\r\n return dstStyleId;\r\n }\r\n\r\n // Copy the style into the target iModel and remap its Id.\r\n const dstStyleProps = await context.cloneElement(srcStyle);\r\n dstStyleId = context.targetDb.getIndirectTxn().insertElement(dstStyleProps);\r\n assert(undefined !== dstStyleId);\r\n context.remapElement(sourceTextStyleId, dstStyleId);\r\n return dstStyleId;\r\n }\r\n\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: AnnotationTextStyleProps, dstProps: AnnotationTextStyleProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n if (!context.isBetweenIModels) {\r\n return;\r\n }\r\n\r\n const settingsProps = AnnotationTextStyle.parseTextStyleSettings(srcProps.settings);\r\n const font = TextStyleSettings.fromJSON(settingsProps?.data).font;\r\n\r\n const fontsToEmbed = [];\r\n for (const file of context.sourceDb.fonts.queryEmbeddedFontFiles()) {\r\n if (file.type === font.type && file.faces.some((face) => face.familyName === font.name)) {\r\n fontsToEmbed.push(file);\r\n }\r\n }\r\n\r\n await Promise.all(fontsToEmbed.map(async (file) => context.targetDb.fonts.embedFontFile({ file })));\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"TextAnnotationElement.js","sourceRoot":"","sources":["../../../src/annotations/TextAnnotationElement.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAgEH,0DAIC;AAlED,oDAAic;AAEjc,wCAAoI;AACpI,sDAA+D;AAC/D,uDAAuE;AACvE,qEAAwE;AACxE,+EAAkI;AAIlI,iCAAiC;AAGjC;;;EAGE;AACW,QAAA,4BAA4B,GAAG,OAAO,CAAC;AAEpD,SAAS,+BAA+B,CACtC,IAAY,EACZ,cAA+B,EAC/B,OAAqC;IAErC,IAAI,MAAM,CAAC;IACX,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAqB,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;IAC/B,IAAI,OAAO,OAAO,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AAE,CAAC;QACxB,KAAK,MAAM,IAAI,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,sBAAsB,EAAE,EAAE,CAAC;YACnE,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;gBACxF,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;QAED,MAAM,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACtG,CAAC;;AAnMH,kDAoMC","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 Elements\r\n */\r\n\r\nimport { AnnotationTextStyleProps, BisCodeSpec, Code, CodeProps, CodeScopeProps, CodeSpec, ECVersionString, ElementGeometry, ElementGeometryBuilderParams, EntityReferenceSet, Placement2d, Placement2dProps, Placement3d, Placement3dProps, PlacementProps, TextAnnotation, TextAnnotation2dProps, TextAnnotation3dProps, TextAnnotationProps, TextStyleSettings, TextStyleSettingsProps, traverseTextBlockComponent, VersionedJSON } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"../IModelDb\";\r\nimport { AnnotationElement2d, DefinitionElement, Drawing, GraphicalElement3d, OnElementIdArg, OnElementPropsArg } from \"../Element\";\r\nimport { assert, Id64, Id64String } from \"@itwin/core-bentley\";\r\nimport { layoutTextBlock, TextStyleResolver } from \"./TextBlockLayout\";\r\nimport { appendTextAnnotationGeometry } from \"./TextAnnotationGeometry\";\r\nimport { ElementDrivesTextAnnotation, TextAnnotationUsesTextStyleByDefault, TextBlockAndId } from \"./ElementDrivesTextAnnotation\";\r\nimport { IModelElementCloneContext } from \"../IModelElementCloneContext\";\r\nimport { CustomHandledProperty, DeserializeEntityArgs, ECSqlRow } from \"../Entity\";\r\n\r\nimport * as semver from \"semver\";\r\n\r\n\r\n/** The version of the JSON stored in `TextAnnotation2d/3dProps.textAnnotationData` used by the code.\r\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\r\n * @internal\r\n*/\r\nexport const TEXT_ANNOTATION_JSON_VERSION = \"1.0.0\";\r\n\r\nfunction validateAndMigrateVersionedJSON<T>(\r\n json: string,\r\n currentVersion: ECVersionString,\r\n migrate: (old: VersionedJSON<T>) => T\r\n): VersionedJSON<T> | undefined {\r\n let parsed;\r\n try {\r\n parsed = JSON.parse(json) as VersionedJSON<T>;\r\n } catch {\r\n return undefined;\r\n }\r\n\r\n const version = parsed.version;\r\n if (typeof version !== \"string\" || !semver.valid(version))\r\n throw new Error(\"JSON version is missing or invalid.\");\r\n\r\n if (typeof parsed.data !== \"object\" || parsed.data === null)\r\n throw new Error(\"JSON data is missing or invalid.\");\r\n\r\n // Newer\r\n if (semver.gt(version, currentVersion))\r\n throw new Error(`JSON version ${parsed.version} is newer than supported version ${currentVersion}. Application update required to understand data.`);\r\n\r\n // Older\r\n if (semver.lt(version, currentVersion)) {\r\n parsed.data = migrate(parsed);\r\n parsed.version = currentVersion;\r\n }\r\n\r\n return parsed;\r\n}\r\n\r\nfunction migrateTextAnnotationData(oldData: VersionedJSON<TextAnnotationProps>): TextAnnotationProps {\r\n if (oldData.version === TEXT_ANNOTATION_JSON_VERSION) return oldData.data;\r\n\r\n // Place migration logic here.\r\n\r\n throw new Error(`Migration for textAnnotationData from version ${oldData.version} to ${TEXT_ANNOTATION_JSON_VERSION} failed.`);\r\n}\r\n\r\n/** Parses, validates, and potentially migrates the text annotation data from a JSON string.\r\n * @internal\r\n */\r\nexport function parseTextAnnotationData(json: string | undefined): VersionedJSON<TextAnnotationProps> | undefined {\r\n if (!json) return undefined;\r\n\r\n return validateAndMigrateVersionedJSON<TextAnnotationProps>(json, TEXT_ANNOTATION_JSON_VERSION, migrateTextAnnotationData);\r\n}\r\n\r\nfunction getElementGeometryBuilderParams(iModel: IModelDb, modelId: Id64String, categoryId: Id64String, _placementProps: PlacementProps, annotationProps?: TextAnnotationProps, textStyleId?: Id64String, _subCategory?: Id64String): ElementGeometryBuilderParams {\r\n const textBlock = TextAnnotation.fromJSON(annotationProps).textBlock;\r\n const textStyleResolver = new TextStyleResolver({ textBlock, textStyleId: textStyleId ?? \"\", iModel });\r\n const layout = layoutTextBlock({ iModel, textBlock, textStyleResolver });\r\n const builder = new ElementGeometry.Builder();\r\n let scaleFactor = 1;\r\n const element = iModel.elements.getElement(modelId);\r\n if (element instanceof Drawing)\r\n scaleFactor = element.scaleFactor;\r\n appendTextAnnotationGeometry({ layout, textStyleResolver, scaleFactor, annotationProps: annotationProps ?? {}, builder, categoryId });\r\n\r\n return { entryArray: builder.entries };\r\n}\r\n\r\n/** Arguments supplied when creating a [[TextAnnotation2d]].\r\n * @beta\r\n */\r\nexport interface TextAnnotation2dCreateArgs {\r\n /** The category ID for the annotation. */\r\n category: Id64String;\r\n /** The model ID where the annotation will be placed. */\r\n model: Id64String;\r\n /** The placement properties for the annotation. */\r\n placement: Placement2dProps;\r\n /** The default text style ID for the annotation. */\r\n defaultTextStyleId?: Id64String;\r\n /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation2d`. Essentially an empty element if not provided. */\r\n textAnnotationProps?: TextAnnotationProps;\r\n /** Optional code for the element. */\r\n code?: CodeProps;\r\n}\r\n\r\n/** Arguments supplied when creating a [[TextAnnotation3d]].\r\n * @beta\r\n */\r\nexport interface TextAnnotation3dCreateArgs {\r\n /** The category ID for the annotation. */\r\n category: Id64String;\r\n /** The model ID where the annotation will be placed. */\r\n model: Id64String;\r\n /** The placement properties for the annotation. */\r\n placement: Placement3dProps;\r\n /** The default text style ID for the annotation. */\r\n defaultTextStyleId?: Id64String;\r\n /** Optional [[TextAnnotation]] JSON representation used to create the `TextAnnotation3d`. Essentially an empty element if not provided. */\r\n textAnnotationProps?: TextAnnotationProps;\r\n /** Optional code for the element. */\r\n code?: CodeProps;\r\n}\r\n\r\n/** An element that displays textual content within a 2d model.\r\n * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed.\r\n * @see [[setAnnotation]] to change the textual content.\r\n * @public @preview\r\n */\r\nexport class TextAnnotation2d extends AnnotationElement2d /* implements ITextAnnotation */ {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation2d\"; }\r\n /**\r\n * The default [[AnnotationTextStyle]] used by the TextAnnotation2d.\r\n * @beta\r\n */\r\n public defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;\r\n /** The data associated with the text annotation. */\r\n private _textAnnotationProps?: TextAnnotationProps;\r\n\r\n /** Extract the textual content, if present.\r\n * @see [[setAnnotation]] to change it.\r\n */\r\n public getAnnotation(): TextAnnotation | undefined {\r\n return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;\r\n }\r\n\r\n /** Change the textual content of the `TextAnnotation2d`.\r\n * @see [[getAnnotation]] to extract the current annotation.\r\n * @param annotation The new annotation\r\n */\r\n public setAnnotation(annotation: TextAnnotation) {\r\n this._textAnnotationProps = annotation.toJSON();\r\n }\r\n\r\n protected constructor(props: TextAnnotation2dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.defaultTextStyle) {\r\n this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);\r\n }\r\n this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;\r\n }\r\n\r\n /** Creates a new instance of `TextAnnotation2d` from its JSON representation. */\r\n public static fromJSON(props: TextAnnotation2dProps, iModel: IModelDb): TextAnnotation2d {\r\n return new TextAnnotation2d(props, iModel);\r\n }\r\n\r\n /**\r\n * Converts the current `TextAnnotation2d` instance to its JSON representation.\r\n * It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): TextAnnotation2dProps {\r\n const props = super.toJSON() as TextAnnotation2dProps;\r\n props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;\r\n if (this._textAnnotationProps) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Creates a new `TextAnnotation2d` instance with the specified properties.\r\n * @param iModelDb The iModel.\r\n * @param arg The arguments for creating the TextAnnotation2d.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextAnnotation2dCreateArgs): TextAnnotation2d {\r\n const elementProps: TextAnnotation2dProps = {\r\n classFullName: this.classFullName,\r\n textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,\r\n defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,\r\n placement: arg.placement,\r\n model: arg.model,\r\n category: arg.category,\r\n code: arg.code ?? Code.createEmpty(),\r\n };\r\n return new this(elementProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation2d on insert and validates version.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation2d on update and validates version.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation2dProps]($common).\r\n * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.\r\n * Also, validates the version of the text annotation data and migrates it if necessary.\r\n * @beta\r\n */\r\n protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void {\r\n const props = arg.props as TextAnnotation2dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);\r\n if (!props.elementGeometryBuilderParams && textAnnotationData) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement2d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);\r\n }\r\n }\r\n\r\n /**\r\n * TextAnnotation2d custom HandledProps include 'textAnnotationData'.\r\n * @inheritdoc\r\n * @internal\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"textAnnotationData\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * TextAnnotation2d deserializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): TextAnnotation2dProps {\r\n const elProps = super.deserialize(props) as TextAnnotation2dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);\r\n if (textAnnotationData) {\r\n elProps.textAnnotationData = JSON.stringify(textAnnotationData);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * TextAnnotation2d serializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: TextAnnotation2dProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.textAnnotationData !== undefined) {\r\n inst.textAnnotationData = props.textAnnotationData;\r\n }\r\n return inst;\r\n }\r\n\r\n /** @internal */\r\n public getTextBlocks(): Iterable<TextBlockAndId> {\r\n return getTextBlocks(this);\r\n }\r\n\r\n /** @internal */\r\n public updateTextBlocks(textBlocks: TextBlockAndId[]): void {\r\n return updateTextBlocks(this, textBlocks);\r\n }\r\n\r\n /** @internal */\r\n public static override onInserted(arg: OnElementIdArg): void {\r\n super.onInserted(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n /** @internal */\r\n public static override onUpdated(arg: OnElementIdArg): void {\r\n super.onUpdated(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n collectReferenceIds(this, referenceIds);\r\n }\r\n\r\n /** @internal */\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: TextAnnotation2dProps, dstProps: TextAnnotation2dProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n\r\n const srcElem = TextAnnotation2d.fromJSON(srcProps, context.sourceDb);\r\n ElementDrivesTextAnnotation.remapFields(srcElem, context);\r\n const anno = srcElem.getAnnotation();\r\n dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;\r\n\r\n return remapTextStyle(context, srcElem, dstProps);\r\n }\r\n}\r\n\r\n/** An element that displays textual content within a 3d model.\r\n * The text is stored as a [TextAnnotation]($common) from which the element's [geometry]($docs/learning/common/GeometryStream.md) and [Placement]($common) are computed.\r\n * @see [[setAnnotation]] to change the textual content.\r\n * @public @preview\r\n */\r\nexport class TextAnnotation3d extends GraphicalElement3d /* implements ITextAnnotation */ {\r\n /** @internal */\r\n public static override get className(): string { return \"TextAnnotation3d\"; }\r\n /**\r\n * The default [[AnnotationTextStyle]] used by the TextAnnotation3d.\r\n * @beta\r\n */\r\n public defaultTextStyle?: TextAnnotationUsesTextStyleByDefault;\r\n /** The data associated with the text annotation. */\r\n private _textAnnotationProps?: TextAnnotationProps;\r\n\r\n /** Extract the textual content, if present.\r\n * @see [[setAnnotation]] to change it.\r\n */\r\n public getAnnotation(): TextAnnotation | undefined {\r\n return this._textAnnotationProps ? TextAnnotation.fromJSON(this._textAnnotationProps) : undefined;\r\n }\r\n\r\n /** Change the textual content of the `TextAnnotation3d`.\r\n * @see [[getAnnotation]] to extract the current annotation.\r\n * @param annotation The new annotation\r\n */\r\n public setAnnotation(annotation: TextAnnotation) {\r\n this._textAnnotationProps = annotation.toJSON();\r\n }\r\n\r\n protected constructor(props: TextAnnotation3dProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n if (props.defaultTextStyle) {\r\n this.defaultTextStyle = new TextAnnotationUsesTextStyleByDefault(props.defaultTextStyle.id);\r\n }\r\n this._textAnnotationProps = parseTextAnnotationData(props.textAnnotationData)?.data;\r\n }\r\n\r\n /** Creates a new instance of `TextAnnotation3d` from its JSON representation. */\r\n public static fromJSON(props: TextAnnotation3dProps, iModel: IModelDb): TextAnnotation3d {\r\n return new TextAnnotation3d(props, iModel);\r\n }\r\n\r\n /**\r\n * Converts the current `TextAnnotation3d` instance to its JSON representation.\r\n * It also computes the `elementGeometryBuilderParams` property used to create the GeometryStream.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): TextAnnotation3dProps {\r\n const props = super.toJSON() as TextAnnotation3dProps;\r\n props.textAnnotationData = this._textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: this._textAnnotationProps }) : undefined;\r\n if (this._textAnnotationProps) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(this.iModel, this.model, this.category, this.placement, this._textAnnotationProps, this.defaultTextStyle ? this.defaultTextStyle.id : undefined);\r\n }\r\n\r\n return props;\r\n }\r\n\r\n /** Creates a new `TextAnnotation3d` instance with the specified properties.\r\n * @param iModelDb The iModel.\r\n * @param arg The arguments for creating the TextAnnotation3d.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextAnnotation3dCreateArgs): TextAnnotation3d {\r\n const elementProps: TextAnnotation3dProps = {\r\n classFullName: this.classFullName,\r\n textAnnotationData: arg.textAnnotationProps ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: arg.textAnnotationProps }) : undefined,\r\n defaultTextStyle: arg.defaultTextStyleId ? new TextAnnotationUsesTextStyleByDefault(arg.defaultTextStyleId).toJSON() : undefined,\r\n placement: arg.placement,\r\n model: arg.model,\r\n category: arg.category,\r\n code: arg.code ?? Code.createEmpty(),\r\n };\r\n return new this(elementProps, iModelDb);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation3d on insert and validates version..\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Updates the geometry of the TextAnnotation3d on update and validates version..\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateVersionAndUpdateGeometry(arg);\r\n }\r\n\r\n /**\r\n * Populates the `elementGeometryBuilderParams` property in the [TextAnnotation3dProps]($common).\r\n * Only does this if the `elementGeometryBuilderParams` is not already set and if there is actually a text annotation to produce geometry for.\r\n * Also, validates the version of the text annotation data and migrates it if necessary.\r\n * @beta\r\n */\r\n protected static validateVersionAndUpdateGeometry(arg: OnElementPropsArg): void {\r\n const props = arg.props as TextAnnotation3dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.textAnnotationData);\r\n if (!props.elementGeometryBuilderParams && textAnnotationData) {\r\n props.elementGeometryBuilderParams = getElementGeometryBuilderParams(arg.iModel, props.model, props.category, props.placement ?? Placement3d.fromJSON(), textAnnotationData.data, props.defaultTextStyle?.id);\r\n }\r\n }\r\n\r\n /**\r\n * TextAnnotation3d custom HandledProps include 'textAnnotationData'.\r\n * @inheritdoc\r\n * @internal\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"textAnnotationData\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * TextAnnotation3d deserializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): TextAnnotation3dProps {\r\n const elProps = super.deserialize(props) as TextAnnotation3dProps;\r\n const textAnnotationData = parseTextAnnotationData(props.row.textAnnotationData);\r\n if (textAnnotationData) {\r\n elProps.textAnnotationData = JSON.stringify(textAnnotationData);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * TextAnnotation3d serializes 'textAnnotationData'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: TextAnnotation3dProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.textAnnotationData !== undefined) {\r\n inst.textAnnotationData = props.textAnnotationData;\r\n }\r\n return inst;\r\n }\r\n\r\n /** @internal */\r\n public getTextBlocks(): Iterable<TextBlockAndId> {\r\n return getTextBlocks(this);\r\n }\r\n\r\n /** @internal */\r\n public updateTextBlocks(textBlocks: TextBlockAndId[]): void {\r\n return updateTextBlocks(this, textBlocks);\r\n }\r\n\r\n /** @internal */\r\n public static override onInserted(arg: OnElementIdArg): void {\r\n super.onInserted(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n /** @internal */\r\n public static override onUpdated(arg: OnElementIdArg): void {\r\n super.onUpdated(arg);\r\n ElementDrivesTextAnnotation.updateFieldDependencies(arg.iModel.getIndirectTxn(), arg.id);\r\n }\r\n\r\n protected override collectReferenceIds(referenceIds: EntityReferenceSet): void {\r\n super.collectReferenceIds(referenceIds);\r\n collectReferenceIds(this, referenceIds);\r\n }\r\n\r\n /** @internal */\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: TextAnnotation3dProps, dstProps: TextAnnotation3dProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n\r\n const srcElem = TextAnnotation3d.fromJSON(srcProps, context.sourceDb);\r\n ElementDrivesTextAnnotation.remapFields(srcElem, context);\r\n const anno = srcElem.getAnnotation();\r\n dstProps.textAnnotationData = anno ? JSON.stringify({ version: TEXT_ANNOTATION_JSON_VERSION, data: anno.toJSON() }) : undefined;\r\n\r\n return remapTextStyle(context, srcElem, dstProps);\r\n }\r\n}\r\n\r\nasync function remapTextStyle(\r\n context: IModelElementCloneContext,\r\n srcElem: TextAnnotation2d | TextAnnotation3d,\r\n dstProps: TextAnnotation2dProps | TextAnnotation3dProps\r\n): Promise<void> {\r\n const dstStyleId = await AnnotationTextStyle.remapTextStyleId(srcElem.defaultTextStyle?.id ?? Id64.invalid, context);\r\n dstProps.defaultTextStyle = Id64.isValid(dstStyleId) ? new TextAnnotationUsesTextStyleByDefault(dstStyleId).toJSON() : undefined;\r\n}\r\n\r\nfunction collectReferenceIds(elem: TextAnnotation2d | TextAnnotation3d, referenceIds: EntityReferenceSet): void {\r\n const style = elem.defaultTextStyle?.id;\r\n if (style && Id64.isValidId64(style)) {\r\n referenceIds.addElement(style);\r\n }\r\n\r\n const block = elem.getAnnotation()?.textBlock;\r\n if (block) {\r\n for (const { child } of traverseTextBlockComponent(block)) {\r\n if (child.type === \"field\") {\r\n const hostId = child.propertyHost.elementId;\r\n if (Id64.isValidId64(hostId)) {\r\n referenceIds.addElement(hostId);\r\n }\r\n }\r\n }\r\n }\r\n}\r\n\r\nfunction getTextBlocks(elem: TextAnnotation2d | TextAnnotation3d): Iterable<TextBlockAndId> {\r\n const annotation = elem.getAnnotation();\r\n return annotation ? [{ textBlock: annotation.textBlock, id: undefined }] : [];\r\n}\r\n\r\nfunction updateTextBlocks(elem: TextAnnotation2d | TextAnnotation3d, textBlocks: TextBlockAndId[]): void {\r\n assert(textBlocks.length === 1);\r\n assert(textBlocks[0].id === undefined);\r\n\r\n const annotation = elem.getAnnotation();\r\n if (!annotation) {\r\n // We must obtain the TextBlockAndId from the element in the first place, so the only way we could end up here is if\r\n // somebody removed the text annotation after we called getTextBlocks. That's gotta be a mistake.\r\n throw new Error(\"Text annotation element has no text\");\r\n }\r\n\r\n annotation.textBlock = textBlocks[0].textBlock;\r\n\r\n elem.setAnnotation(annotation);\r\n}\r\n\r\n/** The version of the JSON stored in `AnnotationTextStyleProps.settings` used by the code.\r\n * Uses the same semantics as [ECVersion]($ecschema-metadata).\r\n * @internal\r\n*/\r\n// 1.0.1 - Added terminatorShapes for leaders\r\n// 1.0.2 - Changed margins to be fractions of text height instead of absolute values\r\n// 1.0.3 - Added new leader style properties for targetPoint feature (showLeaders,showTerminators,showTargetPoint,targetPointShape,targetPointOffsetFactor)\r\nexport const TEXT_STYLE_SETTINGS_JSON_VERSION = \"1.0.3\";\r\n\r\nfunction migrateTextStyleSettings(oldData: VersionedJSON<TextStyleSettingsProps>): TextStyleSettingsProps {\r\n const data = oldData.data;\r\n const version = oldData.version;\r\n if (version === TEXT_STYLE_SETTINGS_JSON_VERSION) return data;\r\n\r\n // Migrate from 1.0.0 to 1.0.1\r\n if (semver.lt(version, \"1.0.1\")) {\r\n if (data.leader && !data.leader.terminatorShape) {\r\n data.leader.terminatorShape = TextStyleSettings.defaultProps.leader.terminatorShape;\r\n }\r\n }\r\n // Migrate from 1.0.1 to 1.0.2.\r\n if (semver.lt(version, \"1.0.2\")) {\r\n // In 1.0.2, margins are specified as a fraction of text height instead of absolute values.\r\n const textHeight = data.textHeight ?? TextStyleSettings.defaultProps.textHeight;\r\n const margins = data.margins ?? TextStyleSettings.defaultProps.margins;\r\n data.margins = {\r\n top: (margins.top ?? TextStyleSettings.defaultProps.margins.top) / textHeight,\r\n bottom: (margins.bottom ?? TextStyleSettings.defaultProps.margins.bottom) / textHeight,\r\n left: (margins.left ?? TextStyleSettings.defaultProps.margins.left) / textHeight,\r\n right: (margins.right ?? TextStyleSettings.defaultProps.margins.right) / textHeight,\r\n };\r\n }\r\n\r\n // Migrate from 1.0.2 to 1.0.3.\r\n if (semver.lt(version, \"1.0.3\")) {\r\n if (data.leader) {\r\n data.leader.showLeaders = data.leader?.showLeaders ?? TextStyleSettings.defaultProps.leader.showLeaders;\r\n data.leader.showTerminators = data.leader?.showTerminators ?? TextStyleSettings.defaultProps.leader.showTerminators;\r\n data.leader.showTargetPoint = data.leader?.showTargetPoint ?? TextStyleSettings.defaultProps.leader.showTargetPoint;\r\n data.leader.targetPointShape = data.leader?.targetPointShape ?? TextStyleSettings.defaultProps.leader.targetPointShape;\r\n data.leader.targetPointOffsetFactor = data.leader?.targetPointOffsetFactor ?? TextStyleSettings.defaultProps.leader.targetPointOffsetFactor;\r\n }\r\n\r\n }\r\n return data;\r\n\r\n}\r\n\r\n/** Arguments supplied when creating an [[AnnotationTextStyle]].\r\n * @beta\r\n */\r\nexport interface TextStyleCreateArgs {\r\n /** The ID of the [[DefinitionModel]]. */\r\n definitionModelId: Id64String;\r\n /** The name to assign to the [[AnnotationTextStyle]]. */\r\n name: string;\r\n /** Optional text style settings used to create the [[AnnotationTextStyle]]. Default settings will be used if not provided. */\r\n settings?: TextStyleSettingsProps;\r\n /** Optional description for the [[AnnotationTextStyle]]. */\r\n description?: string;\r\n}\r\n\r\n/**\r\n * The definition element that holds text style information.\r\n * The style is stored as a [TextStyleSettings]($common).\r\n * @beta\r\n */\r\nexport class AnnotationTextStyle extends DefinitionElement {\r\n /** @internal */\r\n public static override get className(): string { return \"AnnotationTextStyle\"; }\r\n /**\r\n * Optional text describing the `AnnotationTextStyle`.\r\n */\r\n public description?: string;\r\n /**\r\n * The text style settings for the `AnnotationTextStyle`.\r\n * @see [[TextStyleSettings]] for more information.\r\n */\r\n public settings: TextStyleSettings;\r\n\r\n protected constructor(props: AnnotationTextStyleProps, iModel: IModelDb) {\r\n super(props, iModel);\r\n this.description = props.description;\r\n const settingsProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);\r\n this.settings = TextStyleSettings.fromJSON(settingsProps?.data);\r\n }\r\n\r\n /**\r\n * Creates a Code for an `AnnotationTextStyle` given a name that is meant to be unique within the scope of the specified DefinitionModel.\r\n *\r\n * @param iModel - The IModelDb.\r\n * @param definitionModelId - The ID of the DefinitionModel that contains the AnnotationTextStyle and provides the scope for its name.\r\n * @param name - The AnnotationTextStyle name.\r\n * @beta\r\n */\r\n public static createCode(iModel: IModelDb, definitionModelId: CodeScopeProps, name: string): Code {\r\n const codeSpec: CodeSpec = iModel.codeSpecs.getByName(BisCodeSpec.annotationTextStyle);\r\n return new Code({ spec: codeSpec.id, scope: definitionModelId, value: name });\r\n }\r\n\r\n /**\r\n * Creates a new instance of `AnnotationTextStyle` with the specified properties.\r\n *\r\n * @param iModelDb - The iModelDb.\r\n * @param arg - The arguments for creating the AnnotationTextStyle.\r\n * @beta\r\n */\r\n public static create(iModelDb: IModelDb, arg: TextStyleCreateArgs): AnnotationTextStyle {\r\n const props: AnnotationTextStyleProps = {\r\n classFullName: this.classFullName,\r\n model: arg.definitionModelId,\r\n code: this.createCode(iModelDb, arg.definitionModelId, arg.name).toJSON(),\r\n description: arg.description,\r\n settings: arg.settings ? JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: arg.settings }) : undefined,\r\n }\r\n return new this(props, iModelDb);\r\n }\r\n\r\n /**\r\n * Converts the current `AnnotationTextStyle` instance to its JSON representation.\r\n * @inheritdoc\r\n */\r\n public override toJSON(): AnnotationTextStyleProps {\r\n const props = super.toJSON() as AnnotationTextStyleProps;\r\n props.description = this.description;\r\n props.settings = JSON.stringify({ version: TEXT_STYLE_SETTINGS_JSON_VERSION, data: this.settings.toJSON() });\r\n return props;\r\n }\r\n\r\n /** Creates a new instance of `AnnotationTextStyle` from its JSON representation. */\r\n public static fromJSON(props: AnnotationTextStyleProps, iModel: IModelDb): AnnotationTextStyle {\r\n return new AnnotationTextStyle(props, iModel);\r\n }\r\n\r\n /**\r\n * Validates that the AnnotationTextStyle's settings are valid before insert.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onInsert(arg: OnElementPropsArg): void {\r\n super.onInsert(arg);\r\n this.validateSettings(arg.props);\r\n }\r\n\r\n /**\r\n * Validates that the AnnotationTextStyle's settings are valid before update.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override onUpdate(arg: OnElementPropsArg): void {\r\n super.onUpdate(arg);\r\n this.validateSettings(arg.props);\r\n }\r\n\r\n private static validateSettings(props: AnnotationTextStyleProps): void {\r\n const settingProps = AnnotationTextStyle.parseTextStyleSettings(props.settings);\r\n if (!settingProps) return;\r\n const settings = TextStyleSettings.fromJSON(settingProps.data);\r\n const errors = settings.getValidationErrors();\r\n if (errors.length > 0) {\r\n throw new Error(`Invalid AnnotationTextStyle settings: ${errors.join(\", \")}`);\r\n }\r\n }\r\n\r\n /**\r\n * AnnotationTextStyle custom HandledProps include 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n protected static override readonly _customHandledProps: CustomHandledProperty[] = [\r\n { propertyName: \"settings\", source: \"Class\" },\r\n ];\r\n\r\n /**\r\n * AnnotationTextStyle deserializes 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override deserialize(props: DeserializeEntityArgs): AnnotationTextStyleProps {\r\n const elProps = super.deserialize(props) as AnnotationTextStyleProps;\r\n const settings = this.parseTextStyleSettings(props.row.settings);\r\n if (settings) {\r\n elProps.settings = JSON.stringify(settings);\r\n }\r\n return elProps;\r\n }\r\n\r\n /**\r\n * AnnotationTextStyle serializes 'settings'.\r\n * @inheritdoc\r\n * @beta\r\n */\r\n public static override serialize(props: AnnotationTextStyleProps, iModel: IModelDb): ECSqlRow {\r\n const inst = super.serialize(props, iModel);\r\n if (props.settings !== undefined) {\r\n inst.settings = props.settings;\r\n }\r\n return inst;\r\n }\r\n\r\n /** Parses, validates, and potentially migrates the text style settings data from a JSON string. */\r\n private static parseTextStyleSettings(json: string | undefined): VersionedJSON<TextStyleSettingsProps> | undefined {\r\n if (!json) return undefined;\r\n return validateAndMigrateVersionedJSON<TextStyleSettingsProps>(json, TEXT_STYLE_SETTINGS_JSON_VERSION, migrateTextStyleSettings);\r\n }\r\n\r\n /** When copying an element from one iModel to another, returns the Id of the AnnotationTextStyle in the `context`'s target iModel\r\n * corresponding to `sourceTextStyleId`, or [Id64.invalid]($bentley) if no corresponding text style exists.\r\n * If a text style with the same [Code]($common) exists in the target iModel, the style Id will be remapped to refer to that style.\r\n * Otherwise, a copy of the style will be imported into the target iModel and its element Id returned.\r\n * Implementations of [[ITextAnnotation]] should invoke this function when implementing their [[Element.onCloned]] method.\r\n * @throws Error if an attempt to import the text style failed.\r\n */\r\n public static async remapTextStyleId(sourceTextStyleId: Id64String, context: IModelElementCloneContext): Promise<Id64String> {\r\n // No remapping necessary if there's no text style or we're not copying to a different iModel.\r\n if (!Id64.isValid(sourceTextStyleId) || !context.isBetweenIModels) {\r\n return sourceTextStyleId;\r\n }\r\n\r\n // If the style's already been remapped, we're finished.\r\n let dstStyleId: Id64String | undefined = context.findTargetElementId(sourceTextStyleId);\r\n if (Id64.isValid(dstStyleId)) {\r\n return dstStyleId;\r\n }\r\n\r\n // Look up the style. It really ought to exist.\r\n const srcStyle = context.sourceDb.elements.tryGetElement<AnnotationTextStyle>(sourceTextStyleId);\r\n if (!srcStyle) {\r\n return Id64.invalid;\r\n }\r\n\r\n // If a style with the same code exists in the target iModel, remap to that one.\r\n dstStyleId = context.targetDb.elements.queryElementIdByCode(srcStyle.code);\r\n if (undefined !== dstStyleId) {\r\n return dstStyleId;\r\n }\r\n\r\n // Copy the style into the target iModel and remap its Id.\r\n const dstStyleProps = await context.cloneElement(srcStyle);\r\n dstStyleId = context.targetDb.getIndirectTxn().insertElement(dstStyleProps);\r\n assert(undefined !== dstStyleId);\r\n context.remapElement(sourceTextStyleId, dstStyleId);\r\n return dstStyleId;\r\n }\r\n\r\n protected static override async onCloned(context: IModelElementCloneContext, srcProps: AnnotationTextStyleProps, dstProps: AnnotationTextStyleProps): Promise<void> {\r\n await super.onCloned(context, srcProps, dstProps);\r\n if (!context.isBetweenIModels) {\r\n return;\r\n }\r\n\r\n const settingsProps = AnnotationTextStyle.parseTextStyleSettings(srcProps.settings);\r\n const font = TextStyleSettings.fromJSON(settingsProps?.data).font;\r\n\r\n const fontsToEmbed = [];\r\n for (const file of context.sourceDb.fonts.queryEmbeddedFontFiles()) {\r\n if (file.type === font.type && file.faces.some((face) => face.familyName === font.name)) {\r\n fontsToEmbed.push(file);\r\n }\r\n }\r\n\r\n await Promise.all(fontsToEmbed.map(async (file) => context.targetDb.fonts.embedFontFile({ file })));\r\n }\r\n}\r\n"]}
|
|
@@ -54,6 +54,7 @@ export * from "./LineStyle";
|
|
|
54
54
|
export * from "./LocalhostIpcHost";
|
|
55
55
|
export * from "./LocalHub";
|
|
56
56
|
export * from "./LockControl";
|
|
57
|
+
export * from "./SynchronousChannel";
|
|
57
58
|
export * from "./Material";
|
|
58
59
|
export * from "./Model";
|
|
59
60
|
export * from "./NativeAppStorage";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-backend.d.ts","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":"AAKA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,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__exportStar(require("./LocalhostIpcHost"), exports);
|
|
75
75
|
__exportStar(require("./LocalHub"), exports);
|
|
76
76
|
__exportStar(require("./LockControl"), exports);
|
|
77
|
+
__exportStar(require("./SynchronousChannel"), exports);
|
|
77
78
|
__exportStar(require("./Material"), exports);
|
|
78
79
|
__exportStar(require("./Model"), exports);
|
|
79
80
|
__exportStar(require("./NativeAppStorage"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,4EAA0D;AAC1D,8DAA4C;AAC5C,+DAA6C;AAC7C,sEAAoD;AACpD,uEAAqD;AACrD,kEAAgD;AAChD,gEAA8C;AAC9C,qDAAmC;AACnC,0DAAwC;AACxC,kDAAgC;AAChC,yDAAuC;AACvC,qDAAmC;AACnC,8CAA4B;AAC5B,6CAA2B;AAC3B,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,+DAA6C;AAC7C,6DAA2C;AAC3C,4DAA0C;AAC1C,0DAAwC;AACxC,yCAAuB;AACvB,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC;AAClC,4CAA0B;AAC1B,4CAA0B;AAC1B,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AACpC,2CAAyB;AACzB,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,0DAAwC;AACxC,0DAAwC;AACxC,6CAA2B;AAC3B,kDAAgC;AAChC,8DAA4C;AAC5C,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3B,gDAA8B;AAC9B,6CAA2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;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","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\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./ECSqlSyncReader\";\r\nexport * from \"./EditTxn\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsDb\";\r\nexport * from \"./workspace/SettingsEditor\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\nexport * from \"./ChangesetReader\";\r\nexport * from \"./ChangesetReaderTypes\";\r\nexport * from \"./PartialChangeUnifier\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
|
|
1
|
+
{"version":3,"file":"core-backend.js","sourceRoot":"","sources":["../../src/core-backend.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;;;;;;;;;;;;;;AAE/F,4EAA0D;AAC1D,8DAA4C;AAC5C,+DAA6C;AAC7C,sEAAoD;AACpD,uEAAqD;AACrD,kEAAgD;AAChD,gEAA8C;AAC9C,qDAAmC;AACnC,0DAAwC;AACxC,kDAAgC;AAChC,yDAAuC;AACvC,qDAAmC;AACnC,8CAA4B;AAC5B,6CAA2B;AAC3B,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,sDAAoC;AACpC,kDAAgC;AAChC,gDAA8B;AAC9B,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,iDAA+B;AAC/B,+DAA6C;AAC7C,6DAA2C;AAC3C,4DAA0C;AAC1C,0DAAwC;AACxC,yCAAuB;AACvB,uDAAqC;AACrC,mDAAiC;AACjC,oDAAkC;AAClC,4CAA0B;AAC1B,4CAA0B;AAC1B,kDAAgC;AAChC,oDAAkC;AAClC,sDAAoC;AACpC,2CAAyB;AACzB,qDAAmC;AACnC,mDAAiC;AACjC,mDAAiC;AACjC,6CAA2B;AAC3B,mDAAiC;AACjC,0DAAwC;AACxC,0DAAwC;AACxC,6CAA2B;AAC3B,kDAAgC;AAChC,8DAA4C;AAC5C,+CAA6B;AAC7B,+CAA6B;AAC7B,+CAA6B;AAC7B,4CAA0B;AAC1B,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3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;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;IAGI;AAEJ;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG;AAEH;;GAEG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;GAGG;AAEH;;;;GAIG;AAEH;;;GAGG","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\r\nexport * from \"./annotations/ElementDrivesTextAnnotation\";\r\nexport * from \"./annotations/FrameGeometry\";\r\nexport * from \"./annotations/LeaderGeometry\";\r\nexport * from \"./annotations/TextAnnotationElement\";\r\nexport * from \"./annotations/TextAnnotationGeometry\";\r\nexport * from \"./annotations/TextBlockGeometry\";\r\nexport * from \"./annotations/TextBlockLayout\";\r\nexport * from \"./BackendHubAccess\";\r\nexport * from \"./BackendLoggerCategory\";\r\nexport * from \"./BisCoreSchema\";\r\nexport * from \"./BlobContainerService\";\r\nexport * from \"./BriefcaseManager\";\r\nexport * from \"./CatalogDb\";\r\nexport * from \"./Category\";\r\nexport * from \"./ChangedElementsDb\";\r\nexport * from \"./ChangeSummaryManager\";\r\nexport * from \"./ChannelControl\";\r\nexport * from \"./CheckpointManager\";\r\nexport * from \"./ClassRegistry\";\r\nexport * from \"./CloudSqlite\";\r\nexport * from \"./CodeService\";\r\nexport * from \"./CodeSpecs\";\r\nexport * from \"./DevTools\";\r\nexport * from \"./DisplayStyle\";\r\nexport * from \"./domains/FunctionalElements\";\r\nexport * from \"./domains/FunctionalSchema\";\r\nexport * from \"./domains/GenericElements\";\r\nexport * from \"./domains/GenericSchema\";\r\nexport * from \"./ECDb\";\r\nexport * from \"./ECSchemaXmlContext\";\r\nexport * from \"./ECSqlStatement\";\r\nexport * from \"./ECSqlSyncReader\";\r\nexport * from \"./EditTxn\";\r\nexport * from \"./Element\";\r\nexport * from \"./ElementAspect\";\r\nexport * from \"./ElementGraphics\";\r\nexport * from \"./ElementTreeWalker\";\r\nexport * from \"./Entity\";\r\nexport * from \"./EntityReferences\";\r\nexport * from \"./ExportGraphics\";\r\nexport * from \"./ExternalSource\";\r\nexport * from \"./FontFile\";\r\nexport * from \"./GeoCoordConfig\";\r\nexport * from \"./GeographicCRSServices\";\r\nexport * from \"./ImageSourceConversion\";\r\nexport * from \"./IModelDb\";\r\nexport * from \"./IModelDbFonts\";\r\nexport * from \"./IModelElementCloneContext\";\r\nexport * from \"./IModelHost\";\r\nexport * from \"./IModelJsFs\";\r\nexport * from \"./SchemaSync\";\r\nexport * from \"./IpcHost\";\r\nexport * from \"./LineStyle\";\r\nexport * from \"./LocalhostIpcHost\";\r\nexport * from \"./LocalHub\";\r\nexport * from \"./LockControl\";\r\nexport * from \"./SynchronousChannel\";\r\nexport * from \"./Material\";\r\nexport * from \"./Model\";\r\nexport * from \"./NativeAppStorage\";\r\nexport * from \"./NativeHost\";\r\nexport * from \"./NavigationRelationship\";\r\nexport * from \"./PropertyStore\";\r\nexport * from \"./Relationship\";\r\nexport * from \"./rpc/tracing\";\r\nexport * from \"./Schema\";\r\nexport * from \"./SchemaUtils\";\r\nexport * from \"./SheetIndex\";\r\nexport * from \"./SQLiteDb\";\r\nexport * from \"./SqliteStatement\";\r\nexport * from \"./Texture\";\r\nexport * from \"./TileStorage\";\r\nexport * from \"./TxnManager\";\r\nexport * from \"./ViewDefinition\";\r\nexport * from \"./ViewStore\";\r\nexport * from \"./workspace/Settings\";\r\nexport * from \"./workspace/SettingsDb\";\r\nexport * from \"./workspace/SettingsEditor\";\r\nexport * from \"./workspace/SettingsSchemas\";\r\nexport * from \"./workspace/Workspace\";\r\nexport * from \"./workspace/WorkspaceEditor\";\r\nexport * from \"./SqliteChangesetReader\";\r\nexport * from \"./ChangesetECAdaptor\";\r\nexport * from \"./ChangesetReader\";\r\nexport * from \"./ChangesetReaderTypes\";\r\nexport * from \"./PartialChangeUnifier\";\r\n\r\nexport * from \"./internal/cross-package\";\r\n\r\nconst globalSymbolCoreBackend = Symbol.for(\"itwin.core.backend.globals\");\r\nif ((globalThis as any)[globalSymbolCoreBackend]) {\r\n // Get the stack trace from when the module was first loaded\r\n const firstLoadStack = (globalThis as any)[globalSymbolCoreBackend].stack;\r\n\r\n const error = new Error(\r\n \"Multiple @itwin/core-backend imports detected! This may happen if:\\n\" +\r\n \"- You have multiple versions of the package installed\\n\" +\r\n \"- Your bundling configuration is incorrect\\n\" +\r\n \"- You're importing from both ESM and CommonJS versions\"\r\n );\r\n\r\n /* eslint-disable no-console */\r\n console.error(\"Duplicate @itwin/core-backend import:\", error);\r\n console.error(\"First import occurred at:\", firstLoadStack);\r\n console.error(\"Current import occurred at:\", error.stack);\r\n /* eslint-enable no-console */\r\n\r\n throw error;\r\n} else {\r\n (globalThis as any)[globalSymbolCoreBackend] = {\r\n stack: new Error().stack,\r\n };\r\n}\r\n\r\n/** @docs-package-description\r\n * The core-backend package always runs on the computer with a local Briefcase.\r\n *\r\n * It contains classes that [backend code]($docs/learning/backend/index.md) can use to work with directly with iModels.\r\n */\r\n\r\n/**\r\n * @docs-group-description BlobContainers\r\n * Classes for working with cloud-based blob containers.\r\n */\r\n\r\n/**\r\n * @docs-group-description Codes\r\n * Classes for working with [Codes]($docs/BIS/guide/fundamentals/codes.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ECDb\r\n * Classes for working with ECDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description ECSQL\r\n * Classes for working with [ECSQL]($docs/learning/ECSQL.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementAspects\r\n * Subclasses of [ElementAspects]($docs/bis/guide/fundamentals/elementaspect-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ElementGeometry\r\n * Classes for defining the symbology and geometry of geometric elements\r\n */\r\n\r\n/**\r\n * @docs-group-description Elements\r\n * Subclasses of [Elements]($docs/BIS/guide/fundamentals/element-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description ExportGraphics\r\n * APIs for producing low-level graphics primitives from element geometry.\r\n */\r\n\r\n/**\r\n * @docs-group-description HubAccess\r\n * APIs for working with IModelHub\r\n */\r\n\r\n/**\r\n * @docs-group-description Images\r\n * APIs for encoding and decoding images\r\n */\r\n\r\n/**\r\n * @docs-group-description IModelHost\r\n * Classes for configuring and administering the backend [host]($docs/learning/backend/IModelHost.md).\r\n * See [the learning article]($docs/learning/backend/IModelHost.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description iModels\r\n * Classes for working with [iModels]($docs/learning/iModels.md).\r\n * See [the learning article]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Logging\r\n * Logger categories used by this package.\r\n */\r\n\r\n/**\r\n * @docs-group-description Models\r\n * Subclasses of [Models]($docs/BIS/guide/fundamentals/model-fundamentals.md).\r\n * See [the learning articles]($docs/learning/backend/index.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description NativeApp\r\n * Classes for working with Mobile/Desktop Application.\r\n */\r\n\r\n/**\r\n * @docs-group-description Portability\r\n */\r\n\r\n/**\r\n * @docs-group-description Relationships\r\n * Classes that describe the [relationships]($docs/bis/guide/fundamentals/relationship-fundamentals.md) between elements.\r\n */\r\n\r\n/**\r\n * @docs-group-description RpcInterface\r\n * Classes for working with [RpcInterfaces]($docs/learning/RpcInterface.md).\r\n */\r\n\r\n/**\r\n * @docs-group-description Schema\r\n * Classes for working with [ECSchemas]($docs/learning/backend/SchemasAndElementsInTypeScript.md)\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLite\r\n * Classes for working directly with SQLite\r\n */\r\n\r\n/**\r\n * @docs-group-description SQLiteDb\r\n * Classes for working with SQLiteDb.\r\n */\r\n\r\n/**\r\n * @docs-group-description TileStorage\r\n * Class for working with cloud storage using iTwin/object-storage cloud providers\r\n */\r\n\r\n/**\r\n * @docs-group-description ViewDefinitions\r\n * Classes for working with Elements that define what appears in [Views]($docs/learning/frontend/views.md).\r\n * See [the learning articles]($docs/learning/backend/createelements/#orthographicviewdefinition).\r\n */\r\n\r\n/**\r\n * @docs-group-description Workspace\r\n * APIs for loading and using Settings and Workspace resources\r\n */\r\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
1
2
|
import { IModelDb } from "../IModelDb";
|
|
2
3
|
/**
|
|
3
4
|
* Information about each integrity check type, including the name, expected result type, and SQL query to execute
|
|
@@ -64,6 +65,12 @@ export declare const integrityCheckTypeMap: {
|
|
|
64
65
|
readonly sqlCommand: "check_missing_child_rows";
|
|
65
66
|
readonly sqlQuery: "PRAGMA integrity_check(check_missing_child_rows) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES";
|
|
66
67
|
};
|
|
68
|
+
readonly checkDivergedPropMaps: {
|
|
69
|
+
readonly name: "Check Diverged Property Maps";
|
|
70
|
+
readonly resultType: "CheckDivergedPropMapsResultRow";
|
|
71
|
+
readonly sqlCommand: "check_diverged_prop_maps";
|
|
72
|
+
readonly sqlQuery: "PRAGMA integrity_check(check_diverged_prop_maps) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES";
|
|
73
|
+
};
|
|
67
74
|
};
|
|
68
75
|
/**
|
|
69
76
|
* Type representing the keys of the integrityCheckType map, which correspond to the different types of integrity checks that can be performed.
|
|
@@ -81,6 +88,7 @@ interface IntegrityCheckResultTypeMap {
|
|
|
81
88
|
checkDataSchema: CheckDataSchemaResultRow;
|
|
82
89
|
checkSchemaLoad: CheckSchemaLoadResultRow;
|
|
83
90
|
checkMissingChildRows: CheckMissingChildRowsResultRow;
|
|
91
|
+
checkDivergedPropMaps: CheckDivergedPropMapsResultRow;
|
|
84
92
|
}
|
|
85
93
|
/** Checks the Map to give the return type of a specific integrity check */
|
|
86
94
|
type IntegrityCheckResultRow<K extends IntegrityCheckKey> = IntegrityCheckResultTypeMap[K];
|
|
@@ -188,6 +196,19 @@ export interface CheckMissingChildRowsResultRow {
|
|
|
188
196
|
classId: string;
|
|
189
197
|
missingRowInTables: string;
|
|
190
198
|
}
|
|
199
|
+
/**
|
|
200
|
+
* Return type for Check Diverged Property Maps integrity check
|
|
201
|
+
*/
|
|
202
|
+
export interface CheckDivergedPropMapsResultRow {
|
|
203
|
+
sno: number;
|
|
204
|
+
derivedClassId: Id64String;
|
|
205
|
+
derivedClassName: string;
|
|
206
|
+
baseClassId: Id64String;
|
|
207
|
+
baseClassName: string;
|
|
208
|
+
propertyName: string;
|
|
209
|
+
baseColumn: string;
|
|
210
|
+
divergedColumn: string;
|
|
211
|
+
}
|
|
191
212
|
/**
|
|
192
213
|
* Return type for integrity check results, including the check name, whether it passed, and the specific results (if any)
|
|
193
214
|
*/
|
|
@@ -235,6 +256,7 @@ export declare function performSpecificIntegrityCheck(iModel: IModelDb, check: "
|
|
|
235
256
|
export declare function performSpecificIntegrityCheck(iModel: IModelDb, check: "checkDataSchema"): Promise<IntegrityCheckResultRow<"checkDataSchema">[]>;
|
|
236
257
|
export declare function performSpecificIntegrityCheck(iModel: IModelDb, check: "checkSchemaLoad"): Promise<IntegrityCheckResultRow<"checkSchemaLoad">[]>;
|
|
237
258
|
export declare function performSpecificIntegrityCheck(iModel: IModelDb, check: "checkMissingChildRows"): Promise<IntegrityCheckResultRow<"checkMissingChildRows">[]>;
|
|
259
|
+
export declare function performSpecificIntegrityCheck(iModel: IModelDb, check: "checkDivergedPropMaps"): Promise<IntegrityCheckResultRow<"checkDivergedPropMaps">[]>;
|
|
238
260
|
export declare function performSpecificIntegrityCheck<K extends IntegrityCheckKey>(iModel: IModelDb, check: K): Promise<IntegrityCheckResultRow<K>[]>;
|
|
239
261
|
export {};
|
|
240
262
|
//# sourceMappingURL=IntegrityCheck.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityCheck.d.ts","sourceRoot":"","sources":["../../../src/internal/IntegrityCheck.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IntegrityCheck.d.ts","sourceRoot":"","sources":["../../../src/internal/IntegrityCheck.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAgB,MAAM,qBAAqB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC;;;GAGG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmExB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,MAAM,OAAO,qBAAqB,CAAC;AAEnE,4DAA4D;AAC5D,UAAU,2BAA2B;IACnC,gBAAgB,EAAE,yBAAyB,CAAC;IAC5C,cAAc,EAAE,uBAAuB,CAAC;IACxC,uBAAuB,EAAE,yBAAyB,CAAC;IACnD,kBAAkB,EAAE,oBAAoB,CAAC;IACzC,gCAAgC,EAAE,iCAAiC,CAAC;IACpE,2BAA2B,EAAE,4BAA4B,CAAC;IAC1D,aAAa,EAAE,sBAAsB,CAAC;IACtC,eAAe,EAAE,wBAAwB,CAAC;IAC1C,eAAe,EAAE,wBAAwB,CAAC;IAC1C,qBAAqB,EAAE,8BAA8B,CAAC;IACtD,qBAAqB,EAAE,8BAA8B,CAAC;CACvD;AAED,2EAA2E;AAC3E,KAAK,uBAAuB,CAAC,CAAC,SAAS,iBAAiB,IAAI,2BAA2B,CAAC,CAAC,CAAC,CAAC;AAE3F;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,cAA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CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;AACvJ,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnK,wBAAsB,6BAA6B,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC,uBAAuB,CAAC,EAAE,CAAC,CAAC;AACnK,wBAAsB,6BAA6B,CAAC,CAAC,SAAS,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
|
|
@@ -75,6 +75,12 @@ exports.integrityCheckTypeMap = {
|
|
|
75
75
|
sqlCommand: "check_missing_child_rows",
|
|
76
76
|
sqlQuery: `PRAGMA integrity_check(check_missing_child_rows) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,
|
|
77
77
|
},
|
|
78
|
+
checkDivergedPropMaps: {
|
|
79
|
+
name: "Check Diverged Property Maps",
|
|
80
|
+
resultType: "CheckDivergedPropMapsResultRow",
|
|
81
|
+
sqlCommand: "check_diverged_prop_maps",
|
|
82
|
+
sqlQuery: `PRAGMA integrity_check(check_diverged_prop_maps) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,
|
|
83
|
+
},
|
|
78
84
|
};
|
|
79
85
|
/**
|
|
80
86
|
* Gets the user-friendly name of an integrity check based on its key or SQL command.
|
|
@@ -186,6 +192,13 @@ async function performSpecificIntegrityCheck(iModel, check) {
|
|
|
186
192
|
}
|
|
187
193
|
return results;
|
|
188
194
|
}
|
|
195
|
+
case "checkDivergedPropMaps": {
|
|
196
|
+
const results = [];
|
|
197
|
+
for await (const row of iModel.createQueryReader(exports.integrityCheckTypeMap.checkDivergedPropMaps.sqlQuery, undefined, { usePrimaryConn: true })) {
|
|
198
|
+
results.push({ sno: row.sno, derivedClassId: row.derivedClassId, derivedClassName: row.derivedClassName, baseClassId: row.baseClassId, baseClassName: row.baseClassName, propertyName: row.propertyName, baseColumn: row.baseColumn, divergedColumn: row.divergedColumn });
|
|
199
|
+
}
|
|
200
|
+
return results;
|
|
201
|
+
}
|
|
189
202
|
default:
|
|
190
203
|
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadRequest, `Unknown integrity check type`);
|
|
191
204
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegrityCheck.js","sourceRoot":"","sources":["../../../src/internal/IntegrityCheck.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAwO/F,sDAcC;AAQD,gEAOC;AAqBD,sEA2EC;AAnWD,sDAAmD;AACnD,oDAAiD;AAGjD;;;GAGG;AACU,QAAA,qBAAqB,GAAG;IACnC,gBAAgB,EAAE;QAChB,IAAI,EAAE,oBAAoB;QAC1B,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,sFAAsF;KACjG;IACD,cAAc,EAAE;QACd,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,yBAAyB;QACrC,UAAU,EAAE,kBAAkB;QAC9B,QAAQ,EAAE,oFAAoF;KAC/F;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,4BAA4B;QAClC,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,qBAAqB;QACjC,QAAQ,EAAE,uFAAuF;KAClG;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,sBAAsB;QAClC,UAAU,EAAE,eAAe;QAC3B,QAAQ,EAAE,iFAAiF;KAC5F;IACD,gCAAgC,EAAE;QAChC,IAAI,EAAE,wCAAwC;QAC9C,UAAU,EAAE,mCAA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Q,EAAE,SAAS,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;gBACtI,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD,KAAK,uBAAuB,CAAC,CAAC,CAAC;YAC7B,MAAM,OAAO,GAAqC,EAAE,CAAC;YACrD,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,MAAM,CAAC,iBAAiB,CAAC,6BAAqB,CAAC,qBAAqB,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;gBAC5I,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,kBAAkB,EAAE,GAAG,CAAC,kBAAkB,EAAE,CAAC,CAAC;YAClI,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD;YACE,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;IACnF,CAAC;AACH,CAAC","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\r\nimport { IModelStatus } from \"@itwin/core-bentley\";\r\nimport { IModelError } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"../IModelDb\";\r\n\r\n/**\r\n * Information about each integrity check type, including the name, expected result type, and SQL query to execute\r\n * @internal\r\n */\r\nexport const integrityCheckTypeMap = {\r\n checkDataColumns: {\r\n name: \"Check Data Columns\",\r\n resultType: \"CheckDataColumnsResultRow\",\r\n sqlCommand: \"check_data_columns\",\r\n sqlQuery: `PRAGMA integrity_check(check_data_columns) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkECProfile: {\r\n name: \"Check EC Profile\",\r\n resultType: \"CheckECProfileResultRow\",\r\n sqlCommand: \"check_ec_profile\",\r\n sqlQuery: `PRAGMA integrity_check(check_ec_profile) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkNavigationClassIds: {\r\n name: \"Check Navigation Class Ids\",\r\n resultType: \"CheckNavClassIdsResultRow\",\r\n sqlCommand: \"check_nav_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_nav_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkNavigationIds: {\r\n name: \"Check Navigation Ids\",\r\n resultType: \"CheckNavIdsResultRow\",\r\n sqlCommand: \"check_nav_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_nav_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkLinktableForeignKeyClassIds: {\r\n name: \"Check Link Table Foreign Key Class Ids\",\r\n resultType: \"CheckLinkTableFkClassIdsResultRow\",\r\n sqlCommand: \"check_linktable_fk_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_linktable_fk_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkLinktableForeignKeyIds: {\r\n name: \"Check Link Table Foreign Key Ids\",\r\n resultType: \"CheckLinkTableFkIdsResultRow\",\r\n sqlCommand: \"check_linktable_fk_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_linktable_fk_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkClassIds: {\r\n name: \"Check Class Ids\",\r\n resultType: \"CheckClassIdsResultRow\",\r\n sqlCommand: \"check_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkDataSchema: {\r\n name: \"Check Data Schema\",\r\n resultType: \"CheckDataSchemaResultRow\",\r\n sqlCommand: \"check_data_schema\",\r\n sqlQuery: `PRAGMA integrity_check(check_data_schema) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkSchemaLoad: {\r\n name: \"Check Schema Load\",\r\n resultType: \"CheckSchemaLoadResultRow\",\r\n sqlCommand: \"check_schema_load\",\r\n sqlQuery: `PRAGMA integrity_check(check_schema_load) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkMissingChildRows: {\r\n name: \"Check Missing Child Rows\",\r\n resultType: \"CheckMissingChildRowsResultRow\",\r\n sqlCommand: \"check_missing_child_rows\",\r\n sqlQuery: `PRAGMA integrity_check(check_missing_child_rows) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n} as const;\r\n\r\n/**\r\n * Type representing the keys of the integrityCheckType map, which correspond to the different types of integrity checks that can be performed.\r\n */\r\nexport type IntegrityCheckKey = keyof typeof integrityCheckTypeMap;\r\n\r\n/** Map of integrity check keys to their result row types */\r\ninterface IntegrityCheckResultTypeMap {\r\n checkDataColumns: CheckDataColumnsResultRow;\r\n checkECProfile: CheckECProfileResultRow;\r\n checkNavigationClassIds: CheckNavClassIdsResultRow;\r\n checkNavigationIds: CheckNavIdsResultRow;\r\n checkLinktableForeignKeyClassIds: CheckLinkTableFkClassIdsResultRow;\r\n checkLinktableForeignKeyIds: CheckLinkTableFkIdsResultRow;\r\n checkClassIds: CheckClassIdsResultRow;\r\n checkDataSchema: CheckDataSchemaResultRow;\r\n checkSchemaLoad: CheckSchemaLoadResultRow;\r\n checkMissingChildRows: CheckMissingChildRowsResultRow;\r\n}\r\n\r\n/** Checks the Map to give the return type of a specific integrity check */\r\ntype IntegrityCheckResultRow<K extends IntegrityCheckKey> = IntegrityCheckResultTypeMap[K];\r\n\r\n/**\r\n * Return type for quick integrity check\r\n */\r\nexport interface QuickIntegrityCheckResultRow {\r\n check: string;\r\n passed: boolean;\r\n elapsedSeconds: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Data Columns integrity check\r\n */\r\nexport interface CheckDataColumnsResultRow {\r\n sno: number;\r\n table: string;\r\n column: string;\r\n}\r\n\r\n/**\r\n * Return type for Check EC Profile integrity check\r\n */\r\nexport interface CheckECProfileResultRow {\r\n sno: number;\r\n type: string;\r\n name: string;\r\n issue: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Navigation Class Ids integrity check\r\n */\r\nexport interface CheckNavClassIdsResultRow {\r\n sno: number;\r\n id: string;\r\n class: string;\r\n property: string;\r\n navId: string;\r\n navClassId: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Navigation Ids integrity check\r\n */\r\nexport interface CheckNavIdsResultRow {\r\n sno: number;\r\n id: string;\r\n class: string;\r\n property: string;\r\n navId: string;\r\n primaryClass: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Link Table Foreign Key Class Ids integrity check\r\n */\r\nexport interface CheckLinkTableFkClassIdsResultRow {\r\n sno: number;\r\n id: string;\r\n relationship: string;\r\n property: string;\r\n keyId: string;\r\n keyClassId: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Link Table Foreign Key Ids integrity check\r\n */\r\nexport interface CheckLinkTableFkIdsResultRow {\r\n sno: number;\r\n id: string;\r\n relationship: string;\r\n property: string;\r\n keyId: string;\r\n primaryClass: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Class Ids integrity check\r\n */\r\nexport interface CheckClassIdsResultRow {\r\n sno: number;\r\n class: string;\r\n id: string;\r\n classId: string;\r\n type: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Data Schema integrity check\r\n */\r\nexport interface CheckDataSchemaResultRow {\r\n sno: number;\r\n type: string;\r\n name: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Schema Load integrity check\r\n */\r\nexport interface CheckSchemaLoadResultRow {\r\n sno: number;\r\n schema: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Missing Child Rows integrity check\r\n */\r\nexport interface CheckMissingChildRowsResultRow {\r\n sno: number;\r\n class: string;\r\n id: string;\r\n classId: string;\r\n missingRowInTables: string;\r\n}\r\n\r\n/**\r\n * Return type for integrity check results, including the check name, whether it passed, and the specific results (if any)\r\n */\r\nexport interface IntegrityCheckResult {\r\n /** The name of the integrity check that was performed */\r\n check: string;\r\n /** Whether the integrity check passed (i.e. no issues were found = true) */\r\n passed: boolean;\r\n /** The specific results returned by the integrity check, which may include details about any issues that were found.\r\n * In the case where issues are found, this will be an array of result rows specific to the type of check that was performed,\r\n * or an array of quick integrity check results if it was a quick check. */\r\n results: IntegrityCheckResultRow<IntegrityCheckKey>[] | QuickIntegrityCheckResultRow[];\r\n}\r\n\r\n/**\r\n * Gets the user-friendly name of an integrity check based on its key or SQL command.\r\n * It first attempts to find a direct match for the key in the integrityCheckTypeMap. If not found, it searches for a match based on the SQL command.\r\n * If still not found, it returns the original check string.\r\n * @param check - The integrity check key or SQL command to get the name of\r\n * @returns The user-friendly name of the integrity check, or the original check string if no match is found\r\n * @internal\r\n */\r\nexport function getIntegrityCheckName(check: string): string {\r\n // First try direct lookup by key\r\n const directLookup = integrityCheckTypeMap[check as IntegrityCheckKey];\r\n if (directLookup) {\r\n return directLookup.name;\r\n }\r\n // If not found, search by sqlCommand\r\n for (const [, value] of Object.entries(integrityCheckTypeMap)) {\r\n if (value.sqlCommand === check) {\r\n return value.name;\r\n }\r\n }\r\n // Fallback to the original check string\r\n return check;\r\n}\r\n\r\n/**\r\n * Performs a quick integrity check on the given iModel.\r\n * @param iModel The IModelDb instance to perform the integrity check on\r\n * @returns An array of results for each check performed, including the check name, whether it passed, and the elapsed time in seconds\r\n * @internal\r\n */\r\nexport async function performQuickIntegrityCheck(iModel: IModelDb): Promise<QuickIntegrityCheckResultRow[]> {\r\n const integrityCheckQuery = \"PRAGMA integrity_check ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES\";\r\n const integrityCheckResults: QuickIntegrityCheckResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckQuery, undefined, { usePrimaryConn: true })) {\r\n integrityCheckResults.push({ check: getIntegrityCheckName(row.check), passed: row.result, elapsedSeconds: row.elapsed_sec});\r\n };\r\n return integrityCheckResults;\r\n}\r\n\r\n/**\r\n * Performs a specific integrity check on the given iModel based on the provided check key, and returns the results specific to that check type.\r\n * @param iModel The IModelDb instance to perform the integrity check on\r\n * @param check The key of the specific integrity check to perform\r\n * @return An array of results specific to the integrity check that was performed. The type of the result rows will depend on the check that was executed.\r\n * @throws IModelError with status BadRequest if an unknown integrity check key is provided\r\n * @internal\r\n */\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkDataColumns\"): Promise<IntegrityCheckResultRow<\"checkDataColumns\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkECProfile\"): Promise<IntegrityCheckResultRow<\"checkECProfile\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkNavigationClassIds\"): Promise<IntegrityCheckResultRow<\"checkNavigationClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkNavigationIds\"): Promise<IntegrityCheckResultRow<\"checkNavigationIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkLinktableForeignKeyClassIds\"): Promise<IntegrityCheckResultRow<\"checkLinktableForeignKeyClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkLinktableForeignKeyIds\"): Promise<IntegrityCheckResultRow<\"checkLinktableForeignKeyIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkClassIds\"): Promise<IntegrityCheckResultRow<\"checkClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkDataSchema\"): Promise<IntegrityCheckResultRow<\"checkDataSchema\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkSchemaLoad\"): Promise<IntegrityCheckResultRow<\"checkSchemaLoad\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkMissingChildRows\"): Promise<IntegrityCheckResultRow<\"checkMissingChildRows\">[]>;\r\nexport async function performSpecificIntegrityCheck<K extends IntegrityCheckKey>(iModel: IModelDb, check: K): Promise<IntegrityCheckResultRow<K>[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: IntegrityCheckKey): Promise<IntegrityCheckResultRow<IntegrityCheckKey>[]> {\r\n switch (check) {\r\n case \"checkDataColumns\": {\r\n const results: CheckDataColumnsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkDataColumns.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, table: row.table, column: row.column });\r\n }\r\n return results;\r\n }\r\n case \"checkECProfile\": {\r\n const results: CheckECProfileResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkECProfile.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, type: row.type, name: row.name, issue: row.issue });\r\n }\r\n return results;\r\n }\r\n case \"checkNavigationClassIds\": {\r\n const results: CheckNavClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkNavigationClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, class: row.class, property: row.property, navId: row.nav_id, navClassId: row.nav_classId });\r\n }\r\n return results;\r\n }\r\n case \"checkNavigationIds\": {\r\n const results: CheckNavIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkNavigationIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, class: row.class, property: row.property, navId: row.nav_id, primaryClass: row.primary_class });\r\n }\r\n return results;\r\n }\r\n case \"checkLinktableForeignKeyClassIds\": {\r\n const results: CheckLinkTableFkClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkLinktableForeignKeyClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, relationship: row.relationship, property: row.property, keyId: row.key_id, keyClassId: row.key_classId });\r\n }\r\n return results;\r\n }\r\n case \"checkLinktableForeignKeyIds\": {\r\n const results: CheckLinkTableFkIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkLinktableForeignKeyIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, relationship: row.relationship, property: row.property, keyId: row.key_id, primaryClass: row.primary_class });\r\n }\r\n return results;\r\n }\r\n case \"checkClassIds\": {\r\n const results: CheckClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, class: row.class, id: row.id, classId: row.class_id, type: row.type });\r\n }\r\n return results;\r\n }\r\n case \"checkDataSchema\": {\r\n const results: CheckDataSchemaResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkDataSchema.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, type: row.type, name: row.name });\r\n }\r\n return results;\r\n }\r\n case \"checkSchemaLoad\": {\r\n const results: CheckSchemaLoadResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkSchemaLoad.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, schema: row.schema });\r\n }\r\n return results;\r\n }\r\n case \"checkMissingChildRows\": {\r\n const results: CheckMissingChildRowsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkMissingChildRows.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, class: row.class, id: row.id, classId: row.class_id, missingRowInTables: row.MissingRowInTables });\r\n }\r\n return results;\r\n }\r\n default:\r\n throw new IModelError(IModelStatus.BadRequest, `Unknown integrity check type`);\r\n }\r\n}"]}
|
|
1
|
+
{"version":3,"file":"IntegrityCheck.js","sourceRoot":"","sources":["../../../src/internal/IntegrityCheck.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AA6P/F,sDAcC;AAQD,gEAOC;AAsBD,sEAkFC;AAhYD,sDAA+D;AAC/D,oDAAiD;AAGjD;;;GAGG;AACU,QAAA,qBAAqB,GAAG;IACnC,gBAAgB,EAAE;QAChB,IAAI,EAAE,oBAAoB;QAC1B,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,oBAAoB;QAChC,QAAQ,EAAE,sFAAsF;KACjG;IACD,cAAc,EAAE;QACd,IAAI,EAAE,kBAAkB;QACxB,UAAU,EAAE,yBAAyB;QACrC,UAAU,EAAE,kBAAkB;QAC9B,QAAQ,EAAE,oFAAoF;KAC/F;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,4BAA4B;QAClC,UAAU,EAAE,2BAA2B;QACvC,UAAU,EAAE,qBAAqB;QACjC,QAAQ,EAAE,uFAAuF;KAClG;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,sBAAsB;QAClC,UAAU,EAAE,eAAe;QAC3B,QAAQ,EAAE,iFAAiF;KAC5F;IACD,gCAAgC,EAAE;QAChC,IAAI,EAAE,wCAAwC;QAC9C,UAAU,EAAE,mCAAmC;QAC/C,UAAU,EAAE,8BAA8B;QAC1C,QAAQ,EAAE,gGAAgG;KAC3G;IACD,2BAA2B,EAAE;QAC3B,IAAI,EAAE,kCAAkC;QACxC,UAAU,EAAE,8BAA8B;QAC1C,UAAU,EAAE,wBAAwB;QACpC,QAAQ,EAAE,0FAA0F;KACrG;IACD,aAAa,EAAE;QACb,IAAI,EAAE,iBAAiB;QACvB,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AAC,CAAC;YAC7Q,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QACD;YACE,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,UAAU,EAAE,8BAA8B,CAAC,CAAC;IACnF,CAAC;AACH,CAAC","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\r\nimport { Id64String, IModelStatus } from \"@itwin/core-bentley\";\r\nimport { IModelError } from \"@itwin/core-common\";\r\nimport { IModelDb } from \"../IModelDb\";\r\n\r\n/**\r\n * Information about each integrity check type, including the name, expected result type, and SQL query to execute\r\n * @internal\r\n */\r\nexport const integrityCheckTypeMap = {\r\n checkDataColumns: {\r\n name: \"Check Data Columns\",\r\n resultType: \"CheckDataColumnsResultRow\",\r\n sqlCommand: \"check_data_columns\",\r\n sqlQuery: `PRAGMA integrity_check(check_data_columns) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkECProfile: {\r\n name: \"Check EC Profile\",\r\n resultType: \"CheckECProfileResultRow\",\r\n sqlCommand: \"check_ec_profile\",\r\n sqlQuery: `PRAGMA integrity_check(check_ec_profile) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkNavigationClassIds: {\r\n name: \"Check Navigation Class Ids\",\r\n resultType: \"CheckNavClassIdsResultRow\",\r\n sqlCommand: \"check_nav_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_nav_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkNavigationIds: {\r\n name: \"Check Navigation Ids\",\r\n resultType: \"CheckNavIdsResultRow\",\r\n sqlCommand: \"check_nav_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_nav_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkLinktableForeignKeyClassIds: {\r\n name: \"Check Link Table Foreign Key Class Ids\",\r\n resultType: \"CheckLinkTableFkClassIdsResultRow\",\r\n sqlCommand: \"check_linktable_fk_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_linktable_fk_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkLinktableForeignKeyIds: {\r\n name: \"Check Link Table Foreign Key Ids\",\r\n resultType: \"CheckLinkTableFkIdsResultRow\",\r\n sqlCommand: \"check_linktable_fk_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_linktable_fk_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkClassIds: {\r\n name: \"Check Class Ids\",\r\n resultType: \"CheckClassIdsResultRow\",\r\n sqlCommand: \"check_class_ids\",\r\n sqlQuery: `PRAGMA integrity_check(check_class_ids) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkDataSchema: {\r\n name: \"Check Data Schema\",\r\n resultType: \"CheckDataSchemaResultRow\",\r\n sqlCommand: \"check_data_schema\",\r\n sqlQuery: `PRAGMA integrity_check(check_data_schema) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkSchemaLoad: {\r\n name: \"Check Schema Load\",\r\n resultType: \"CheckSchemaLoadResultRow\",\r\n sqlCommand: \"check_schema_load\",\r\n sqlQuery: `PRAGMA integrity_check(check_schema_load) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkMissingChildRows: {\r\n name: \"Check Missing Child Rows\",\r\n resultType: \"CheckMissingChildRowsResultRow\",\r\n sqlCommand: \"check_missing_child_rows\",\r\n sqlQuery: `PRAGMA integrity_check(check_missing_child_rows) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n checkDivergedPropMaps: {\r\n name: \"Check Diverged Property Maps\",\r\n resultType: \"CheckDivergedPropMapsResultRow\",\r\n sqlCommand: \"check_diverged_prop_maps\",\r\n sqlQuery: `PRAGMA integrity_check(check_diverged_prop_maps) ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES`,\r\n },\r\n} as const;\r\n\r\n/**\r\n * Type representing the keys of the integrityCheckType map, which correspond to the different types of integrity checks that can be performed.\r\n */\r\nexport type IntegrityCheckKey = keyof typeof integrityCheckTypeMap;\r\n\r\n/** Map of integrity check keys to their result row types */\r\ninterface IntegrityCheckResultTypeMap {\r\n checkDataColumns: CheckDataColumnsResultRow;\r\n checkECProfile: CheckECProfileResultRow;\r\n checkNavigationClassIds: CheckNavClassIdsResultRow;\r\n checkNavigationIds: CheckNavIdsResultRow;\r\n checkLinktableForeignKeyClassIds: CheckLinkTableFkClassIdsResultRow;\r\n checkLinktableForeignKeyIds: CheckLinkTableFkIdsResultRow;\r\n checkClassIds: CheckClassIdsResultRow;\r\n checkDataSchema: CheckDataSchemaResultRow;\r\n checkSchemaLoad: CheckSchemaLoadResultRow;\r\n checkMissingChildRows: CheckMissingChildRowsResultRow;\r\n checkDivergedPropMaps: CheckDivergedPropMapsResultRow;\r\n}\r\n\r\n/** Checks the Map to give the return type of a specific integrity check */\r\ntype IntegrityCheckResultRow<K extends IntegrityCheckKey> = IntegrityCheckResultTypeMap[K];\r\n\r\n/**\r\n * Return type for quick integrity check\r\n */\r\nexport interface QuickIntegrityCheckResultRow {\r\n check: string;\r\n passed: boolean;\r\n elapsedSeconds: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Data Columns integrity check\r\n */\r\nexport interface CheckDataColumnsResultRow {\r\n sno: number;\r\n table: string;\r\n column: string;\r\n}\r\n\r\n/**\r\n * Return type for Check EC Profile integrity check\r\n */\r\nexport interface CheckECProfileResultRow {\r\n sno: number;\r\n type: string;\r\n name: string;\r\n issue: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Navigation Class Ids integrity check\r\n */\r\nexport interface CheckNavClassIdsResultRow {\r\n sno: number;\r\n id: string;\r\n class: string;\r\n property: string;\r\n navId: string;\r\n navClassId: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Navigation Ids integrity check\r\n */\r\nexport interface CheckNavIdsResultRow {\r\n sno: number;\r\n id: string;\r\n class: string;\r\n property: string;\r\n navId: string;\r\n primaryClass: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Link Table Foreign Key Class Ids integrity check\r\n */\r\nexport interface CheckLinkTableFkClassIdsResultRow {\r\n sno: number;\r\n id: string;\r\n relationship: string;\r\n property: string;\r\n keyId: string;\r\n keyClassId: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Link Table Foreign Key Ids integrity check\r\n */\r\nexport interface CheckLinkTableFkIdsResultRow {\r\n sno: number;\r\n id: string;\r\n relationship: string;\r\n property: string;\r\n keyId: string;\r\n primaryClass: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Class Ids integrity check\r\n */\r\nexport interface CheckClassIdsResultRow {\r\n sno: number;\r\n class: string;\r\n id: string;\r\n classId: string;\r\n type: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Data Schema integrity check\r\n */\r\nexport interface CheckDataSchemaResultRow {\r\n sno: number;\r\n type: string;\r\n name: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Schema Load integrity check\r\n */\r\nexport interface CheckSchemaLoadResultRow {\r\n sno: number;\r\n schema: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Missing Child Rows integrity check\r\n */\r\nexport interface CheckMissingChildRowsResultRow {\r\n sno: number;\r\n class: string;\r\n id: string;\r\n classId: string;\r\n missingRowInTables: string;\r\n}\r\n\r\n/**\r\n * Return type for Check Diverged Property Maps integrity check\r\n */\r\nexport interface CheckDivergedPropMapsResultRow {\r\n sno: number;\r\n derivedClassId: Id64String;\r\n derivedClassName: string;\r\n baseClassId: Id64String;\r\n baseClassName: string;\r\n propertyName: string;\r\n baseColumn: string;\r\n divergedColumn: string;\r\n}\r\n\r\n/**\r\n * Return type for integrity check results, including the check name, whether it passed, and the specific results (if any)\r\n */\r\nexport interface IntegrityCheckResult {\r\n /** The name of the integrity check that was performed */\r\n check: string;\r\n /** Whether the integrity check passed (i.e. no issues were found = true) */\r\n passed: boolean;\r\n /** The specific results returned by the integrity check, which may include details about any issues that were found.\r\n * In the case where issues are found, this will be an array of result rows specific to the type of check that was performed,\r\n * or an array of quick integrity check results if it was a quick check. */\r\n results: IntegrityCheckResultRow<IntegrityCheckKey>[] | QuickIntegrityCheckResultRow[];\r\n}\r\n\r\n/**\r\n * Gets the user-friendly name of an integrity check based on its key or SQL command.\r\n * It first attempts to find a direct match for the key in the integrityCheckTypeMap. If not found, it searches for a match based on the SQL command.\r\n * If still not found, it returns the original check string.\r\n * @param check - The integrity check key or SQL command to get the name of\r\n * @returns The user-friendly name of the integrity check, or the original check string if no match is found\r\n * @internal\r\n */\r\nexport function getIntegrityCheckName(check: string): string {\r\n // First try direct lookup by key\r\n const directLookup = integrityCheckTypeMap[check as IntegrityCheckKey];\r\n if (directLookup) {\r\n return directLookup.name;\r\n }\r\n // If not found, search by sqlCommand\r\n for (const [, value] of Object.entries(integrityCheckTypeMap)) {\r\n if (value.sqlCommand === check) {\r\n return value.name;\r\n }\r\n }\r\n // Fallback to the original check string\r\n return check;\r\n}\r\n\r\n/**\r\n * Performs a quick integrity check on the given iModel.\r\n * @param iModel The IModelDb instance to perform the integrity check on\r\n * @returns An array of results for each check performed, including the check name, whether it passed, and the elapsed time in seconds\r\n * @internal\r\n */\r\nexport async function performQuickIntegrityCheck(iModel: IModelDb): Promise<QuickIntegrityCheckResultRow[]> {\r\n const integrityCheckQuery = \"PRAGMA integrity_check ECSQLOPTIONS ENABLE_EXPERIMENTAL_FEATURES\";\r\n const integrityCheckResults: QuickIntegrityCheckResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckQuery, undefined, { usePrimaryConn: true })) {\r\n integrityCheckResults.push({ check: getIntegrityCheckName(row.check), passed: row.result, elapsedSeconds: row.elapsed_sec });\r\n };\r\n return integrityCheckResults;\r\n}\r\n\r\n/**\r\n * Performs a specific integrity check on the given iModel based on the provided check key, and returns the results specific to that check type.\r\n * @param iModel The IModelDb instance to perform the integrity check on\r\n * @param check The key of the specific integrity check to perform\r\n * @return An array of results specific to the integrity check that was performed. The type of the result rows will depend on the check that was executed.\r\n * @throws IModelError with status BadRequest if an unknown integrity check key is provided\r\n * @internal\r\n */\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkDataColumns\"): Promise<IntegrityCheckResultRow<\"checkDataColumns\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkECProfile\"): Promise<IntegrityCheckResultRow<\"checkECProfile\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkNavigationClassIds\"): Promise<IntegrityCheckResultRow<\"checkNavigationClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkNavigationIds\"): Promise<IntegrityCheckResultRow<\"checkNavigationIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkLinktableForeignKeyClassIds\"): Promise<IntegrityCheckResultRow<\"checkLinktableForeignKeyClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkLinktableForeignKeyIds\"): Promise<IntegrityCheckResultRow<\"checkLinktableForeignKeyIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkClassIds\"): Promise<IntegrityCheckResultRow<\"checkClassIds\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkDataSchema\"): Promise<IntegrityCheckResultRow<\"checkDataSchema\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkSchemaLoad\"): Promise<IntegrityCheckResultRow<\"checkSchemaLoad\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkMissingChildRows\"): Promise<IntegrityCheckResultRow<\"checkMissingChildRows\">[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: \"checkDivergedPropMaps\"): Promise<IntegrityCheckResultRow<\"checkDivergedPropMaps\">[]>;\r\nexport async function performSpecificIntegrityCheck<K extends IntegrityCheckKey>(iModel: IModelDb, check: K): Promise<IntegrityCheckResultRow<K>[]>;\r\nexport async function performSpecificIntegrityCheck(iModel: IModelDb, check: IntegrityCheckKey): Promise<IntegrityCheckResultRow<IntegrityCheckKey>[]> {\r\n switch (check) {\r\n case \"checkDataColumns\": {\r\n const results: CheckDataColumnsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkDataColumns.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, table: row.table, column: row.column });\r\n }\r\n return results;\r\n }\r\n case \"checkECProfile\": {\r\n const results: CheckECProfileResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkECProfile.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, type: row.type, name: row.name, issue: row.issue });\r\n }\r\n return results;\r\n }\r\n case \"checkNavigationClassIds\": {\r\n const results: CheckNavClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkNavigationClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, class: row.class, property: row.property, navId: row.nav_id, navClassId: row.nav_classId });\r\n }\r\n return results;\r\n }\r\n case \"checkNavigationIds\": {\r\n const results: CheckNavIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkNavigationIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, class: row.class, property: row.property, navId: row.nav_id, primaryClass: row.primary_class });\r\n }\r\n return results;\r\n }\r\n case \"checkLinktableForeignKeyClassIds\": {\r\n const results: CheckLinkTableFkClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkLinktableForeignKeyClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, relationship: row.relationship, property: row.property, keyId: row.key_id, keyClassId: row.key_classId });\r\n }\r\n return results;\r\n }\r\n case \"checkLinktableForeignKeyIds\": {\r\n const results: CheckLinkTableFkIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkLinktableForeignKeyIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, id: row.id, relationship: row.relationship, property: row.property, keyId: row.key_id, primaryClass: row.primary_class });\r\n }\r\n return results;\r\n }\r\n case \"checkClassIds\": {\r\n const results: CheckClassIdsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkClassIds.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, class: row.class, id: row.id, classId: row.class_id, type: row.type });\r\n }\r\n return results;\r\n }\r\n case \"checkDataSchema\": {\r\n const results: CheckDataSchemaResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkDataSchema.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, type: row.type, name: row.name });\r\n }\r\n return results;\r\n }\r\n case \"checkSchemaLoad\": {\r\n const results: CheckSchemaLoadResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkSchemaLoad.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, schema: row.schema });\r\n }\r\n return results;\r\n }\r\n case \"checkMissingChildRows\": {\r\n const results: CheckMissingChildRowsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkMissingChildRows.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, class: row.class, id: row.id, classId: row.class_id, missingRowInTables: row.MissingRowInTables });\r\n }\r\n return results;\r\n }\r\n case \"checkDivergedPropMaps\": {\r\n const results: CheckDivergedPropMapsResultRow[] = [];\r\n for await (const row of iModel.createQueryReader(integrityCheckTypeMap.checkDivergedPropMaps.sqlQuery, undefined, { usePrimaryConn: true })) {\r\n results.push({ sno: row.sno, derivedClassId: row.derivedClassId, derivedClassName: row.derivedClassName, baseClassId: row.baseClassId, baseClassName: row.baseClassName, propertyName: row.propertyName, baseColumn: row.baseColumn, divergedColumn: row.divergedColumn });\r\n }\r\n return results;\r\n }\r\n default:\r\n throw new IModelError(IModelStatus.BadRequest, `Unknown integrity check type`);\r\n }\r\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NoReservations.d.ts","sourceRoot":"","sources":["../../../src/internal/NoReservations.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAa3D,wBAAgB,sBAAsB,IAAI,kBAAkB,CAAC,YAAY,CAExE"}
|