@itwin/core-backend 5.0.0-dev.7 → 5.0.0-dev.72
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 +36 -1
- package/lib/cjs/BackendHubAccess.d.ts +13 -22
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js +2 -0
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +2 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.d.ts +4 -4
- package/lib/cjs/BlobContainerService.d.ts.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +10 -0
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +63 -20
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.js +6 -1
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +90 -22
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts +3 -3
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
- package/lib/cjs/ChangedElementsDb.js +8 -7
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +3 -3
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +31 -19
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +15 -12
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.js +8 -18
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +2 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +15 -8
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.d.ts +2 -0
- package/lib/cjs/CodeService.d.ts.map +1 -1
- package/lib/cjs/CodeService.js +4 -0
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js +3 -2
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js +7 -6
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js +16 -16
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.js +2 -0
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +3 -9
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +10 -9
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js +1 -0
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +4 -2
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +13 -4
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +1 -9
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +122 -31
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js +24 -0
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +13 -12
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +18 -0
- package/lib/cjs/Entity.d.ts.map +1 -1
- package/lib/cjs/Entity.js +53 -16
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/ExportGraphics.js +4 -0
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js +22 -0
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/FontFile.d.ts +68 -0
- package/lib/cjs/FontFile.d.ts.map +1 -0
- package/lib/cjs/FontFile.js +36 -0
- package/lib/cjs/FontFile.js.map +1 -0
- package/lib/cjs/GeoCoordConfig.js +8 -8
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +6 -3
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.d.ts +1 -1
- package/lib/cjs/HubMock.d.ts.map +1 -1
- package/lib/cjs/HubMock.js +9 -5
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +98 -15
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +185 -81
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelDbFonts.d.ts +54 -0
- package/lib/cjs/IModelDbFonts.d.ts.map +1 -0
- package/lib/cjs/IModelDbFonts.js +11 -0
- package/lib/cjs/IModelDbFonts.js.map +1 -0
- package/lib/cjs/IModelElementCloneContext.d.ts +2 -0
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +11 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +14 -14
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +75 -42
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts.map +1 -1
- package/lib/cjs/IModelJsFs.js +17 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/ImageSourceConversion.d.ts +49 -0
- package/lib/cjs/ImageSourceConversion.d.ts.map +1 -0
- package/lib/cjs/ImageSourceConversion.js +37 -0
- package/lib/cjs/ImageSourceConversion.js.map +1 -0
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +8 -8
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LocalHub.js +8 -2
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js +5 -6
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.js +40 -0
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +1 -1
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +27 -2
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js +5 -3
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js +6 -3
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js +25 -25
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +2 -3
- package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
- package/lib/cjs/PromiseMemoizer.js +12 -5
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js +1 -4
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +13 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +6 -4
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +74 -15
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +6 -0
- package/lib/cjs/Schema.d.ts.map +1 -1
- package/lib/cjs/Schema.js +12 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +1 -4
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SheetIndex.js +6 -0
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts +11 -3
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +21 -5
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +4 -2
- package/lib/cjs/SqliteStatement.d.ts.map +1 -1
- package/lib/cjs/SqliteStatement.js +13 -1
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/TextAnnotationLayout.d.ts +6 -3
- package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -1
- package/lib/cjs/TextAnnotationLayout.js +30 -12
- package/lib/cjs/TextAnnotationLayout.js.map +1 -1
- package/lib/cjs/Texture.js +3 -0
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js +6 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +43 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +218 -55
- 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 +81 -26
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +0 -1
- package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
- package/lib/cjs/ViewStateHydrator.js +1 -11
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js +3 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +7 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +7 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts +40 -2
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.js +101 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +7 -7
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/FontFileImpl.d.ts +34 -0
- package/lib/cjs/internal/FontFileImpl.d.ts.map +1 -0
- package/lib/cjs/internal/FontFileImpl.js +143 -0
- package/lib/cjs/internal/FontFileImpl.js.map +1 -0
- package/lib/cjs/internal/IModelDbFontsImpl.d.ts +7 -0
- package/lib/cjs/internal/IModelDbFontsImpl.d.ts.map +1 -0
- package/lib/cjs/internal/IModelDbFontsImpl.js +186 -0
- package/lib/cjs/internal/IModelDbFontsImpl.js.map +1 -0
- package/lib/cjs/internal/NoLocks.js +2 -5
- package/lib/cjs/internal/NoLocks.js.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -1
- package/lib/cjs/internal/ServerBasedLocks.js +6 -6
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +7 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +8 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js +6 -9
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +8 -12
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +22 -17
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +1 -4
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.d.ts.map +1 -1
- package/lib/cjs/rpc/multipart.js +2 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js +2 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/request.d.ts.map +1 -1
- package/lib/cjs/rpc/web/request.js +2 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +4 -2
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +5 -3
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +4 -3
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/package.json +22 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnManager.js","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAuEH,wDAIC;AAzED,+BAA+B;AAC/B,sDAE6B;AAE7B,mEAAgE;AAEhE,uCAAoC;AAGpC,gDAA+C;AA0D/C,oCAAoC;AACpC,SAAgB,sBAAsB,CAAC,GAAW;IAChD,MAAM,OAAO,GAAG,mBAAmB,CAAC,WAAW,CAAC;IAChD,mBAAmB,CAAC,WAAW,GAAG,GAAG,CAAC;IACtC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iIAAiI;AACjI,MAAM,oBAAoB;IAKxB,YAAmB,QAA8B;QAJjC,cAAS,GAAG,IAAI,+BAAgB,EAAE,CAAC;QAClC,kBAAa,GAAa,EAAE,CAAC;QAI5C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,QAAoB,EAAE,OAAmB;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,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,kBAAkB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/G,oDAAoD;IAC7C,eAAe,KAAkB,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC;IAElF,sFAAsF;IAC/E,iBAAiB,CAAC,KAAkB,IAAY,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAExG,+BAA+B;IACxB,YAAY,CAAC,KAAkB,IAAa,OAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE/F,2FAA2F;IAC3F,IAAW,cAAc,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC;IAEhF,0FAA0F;IAC1F,IAAW,iBAAiB,KAAc,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC;IAEtF,8DAA8D;IAC9D,IAAW,eAAe,KAAc,OAAO,IAAI,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IAE/F;;MAEE;IACK,iBAAiB,CAAC,IAA4B;QACnD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,EAAE,IAAI,CAAC,qBAAqB,IAAI,KAAK,CAAC,CAAC;IACzG,CAAC;CACF;AAzSD,gCAySC","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 iModels\r\n */\r\n\r\nimport * as touch from \"touch\";\r\nimport {\r\n assert, BeEvent, BentleyError, compareStrings, CompressedId64Set, DbResult, Id64Array, Id64String, IModelStatus, IndexMap, Logger, OrderedId64Array,\r\n} from \"@itwin/core-bentley\";\r\nimport { EntityIdAndClassIdIterable, ModelGeometryChangesProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, NotifyEntitiesChangedMetadata } from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { BriefcaseDb, StandaloneDb } from \"./IModelDb\";\r\nimport { IpcHost } from \"./IpcHost\";\r\nimport { Relationship, RelationshipProps } from \"./Relationship\";\r\nimport { SqliteStatement } from \"./SqliteStatement\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\n\r\n/** A string that identifies a Txn.\r\n * @public\r\n */\r\nexport type TxnIdString = string;\r\n\r\n/** An error generated during dependency validation.\r\n * @see [[TxnManager.validationErrors]].\r\n * @public\r\n */\r\nexport interface ValidationError {\r\n /** If true, txn is aborted. */\r\n fatal: boolean;\r\n /** The type of error. */\r\n errorType: string;\r\n /** Optional description of what went wrong. */\r\n message?: string;\r\n}\r\n\r\n/** Describes a set of [[Element]]s or [[Model]]s that changed as part of a transaction.\r\n * @see [[TxnManager.onElementsChanged]] and [[TxnManager.onModelsChanged]].\r\n * @public\r\n */\r\nexport interface TxnChangedEntities {\r\n /** The entities that were inserted by the transaction. */\r\n readonly inserts: EntityIdAndClassIdIterable;\r\n /** The entities that were deleted by the transaction. */\r\n readonly deletes: EntityIdAndClassIdIterable;\r\n /** The entities that were modified by the transaction, including any [[Element]]s for which one of their [[ElementAspect]]s was changed. */\r\n readonly updates: EntityIdAndClassIdIterable;\r\n}\r\n\r\n/** Arguments supplied to [[TxnManager.queryLocalChanges]].\r\n * @beta\r\n */\r\nexport interface QueryLocalChangesArgs {\r\n /** If supplied and non-empty, restricts the results to include only EC instances belonging to the specified classes or subclasses thereof. */\r\n readonly includedClasses?: string[];\r\n /** If `true`, include changes that have not yet been saved. */\r\n readonly includeUnsavedChanges?: boolean;\r\n}\r\n\r\n/** Represents a change (insertion, deletion, or modification) to a single EC instance made in a local [[BriefcaseDb]].\r\n * @see [[TxnManager.queryLocalChanges]] to iterate all of the changed instances.\r\n* @beta\r\n*/\r\nexport interface ChangeInstanceKey {\r\n /** ECInstanceId of the instance. */\r\n id: Id64String;\r\n /** Fully-qualified class name of the instance. */\r\n classFullName: string;\r\n /** The type of change. */\r\n changeType: \"inserted\" | \"updated\" | \"deleted\";\r\n}\r\n\r\ntype EntitiesChangedEvent = BeEvent<(changes: TxnChangedEntities) => void>;\r\n\r\n/** Strictly for tests. @internal */\r\nexport function setMaxEntitiesPerEvent(max: number): number {\r\n const prevMax = ChangedEntitiesProc.maxPerEvent;\r\n ChangedEntitiesProc.maxPerEvent = max;\r\n return prevMax;\r\n}\r\n\r\n/** Maintains an ordered array of entity Ids and a parallel array containing the index of the corresponding entity's class Id. */\r\nclass ChangedEntitiesArray {\r\n public readonly entityIds = new OrderedId64Array();\r\n private readonly _classIndices: number[] = [];\r\n private readonly _classIds: IndexMap<Id64String>;\r\n\r\n public constructor(classIds: IndexMap<Id64String>) {\r\n this._classIds = classIds;\r\n }\r\n\r\n public insert(entityId: Id64String, classId: Id64String): void {\r\n const entityIndex = this.entityIds.insert(entityId);\r\n const classIndex = this._classIds.insert(classId);\r\n assert(classIndex >= 0);\r\n if (this.entityIds.length !== this._classIndices.length) {\r\n // New entity - insert corresponding class index entry.\r\n this._classIndices.splice(entityIndex, 0, classIndex);\r\n } else {\r\n // Existing entity - update corresponding class index.\r\n // (We do this because apparently connectors can (very rarely) change the class Id of an existing element).\r\n this._classIndices[entityIndex] = classIndex;\r\n }\r\n\r\n assert(this.entityIds.length === this._classIndices.length);\r\n }\r\n\r\n public clear(): void {\r\n this.entityIds.clear();\r\n this._classIndices.length = 0;\r\n }\r\n\r\n public addToChangedEntities(entities: NotifyEntitiesChangedArgs, type: \"deleted\" | \"inserted\" | \"updated\"): void {\r\n if (this.entityIds.length > 0)\r\n entities[type] = CompressedId64Set.compressIds(this.entityIds);\r\n\r\n entities[`${type}Meta`] = this._classIndices;\r\n }\r\n\r\n public iterable(classIds: Id64Array): EntityIdAndClassIdIterable {\r\n function* iterator(entityIds: ReadonlyArray<Id64String>, classIndices: number[]) {\r\n const entity = { id: \"\", classId: \"\" };\r\n for (let i = 0; i < entityIds.length; i++) {\r\n entity.id = entityIds[i];\r\n entity.classId = classIds[classIndices[i]];\r\n yield entity;\r\n }\r\n }\r\n\r\n return {\r\n [Symbol.iterator]: () => iterator(this.entityIds.array, this._classIndices),\r\n };\r\n }\r\n}\r\n\r\nclass ChangedEntitiesProc {\r\n private readonly _classIds = new IndexMap<Id64String>((lhs, rhs) => compareStrings(lhs, rhs));\r\n private readonly _inserted = new ChangedEntitiesArray(this._classIds);\r\n private readonly _deleted = new ChangedEntitiesArray(this._classIds);\r\n private readonly _updated = new ChangedEntitiesArray(this._classIds);\r\n private _currSize = 0;\r\n\r\n public static maxPerEvent = 1000;\r\n\r\n public static process(iModel: BriefcaseDb | StandaloneDb, mgr: TxnManager): void {\r\n if (mgr.isDisposed) {\r\n // The iModel is being closed. Do not prepare new sqlite statements.\r\n return;\r\n }\r\n\r\n this.processChanges(iModel, mgr.onElementsChanged, \"notifyElementsChanged\");\r\n this.processChanges(iModel, mgr.onModelsChanged, \"notifyModelsChanged\");\r\n }\r\n\r\n private populateMetadata(db: BriefcaseDb | StandaloneDb, classIds: Id64Array): NotifyEntitiesChangedMetadata[] {\r\n // Ensure metadata for all class Ids is loaded. Loading metadata for a derived class loads metadata for all of its superclasses.\r\n const classIdsToLoad = classIds.filter((x) => undefined === db.classMetaDataRegistry.findByClassId(x));\r\n if (classIdsToLoad.length > 0) {\r\n const classIdsStr = classIdsToLoad.join(\",\");\r\n const sql = `SELECT ec_class.Name, ec_class.Id, ec_schema.Name FROM ec_class JOIN ec_schema WHERE ec_schema.Id = ec_class.SchemaId AND ec_class.Id IN (${classIdsStr})`;\r\n db.withPreparedSqliteStatement(sql, (stmt) => {\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n const classFullName = `${stmt.getValueString(2)}:${stmt.getValueString(0)}`;\r\n db.tryGetMetaData(classFullName);\r\n }\r\n });\r\n }\r\n\r\n // Define array indices for the metadata array entries correlating to the class Ids in the input list.\r\n const nameToIndex = new Map<string, number>();\r\n for (const classId of classIds) {\r\n const meta = db.classMetaDataRegistry.findByClassId(classId);\r\n nameToIndex.set(meta?.ecclass ?? \"\", nameToIndex.size);\r\n }\r\n\r\n const result: NotifyEntitiesChangedMetadata[] = [];\r\n\r\n function addMetadata(name: string, index: number): void {\r\n const bases: number[] = [];\r\n result[index] = { name, bases };\r\n\r\n const meta = db.tryGetMetaData(name);\r\n if (!meta) {\r\n return;\r\n }\r\n\r\n for (const baseClassName of meta.baseClasses) {\r\n let baseClassIndex = nameToIndex.get(baseClassName);\r\n if (undefined === baseClassIndex) {\r\n baseClassIndex = nameToIndex.size;\r\n nameToIndex.set(baseClassName, baseClassIndex);\r\n addMetadata(baseClassName, baseClassIndex);\r\n }\r\n\r\n bases.push(baseClassIndex);\r\n }\r\n }\r\n\r\n for (const [name, index] of nameToIndex) {\r\n if (index >= classIds.length) {\r\n // Entries beyond this are base classes for the classes in `classIds` - don't reprocess them.\r\n break;\r\n }\r\n\r\n addMetadata(name, index);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private sendEvent(iModel: BriefcaseDb | StandaloneDb, evt: EntitiesChangedEvent, evtName: \"notifyElementsChanged\" | \"notifyModelsChanged\") {\r\n if (this._currSize === 0)\r\n return;\r\n\r\n const classIds = this._classIds.toArray();\r\n\r\n // Notify backend listeners.\r\n const txnEntities: TxnChangedEntities = {\r\n inserts: this._inserted.iterable(classIds),\r\n deletes: this._deleted.iterable(classIds),\r\n updates: this._updated.iterable(classIds),\r\n };\r\n evt.raiseEvent(txnEntities);\r\n\r\n // Notify frontend listeners.\r\n const entities: NotifyEntitiesChangedArgs = {\r\n insertedMeta: [],\r\n updatedMeta: [],\r\n deletedMeta: [],\r\n meta: this.populateMetadata(iModel, classIds),\r\n };\r\n\r\n this._inserted.addToChangedEntities(entities, \"inserted\");\r\n this._deleted.addToChangedEntities(entities, \"deleted\");\r\n this._updated.addToChangedEntities(entities, \"updated\");\r\n\r\n IpcHost.notifyTxns(iModel, evtName, entities);\r\n\r\n // Reset state.\r\n this._inserted.clear();\r\n this._deleted.clear();\r\n this._updated.clear();\r\n this._classIds.clear();\r\n this._currSize = 0;\r\n }\r\n\r\n private static processChanges(iModel: BriefcaseDb | StandaloneDb, changedEvent: EntitiesChangedEvent, evtName: \"notifyElementsChanged\" | \"notifyModelsChanged\") {\r\n try {\r\n const maxSize = this.maxPerEvent;\r\n const changes = new ChangedEntitiesProc();\r\n const select = \"notifyElementsChanged\" === evtName\r\n ? \"SELECT ElementId, ChangeType, ECClassId FROM temp.txn_Elements\"\r\n : \"SELECT ModelId, ChangeType, ECClassId FROM temp.txn_Models\";\r\n iModel.withPreparedSqliteStatement(select, (sql: SqliteStatement) => {\r\n const stmt = sql.stmt;\r\n while (sql.step() === DbResult.BE_SQLITE_ROW) {\r\n const id = stmt.getValueId(0);\r\n const classId = stmt.getValueId(2);\r\n switch (stmt.getValueInteger(1)) {\r\n case 0:\r\n changes._inserted.insert(id, classId);\r\n break;\r\n case 1:\r\n changes._updated.insert(id, classId);\r\n break;\r\n case 2:\r\n changes._deleted.insert(id, classId);\r\n break;\r\n }\r\n\r\n if (++changes._currSize >= maxSize)\r\n changes.sendEvent(iModel, changedEvent, evtName);\r\n }\r\n });\r\n\r\n changes.sendEvent(iModel, changedEvent, evtName);\r\n } catch (err) {\r\n Logger.logError(BackendLoggerCategory.IModelDb, BentleyError.getErrorMessage(err));\r\n }\r\n }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseDb]] or [[StandaloneDb]] via [Txns]($docs/learning/InteractiveEditing.md)\r\n * @public\r\n */\r\nexport class TxnManager {\r\n /** @internal */\r\n private _isDisposed = false;\r\n\r\n /** @internal */\r\n public get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /** @internal */\r\n constructor(private _iModel: BriefcaseDb | StandaloneDb) {\r\n _iModel.onBeforeClose.addOnce(() => {\r\n this._isDisposed = true;\r\n });\r\n }\r\n\r\n /** Array of errors from dependency propagation */\r\n public readonly validationErrors: ValidationError[] = [];\r\n\r\n private get _nativeDb() { return this._iModel[_nativeDb]; }\r\n private _getElementClass(elClassName: string): typeof Element {\r\n return this._iModel.getJsClass(elClassName) as unknown as typeof Element;\r\n }\r\n private _getRelationshipClass(relClassName: string): typeof Relationship {\r\n return this._iModel.getJsClass<typeof Relationship>(relClassName);\r\n }\r\n\r\n /** If a -watch file exists for this iModel, update its timestamp so watching processes can be\r\n * notified that we've modified the briefcase.\r\n * @internal Used by IModelDb on push/pull.\r\n */\r\n public touchWatchFile(): void {\r\n // This is an async call. We don't have any reason to await it.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n touch(this._iModel.watchFilePathName, { nocreate: true });\r\n }\r\n\r\n /** @internal */\r\n protected _onBeforeOutputsHandled(elClassName: string, elId: Id64String): void {\r\n (this._getElementClass(elClassName) as any).onBeforeOutputsHandled(elId, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onAllInputsHandled(elClassName: string, elId: Id64String): void {\r\n (this._getElementClass(elClassName) as any).onAllInputsHandled(elId, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onRootChanged(props: RelationshipProps): void {\r\n this._getRelationshipClass(props.classFullName).onRootChanged(props, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onDeletedDependency(props: RelationshipProps): void {\r\n this._getRelationshipClass(props.classFullName).onDeletedDependency(props, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onBeginValidate() { this.validationErrors.length = 0; }\r\n\r\n /** called from native code after validation of a Txn, either from saveChanges or apply changeset.\r\n * @internal\r\n */\r\n protected _onEndValidate() {\r\n ChangedEntitiesProc.process(this._iModel, this);\r\n this.onEndValidation.raiseEvent();\r\n // TODO: if (this.validationErrors.length !== 0) throw new IModelError(validation ...)\r\n }\r\n\r\n /** @internal */\r\n protected _onGeometryChanged(modelProps: ModelGeometryChangesProps[]) {\r\n this.onGeometryChanged.raiseEvent(modelProps);\r\n IpcHost.notifyEditingScope(this._iModel, \"notifyGeometryChanged\", modelProps); // send to frontend\r\n }\r\n\r\n /** @internal */\r\n protected _onGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n IpcHost.notifyTxns(this._iModel, \"notifyGeometryGuidsChanged\", changes);\r\n }\r\n\r\n /** @internal */\r\n protected _onCommit() {\r\n this.onCommit.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyCommit\");\r\n }\r\n\r\n /** @internal */\r\n protected _onCommitted() {\r\n this.touchWatchFile();\r\n this.onCommitted.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyCommitted\", this.hasPendingTxns, Date.now());\r\n }\r\n\r\n /** @internal */\r\n protected _onReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyReplayExternalTxns\");\r\n }\r\n\r\n /** @internal */\r\n protected _onReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyReplayedExternalTxns\");\r\n }\r\n\r\n /** @internal */\r\n protected _onChangesApplied() {\r\n ChangedEntitiesProc.process(this._iModel, this);\r\n this.onChangesApplied.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyChangesApplied\");\r\n }\r\n\r\n /** @internal */\r\n protected _onBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n IpcHost.notifyTxns(this._iModel, \"notifyBeforeUndoRedo\", isUndo);\r\n }\r\n\r\n /** @internal */\r\n protected _onAfterUndoRedo(isUndo: boolean) {\r\n this.touchWatchFile();\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n IpcHost.notifyTxns(this._iModel, \"notifyAfterUndoRedo\", isUndo);\r\n }\r\n\r\n /** Dependency handlers may call method this to report a validation error.\r\n * @param error The error. If error.fatal === true, the transaction will cancel rather than commit.\r\n */\r\n public reportError(error: ValidationError) {\r\n this.validationErrors.push(error);\r\n this._nativeDb.logTxnError(error.fatal);\r\n }\r\n\r\n /** Determine whether any fatal validation errors have occurred during dependency propagation. */\r\n public get hasFatalError(): boolean { return this._nativeDb.hasFatalTxnError(); }\r\n\r\n /** @internal */\r\n public readonly onEndValidation = new BeEvent<() => void>();\r\n\r\n /** Called after validation completes from [[IModelDb.saveChanges]].\r\n * The argument to the event holds the list of elements that were inserted, updated, and deleted.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnChangedEntities) => void>();\r\n\r\n /** Called after validation completes from [[IModelDb.saveChanges]].\r\n * The argument to the event holds the list of models that were inserted, updated, and deleted.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnChangedEntities) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModel]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [[IModelDb.Models.updateModel]].\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n public readonly onGeometryChanged = new BeEvent<(models: ModelGeometryChangesProps[]) => void>();\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[IModelDb.saveChanges]], unless there are no changes to save. */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n /** Event raised after a commit operation has been performed. Initiated by a call to [[IModelDb.saveChanges]], even if there were no changes to save. */\r\n public readonly onCommitted = new BeEvent<() => void>();\r\n /** Event raised after a ChangeSet has been applied to this briefcase */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n /** Event raised before an undo/redo operation is performed. */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n /** Event raised after an undo/redo operation has been performed.\r\n * @param _action The action that was performed.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /**\r\n * Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public restartSession() {\r\n this._nativeDb.restartTxnSession();\r\n }\r\n\r\n /** Determine whether current txn is propagating indirect changes or not. */\r\n public get isIndirectChanges(): boolean { return this._nativeDb.isIndirectChanges(); }\r\n\r\n /** Determine if there are currently any reversible (undoable) changes from this editing session. */\r\n public get isUndoPossible(): boolean { return this._nativeDb.isUndoPossible(); }\r\n\r\n /** Determine if there are currently any reinstatable (redoable) changes */\r\n public get isRedoPossible(): boolean { return this._nativeDb.isRedoPossible(); }\r\n\r\n /** Get the description of the operation that would be reversed by calling reverseTxns(1).\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public getUndoString(): string { return this._nativeDb.getUndoString(); }\r\n\r\n /** Get a description of the operation that would be reinstated by calling reinstateTxn.\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public getRedoString(): string { return this._nativeDb.getRedoString(); }\r\n\r\n /** Begin a new multi-Txn operation. This can be used to cause a series of Txns that would normally\r\n * be considered separate actions for undo to be grouped into a single undoable operation. This means that when reverseTxns(1) is called,\r\n * the entire group of changes are undone together. Multi-Txn operations can be nested and until the outermost operation is closed\r\n * all changes constitute a single operation.\r\n * @note This method must always be paired with a call to endMultiTxnAction.\r\n */\r\n public beginMultiTxnOperation(): DbResult { return this._nativeDb.beginMultiTxnOperation(); }\r\n\r\n /** End a multi-Txn operation */\r\n public endMultiTxnOperation(): DbResult { return this._nativeDb.endMultiTxnOperation(); }\r\n\r\n /** Return the depth of the multi-Txn stack. Generally for diagnostic use only. */\r\n public getMultiTxnOperationDepth(): number { return this._nativeDb.getMultiTxnOperationDepth(); }\r\n\r\n /** Reverse (undo) the most recent operation(s) to this IModelDb.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if ReinstateTxn is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [[beginMultiTxnOperation]]. So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the operations are reversible are reversed.\r\n */\r\n public reverseTxns(numOperations: number): IModelStatus {\r\n return this._nativeDb.reverseTxns(numOperations);\r\n }\r\n\r\n /** Reverse the most recent operation. */\r\n public reverseSingleTxn(): IModelStatus { return this.reverseTxns(1); }\r\n\r\n /** Reverse all changes back to the beginning of the session. */\r\n public reverseAll(): IModelStatus { return this._nativeDb.reverseAll(); }\r\n\r\n /** Reverse all changes back to a previously saved TxnId.\r\n * @param txnId a TxnId obtained from a previous call to GetCurrentTxnId.\r\n * @returns Success if the transactions were reversed, error status otherwise.\r\n * @see [[getCurrentTxnId]] [[cancelTo]]\r\n */\r\n public reverseTo(txnId: TxnIdString): IModelStatus { return this._nativeDb.reverseTo(txnId); }\r\n\r\n /** Reverse and then cancel (make non-reinstatable) all changes back to a previous TxnId.\r\n * @param txnId a TxnId obtained from a previous call to [[getCurrentTxnId]]\r\n * @returns Success if the transactions were reversed and cleared, error status otherwise.\r\n */\r\n public cancelTo(txnId: TxnIdString): IModelStatus { return this._nativeDb.cancelTo(txnId); }\r\n\r\n /** Reinstate the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n */\r\n public reinstateTxn(): IModelStatus { return this._iModel.reinstateTxn(); }\r\n\r\n /** Get the Id of the first transaction, if any.\r\n */\r\n public queryFirstTxnId(): TxnIdString { return this._nativeDb.queryFirstTxnId(); }\r\n\r\n /** Get the successor of the specified TxnId */\r\n public queryNextTxnId(txnId: TxnIdString): TxnIdString { return this._nativeDb.queryNextTxnId(txnId); }\r\n\r\n /** Get the predecessor of the specified TxnId */\r\n public queryPreviousTxnId(txnId: TxnIdString): TxnIdString { return this._nativeDb.queryPreviousTxnId(txnId); }\r\n\r\n /** Get the Id of the current (tip) transaction. */\r\n public getCurrentTxnId(): TxnIdString { return this._nativeDb.getCurrentTxnId(); }\r\n\r\n /** Get the description that was supplied when the specified transaction was saved. */\r\n public getTxnDescription(txnId: TxnIdString): string { return this._nativeDb.getTxnDescription(txnId); }\r\n\r\n /** Test if a TxnId is valid */\r\n public isTxnIdValid(txnId: TxnIdString): boolean { return this._nativeDb.isTxnIdValid(txnId); }\r\n\r\n /** Query if there are any pending Txns in this IModelDb that are waiting to be pushed. */\r\n public get hasPendingTxns(): boolean { return this._nativeDb.hasPendingTxns(); }\r\n\r\n /** Query if there are any changes in memory that have yet to be saved to the IModelDb. */\r\n public get hasUnsavedChanges(): boolean { return this._nativeDb.hasUnsavedChanges(); }\r\n\r\n /** Query if there are un-saved or un-pushed local changes. */\r\n public get hasLocalChanges(): boolean { return this.hasUnsavedChanges || this.hasPendingTxns; }\r\n\r\n /** Obtain a list of the EC instances that have been changed locally by the [[BriefcaseDb]] associated with this `TxnManager` and have not yet been pushed to the iModel.\r\n * @beta\r\n */\r\n public queryLocalChanges(args?: QueryLocalChangesArgs): Iterable<ChangeInstanceKey> {\r\n if (!args) {\r\n args = { includedClasses: [], includeUnsavedChanges: false };\r\n }\r\n return this._nativeDb.getLocalChanges(args.includedClasses ?? [], args.includeUnsavedChanges ?? false);\r\n }\r\n}\r\n\r\n"]}
|
|
1
|
+
{"version":3,"file":"TxnManager.js","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAwEH,wDAIC;AA1ED,+BAA+B;AAC/B,sDAE6B;AAC7B,oDAA0L;AAC1L,mEAAgE;AAEhE,uCAAoC;AAGpC,gDAA+C;AAC/C,4EAAuH;AA0DvH,oCAAoC;AACpC,SAAgB,sBAAsB,CAAC,GAAW;IAChD,MAAM,OAAO,GAAG,mBAAmB,CAAC,WAAW,CAAC;IAChD,mBAAmB,CAAC,WAAW,GAAG,GAAG,CAAC;IACtC,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,iIAAiI;AACjI,MAAM,oBAAoB;IACR,SAAS,GAAG,IAAI,+BAAgB,EAAE,CAAC;IAClC,aAAa,GAAa,EAAE,CAAC;IAC7B,SAAS,CAAuB;IAEjD,YAAmB,QAA8B;QAC/C,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,QAAoB,EAAE,OAAmB;QACrD,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACpD,MAAM,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAClD,IAAA,qBAAM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ACjC,CAAC;IAED;;MAEE;IACK,iBAAiB,CAAC,IAA4B;QACnD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,IAAI,GAAG,EAAE,eAAe,EAAE,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE,CAAC;QAC/D,CAAC;QACD,OAAO,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,IAAI,CAAC,eAAe,IAAI,EAAE,EAAE,IAAI,CAAC,qBAAqB,IAAI,KAAK,CAAC,CAAC;IACzG,CAAC;IAED;;OAEG;IACI,2BAA2B;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAS,CAAC,CAAC,2BAA2B,EAAE,CAAC;IAC/D,CAAC;CACF;AA5ZD,gCA4ZC","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 iModels\r\n */\r\n\r\nimport * as touch from \"touch\";\r\nimport {\r\n assert, BeEvent, BentleyError, compareStrings, CompressedId64Set, DbConflictResolution, DbResult, Id64Array, Id64String, IModelStatus, IndexMap, Logger, OrderedId64Array\r\n} from \"@itwin/core-bentley\";\r\nimport { EntityIdAndClassIdIterable, IModelError, ModelGeometryChangesProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, NotifyEntitiesChangedMetadata } from \"@itwin/core-common\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { BriefcaseDb, StandaloneDb } from \"./IModelDb\";\r\nimport { IpcHost } from \"./IpcHost\";\r\nimport { Relationship, RelationshipProps } from \"./Relationship\";\r\nimport { SqliteStatement } from \"./SqliteStatement\";\r\nimport { _nativeDb } from \"./internal/Symbols\";\r\nimport { DbRebaseChangesetConflictArgs, RebaseChangesetConflictArgs, TxnArgs } from \"./internal/ChangesetConflictArgs\";\r\n\r\n/** A string that identifies a Txn.\r\n * @public\r\n */\r\nexport type TxnIdString = string;\r\n\r\n/** An error generated during dependency validation.\r\n * @see [[TxnManager.validationErrors]].\r\n * @public\r\n */\r\nexport interface ValidationError {\r\n /** If true, txn is aborted. */\r\n fatal: boolean;\r\n /** The type of error. */\r\n errorType: string;\r\n /** Optional description of what went wrong. */\r\n message?: string;\r\n}\r\n\r\n/** Describes a set of [[Element]]s or [[Model]]s that changed as part of a transaction.\r\n * @see [[TxnManager.onElementsChanged]] and [[TxnManager.onModelsChanged]].\r\n * @public\r\n */\r\nexport interface TxnChangedEntities {\r\n /** The entities that were inserted by the transaction. */\r\n readonly inserts: EntityIdAndClassIdIterable;\r\n /** The entities that were deleted by the transaction. */\r\n readonly deletes: EntityIdAndClassIdIterable;\r\n /** The entities that were modified by the transaction, including any [[Element]]s for which one of their [[ElementAspect]]s was changed. */\r\n readonly updates: EntityIdAndClassIdIterable;\r\n}\r\n\r\n/** Arguments supplied to [[TxnManager.queryLocalChanges]].\r\n * @beta\r\n */\r\nexport interface QueryLocalChangesArgs {\r\n /** If supplied and non-empty, restricts the results to include only EC instances belonging to the specified classes or subclasses thereof. */\r\n readonly includedClasses?: string[];\r\n /** If `true`, include changes that have not yet been saved. */\r\n readonly includeUnsavedChanges?: boolean;\r\n}\r\n\r\n/** Represents a change (insertion, deletion, or modification) to a single EC instance made in a local [[BriefcaseDb]].\r\n * @see [[TxnManager.queryLocalChanges]] to iterate all of the changed instances.\r\n* @beta\r\n*/\r\nexport interface ChangeInstanceKey {\r\n /** ECInstanceId of the instance. */\r\n id: Id64String;\r\n /** Fully-qualified class name of the instance. */\r\n classFullName: string;\r\n /** The type of change. */\r\n changeType: \"inserted\" | \"updated\" | \"deleted\";\r\n}\r\n\r\ntype EntitiesChangedEvent = BeEvent<(changes: TxnChangedEntities) => void>;\r\n\r\n/** Strictly for tests. @internal */\r\nexport function setMaxEntitiesPerEvent(max: number): number {\r\n const prevMax = ChangedEntitiesProc.maxPerEvent;\r\n ChangedEntitiesProc.maxPerEvent = max;\r\n return prevMax;\r\n}\r\n\r\n/** Maintains an ordered array of entity Ids and a parallel array containing the index of the corresponding entity's class Id. */\r\nclass ChangedEntitiesArray {\r\n public readonly entityIds = new OrderedId64Array();\r\n private readonly _classIndices: number[] = [];\r\n private readonly _classIds: IndexMap<Id64String>;\r\n\r\n public constructor(classIds: IndexMap<Id64String>) {\r\n this._classIds = classIds;\r\n }\r\n\r\n public insert(entityId: Id64String, classId: Id64String): void {\r\n const entityIndex = this.entityIds.insert(entityId);\r\n const classIndex = this._classIds.insert(classId);\r\n assert(classIndex >= 0);\r\n if (this.entityIds.length !== this._classIndices.length) {\r\n // New entity - insert corresponding class index entry.\r\n this._classIndices.splice(entityIndex, 0, classIndex);\r\n } else {\r\n // Existing entity - update corresponding class index.\r\n // (We do this because apparently connectors can (very rarely) change the class Id of an existing element).\r\n this._classIndices[entityIndex] = classIndex;\r\n }\r\n\r\n assert(this.entityIds.length === this._classIndices.length);\r\n }\r\n\r\n public clear(): void {\r\n this.entityIds.clear();\r\n this._classIndices.length = 0;\r\n }\r\n\r\n public addToChangedEntities(entities: NotifyEntitiesChangedArgs, type: \"deleted\" | \"inserted\" | \"updated\"): void {\r\n if (this.entityIds.length > 0)\r\n entities[type] = CompressedId64Set.compressIds(this.entityIds);\r\n\r\n entities[`${type}Meta`] = this._classIndices;\r\n }\r\n\r\n public iterable(classIds: Id64Array): EntityIdAndClassIdIterable {\r\n function* iterator(entityIds: ReadonlyArray<Id64String>, classIndices: number[]) {\r\n const entity = { id: \"\", classId: \"\" };\r\n for (let i = 0; i < entityIds.length; i++) {\r\n entity.id = entityIds[i];\r\n entity.classId = classIds[classIndices[i]];\r\n yield entity;\r\n }\r\n }\r\n\r\n return {\r\n [Symbol.iterator]: () => iterator(this.entityIds.array, this._classIndices),\r\n };\r\n }\r\n}\r\n\r\nclass ChangedEntitiesProc {\r\n private readonly _classIds = new IndexMap<Id64String>((lhs, rhs) => compareStrings(lhs, rhs));\r\n private readonly _inserted = new ChangedEntitiesArray(this._classIds);\r\n private readonly _deleted = new ChangedEntitiesArray(this._classIds);\r\n private readonly _updated = new ChangedEntitiesArray(this._classIds);\r\n private _currSize = 0;\r\n\r\n public static maxPerEvent = 1000;\r\n\r\n public static process(iModel: BriefcaseDb | StandaloneDb, mgr: TxnManager): void {\r\n if (mgr.isDisposed) {\r\n // The iModel is being closed. Do not prepare new sqlite statements.\r\n return;\r\n }\r\n\r\n this.processChanges(iModel, mgr.onElementsChanged, \"notifyElementsChanged\");\r\n this.processChanges(iModel, mgr.onModelsChanged, \"notifyModelsChanged\");\r\n }\r\n\r\n private populateMetadata(db: BriefcaseDb | StandaloneDb, classIds: Id64Array): NotifyEntitiesChangedMetadata[] {\r\n // Ensure metadata for all class Ids is loaded. Loading metadata for a derived class loads metadata for all of its superclasses.\r\n const classIdsToLoad = classIds.filter((x) => undefined === db.classMetaDataRegistry.findByClassId(x));\r\n if (classIdsToLoad.length > 0) {\r\n const classIdsStr = classIdsToLoad.join(\",\");\r\n const sql = `SELECT ec_class.Name, ec_class.Id, ec_schema.Name FROM ec_class JOIN ec_schema WHERE ec_schema.Id = ec_class.SchemaId AND ec_class.Id IN (${classIdsStr})`;\r\n db.withPreparedSqliteStatement(sql, (stmt) => {\r\n while (stmt.step() === DbResult.BE_SQLITE_ROW) {\r\n const classFullName = `${stmt.getValueString(2)}:${stmt.getValueString(0)}`;\r\n db.tryGetMetaData(classFullName);\r\n }\r\n });\r\n }\r\n\r\n // Define array indices for the metadata array entries correlating to the class Ids in the input list.\r\n const nameToIndex = new Map<string, number>();\r\n for (const classId of classIds) {\r\n const meta = db.classMetaDataRegistry.findByClassId(classId);\r\n nameToIndex.set(meta?.ecclass ?? \"\", nameToIndex.size);\r\n }\r\n\r\n const result: NotifyEntitiesChangedMetadata[] = [];\r\n\r\n function addMetadata(name: string, index: number): void {\r\n const bases: number[] = [];\r\n result[index] = { name, bases };\r\n\r\n const meta = db.tryGetMetaData(name);\r\n if (!meta) {\r\n return;\r\n }\r\n\r\n for (const baseClassName of meta.baseClasses) {\r\n let baseClassIndex = nameToIndex.get(baseClassName);\r\n if (undefined === baseClassIndex) {\r\n baseClassIndex = nameToIndex.size;\r\n nameToIndex.set(baseClassName, baseClassIndex);\r\n addMetadata(baseClassName, baseClassIndex);\r\n }\r\n\r\n bases.push(baseClassIndex);\r\n }\r\n }\r\n\r\n for (const [name, index] of nameToIndex) {\r\n if (index >= classIds.length) {\r\n // Entries beyond this are base classes for the classes in `classIds` - don't reprocess them.\r\n break;\r\n }\r\n\r\n addMetadata(name, index);\r\n }\r\n\r\n return result;\r\n }\r\n\r\n private sendEvent(iModel: BriefcaseDb | StandaloneDb, evt: EntitiesChangedEvent, evtName: \"notifyElementsChanged\" | \"notifyModelsChanged\") {\r\n if (this._currSize === 0)\r\n return;\r\n\r\n const classIds = this._classIds.toArray();\r\n\r\n // Notify backend listeners.\r\n const txnEntities: TxnChangedEntities = {\r\n inserts: this._inserted.iterable(classIds),\r\n deletes: this._deleted.iterable(classIds),\r\n updates: this._updated.iterable(classIds),\r\n };\r\n evt.raiseEvent(txnEntities);\r\n\r\n // Notify frontend listeners.\r\n const entities: NotifyEntitiesChangedArgs = {\r\n insertedMeta: [],\r\n updatedMeta: [],\r\n deletedMeta: [],\r\n meta: this.populateMetadata(iModel, classIds),\r\n };\r\n\r\n this._inserted.addToChangedEntities(entities, \"inserted\");\r\n this._deleted.addToChangedEntities(entities, \"deleted\");\r\n this._updated.addToChangedEntities(entities, \"updated\");\r\n\r\n IpcHost.notifyTxns(iModel, evtName, entities);\r\n\r\n // Reset state.\r\n this._inserted.clear();\r\n this._deleted.clear();\r\n this._updated.clear();\r\n this._classIds.clear();\r\n this._currSize = 0;\r\n }\r\n\r\n private static processChanges(iModel: BriefcaseDb | StandaloneDb, changedEvent: EntitiesChangedEvent, evtName: \"notifyElementsChanged\" | \"notifyModelsChanged\") {\r\n try {\r\n const maxSize = this.maxPerEvent;\r\n const changes = new ChangedEntitiesProc();\r\n const select = \"notifyElementsChanged\" === evtName\r\n ? \"SELECT ElementId, ChangeType, ECClassId FROM temp.txn_Elements\"\r\n : \"SELECT ModelId, ChangeType, ECClassId FROM temp.txn_Models\";\r\n iModel.withPreparedSqliteStatement(select, (sql: SqliteStatement) => {\r\n const stmt = sql.stmt;\r\n while (sql.step() === DbResult.BE_SQLITE_ROW) {\r\n const id = stmt.getValueId(0);\r\n const classId = stmt.getValueId(2);\r\n switch (stmt.getValueInteger(1)) {\r\n case 0:\r\n changes._inserted.insert(id, classId);\r\n break;\r\n case 1:\r\n changes._updated.insert(id, classId);\r\n break;\r\n case 2:\r\n changes._deleted.insert(id, classId);\r\n break;\r\n }\r\n\r\n if (++changes._currSize >= maxSize)\r\n changes.sendEvent(iModel, changedEvent, evtName);\r\n }\r\n });\r\n\r\n changes.sendEvent(iModel, changedEvent, evtName);\r\n } catch (err) {\r\n Logger.logError(BackendLoggerCategory.IModelDb, BentleyError.getErrorMessage(err));\r\n }\r\n }\r\n}\r\n\r\n/** @internal */\r\ninterface IConflictHandler {\r\n handler: (arg: RebaseChangesetConflictArgs) => DbConflictResolution | undefined;\r\n next: IConflictHandler | undefined;\r\n id: string;\r\n}\r\n\r\n/**\r\n * @internal\r\n * Manages conflict resolution during a merge operation.\r\n*/\r\nexport class ChangeMergeManager {\r\n private _conflictHandlers?: IConflictHandler;\r\n public constructor(private _iModel: BriefcaseDb | StandaloneDb) { }\r\n public resume() {\r\n this._iModel[_nativeDb].pullMergeResume();\r\n }\r\n public inProgress() {\r\n return this._iModel[_nativeDb].pullMergeInProgress();\r\n }\r\n public onConflict(args: RebaseChangesetConflictArgs): DbConflictResolution | undefined {\r\n let curr = this._conflictHandlers;\r\n while (curr) {\r\n const resolution = curr.handler(args);\r\n if (resolution !== undefined) {\r\n Logger.logTrace(BackendLoggerCategory.IModelDb, `Conflict handler ${curr.id} resolved conflict`);\r\n return resolution;\r\n }\r\n curr = curr.next;\r\n }\r\n return undefined\r\n }\r\n public addConflictHandler(args: { id: string, handler: (args: RebaseChangesetConflictArgs) => DbConflictResolution | undefined }) {\r\n const idExists = (id: string) => {\r\n let curr = this._conflictHandlers;\r\n while (curr) {\r\n if (curr.id === id)\r\n return true;\r\n curr = curr.next;\r\n }\r\n return false;\r\n }\r\n if (idExists(args.id))\r\n throw new IModelError(DbResult.BE_SQLITE_ERROR, `Conflict handler with id ${args.id} already exists`);\r\n this._conflictHandlers = { ...args, next: this._conflictHandlers };\r\n }\r\n public removeConflictHandler(id: string) {\r\n if (!this._conflictHandlers)\r\n return;\r\n\r\n if (this._conflictHandlers?.id === id) {\r\n this._conflictHandlers = this._conflictHandlers.next;\r\n return;\r\n }\r\n\r\n let prev = this._conflictHandlers;\r\n let curr = this._conflictHandlers?.next;\r\n while (curr) {\r\n if (curr.id === id) {\r\n prev.next = curr.next;\r\n return;\r\n }\r\n prev = curr;\r\n curr = curr.next;\r\n }\r\n }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseDb]] or [[StandaloneDb]] via [Txns]($docs/learning/InteractiveEditing.md)\r\n * @public\r\n */\r\nexport class TxnManager {\r\n /** @internal */\r\n private _isDisposed = false;\r\n\r\n /** @internal */\r\n public get isDisposed(): boolean {\r\n return this._isDisposed;\r\n }\r\n\r\n /** @internal */\r\n public readonly changeMergeManager: ChangeMergeManager;\r\n\r\n /** @internal */\r\n constructor(private _iModel: BriefcaseDb | StandaloneDb) {\r\n this.changeMergeManager = new ChangeMergeManager(_iModel);\r\n _iModel.onBeforeClose.addOnce(() => {\r\n this._isDisposed = true;\r\n });\r\n }\r\n\r\n /** Array of errors from dependency propagation */\r\n public readonly validationErrors: ValidationError[] = [];\r\n\r\n private get _nativeDb() { return this._iModel[_nativeDb]; }\r\n private _getElementClass(elClassName: string): typeof Element {\r\n return this._iModel.getJsClass(elClassName) as unknown as typeof Element;\r\n }\r\n private _getRelationshipClass(relClassName: string): typeof Relationship {\r\n return this._iModel.getJsClass<typeof Relationship>(relClassName);\r\n }\r\n\r\n /** If a -watch file exists for this iModel, update its timestamp so watching processes can be\r\n * notified that we've modified the briefcase.\r\n * @internal Used by IModelDb on push/pull.\r\n */\r\n public touchWatchFile(): void {\r\n // This is an async call. We don't have any reason to await it.\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n touch(this._iModel.watchFilePathName, { nocreate: true });\r\n }\r\n\r\n /** @internal */\r\n protected _onBeforeOutputsHandled(elClassName: string, elId: Id64String): void {\r\n (this._getElementClass(elClassName) as any).onBeforeOutputsHandled(elId, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onAllInputsHandled(elClassName: string, elId: Id64String): void {\r\n (this._getElementClass(elClassName) as any).onAllInputsHandled(elId, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onRootChanged(props: RelationshipProps): void {\r\n this._getRelationshipClass(props.classFullName).onRootChanged(props, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onDeletedDependency(props: RelationshipProps): void {\r\n this._getRelationshipClass(props.classFullName).onDeletedDependency(props, this._iModel);\r\n }\r\n /** @internal */\r\n protected _onBeginValidate() { this.validationErrors.length = 0; }\r\n\r\n /** called from native code after validation of a Txn, either from saveChanges or apply changeset.\r\n * @internal\r\n */\r\n protected _onEndValidate() {\r\n ChangedEntitiesProc.process(this._iModel, this);\r\n this.onEndValidation.raiseEvent();\r\n // TODO: if (this.validationErrors.length !== 0) throw new IModelError(validation ...)\r\n }\r\n\r\n /** @internal */\r\n protected _onGeometryChanged(modelProps: ModelGeometryChangesProps[]) {\r\n this.onGeometryChanged.raiseEvent(modelProps);\r\n IpcHost.notifyEditingScope(this._iModel, \"notifyGeometryChanged\", modelProps); // send to frontend\r\n }\r\n\r\n /** @internal */\r\n protected _onGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n IpcHost.notifyTxns(this._iModel, \"notifyGeometryGuidsChanged\", changes);\r\n }\r\n\r\n /** @internal */\r\n protected _onCommit() {\r\n this.onCommit.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyCommit\");\r\n }\r\n\r\n /** @internal */\r\n protected _onCommitted() {\r\n this.touchWatchFile();\r\n this.onCommitted.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyCommitted\", this.hasPendingTxns, Date.now());\r\n }\r\n\r\n /** @internal */\r\n protected _onReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyReplayExternalTxns\");\r\n }\r\n\r\n /** @internal */\r\n protected _onReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyReplayedExternalTxns\");\r\n }\r\n\r\n /** @internal */\r\n protected _onChangesApplied() {\r\n ChangedEntitiesProc.process(this._iModel, this);\r\n this.onChangesApplied.raiseEvent();\r\n IpcHost.notifyTxns(this._iModel, \"notifyChangesApplied\");\r\n }\r\n\r\n /** @internal */\r\n protected _onBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n IpcHost.notifyTxns(this._iModel, \"notifyBeforeUndoRedo\", isUndo);\r\n }\r\n\r\n /** @internal */\r\n protected _onAfterUndoRedo(isUndo: boolean) {\r\n this.touchWatchFile();\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n IpcHost.notifyTxns(this._iModel, \"notifyAfterUndoRedo\", isUndo);\r\n }\r\n\r\n private _onRebaseTxnBegin(txn: TxnArgs) {\r\n this.onRebaseTxnBegin.raiseEvent(txn);\r\n }\r\n\r\n private _onRebaseTxnEnd(txn: TxnArgs) {\r\n this.onRebaseTxnEnd.raiseEvent(txn);\r\n }\r\n\r\n private _onRebaseLocalTxnConflict(internalArg: DbRebaseChangesetConflictArgs): DbConflictResolution {\r\n const args = new RebaseChangesetConflictArgs(internalArg, this._iModel);\r\n\r\n const getChangeMetaData = () => {\r\n return {\r\n parent: this._iModel.changeset,\r\n txn: args.txn,\r\n table: args.tableName,\r\n op: args.opcode,\r\n cause: args.cause,\r\n indirect: args.indirect,\r\n primarykey: args.getPrimaryKeyValues(),\r\n fkConflictCount: args.cause === \"ForeignKey\" ? args.getForeignKeyConflicts() : undefined,\r\n };\r\n }\r\n\r\n // Default conflict resolution for which custom handler is never called.\r\n if (args.cause === \"Data\" && !args.indirect) {\r\n if (args.tableName === \"be_Prop\") {\r\n if (args.getValueText(0, \"Old\") === \"ec_Db\" && args.getValueText(1, \"Old\") === \"localDbInfo\") {\r\n return DbConflictResolution.Skip;\r\n }\r\n }\r\n if (args.tableName.startsWith(\"ec_\")) {\r\n return DbConflictResolution.Skip;\r\n }\r\n }\r\n\r\n if (args.cause === \"Conflict\") {\r\n if (args.tableName.startsWith(\"ec_\")) {\r\n return DbConflictResolution.Skip;\r\n }\r\n }\r\n\r\n try {\r\n const resolution = this.changeMergeManager.onConflict(args);\r\n if (resolution !== undefined)\r\n return resolution;\r\n } catch (err) {\r\n const msg = `Rebase failed. Custom conflict handler should not throw exception. Aborting txn. ${BentleyError.getErrorMessage(err)}`;\r\n Logger.logError(BackendLoggerCategory.IModelDb, msg, getChangeMetaData());\r\n args.setLastError(msg);\r\n return DbConflictResolution.Abort;\r\n }\r\n\r\n if (args.cause === \"Data\" && !args.indirect) {\r\n Logger.logInfo(BackendLoggerCategory.IModelDb, \"UPDATE/DELETE before value do not match with one in db or CASCADE action was triggered. Local change will replace existing.\", getChangeMetaData());\r\n return DbConflictResolution.Replace;\r\n }\r\n\r\n if (args.cause === \"Conflict\") {\r\n const msg = \"PRIMARY KEY insert conflict. Aborting rebase.\";\r\n Logger.logError(BackendLoggerCategory.IModelDb, msg, getChangeMetaData());\r\n args.setLastError(msg);\r\n return DbConflictResolution.Abort;\r\n }\r\n\r\n if (args.cause === \"ForeignKey\") {\r\n const msg = `Foreign key conflicts in ChangeSet. Aborting rebase.`;\r\n Logger.logInfo(BackendLoggerCategory.IModelDb, msg, getChangeMetaData());\r\n args.setLastError(msg);\r\n return DbConflictResolution.Abort;\r\n }\r\n\r\n if (args.cause === \"NotFound\") {\r\n Logger.logInfo(BackendLoggerCategory.IModelDb, \"PRIMARY KEY not found. Skipping local change.\", getChangeMetaData());\r\n return DbConflictResolution.Skip;\r\n }\r\n\r\n if (args.cause === \"Constraint\") {\r\n Logger.logInfo(BackendLoggerCategory.IModelDb, \"Constraint voilation detected. Generally caused by db constraints like UNIQUE index. Skipping local change.\", getChangeMetaData());\r\n return DbConflictResolution.Skip;\r\n }\r\n\r\n return DbConflictResolution.Replace;\r\n }\r\n\r\n /** Dependency handlers may call method this to report a validation error.\r\n * @param error The error. If error.fatal === true, the transaction will cancel rather than commit.\r\n */\r\n public reportError(error: ValidationError) {\r\n this.validationErrors.push(error);\r\n this._nativeDb.logTxnError(error.fatal);\r\n }\r\n\r\n /** Determine whether any fatal validation errors have occurred during dependency propagation. */\r\n public get hasFatalError(): boolean { return this._nativeDb.hasFatalTxnError(); }\r\n\r\n /** @internal */\r\n public readonly onEndValidation = new BeEvent<() => void>();\r\n\r\n /** Called after validation completes from [[IModelDb.saveChanges]].\r\n * The argument to the event holds the list of elements that were inserted, updated, and deleted.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnChangedEntities) => void>();\r\n\r\n /** Called after validation completes from [[IModelDb.saveChanges]].\r\n * The argument to the event holds the list of models that were inserted, updated, and deleted.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnChangedEntities) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModel]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [[IModelDb.Models.updateModel]].\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n public readonly onGeometryChanged = new BeEvent<(models: ModelGeometryChangesProps[]) => void>();\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[IModelDb.saveChanges]], unless there are no changes to save. */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n /** Event raised after a commit operation has been performed. Initiated by a call to [[IModelDb.saveChanges]], even if there were no changes to save. */\r\n public readonly onCommitted = new BeEvent<() => void>();\r\n /** Event raised after a ChangeSet has been applied to this briefcase */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n /** Event raised before an undo/redo operation is performed. */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n /** Event raised after an undo/redo operation has been performed.\r\n * @param _action The action that was performed.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public readonly onRebaseTxnBegin = new BeEvent<(txn: TxnArgs) => void>();\r\n /** @internal */\r\n public readonly onRebaseTxnEnd = new BeEvent<(txn: TxnArgs) => void>();\r\n /**\r\n * if handler is set and it does not return undefiend then default handler will not be called\r\n * @internal\r\n * */\r\n public appCustomConflictHandler?: (args: DbRebaseChangesetConflictArgs) => DbConflictResolution | undefined;\r\n\r\n /**\r\n * Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public restartSession() {\r\n this._nativeDb.restartTxnSession();\r\n }\r\n\r\n /** Determine whether current txn is propagating indirect changes or not. */\r\n public get isIndirectChanges(): boolean { return this._nativeDb.isIndirectChanges(); }\r\n\r\n /** Determine if there are currently any reversible (undoable) changes from this editing session. */\r\n public get isUndoPossible(): boolean { return this._nativeDb.isUndoPossible(); }\r\n\r\n /** Determine if there are currently any reinstatable (redoable) changes */\r\n public get isRedoPossible(): boolean { return this._nativeDb.isRedoPossible(); }\r\n\r\n /** Get the description of the operation that would be reversed by calling reverseTxns(1).\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public getUndoString(): string { return this._nativeDb.getUndoString(); }\r\n\r\n /** Get a description of the operation that would be reinstated by calling reinstateTxn.\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public getRedoString(): string { return this._nativeDb.getRedoString(); }\r\n\r\n /** Begin a new multi-Txn operation. This can be used to cause a series of Txns that would normally\r\n * be considered separate actions for undo to be grouped into a single undoable operation. This means that when reverseTxns(1) is called,\r\n * the entire group of changes are undone together. Multi-Txn operations can be nested and until the outermost operation is closed\r\n * all changes constitute a single operation.\r\n * @note This method must always be paired with a call to endMultiTxnAction.\r\n */\r\n public beginMultiTxnOperation(): DbResult { return this._nativeDb.beginMultiTxnOperation(); }\r\n\r\n /** End a multi-Txn operation */\r\n public endMultiTxnOperation(): DbResult { return this._nativeDb.endMultiTxnOperation(); }\r\n\r\n /** Return the depth of the multi-Txn stack. Generally for diagnostic use only. */\r\n public getMultiTxnOperationDepth(): number { return this._nativeDb.getMultiTxnOperationDepth(); }\r\n\r\n /** Reverse (undo) the most recent operation(s) to this IModelDb.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if ReinstateTxn is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [[beginMultiTxnOperation]]. So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the operations are reversible are reversed.\r\n */\r\n public reverseTxns(numOperations: number): IModelStatus {\r\n return this._nativeDb.reverseTxns(numOperations);\r\n }\r\n\r\n /** Reverse the most recent operation. */\r\n public reverseSingleTxn(): IModelStatus { return this.reverseTxns(1); }\r\n\r\n /** Reverse all changes back to the beginning of the session. */\r\n public reverseAll(): IModelStatus { return this._nativeDb.reverseAll(); }\r\n\r\n /** Reverse all changes back to a previously saved TxnId.\r\n * @param txnId a TxnId obtained from a previous call to GetCurrentTxnId.\r\n * @returns Success if the transactions were reversed, error status otherwise.\r\n * @see [[getCurrentTxnId]] [[cancelTo]]\r\n */\r\n public reverseTo(txnId: TxnIdString): IModelStatus { return this._nativeDb.reverseTo(txnId); }\r\n\r\n /** Reverse and then cancel (make non-reinstatable) all changes back to a previous TxnId.\r\n * @param txnId a TxnId obtained from a previous call to [[getCurrentTxnId]]\r\n * @returns Success if the transactions were reversed and cleared, error status otherwise.\r\n */\r\n public cancelTo(txnId: TxnIdString): IModelStatus { return this._nativeDb.cancelTo(txnId); }\r\n\r\n /** Reinstate the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n */\r\n public reinstateTxn(): IModelStatus { return this._iModel.reinstateTxn(); }\r\n\r\n /** Get the Id of the first transaction, if any.\r\n */\r\n public queryFirstTxnId(): TxnIdString { return this._nativeDb.queryFirstTxnId(); }\r\n\r\n /** Get the successor of the specified TxnId */\r\n public queryNextTxnId(txnId: TxnIdString): TxnIdString { return this._nativeDb.queryNextTxnId(txnId); }\r\n\r\n /** Get the predecessor of the specified TxnId */\r\n public queryPreviousTxnId(txnId: TxnIdString): TxnIdString { return this._nativeDb.queryPreviousTxnId(txnId); }\r\n\r\n /** Get the Id of the current (tip) transaction. */\r\n public getCurrentTxnId(): TxnIdString { return this._nativeDb.getCurrentTxnId(); }\r\n\r\n /** Get the description that was supplied when the specified transaction was saved. */\r\n public getTxnDescription(txnId: TxnIdString): string { return this._nativeDb.getTxnDescription(txnId); }\r\n\r\n /** Test if a TxnId is valid */\r\n public isTxnIdValid(txnId: TxnIdString): boolean { return this._nativeDb.isTxnIdValid(txnId); }\r\n\r\n /** Query if there are any pending Txns in this IModelDb that are waiting to be pushed. */\r\n public get hasPendingTxns(): boolean { return this._nativeDb.hasPendingTxns(); }\r\n\r\n /** Query if there are any changes in memory that have yet to be saved to the IModelDb. */\r\n public get hasUnsavedChanges(): boolean { return this._nativeDb.hasUnsavedChanges(); }\r\n\r\n /** Query if there are un-saved or un-pushed local changes. */\r\n public get hasLocalChanges(): boolean { return this.hasUnsavedChanges || this.hasPendingTxns; }\r\n\r\n /** Destroy the record of all local changes that have yet to be saved and/or pushed.\r\n * This permanently eradicates your changes - use with caution!\r\n * Typically, callers will want to subsequently use [[LockControl.releaseAllLocks]].\r\n * After calling this function, [[hasLocalChanges]], [[hasPendingTxns]], and [[hasUnsavedChanges]] will all be `false`.\r\n */\r\n public deleteAllTxns(): void {\r\n this._nativeDb.deleteAllTxns();\r\n }\r\n\r\n /** Obtain a list of the EC instances that have been changed locally by the [[BriefcaseDb]] associated with this `TxnManager` and have not yet been pushed to the iModel.\r\n * @beta\r\n */\r\n public queryLocalChanges(args?: QueryLocalChangesArgs): Iterable<ChangeInstanceKey> {\r\n if (!args) {\r\n args = { includedClasses: [], includeUnsavedChanges: false };\r\n }\r\n return this._nativeDb.getLocalChanges(args.includedClasses ?? [], args.includeUnsavedChanges ?? false);\r\n }\r\n\r\n /** Query the number of bytes of memory currently allocated by SQLite to keep track of\r\n * changes to the iModel, for debugging/diagnostic purposes, as reported by [sqlite3session_memory_used](https://www.sqlite.org/session/sqlite3session_memory_used.html).\r\n */\r\n public getChangeTrackingMemoryUsed(): number {\r\n return this._iModel[_nativeDb].getChangeTrackingMemoryUsed();\r\n }\r\n}\r\n\r\n"]}
|
|
@@ -323,7 +323,7 @@ export declare class TemplateViewDefinition3d extends ViewDefinition3d {
|
|
|
323
323
|
*/
|
|
324
324
|
export declare abstract class AuxCoordSystem extends DefinitionElement {
|
|
325
325
|
static get className(): string;
|
|
326
|
-
type
|
|
326
|
+
type?: number;
|
|
327
327
|
description?: string;
|
|
328
328
|
constructor(props: AuxCoordSystemProps, iModel: IModelDb);
|
|
329
329
|
}
|
|
@@ -333,7 +333,7 @@ export declare abstract class AuxCoordSystem extends DefinitionElement {
|
|
|
333
333
|
export declare class AuxCoordSystem2d extends AuxCoordSystem {
|
|
334
334
|
static get className(): string;
|
|
335
335
|
origin?: Point2d;
|
|
336
|
-
angle
|
|
336
|
+
angle?: number;
|
|
337
337
|
constructor(props: AuxCoordSystem2dProps, iModel: IModelDb);
|
|
338
338
|
/** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
339
339
|
* @param iModel The IModelDb
|
|
@@ -348,9 +348,9 @@ export declare class AuxCoordSystem2d extends AuxCoordSystem {
|
|
|
348
348
|
export declare class AuxCoordSystem3d extends AuxCoordSystem {
|
|
349
349
|
static get className(): string;
|
|
350
350
|
origin?: Point3d;
|
|
351
|
-
yaw
|
|
352
|
-
pitch
|
|
353
|
-
roll
|
|
351
|
+
yaw?: number;
|
|
352
|
+
pitch?: number;
|
|
353
|
+
roll?: number;
|
|
354
354
|
constructor(props: AuxCoordSystem3dProps, iModel: IModelDb);
|
|
355
355
|
/** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
356
356
|
* @param iModel The IModelDb
|
|
@@ -386,7 +386,7 @@ export declare class ViewAttachment extends GraphicalElement2d {
|
|
|
386
386
|
export declare class LightLocation extends SpatialLocationElement {
|
|
387
387
|
static get className(): string;
|
|
388
388
|
/** Whether this light is currently turned on. */
|
|
389
|
-
enabled
|
|
389
|
+
enabled?: boolean;
|
|
390
390
|
protected constructor(props: LightLocationProps, iModel: IModelDb);
|
|
391
391
|
}
|
|
392
392
|
//# sourceMappingURL=ViewDefinition.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewDefinition.d.ts","sourceRoot":"","sources":["../../src/ViewDefinition.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAQ,SAAS,EAAE,UAAU,EAA2B,MAAM,qBAAqB,CAAC;AAC3F,OAAO,EACL,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAa,QAAQ,EAAE,kBAAkB,EAChH,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAe,MAAM,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EACzH,mBAAmB,EAAE,kBAAkB,EAAe,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EACtH,0BAA0B,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,WAAW,EAC/H,aAAa,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAExE;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;IAClD,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAE1E,mFAAmF;IAC5E,MAAM,EAAE,UAAU,EAAE,CAAC;IAE5B,SAAS,aAAa,KAAK,EAAE,kBAAkB,EAAE,MAAM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,GAAG,IAAI;CAIlG;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,gBAAgB;IACzD,WAA2B,SAAS,IAAI,MAAM,CAAoC;IAClF;;;;OAIG;WACoB,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI;CAI3G;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,WAA2B,SAAS,IAAI,MAAM,CAA6B;IACpE,IAAI,EAAE,cAAc,CAAC;gBACT,KAAK,EAAE,mBAAmB,EAAE,MAAM,EAAE,QAAQ;cAK5C,mBAAmB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;CAI/E;AAED;;GAEG;AACH,qBAAa,aAAc,SAAQ,sBAAsB;IACvD,WAA2B,SAAS,IAAI,MAAM,CAA4B;IAC1E,iDAAiD;IAC1C,OAAO,CAAC,EAAE,OAAO,CAAC;IAEzB,SAAS,aAAa,KAAK,EAAE,kBAAkB,EAAE,MAAM,EAAE,QAAQ;CAIlE"}
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module ViewDefinitions
|
|
8
8
|
*/
|
|
9
|
-
var _a, _b, _c, _d;
|
|
10
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
10
|
exports.LightLocation = exports.ViewAttachment = exports.AuxCoordSystemSpatial = exports.AuxCoordSystem3d = exports.AuxCoordSystem2d = exports.AuxCoordSystem = exports.TemplateViewDefinition3d = exports.TemplateViewDefinition2d = exports.SheetViewDefinition = exports.DrawingViewDefinition = exports.ViewDefinition2d = exports.OrthographicViewDefinition = exports.SpatialViewDefinition = exports.ViewDefinition3d = exports.ViewDefinition = exports.CategorySelector = exports.ModelSelector = void 0;
|
|
12
11
|
const core_bentley_1 = require("@itwin/core-bentley");
|
|
@@ -20,6 +19,8 @@ const Element_1 = require("./Element");
|
|
|
20
19
|
*/
|
|
21
20
|
class ModelSelector extends Element_1.DefinitionElement {
|
|
22
21
|
static get className() { return "ModelSelector"; }
|
|
22
|
+
/** The array of modelIds of the GeometricModels displayed by this ModelSelector */
|
|
23
|
+
models;
|
|
23
24
|
constructor(props, iModel) {
|
|
24
25
|
super(props, iModel);
|
|
25
26
|
this.models = props.models;
|
|
@@ -83,6 +84,8 @@ exports.ModelSelector = ModelSelector;
|
|
|
83
84
|
*/
|
|
84
85
|
class CategorySelector extends Element_1.DefinitionElement {
|
|
85
86
|
static get className() { return "CategorySelector"; }
|
|
87
|
+
/** The array of element Ids of the Categories selected by this CategorySelector */
|
|
88
|
+
categories;
|
|
86
89
|
constructor(props, iModel) {
|
|
87
90
|
super(props, iModel);
|
|
88
91
|
this.categories = props.categories;
|
|
@@ -146,8 +149,12 @@ exports.CategorySelector = CategorySelector;
|
|
|
146
149
|
* @note ViewDefinition is only available in the backend. See [ViewState]($frontend) for usage in the frontend.
|
|
147
150
|
* @public
|
|
148
151
|
*/
|
|
149
|
-
class ViewDefinition extends
|
|
152
|
+
class ViewDefinition extends Element_1.DefinitionElement {
|
|
150
153
|
static get className() { return "ViewDefinition"; }
|
|
154
|
+
/** The element Id of the [[CategorySelector]] for this ViewDefinition */
|
|
155
|
+
categorySelectorId;
|
|
156
|
+
/** The element Id of the [[DisplayStyle]] for this ViewDefinition */
|
|
157
|
+
displayStyleId;
|
|
151
158
|
constructor(props, iModel) {
|
|
152
159
|
super(props, iModel);
|
|
153
160
|
this.categorySelectorId = core_bentley_1.Id64.fromJSON(props.categorySelectorId);
|
|
@@ -173,6 +180,14 @@ class ViewDefinition extends (_b = Element_1.DefinitionElement) {
|
|
|
173
180
|
}
|
|
174
181
|
}
|
|
175
182
|
/** @beta */
|
|
183
|
+
static requiredReferenceKeys = [...super.requiredReferenceKeys, "categorySelectorId", "displayStyleId"];
|
|
184
|
+
/** @alpha */
|
|
185
|
+
static requiredReferenceKeyTypeMap = {
|
|
186
|
+
...super.requiredReferenceKeyTypeMap,
|
|
187
|
+
categorySelectorId: core_common_1.ConcreteEntityTypes.Element,
|
|
188
|
+
displayStyleId: core_common_1.ConcreteEntityTypes.Element,
|
|
189
|
+
};
|
|
190
|
+
/** @beta */
|
|
176
191
|
static onCloned(context, sourceElementProps, targetElementProps) {
|
|
177
192
|
super.onCloned(context, sourceElementProps, targetElementProps);
|
|
178
193
|
if (context.isBetweenIModels && targetElementProps.jsonProperties && targetElementProps.jsonProperties.viewDetails) {
|
|
@@ -215,20 +230,22 @@ class ViewDefinition extends (_b = Element_1.DefinitionElement) {
|
|
|
215
230
|
}
|
|
216
231
|
}
|
|
217
232
|
exports.ViewDefinition = ViewDefinition;
|
|
218
|
-
_a = ViewDefinition;
|
|
219
|
-
/** @beta */
|
|
220
|
-
ViewDefinition.requiredReferenceKeys = [...Reflect.get(_b, "requiredReferenceKeys", _a), "categorySelectorId", "displayStyleId"];
|
|
221
|
-
/** @alpha */
|
|
222
|
-
ViewDefinition.requiredReferenceKeyTypeMap = {
|
|
223
|
-
...Reflect.get(_b, "requiredReferenceKeyTypeMap", _a),
|
|
224
|
-
categorySelectorId: core_common_1.ConcreteEntityTypes.Element,
|
|
225
|
-
displayStyleId: core_common_1.ConcreteEntityTypes.Element,
|
|
226
|
-
};
|
|
227
233
|
/** Defines a view of one or more 3d models.
|
|
228
234
|
* @public
|
|
229
235
|
*/
|
|
230
236
|
class ViewDefinition3d extends ViewDefinition {
|
|
237
|
+
_details;
|
|
231
238
|
static get className() { return "ViewDefinition3d"; }
|
|
239
|
+
/** If true, camera is used. Otherwise, use an orthographic projection. */
|
|
240
|
+
cameraOn;
|
|
241
|
+
/** The lower left back corner of the view frustum. */
|
|
242
|
+
origin;
|
|
243
|
+
/** The extent (size) of the view frustum, in meters, along its x,y,z axes. */
|
|
244
|
+
extents;
|
|
245
|
+
/** Rotation from world coordinates to view coordinates. */
|
|
246
|
+
angles;
|
|
247
|
+
/** The camera used for this view, if `cameraOn` is true. */
|
|
248
|
+
camera;
|
|
232
249
|
constructor(props, iModel) {
|
|
233
250
|
super(props, iModel);
|
|
234
251
|
this.cameraOn = core_bentley_1.JsonUtils.asBool(props.cameraOn);
|
|
@@ -265,8 +282,10 @@ exports.ViewDefinition3d = ViewDefinition3d;
|
|
|
265
282
|
* * CategoryIds -----> SpatialCategories <----------GeometricElement3d.Category
|
|
266
283
|
* @public
|
|
267
284
|
*/
|
|
268
|
-
class SpatialViewDefinition extends
|
|
285
|
+
class SpatialViewDefinition extends ViewDefinition3d {
|
|
269
286
|
static get className() { return "SpatialViewDefinition"; }
|
|
287
|
+
/** The Id of the [[ModelSelector]] for this SpatialViewDefinition. */
|
|
288
|
+
modelSelectorId;
|
|
270
289
|
constructor(props, iModel) {
|
|
271
290
|
super(props, iModel);
|
|
272
291
|
this.modelSelectorId = core_bentley_1.Id64.fromJSON(props.modelSelectorId);
|
|
@@ -275,7 +294,7 @@ class SpatialViewDefinition extends (_d = ViewDefinition3d) {
|
|
|
275
294
|
}
|
|
276
295
|
/** Construct a SpatialViewDefinition from its JSON representation. */
|
|
277
296
|
static fromJSON(props, iModel) {
|
|
278
|
-
return new
|
|
297
|
+
return new SpatialViewDefinition({ ...props, classFullName: this.classFullName }, iModel);
|
|
279
298
|
}
|
|
280
299
|
toJSON() {
|
|
281
300
|
const json = super.toJSON();
|
|
@@ -286,6 +305,13 @@ class SpatialViewDefinition extends (_d = ViewDefinition3d) {
|
|
|
286
305
|
super.collectReferenceIds(referenceIds);
|
|
287
306
|
referenceIds.addElement(this.modelSelectorId);
|
|
288
307
|
}
|
|
308
|
+
/** @beta */
|
|
309
|
+
static requiredReferenceKeys = [...super.requiredReferenceKeys, "modelSelectorId"];
|
|
310
|
+
/** @alpha */
|
|
311
|
+
static requiredReferenceKeyTypeMap = {
|
|
312
|
+
...super.requiredReferenceKeyTypeMap,
|
|
313
|
+
modelSelectorId: core_common_1.ConcreteEntityTypes.Element,
|
|
314
|
+
};
|
|
289
315
|
/** Load this view's ModelSelector from the IModelDb. */
|
|
290
316
|
loadModelSelector() { return this.iModel.elements.getElement(this.modelSelectorId); }
|
|
291
317
|
/**
|
|
@@ -324,7 +350,7 @@ class SpatialViewDefinition extends (_d = ViewDefinition3d) {
|
|
|
324
350
|
cameraOn: true,
|
|
325
351
|
camera: { lens: { radians: cameraAngle }, focusDist: cameraDistance, eye: cameraLocation },
|
|
326
352
|
};
|
|
327
|
-
return new
|
|
353
|
+
return new SpatialViewDefinition(viewDefinitionProps, iModelDb);
|
|
328
354
|
}
|
|
329
355
|
/**
|
|
330
356
|
* Insert an SpatialViewDefinition with the camera turned on.
|
|
@@ -338,14 +364,6 @@ class SpatialViewDefinition extends (_d = ViewDefinition3d) {
|
|
|
338
364
|
}
|
|
339
365
|
}
|
|
340
366
|
exports.SpatialViewDefinition = SpatialViewDefinition;
|
|
341
|
-
_c = SpatialViewDefinition;
|
|
342
|
-
/** @beta */
|
|
343
|
-
SpatialViewDefinition.requiredReferenceKeys = [...Reflect.get(_d, "requiredReferenceKeys", _c), "modelSelectorId"];
|
|
344
|
-
/** @alpha */
|
|
345
|
-
SpatialViewDefinition.requiredReferenceKeyTypeMap = {
|
|
346
|
-
...Reflect.get(_d, "requiredReferenceKeyTypeMap", _c),
|
|
347
|
-
modelSelectorId: core_common_1.ConcreteEntityTypes.Element,
|
|
348
|
-
};
|
|
349
367
|
/** Defines a spatial view that displays geometry on the image plane using a parallel orthographic projection.
|
|
350
368
|
* See [how to create a OrthographicViewDefinition]$(docs/learning/backend/CreateElements.md#OrthographicViewDefinition).
|
|
351
369
|
* @public
|
|
@@ -417,7 +435,16 @@ exports.OrthographicViewDefinition = OrthographicViewDefinition;
|
|
|
417
435
|
* @public
|
|
418
436
|
*/
|
|
419
437
|
class ViewDefinition2d extends ViewDefinition {
|
|
438
|
+
_details;
|
|
420
439
|
static get className() { return "ViewDefinition2d"; }
|
|
440
|
+
/** The Id of the Model displayed by this view. */
|
|
441
|
+
baseModelId;
|
|
442
|
+
/** The lower-left corner of this view in Model coordinates. */
|
|
443
|
+
origin;
|
|
444
|
+
/** The delta (size) of this view, in meters, aligned with view x,y. */
|
|
445
|
+
delta;
|
|
446
|
+
/** The rotation of this view. */
|
|
447
|
+
angle;
|
|
421
448
|
constructor(props, iModel) {
|
|
422
449
|
super(props, iModel);
|
|
423
450
|
this.baseModelId = core_bentley_1.Id64.fromJSON(props.baseModelId);
|
|
@@ -523,7 +550,13 @@ exports.TemplateViewDefinition3d = TemplateViewDefinition3d;
|
|
|
523
550
|
*/
|
|
524
551
|
class AuxCoordSystem extends Element_1.DefinitionElement {
|
|
525
552
|
static get className() { return "AuxCoordSystem"; }
|
|
526
|
-
|
|
553
|
+
type;
|
|
554
|
+
description;
|
|
555
|
+
constructor(props, iModel) {
|
|
556
|
+
super(props, iModel);
|
|
557
|
+
this.type = props.type;
|
|
558
|
+
this.description = props.description;
|
|
559
|
+
}
|
|
527
560
|
}
|
|
528
561
|
exports.AuxCoordSystem = AuxCoordSystem;
|
|
529
562
|
/** A 2d auxiliary coordinate system.
|
|
@@ -531,7 +564,13 @@ exports.AuxCoordSystem = AuxCoordSystem;
|
|
|
531
564
|
*/
|
|
532
565
|
class AuxCoordSystem2d extends AuxCoordSystem {
|
|
533
566
|
static get className() { return "AuxCoordSystem2d"; }
|
|
534
|
-
|
|
567
|
+
origin;
|
|
568
|
+
angle;
|
|
569
|
+
constructor(props, iModel) {
|
|
570
|
+
super(props, iModel);
|
|
571
|
+
this.origin = props.origin ? core_geometry_1.Point2d.fromJSON(props.origin) : undefined;
|
|
572
|
+
this.angle = props.angle ? core_geometry_1.Angle.fromJSON(props.angle).degrees : undefined;
|
|
573
|
+
}
|
|
535
574
|
/** Create a Code for a AuxCoordSystem2d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
536
575
|
* @param iModel The IModelDb
|
|
537
576
|
* @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem2d element and provides the scope for its name.
|
|
@@ -548,7 +587,17 @@ exports.AuxCoordSystem2d = AuxCoordSystem2d;
|
|
|
548
587
|
*/
|
|
549
588
|
class AuxCoordSystem3d extends AuxCoordSystem {
|
|
550
589
|
static get className() { return "AuxCoordSystem3d"; }
|
|
551
|
-
|
|
590
|
+
origin;
|
|
591
|
+
yaw;
|
|
592
|
+
pitch;
|
|
593
|
+
roll;
|
|
594
|
+
constructor(props, iModel) {
|
|
595
|
+
super(props, iModel);
|
|
596
|
+
this.origin = props.origin ? core_geometry_1.Point3d.fromJSON(props.origin) : undefined;
|
|
597
|
+
this.yaw = props.yaw ? core_geometry_1.Angle.fromJSON(props.yaw).degrees : undefined;
|
|
598
|
+
this.pitch = props.pitch ? core_geometry_1.Angle.fromJSON(props.pitch).degrees : undefined;
|
|
599
|
+
this.roll = props.roll ? core_geometry_1.Angle.fromJSON(props.roll).degrees : undefined;
|
|
600
|
+
}
|
|
552
601
|
/** Create a Code for a AuxCoordSystem3d element given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
553
602
|
* @param iModel The IModelDb
|
|
554
603
|
* @param scopeModelId The Id of the DefinitionModel that contains the AuxCoordSystem3d element and provides the scope for its name.
|
|
@@ -581,6 +630,7 @@ exports.AuxCoordSystemSpatial = AuxCoordSystemSpatial;
|
|
|
581
630
|
*/
|
|
582
631
|
class ViewAttachment extends Element_1.GraphicalElement2d {
|
|
583
632
|
static get className() { return "ViewAttachment"; }
|
|
633
|
+
view;
|
|
584
634
|
constructor(props, iModel) {
|
|
585
635
|
super(props, iModel);
|
|
586
636
|
this.view = new core_common_1.RelatedElement(props.view);
|
|
@@ -597,7 +647,12 @@ exports.ViewAttachment = ViewAttachment;
|
|
|
597
647
|
*/
|
|
598
648
|
class LightLocation extends Element_1.SpatialLocationElement {
|
|
599
649
|
static get className() { return "LightLocation"; }
|
|
600
|
-
|
|
650
|
+
/** Whether this light is currently turned on. */
|
|
651
|
+
enabled;
|
|
652
|
+
constructor(props, iModel) {
|
|
653
|
+
super(props, iModel);
|
|
654
|
+
this.enabled = props.enabled;
|
|
655
|
+
}
|
|
601
656
|
}
|
|
602
657
|
exports.LightLocation = LightLocation;
|
|
603
658
|
//# sourceMappingURL=ViewDefinition.js.map
|