@itwin/core-backend 5.1.0-dev.5 → 5.1.0-dev.52
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 +122 -1
- package/lib/cjs/BackendHubAccess.d.ts +1 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +10 -2
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +16 -0
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +67 -8
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +248 -33
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +1 -1
- package/lib/cjs/ClassRegistry.js +1 -1
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +4 -4
- package/lib/cjs/DisplayStyle.js +3 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +4 -4
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +4 -4
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +15 -6
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +18 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +51 -51
- package/lib/cjs/Element.js +52 -52
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +8 -8
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +8 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/Entity.d.ts +3 -3
- package/lib/cjs/Entity.js +2 -2
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +54 -8
- package/lib/cjs/ExportGraphics.d.ts.map +1 -1
- package/lib/cjs/ExportGraphics.js +158 -59
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.d.ts +6 -2
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +1 -1
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +29 -23
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +106 -43
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +2 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +2 -3
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/Material.d.ts +1 -1
- package/lib/cjs/Material.js +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +22 -22
- package/lib/cjs/Model.js +22 -22
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +1 -1
- package/lib/cjs/SQLiteDb.js +1 -1
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +1 -1
- package/lib/cjs/SqliteStatement.d.ts.map +1 -1
- package/lib/cjs/SqliteStatement.js +1 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +4 -4
- package/lib/cjs/TxnManager.js +1 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +40 -14
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +42 -14
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/annotations/FrameGeometry.d.ts +52 -0
- package/lib/cjs/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/FrameGeometry.js +250 -0
- package/lib/cjs/annotations/FrameGeometry.js.map +1 -0
- package/lib/cjs/{TextAnnotationElement.d.ts → annotations/TextAnnotationElement.d.ts} +6 -11
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationElement.js → annotations/TextAnnotationElement.js} +20 -26
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +31 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js +132 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +13 -69
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +22 -8
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/cjs/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +51 -9
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -0
- package/lib/cjs/core-backend.d.ts +5 -3
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +25 -6
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.d.ts +23 -0
- package/lib/cjs/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/cjs/internal/ElementLRUCache.js +167 -3
- package/lib/cjs/internal/ElementLRUCache.js.map +1 -1
- 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/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +1 -1
- package/lib/esm/BackendHubAccess.js +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BisCoreSchema.js +1 -1
- package/lib/esm/BisCoreSchema.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +10 -2
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +17 -1
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +67 -8
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +248 -33
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ClassRegistry.d.ts +1 -1
- package/lib/esm/ClassRegistry.js +1 -1
- package/lib/esm/ClassRegistry.js.map +1 -1
- package/lib/esm/CloudSqlite.js +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +1 -1
- package/lib/esm/CodeSpecs.js +1 -1
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +4 -4
- package/lib/esm/DisplayStyle.js +3 -3
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECDb.d.ts +4 -4
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +4 -4
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts +15 -6
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js +18 -4
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/Element.d.ts +51 -51
- package/lib/esm/Element.js +52 -52
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +8 -8
- package/lib/esm/ElementAspect.d.ts.map +1 -1
- package/lib/esm/ElementAspect.js +8 -8
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/Entity.d.ts +3 -3
- package/lib/esm/Entity.js +2 -2
- package/lib/esm/Entity.js.map +1 -1
- package/lib/esm/ExportGraphics.d.ts +54 -8
- package/lib/esm/ExportGraphics.d.ts.map +1 -1
- package/lib/esm/ExportGraphics.js +156 -58
- package/lib/esm/ExportGraphics.js.map +1 -1
- package/lib/esm/GeographicCRSServices.d.ts +6 -2
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +1 -1
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +29 -23
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +109 -46
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts +1 -1
- package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/esm/IModelElementCloneContext.js +1 -1
- package/lib/esm/IModelElementCloneContext.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +2 -3
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +2 -3
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/Material.d.ts +1 -1
- package/lib/esm/Material.js +1 -1
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +22 -22
- package/lib/esm/Model.js +22 -22
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/SQLiteDb.d.ts +1 -1
- package/lib/esm/SQLiteDb.js +1 -1
- package/lib/esm/SQLiteDb.js.map +1 -1
- package/lib/esm/SqliteStatement.d.ts +1 -1
- package/lib/esm/SqliteStatement.d.ts.map +1 -1
- package/lib/esm/SqliteStatement.js +1 -1
- package/lib/esm/SqliteStatement.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +4 -4
- package/lib/esm/TxnManager.js +1 -1
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +40 -14
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +42 -14
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/annotations/FrameGeometry.d.ts +52 -0
- package/lib/esm/annotations/FrameGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/FrameGeometry.js +245 -0
- package/lib/esm/annotations/FrameGeometry.js.map +1 -0
- package/lib/esm/{TextAnnotationElement.d.ts → annotations/TextAnnotationElement.d.ts} +6 -11
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationElement.js → annotations/TextAnnotationElement.js} +22 -28
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +31 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js +129 -0
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts +16 -0
- package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationGeometry.js → annotations/TextBlockGeometry.js} +13 -69
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -0
- package/lib/esm/{TextAnnotationLayout.d.ts → annotations/TextBlockLayout.d.ts} +22 -8
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -0
- package/lib/esm/{TextAnnotationLayout.js → annotations/TextBlockLayout.js} +51 -9
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -0
- package/lib/esm/core-backend.d.ts +5 -3
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +25 -3
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/internal/ElementLRUCache.d.ts +23 -0
- package/lib/esm/internal/ElementLRUCache.d.ts.map +1 -1
- package/lib/esm/internal/ElementLRUCache.js +165 -2
- package/lib/esm/internal/ElementLRUCache.js.map +1 -1
- 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/rpc-impl/IModelReadRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.d.ts +2 -2
- package/lib/esm/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.d.ts +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js +1 -1
- package/lib/esm/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/esm/test/ElementLRUCache.test.js +224 -1
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/TestUtils.d.ts +1 -1
- package/lib/esm/test/TestUtils.d.ts.map +1 -1
- package/lib/esm/test/TestUtils.js +1 -1
- package/lib/esm/test/TestUtils.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +190 -1025
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.d.ts +2 -0
- package/lib/esm/test/annotations/TextBlock.test.d.ts.map +1 -0
- package/lib/esm/test/annotations/TextBlock.test.js +1105 -0
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts +2 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.d.ts.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +164 -0
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -0
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js +22 -32
- package/lib/esm/test/ecdb/ConcurrentQueryLoad.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +29 -8
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlQuery.test.js +0 -55
- package/lib/esm/test/ecdb/ECSqlQuery.test.js.map +1 -1
- package/lib/esm/test/ecdb/ECSqlStatement.test.js +192 -0
- package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +255 -5
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js +23 -9
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +451 -136
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js +53 -1
- package/lib/esm/test/standalone/ExportGraphics.test.js.map +1 -1
- package/lib/esm/test/standalone/GeometryStream.test.js +49 -1
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/IModelLimits.test.d.ts +2 -0
- package/lib/esm/test/standalone/IModelLimits.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/IModelLimits.test.js +103 -0
- package/lib/esm/test/standalone/IModelLimits.test.js.map +1 -0
- package/lib/esm/test/standalone/SnapshotDb.test.js +19 -1
- package/lib/esm/test/standalone/SnapshotDb.test.js.map +1 -1
- package/package.json +12 -12
- package/lib/cjs/TextAnnotationElement.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationElement.js.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.d.ts +0 -32
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +0 -1
- package/lib/cjs/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/cjs/TextAnnotationLayout.js.map +0 -1
- package/lib/esm/TextAnnotationElement.d.ts.map +0 -1
- package/lib/esm/TextAnnotationElement.js.map +0 -1
- package/lib/esm/TextAnnotationGeometry.d.ts +0 -32
- package/lib/esm/TextAnnotationGeometry.d.ts.map +0 -1
- package/lib/esm/TextAnnotationGeometry.js.map +0 -1
- package/lib/esm/TextAnnotationLayout.d.ts.map +0 -1
- package/lib/esm/TextAnnotationLayout.js.map +0 -1
package/lib/esm/IModelDb.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as fs from "fs";
|
|
|
9
9
|
import { join } from "path";
|
|
10
10
|
import * as touch from "touch";
|
|
11
11
|
import { assert, BeEvent, BentleyStatus, ChangeSetStatus, DbChangeStage, DbConflictCause, DbConflictResolution, DbResult, Guid, Id64, IModelStatus, JsonUtils, Logger, LogLevel, LRUMap, OpenMode } from "@itwin/core-bentley";
|
|
12
|
-
import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreRpc } from "@itwin/core-common";
|
|
12
|
+
import { BriefcaseIdValue, Code, DomainOptions, ECJsNames, ECSqlReader, EntityMetaData, FontMap, IModel, IModelError, IModelNotFoundResponse, ProfileOptions, QueryRowFormat, SchemaState, ViewStoreError, ViewStoreRpc } from "@itwin/core-common";
|
|
13
13
|
import { Range2d, Range3d } from "@itwin/core-geometry";
|
|
14
14
|
import { BackendLoggerCategory } from "./BackendLoggerCategory";
|
|
15
15
|
import { BriefcaseManager } from "./BriefcaseManager";
|
|
@@ -44,10 +44,10 @@ import { SettingsImpl } from "./internal/workspace/SettingsImpl";
|
|
|
44
44
|
import { IModelNative } from "./internal/NativePlatform";
|
|
45
45
|
import { createNoOpLockControl } from "./internal/NoLocks";
|
|
46
46
|
import { createIModelDbFonts } from "./internal/IModelDbFontsImpl";
|
|
47
|
-
import { _cache, _close, _hubAccess, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
|
|
47
|
+
import { _cache, _close, _hubAccess, _instanceKeyCache, _nativeDb, _releaseAllLocks } from "./internal/Symbols";
|
|
48
48
|
import { SchemaContext, SchemaJsonLocater } from "@itwin/ecschema-metadata";
|
|
49
49
|
import { SchemaMap } from "./Schema";
|
|
50
|
-
import { ElementLRUCache } from "./internal/ElementLRUCache";
|
|
50
|
+
import { ElementLRUCache, InstanceKeyLRUCache } from "./internal/ElementLRUCache";
|
|
51
51
|
// spell:ignore fontid fontmap
|
|
52
52
|
const loggerCategory = BackendLoggerCategory.IModelDb;
|
|
53
53
|
/** @internal */
|
|
@@ -107,7 +107,7 @@ export class IModelDb extends IModel {
|
|
|
107
107
|
_jsClassMap;
|
|
108
108
|
_schemaMap;
|
|
109
109
|
_schemaContext;
|
|
110
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
110
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
111
111
|
_fontMap; // eslint-disable-line @typescript-eslint/no-deprecated
|
|
112
112
|
_fonts = createIModelDbFonts(this);
|
|
113
113
|
_workspace;
|
|
@@ -163,7 +163,7 @@ export class IModelDb extends IModel {
|
|
|
163
163
|
restartDefaultTxn() {
|
|
164
164
|
this[_nativeDb].restartDefaultTxn();
|
|
165
165
|
}
|
|
166
|
-
/** @deprecated in 5.0.0. Use [[fonts]]. */
|
|
166
|
+
/** @deprecated in 5.0.0 - will not be removed until after 2026-06-13. Use [[fonts]]. */
|
|
167
167
|
get fontMap() {
|
|
168
168
|
return this._fontMap ?? (this._fontMap = new FontMap(this[_nativeDb].readFontMap())); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
169
169
|
}
|
|
@@ -340,7 +340,7 @@ export class IModelDb extends IModel {
|
|
|
340
340
|
* @returns the value returned by `callback`.
|
|
341
341
|
* @see [[withStatement]]
|
|
342
342
|
* @public
|
|
343
|
-
* @deprecated in 4.11. Use [[createQueryReader]] instead.
|
|
343
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
344
344
|
*/
|
|
345
345
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
346
346
|
withPreparedStatement(ecsql, callback, logErrors = true) {
|
|
@@ -372,7 +372,7 @@ export class IModelDb extends IModel {
|
|
|
372
372
|
* @returns the value returned by `callback`.
|
|
373
373
|
* @see [[withPreparedStatement]]
|
|
374
374
|
* @public
|
|
375
|
-
* @deprecated in 4.11. Use [[createQueryReader]] instead.
|
|
375
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [[createQueryReader]] instead.
|
|
376
376
|
*/
|
|
377
377
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
378
378
|
withStatement(ecsql, callback, logErrors = true) {
|
|
@@ -579,6 +579,8 @@ export class IModelDb extends IModel {
|
|
|
579
579
|
this._schemaContext = undefined;
|
|
580
580
|
this.elements[_cache].clear();
|
|
581
581
|
this.models[_cache].clear();
|
|
582
|
+
this.elements[_instanceKeyCache].clear();
|
|
583
|
+
this.models[_instanceKeyCache].clear();
|
|
582
584
|
}
|
|
583
585
|
/** Update the project extents for this iModel.
|
|
584
586
|
* <p><em>Example:</em>
|
|
@@ -634,6 +636,7 @@ export class IModelDb extends IModel {
|
|
|
634
636
|
* @note This will not delete Txns that have already been saved, even if they have not yet been pushed.
|
|
635
637
|
*/
|
|
636
638
|
abandonChanges() {
|
|
639
|
+
this.clearCaches();
|
|
637
640
|
this[_nativeDb].abandonChanges();
|
|
638
641
|
}
|
|
639
642
|
/**
|
|
@@ -647,11 +650,14 @@ export class IModelDb extends IModel {
|
|
|
647
650
|
performCheckpoint() {
|
|
648
651
|
if (!this.isReadonly) {
|
|
649
652
|
this.saveChanges();
|
|
653
|
+
this.clearCaches();
|
|
654
|
+
this[_nativeDb].concurrentQueryShutdown();
|
|
655
|
+
this[_nativeDb].clearECDbCache();
|
|
650
656
|
this[_nativeDb].performCheckpoint();
|
|
651
657
|
}
|
|
652
658
|
}
|
|
653
659
|
/** @internal
|
|
654
|
-
* @deprecated in 4.8. Use `txns.reverseTxns`.
|
|
660
|
+
* @deprecated in 4.8 - will not be removed until after 2026-06-13. Use `txns.reverseTxns`.
|
|
655
661
|
*/
|
|
656
662
|
reverseTxns(numOperations) {
|
|
657
663
|
return this[_nativeDb].reverseTxns(numOperations);
|
|
@@ -877,7 +883,7 @@ export class IModelDb extends IModel {
|
|
|
877
883
|
}
|
|
878
884
|
/** The registry of entity metadata for this iModel.
|
|
879
885
|
* @internal
|
|
880
|
-
* @deprecated in 5.0. Please use `schemaContext` from the `iModel` instead.
|
|
886
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from the `iModel` instead.
|
|
881
887
|
*
|
|
882
888
|
* @example
|
|
883
889
|
* ```typescript
|
|
@@ -937,7 +943,7 @@ export class IModelDb extends IModel {
|
|
|
937
943
|
* @param sql The ECSQL statement to prepare
|
|
938
944
|
* @param logErrors Determines if error will be logged if statement fail to prepare
|
|
939
945
|
* @throws [[IModelError]] if there is a problem preparing the statement.
|
|
940
|
-
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
946
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
941
947
|
*/
|
|
942
948
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
943
949
|
prepareStatement(sql, logErrors = true) {
|
|
@@ -949,7 +955,7 @@ export class IModelDb extends IModel {
|
|
|
949
955
|
/** Prepare an ECSQL statement.
|
|
950
956
|
* @param sql The ECSQL statement to prepare
|
|
951
957
|
* @returns `undefined` if there is a problem preparing the statement.
|
|
952
|
-
* @deprecated in 4.11. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
958
|
+
* @deprecated in 4.11 - will not be removed until after 2026-06-13. Use [IModelDb.createQueryReader]($backend) or [ECDb.createQueryReader]($backend) to query.
|
|
953
959
|
*/
|
|
954
960
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
955
961
|
tryPrepareStatement(sql) {
|
|
@@ -999,7 +1005,7 @@ export class IModelDb extends IModel {
|
|
|
999
1005
|
}
|
|
1000
1006
|
/** Get metadata for a class. This method will load the metadata from the iModel into the cache as a side-effect, if necessary.
|
|
1001
1007
|
* @throws [[IModelError]] if the metadata cannot be found nor loaded.
|
|
1002
|
-
* @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1008
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1003
1009
|
*
|
|
1004
1010
|
* @example
|
|
1005
1011
|
* * ```typescript
|
|
@@ -1025,7 +1031,7 @@ export class IModelDb extends IModel {
|
|
|
1025
1031
|
return metadata;
|
|
1026
1032
|
}
|
|
1027
1033
|
/** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded.
|
|
1028
|
-
* @deprecated in 5.0. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1034
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `getSchemaItem` from `SchemaContext` class instead.
|
|
1029
1035
|
*
|
|
1030
1036
|
* @example
|
|
1031
1037
|
* * ```typescript
|
|
@@ -1053,7 +1059,7 @@ export class IModelDb extends IModel {
|
|
|
1053
1059
|
* @param func The callback to be invoked on each property
|
|
1054
1060
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1055
1061
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1056
|
-
* @deprecated in 5.0. Please use `forEachProperty` instead.
|
|
1062
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `forEachProperty` instead.
|
|
1057
1063
|
*
|
|
1058
1064
|
* @example
|
|
1059
1065
|
* ```typescript
|
|
@@ -1079,7 +1085,7 @@ export class IModelDb extends IModel {
|
|
|
1079
1085
|
* @param func The callback to be invoked on each property
|
|
1080
1086
|
* @param includeCustom If true (default), include custom-handled properties in the iteration. Otherwise, skip custom-handled properties.
|
|
1081
1087
|
* @note Custom-handled properties are core properties that have behavior enforced by C++ handlers.
|
|
1082
|
-
* @deprecated in 5.0. Use `forEachProperty` from `SchemaContext` class instead.
|
|
1088
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use `forEachProperty` from `SchemaContext` class instead.
|
|
1083
1089
|
*
|
|
1084
1090
|
* @example
|
|
1085
1091
|
* ```typescript
|
|
@@ -1109,7 +1115,7 @@ export class IModelDb extends IModel {
|
|
|
1109
1115
|
}
|
|
1110
1116
|
/**
|
|
1111
1117
|
* @internal
|
|
1112
|
-
* @deprecated in 5.0. Please use `schemaContext` from `iModel` instead to get metadata.
|
|
1118
|
+
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Please use `schemaContext` from `iModel` instead to get metadata.
|
|
1113
1119
|
*/
|
|
1114
1120
|
loadMetaData(classFullName) {
|
|
1115
1121
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
@@ -1240,11 +1246,21 @@ export class IModelDb extends IModel {
|
|
|
1240
1246
|
}
|
|
1241
1247
|
/** Get the IModel coordinate corresponding to each GeoCoordinate point in the input */
|
|
1242
1248
|
async getIModelCoordinatesFromGeoCoordinates(props) {
|
|
1243
|
-
|
|
1249
|
+
const response = this[_nativeDb].getIModelCoordinatesFromGeoCoordinates(props);
|
|
1250
|
+
// fromCache is only meaningful on the front-end; provide it for compatibility with return type.
|
|
1251
|
+
response.fromCache = 0;
|
|
1252
|
+
// Native omits the array if the input was empty.
|
|
1253
|
+
response.iModelCoords = response.iModelCoords ?? [];
|
|
1254
|
+
return response;
|
|
1244
1255
|
}
|
|
1245
1256
|
/** Get the GeoCoordinate (longitude, latitude, elevation) corresponding to each IModel Coordinate point in the input */
|
|
1246
1257
|
async getGeoCoordinatesFromIModelCoordinates(props) {
|
|
1247
|
-
|
|
1258
|
+
const response = this[_nativeDb].getGeoCoordinatesFromIModelCoordinates(props);
|
|
1259
|
+
// fromCache is only meaningful on the front-end; provide it for compatibility with return type.
|
|
1260
|
+
response.fromCache = 0;
|
|
1261
|
+
// Native omits the array if the input was empty.
|
|
1262
|
+
response.geoCoords = response.geoCoords ?? [];
|
|
1263
|
+
return response;
|
|
1248
1264
|
}
|
|
1249
1265
|
/** Export meshes suitable for graphics APIs from arbitrary geometry in elements in this IModelDb.
|
|
1250
1266
|
* * Requests can be slow when processing many elements so it is expected that this function be used on a dedicated backend,
|
|
@@ -1474,12 +1490,15 @@ function processSchemaWriteStatus(status) {
|
|
|
1474
1490
|
/** @public */
|
|
1475
1491
|
(function (IModelDb) {
|
|
1476
1492
|
/** The collection of models in an [[IModelDb]].
|
|
1477
|
-
* @public
|
|
1493
|
+
* @public @preview
|
|
1478
1494
|
*/
|
|
1479
1495
|
class Models {
|
|
1480
1496
|
_iModel;
|
|
1497
|
+
_modelCacheSize = 10;
|
|
1498
|
+
/** @internal */
|
|
1499
|
+
[_cache] = new LRUMap(this._modelCacheSize);
|
|
1481
1500
|
/** @internal */
|
|
1482
|
-
[
|
|
1501
|
+
[_instanceKeyCache] = new InstanceKeyLRUCache(this._modelCacheSize);
|
|
1483
1502
|
/** @internal */
|
|
1484
1503
|
constructor(_iModel) {
|
|
1485
1504
|
this._iModel = _iModel;
|
|
@@ -1583,7 +1602,16 @@ function processSchemaWriteStatus(status) {
|
|
|
1583
1602
|
else {
|
|
1584
1603
|
throw new IModelError(IModelStatus.InvalidId, `Invalid model identifier: ${JSON.stringify(modelIdArg)}`);
|
|
1585
1604
|
}
|
|
1586
|
-
|
|
1605
|
+
// Check the cache to avoid unnecessary native calls
|
|
1606
|
+
const cachedResult = this[_instanceKeyCache].get(args);
|
|
1607
|
+
if (cachedResult) {
|
|
1608
|
+
return cachedResult;
|
|
1609
|
+
}
|
|
1610
|
+
else {
|
|
1611
|
+
const instanceKey = this._iModel[_nativeDb].resolveInstanceKey(args);
|
|
1612
|
+
this[_instanceKeyCache].set(args, instanceKey);
|
|
1613
|
+
return instanceKey;
|
|
1614
|
+
}
|
|
1587
1615
|
}
|
|
1588
1616
|
/** Get the sub-model of the specified Element.
|
|
1589
1617
|
* See [[IModelDb.Elements.queryElementIdByCode]] for more on how to find an element by Code.
|
|
@@ -1627,7 +1655,9 @@ function processSchemaWriteStatus(status) {
|
|
|
1627
1655
|
return props.id = this._iModel[_nativeDb].insertModel(props);
|
|
1628
1656
|
}
|
|
1629
1657
|
catch (err) {
|
|
1630
|
-
|
|
1658
|
+
const error = new IModelError(err.errorNumber, `Error inserting model [${err.message}], class=${props.classFullName}`);
|
|
1659
|
+
error.cause = err;
|
|
1660
|
+
throw error;
|
|
1631
1661
|
}
|
|
1632
1662
|
}
|
|
1633
1663
|
/** Update an existing model.
|
|
@@ -1641,7 +1671,9 @@ function processSchemaWriteStatus(status) {
|
|
|
1641
1671
|
this._iModel[_nativeDb].updateModel(props);
|
|
1642
1672
|
}
|
|
1643
1673
|
catch (err) {
|
|
1644
|
-
|
|
1674
|
+
const error = new IModelError(err.errorNumber, `Error updating model [${err.message}], id: ${props.id}`);
|
|
1675
|
+
error.cause = err;
|
|
1676
|
+
throw error;
|
|
1645
1677
|
}
|
|
1646
1678
|
}
|
|
1647
1679
|
/** Mark the geometry of [[GeometricModel]] as having changed, by recording an indirect change to its GeometryGuid property.
|
|
@@ -1657,7 +1689,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1657
1689
|
this._iModel.models[_cache].delete(modelId);
|
|
1658
1690
|
const error = this._iModel[_nativeDb].updateModelGeometryGuid(modelId);
|
|
1659
1691
|
if (error !== IModelStatus.Success)
|
|
1660
|
-
throw new IModelError(error, `updating geometry guid for model ${modelId}`);
|
|
1692
|
+
throw new IModelError(error, `Error updating geometry guid for model ${modelId}`);
|
|
1661
1693
|
}
|
|
1662
1694
|
/** Delete one or more existing models.
|
|
1663
1695
|
* @param ids The Ids of the models to be deleted
|
|
@@ -1667,10 +1699,13 @@ function processSchemaWriteStatus(status) {
|
|
|
1667
1699
|
Id64.toIdSet(ids).forEach((id) => {
|
|
1668
1700
|
try {
|
|
1669
1701
|
this[_cache].delete(id);
|
|
1702
|
+
this[_instanceKeyCache].deleteById(id);
|
|
1670
1703
|
this._iModel[_nativeDb].deleteModel(id);
|
|
1671
1704
|
}
|
|
1672
1705
|
catch (err) {
|
|
1673
|
-
|
|
1706
|
+
const error = new IModelError(err.errorNumber, `Error deleting model [${err.message}], id: ${id}`);
|
|
1707
|
+
error.cause = err;
|
|
1708
|
+
throw error;
|
|
1674
1709
|
}
|
|
1675
1710
|
});
|
|
1676
1711
|
}
|
|
@@ -1700,12 +1735,15 @@ function processSchemaWriteStatus(status) {
|
|
|
1700
1735
|
}
|
|
1701
1736
|
IModelDb.Models = Models;
|
|
1702
1737
|
/** The collection of elements in an [[IModelDb]].
|
|
1703
|
-
* @public
|
|
1738
|
+
* @public @preview
|
|
1704
1739
|
*/
|
|
1705
1740
|
class Elements {
|
|
1706
1741
|
_iModel;
|
|
1742
|
+
_elementCacheSize = 50;
|
|
1743
|
+
/** @internal */
|
|
1744
|
+
[_cache] = new ElementLRUCache(this._elementCacheSize);
|
|
1707
1745
|
/** @internal */
|
|
1708
|
-
[
|
|
1746
|
+
[_instanceKeyCache] = new InstanceKeyLRUCache(this._elementCacheSize);
|
|
1709
1747
|
/** @internal */
|
|
1710
1748
|
constructor(_iModel) {
|
|
1711
1749
|
this._iModel = _iModel;
|
|
@@ -1755,7 +1793,16 @@ function processSchemaWriteStatus(status) {
|
|
|
1755
1793
|
throw new IModelError(IModelStatus.InvalidId, "Element Id or FederationGuid or Code is required");
|
|
1756
1794
|
}
|
|
1757
1795
|
}
|
|
1758
|
-
|
|
1796
|
+
// Check the cache to avoid unnecessary native calls
|
|
1797
|
+
const cachedResult = this[_instanceKeyCache].get(args);
|
|
1798
|
+
if (cachedResult) {
|
|
1799
|
+
return cachedResult;
|
|
1800
|
+
}
|
|
1801
|
+
else {
|
|
1802
|
+
const instanceKey = this._iModel[_nativeDb].resolveInstanceKey(args);
|
|
1803
|
+
this[_instanceKeyCache].set(args, instanceKey);
|
|
1804
|
+
return instanceKey;
|
|
1805
|
+
}
|
|
1759
1806
|
}
|
|
1760
1807
|
/** Get properties of an Element by Id, FederationGuid, or Code
|
|
1761
1808
|
* @returns The properties of the element or `undefined` if the element is not found.
|
|
@@ -1845,15 +1892,16 @@ function processSchemaWriteStatus(status) {
|
|
|
1845
1892
|
throw new IModelError(IModelStatus.InvalidCodeSpec, "Invalid CodeSpec");
|
|
1846
1893
|
if (code.value === undefined)
|
|
1847
1894
|
throw new IModelError(IModelStatus.InvalidCode, "Invalid Code");
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1895
|
+
const codeToQuery = new Code(code);
|
|
1896
|
+
try {
|
|
1897
|
+
const elementKey = this.resolveElementKey(codeToQuery);
|
|
1898
|
+
return Id64.fromString(elementKey.id);
|
|
1899
|
+
}
|
|
1900
|
+
catch (err) {
|
|
1901
|
+
if (err.errorNumber === IModelStatus.NotFound)
|
|
1854
1902
|
return undefined;
|
|
1855
|
-
|
|
1856
|
-
}
|
|
1903
|
+
throw err;
|
|
1904
|
+
}
|
|
1857
1905
|
}
|
|
1858
1906
|
/** Query for an [[Element]]'s last modified time.
|
|
1859
1907
|
* @param elementId The Id of the element.
|
|
@@ -1877,7 +1925,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1877
1925
|
/** Insert a new element into the iModel.
|
|
1878
1926
|
* @param elProps The properties of the new element.
|
|
1879
1927
|
* @returns The newly inserted element's Id.
|
|
1880
|
-
* @throws [[
|
|
1928
|
+
* @throws [[ITwinError]] if unable to insert the element.
|
|
1881
1929
|
* @note For convenience, the value of `elProps.id` is updated to reflect the resultant element's id.
|
|
1882
1930
|
* However when `elProps.federationGuid` is not present or undefined, a new Guid will be generated and stored on the resultant element. But
|
|
1883
1931
|
* the value of `elProps.federationGuid` is *not* updated. Generally, it is best to re-read the element after inserting (e.g. via [[getElementProps]])
|
|
@@ -1907,7 +1955,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1907
1955
|
* @param elProps the properties of the element to update.
|
|
1908
1956
|
* @note The values of `classFullName` and `model` *may not be changed* by this method. Further, it will permute the `elProps` object by adding or
|
|
1909
1957
|
* overwriting their values to the correct values.
|
|
1910
|
-
* @throws [[
|
|
1958
|
+
* @throws [[ITwinError]] if unable to update the element.
|
|
1911
1959
|
*/
|
|
1912
1960
|
updateElement(elProps) {
|
|
1913
1961
|
try {
|
|
@@ -1926,7 +1974,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1926
1974
|
}
|
|
1927
1975
|
/** Delete one or more elements from this iModel.
|
|
1928
1976
|
* @param ids The set of Ids of the element(s) to be deleted
|
|
1929
|
-
* @throws [[
|
|
1977
|
+
* @throws [[ITwinError]]
|
|
1930
1978
|
* @see deleteDefinitionElements
|
|
1931
1979
|
*/
|
|
1932
1980
|
deleteElement(ids) {
|
|
@@ -1934,6 +1982,7 @@ function processSchemaWriteStatus(status) {
|
|
|
1934
1982
|
Id64.toIdSet(ids).forEach((id) => {
|
|
1935
1983
|
try {
|
|
1936
1984
|
this[_cache].delete({ id });
|
|
1985
|
+
this[_instanceKeyCache].deleteById(id);
|
|
1937
1986
|
iModel[_nativeDb].deleteElement(id);
|
|
1938
1987
|
}
|
|
1939
1988
|
catch (err) {
|
|
@@ -2213,7 +2262,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2213
2262
|
return this._iModel[_nativeDb].insertElementAspect(aspectProps);
|
|
2214
2263
|
}
|
|
2215
2264
|
catch (err) {
|
|
2216
|
-
|
|
2265
|
+
const error = new IModelError(err.errorNumber, `Error inserting ElementAspect [${err.message}], class: ${aspectProps.classFullName}`, aspectProps);
|
|
2266
|
+
error.cause = err;
|
|
2267
|
+
throw error;
|
|
2217
2268
|
}
|
|
2218
2269
|
}
|
|
2219
2270
|
/** Update an exist ElementAspect within the iModel.
|
|
@@ -2225,7 +2276,9 @@ function processSchemaWriteStatus(status) {
|
|
|
2225
2276
|
this._iModel[_nativeDb].updateElementAspect(aspectProps);
|
|
2226
2277
|
}
|
|
2227
2278
|
catch (err) {
|
|
2228
|
-
|
|
2279
|
+
const error = new IModelError(err.errorNumber, `Error updating ElementAspect [${err.message}], id: ${aspectProps.id}`, aspectProps);
|
|
2280
|
+
error.cause = err;
|
|
2281
|
+
throw error;
|
|
2229
2282
|
}
|
|
2230
2283
|
}
|
|
2231
2284
|
/** Delete one or more ElementAspects from this iModel.
|
|
@@ -2239,14 +2292,16 @@ function processSchemaWriteStatus(status) {
|
|
|
2239
2292
|
iModel[_nativeDb].deleteElementAspect(aspectInstanceId);
|
|
2240
2293
|
}
|
|
2241
2294
|
catch (err) {
|
|
2242
|
-
|
|
2295
|
+
const error = new IModelError(err.errorNumber, `Error deleting ElementAspect [${err.message}], id: ${aspectInstanceId}`);
|
|
2296
|
+
error.cause = err;
|
|
2297
|
+
throw error;
|
|
2243
2298
|
}
|
|
2244
2299
|
});
|
|
2245
2300
|
}
|
|
2246
2301
|
}
|
|
2247
2302
|
IModelDb.Elements = Elements;
|
|
2248
2303
|
/** The collection of views in an [[IModelDb]].
|
|
2249
|
-
* @public
|
|
2304
|
+
* @public @preview
|
|
2250
2305
|
*/
|
|
2251
2306
|
class Views {
|
|
2252
2307
|
_iModel;
|
|
@@ -2272,7 +2327,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2272
2327
|
if (undefined === props) {
|
|
2273
2328
|
const propsString = this._iModel.queryFilePropertyString(Views.viewStoreProperty);
|
|
2274
2329
|
if (!propsString)
|
|
2275
|
-
|
|
2330
|
+
ViewStoreError.throwError("no-viewstore", { message: "iModel does not have a default ViewStore" });
|
|
2276
2331
|
props = JSON.parse(propsString);
|
|
2277
2332
|
}
|
|
2278
2333
|
const accessToken = await CloudSqlite.requestToken({
|
|
@@ -2393,7 +2448,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2393
2448
|
}
|
|
2394
2449
|
getViewThumbnailArg(viewDefinitionId) {
|
|
2395
2450
|
if (!Id64.isValid(viewDefinitionId))
|
|
2396
|
-
throw new
|
|
2451
|
+
throw new IModelError(IModelStatus.BadArg, "illegal thumbnail id");
|
|
2397
2452
|
return { namespace: "dgn_View", name: "Thumbnail", id: viewDefinitionId };
|
|
2398
2453
|
}
|
|
2399
2454
|
/** Get the thumbnail for a view.
|
|
@@ -2422,7 +2477,7 @@ function processSchemaWriteStatus(status) {
|
|
|
2422
2477
|
}
|
|
2423
2478
|
/** Set the default view property the iModel.
|
|
2424
2479
|
* @param viewId The Id of the ViewDefinition to use as the default
|
|
2425
|
-
* @deprecated in 4.2.x. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
|
|
2480
|
+
* @deprecated in 4.2.x - will not be removed until after 2026-06-13. Avoid setting this property - it is not practical for one single view to serve the needs of the many applications
|
|
2426
2481
|
* that might wish to view the contents of the iModel.
|
|
2427
2482
|
*/
|
|
2428
2483
|
setDefaultViewId(viewId) {
|
|
@@ -3100,6 +3155,10 @@ export class SnapshotDb extends IModelDb {
|
|
|
3100
3155
|
snapshotDb.channels.addAllowedChannel(ChannelControl.sharedChannelName);
|
|
3101
3156
|
if (options.createClassViews)
|
|
3102
3157
|
snapshotDb._createClassViewsOnClose = true; // save flag that will be checked when close() is called
|
|
3158
|
+
if (options.geographicCoordinateSystem)
|
|
3159
|
+
snapshotDb.setGeographicCoordinateSystem(options.geographicCoordinateSystem);
|
|
3160
|
+
if (options.ecefLocation)
|
|
3161
|
+
snapshotDb.setEcefLocation(options.ecefLocation);
|
|
3103
3162
|
return snapshotDb;
|
|
3104
3163
|
}
|
|
3105
3164
|
/** Create a local [Snapshot]($docs/learning/backend/AccessingIModels.md#snapshot-imodels) iModel file, using this iModel as a *seed* or starting point.
|
|
@@ -3254,6 +3313,10 @@ export class StandaloneDb extends BriefcaseDb {
|
|
|
3254
3313
|
nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned);
|
|
3255
3314
|
nativeDb.saveChanges();
|
|
3256
3315
|
const db = new this({ nativeDb, key: Guid.createValue(), briefcaseId: BriefcaseIdValue.Unassigned, openMode: OpenMode.ReadWrite });
|
|
3316
|
+
if (args.geographicCoordinateSystem)
|
|
3317
|
+
db.setGeographicCoordinateSystem(args.geographicCoordinateSystem);
|
|
3318
|
+
if (args.ecefLocation)
|
|
3319
|
+
db.setEcefLocation(args.ecefLocation);
|
|
3257
3320
|
db.channels.addAllowedChannel(ChannelControl.sharedChannelName);
|
|
3258
3321
|
return db;
|
|
3259
3322
|
}
|