@itwin/core-backend 3.6.0-dev.35 → 3.6.0-dev.36
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/LICENSE.md +1 -1
- package/lib/cjs/AliCloudStorageService.d.ts +23 -23
- package/lib/cjs/AliCloudStorageService.js +71 -71
- package/lib/cjs/AliCloudStorageService.js.map +1 -1
- package/lib/cjs/BackendHubAccess.d.ts +224 -224
- package/lib/cjs/BackendHubAccess.js +41 -41
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +91 -91
- package/lib/cjs/BackendLoggerCategory.js +99 -99
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts +21 -21
- package/lib/cjs/BisCoreSchema.js +60 -60
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +170 -170
- package/lib/cjs/BriefcaseManager.js +413 -413
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +153 -153
- package/lib/cjs/Category.js +243 -243
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts +187 -187
- package/lib/cjs/ChangeSummaryManager.js +447 -447
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts +99 -99
- package/lib/cjs/ChangedElementsDb.js +165 -165
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.d.ts +39 -39
- package/lib/cjs/ChangedElementsManager.js +88 -88
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts +122 -122
- package/lib/cjs/CheckpointManager.js +343 -343
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +79 -79
- package/lib/cjs/ClassRegistry.js +249 -249
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +350 -350
- package/lib/cjs/CloudSqlite.js +153 -153
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CloudStorageBackend.d.ts +58 -58
- package/lib/cjs/CloudStorageBackend.js +173 -173
- package/lib/cjs/CloudStorageBackend.js.map +1 -1
- package/lib/cjs/CodeService.d.ts +396 -396
- package/lib/cjs/CodeService.js +63 -63
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +50 -50
- package/lib/cjs/CodeSpecs.js +112 -112
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.d.ts +13 -13
- package/lib/cjs/ConcurrentQuery.js +36 -36
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.d.ts +21 -21
- package/lib/cjs/CustomViewState3dCreator.js +81 -81
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.d.ts +71 -71
- package/lib/cjs/DevTools.js +154 -154
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +106 -106
- package/lib/cjs/DisplayStyle.js +256 -256
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +191 -191
- package/lib/cjs/ECDb.js +350 -350
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.d.ts +18 -18
- package/lib/cjs/ECSchemaXmlContext.js +41 -41
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +473 -466
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +791 -791
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +1102 -1102
- package/lib/cjs/Element.js +1416 -1416
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +176 -176
- package/lib/cjs/ElementAspect.js +211 -211
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts +9 -9
- package/lib/cjs/ElementGraphics.js +41 -41
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +162 -162
- package/lib/cjs/ElementTreeWalker.js +409 -409
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.d.ts +106 -106
- package/lib/cjs/Entity.js +134 -134
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.d.ts +49 -49
- package/lib/cjs/EntityReferences.js +95 -95
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +317 -317
- package/lib/cjs/ExportGraphics.js +208 -208
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +96 -96
- package/lib/cjs/ExternalSource.js +131 -131
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts +19 -19
- package/lib/cjs/GeoCoordConfig.js +85 -85
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts +4 -4
- package/lib/cjs/GeometrySummary.js +380 -380
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.d.ts +94 -94
- package/lib/cjs/HubMock.js +222 -222
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.d.ts +8 -8
- package/lib/cjs/IModelCloneContext.js +15 -15
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +1183 -1183
- package/lib/cjs/IModelDb.js +2374 -2374
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts +89 -89
- package/lib/cjs/IModelElementCloneContext.js +159 -159
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +370 -370
- package/lib/cjs/IModelHost.js +496 -496
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts +62 -62
- package/lib/cjs/IModelJsFs.js +140 -140
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts +104 -104
- package/lib/cjs/IpcHost.js +278 -278
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +311 -311
- package/lib/cjs/LineStyle.js +295 -295
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +162 -162
- package/lib/cjs/LocalHub.js +587 -587
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.d.ts +20 -20
- package/lib/cjs/LocalhostIpcHost.js +81 -81
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.d.ts +103 -103
- package/lib/cjs/Material.js +147 -147
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +392 -392
- package/lib/cjs/Model.js +485 -485
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.d.ts +51 -51
- package/lib/cjs/NativeAppStorage.js +202 -202
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.d.ts +52 -52
- package/lib/cjs/NativeHost.js +163 -163
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.d.ts +156 -156
- package/lib/cjs/NavigationRelationship.js +225 -225
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +51 -51
- package/lib/cjs/PromiseMemoizer.js +101 -101
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.d.ts +132 -132
- package/lib/cjs/PropertyStore.js +11 -11
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +416 -416
- package/lib/cjs/Relationship.js +494 -494
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.d.ts +5 -5
- package/lib/cjs/RpcBackend.js +31 -31
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +219 -219
- package/lib/cjs/SQLiteDb.js +214 -214
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.d.ts +55 -55
- package/lib/cjs/Schema.js +83 -83
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/ServerBasedLocks.d.ts +57 -57
- package/lib/cjs/ServerBasedLocks.js +168 -168
- package/lib/cjs/ServerBasedLocks.js.map +1 -1
- package/lib/cjs/SqliteStatement.d.ts +360 -360
- package/lib/cjs/SqliteStatement.js +586 -586
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/Texture.d.ts +58 -58
- package/lib/cjs/Texture.js +82 -82
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.d.ts +18 -18
- package/lib/cjs/TileStorage.js +90 -90
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +202 -202
- package/lib/cjs/TxnManager.js +356 -356
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +439 -439
- package/lib/cjs/ViewDefinition.js +646 -646
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +13 -13
- package/lib/cjs/ViewStateHydrator.js +103 -103
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Cloud.Schema.json +67 -67
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +31 -31
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +52 -52
- package/lib/cjs/assets/Settings/backend.setting.json5 +138 -138
- package/lib/cjs/core-backend.d.ts +184 -184
- package/lib/cjs/core-backend.js +204 -204
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +101 -101
- package/lib/cjs/domains/FunctionalElements.js +145 -145
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts +13 -13
- package/lib/cjs/domains/FunctionalSchema.js +40 -40
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +177 -177
- package/lib/cjs/domains/GenericElements.js +263 -263
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.d.ts +10 -10
- package/lib/cjs/domains/GenericSchema.js +28 -28
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/rpc/multipart.d.ts +11 -11
- package/lib/cjs/rpc/multipart.js +70 -70
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.d.ts +28 -28
- package/lib/cjs/rpc/tracing.js +73 -73
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.d.ts +9 -9
- package/lib/cjs/rpc/web/logging.js +42 -42
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.d.ts +6 -6
- package/lib/cjs/rpc/web/request.js +73 -73
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.d.ts +6 -6
- package/lib/cjs/rpc/web/response.js +105 -105
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js +32 -32
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +47 -47
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +291 -291
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts +22 -22
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js +202 -202
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.d.ts +36 -36
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +168 -168
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.d.ts +16 -16
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js +43 -43
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.d.ts +15 -15
- package/lib/cjs/rpc-impl/WipRpcImpl.js +37 -37
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +186 -186
- package/lib/cjs/workspace/Settings.js +155 -155
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +75 -75
- package/lib/cjs/workspace/SettingsSchemas.js +191 -191
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +414 -414
- package/lib/cjs/workspace/Workspace.js +543 -543
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +11 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseManager.js","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAqC;AAErC,6BAA6B;AAC7B,sDAE6B;AAC7B,oDAG4B;AAC5B,0DAAuD;AAEvD,mEAAgE;AAChE,2DAA2F;AAC3F,yCAA6D;AAC7D,6CAA0C;AAC1C,6CAA0C;AAE1C,MAAM,cAAc,GAAG,6CAAqB,CAAC,QAAQ,CAAC;AAkDtD;;GAEG;AACH,MAAa,gBAAgB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MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,MAAA,MAAM,CAAC,SAAS,0CAAE,EAAE,CACrB,CAAC;QACF,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI;YACrB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,uBAAU,CAAC,aAAa;YACvC,kBAAkB,EAAE,uBAAU,CAAC,kBAAkB;YACjD,SAAS,EAAE,uBAAU,CAAC,SAAS;YAC/B,WAAW,EAAE,EAAE,EAAE,uDAAuD;SACzE,CAAC;QAEF,uBAAU,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,8DAA8D;IAC9H,CAAC;;AA3aH,4CA4aC;AA/ZgB,iCAAgB,GAAG,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module iModels\r\n */\r\n\r\n// cspell:ignore cset csets ecchanges\r\n\r\nimport * as path from \"path\";\r\nimport {\r\n AccessToken, BeDuration, ChangeSetStatus, GuidString, IModelHubStatus, IModelStatus, Logger, OpenMode,\r\n} from \"@itwin/core-bentley\";\r\nimport {\r\n BriefcaseId, BriefcaseIdValue, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetType, IModelError, IModelVersion, LocalBriefcaseProps,\r\n LocalDirName, LocalFileName, RequestNewBriefcaseProps, RpcActivity,\r\n} from \"@itwin/core-common\";\r\nimport { TelemetryEvent } from \"@itwin/core-telemetry\";\r\nimport { AcquireNewBriefcaseIdArg } from \"./BackendHubAccess\";\r\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\r\nimport { CheckpointManager, CheckpointProps, ProgressFunction } from \"./CheckpointManager\";\r\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\r\nimport { IModelHost } from \"./IModelHost\";\r\nimport { IModelJsFs } from \"./IModelJsFs\";\r\n\r\nconst loggerCategory = BackendLoggerCategory.IModelDb;\r\n\r\n/** The argument for [[BriefcaseManager.downloadBriefcase]]\r\n * @public\r\n*/\r\nexport interface RequestNewBriefcaseArg extends TokenArg, RequestNewBriefcaseProps {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n}\r\n\r\n/**\r\n * Parameters for pushing changesets to iModelHub\r\n * @public\r\n */\r\nexport interface PushChangesArgs extends TokenArg {\r\n /** A description of the changes. This is visible on the iModel's timeline. */\r\n description: string;\r\n /** if present, the locks are retained after the operation. Otherwise, *all* locks are released after the changeset is successfully pushed. */\r\n retainLocks?: true;\r\n /** number of times to retry pull/merge if other users are pushing at the same time. Default is 5 */\r\n mergeRetryCount?: number;\r\n /** delay to wait between pull/merge retry attempts. Default is 3 seconds */\r\n mergeRetryDelay?: BeDuration;\r\n /** the number of time to attempt to retry to push the changeset upon failure. Default is 3 */\r\n pushRetryCount?: number;\r\n /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */\r\n pushRetryDelay?: BeDuration;\r\n}\r\n\r\n/**\r\n * Specifies a specific index for pulling changes.\r\n * @public\r\n */\r\nexport interface ToChangesetArgs extends TokenArg {\r\n /** The last ChangesetIndex to pull. If not present, pull *all* newer changesets. */\r\n toIndex?: ChangesetIndex;\r\n}\r\n\r\n/** Arguments for [[BriefcaseManager.pullAndApplyChangesets]]\r\n * @public\r\n */\r\nexport type PullChangesArgs = ToChangesetArgs & {\r\n /** If present, a function called periodically during the download to indicate progress.\r\n * @note return non-zero from this function to abort the download.\r\n */\r\n onProgress?: ProgressFunction;\r\n};\r\n\r\n/** Manages downloading Briefcases and downloading and uploading changesets.\r\n * @public\r\n */\r\nexport class BriefcaseManager {\r\n /** Get the local path of the folder storing files that are associated with an imodel */\r\n public static getIModelPath(iModelId: GuidString): LocalDirName { return path.join(this._cacheDir, iModelId); }\r\n\r\n /** @internal */\r\n public static getChangeSetsPath(iModelId: GuidString): LocalDirName { return path.join(this.getIModelPath(iModelId), \"changesets\"); }\r\n\r\n /** @internal */\r\n public static getChangeCachePathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.ecchanges\")); }\r\n\r\n /** @internal */\r\n public static getChangedElementsPathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.elems\")); }\r\n\r\n private static _briefcaseSubDir = \"briefcases\";\r\n /** @internal */\r\n public static getBriefcaseBasePath(iModelId: GuidString): LocalDirName {\r\n return path.join(this.getIModelPath(iModelId), this._briefcaseSubDir);\r\n }\r\n\r\n /** Get the name of the local file that holds, or will hold, a local briefcase in the briefcase cache.\r\n * @note The briefcase cache is a local directory established in the call to [[BriefcaseManager.initialize]].\r\n * @param briefcase the iModelId and BriefcaseId for the filename\r\n * @see getIModelPath\r\n */\r\n public static getFileName(briefcase: BriefcaseProps): LocalFileName {\r\n return path.join(this.getBriefcaseBasePath(briefcase.iModelId), `${briefcase.briefcaseId}.bim`);\r\n }\r\n\r\n private static setupCacheDir(cacheRootDir: LocalDirName) {\r\n this._cacheDir = cacheRootDir;\r\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\r\n }\r\n\r\n private static _initialized?: boolean;\r\n /** Initialize BriefcaseManager\r\n * @param cacheRootDir The root directory for storing a cache of downloaded briefcase files on the local computer.\r\n * Briefcases are stored relative to this path in sub-folders organized by IModelId.\r\n * @note It is perfectly valid for applications to store briefcases in locations they manage, outside of `cacheRootDir`.\r\n */\r\n public static initialize(cacheRootDir: LocalDirName) {\r\n if (this._initialized)\r\n return;\r\n this.setupCacheDir(cacheRootDir);\r\n IModelHost.onBeforeShutdown.addOnce(this.finalize, this);\r\n this._initialized = true;\r\n }\r\n\r\n private static finalize() {\r\n this._initialized = false;\r\n }\r\n\r\n /** Get a list of the local briefcase held in the briefcase cache, optionally for a single iModelId\r\n * @param iModelId if present, only briefcases for this iModelId are returned, otherwise all briefcases for all\r\n * iModels in the briefcase cache are returned.\r\n * @note usually there should only be one briefcase per iModel.\r\n */\r\n public static getCachedBriefcases(iModelId?: GuidString): LocalBriefcaseProps[] {\r\n const briefcaseList: LocalBriefcaseProps[] = [];\r\n const iModelDirs = IModelJsFs.readdirSync(this._cacheDir);\r\n for (const iModelDir of iModelDirs) {\r\n if (iModelId && iModelId !== iModelDir)\r\n continue;\r\n const bcPath = path.join(this._cacheDir, iModelDir, this._briefcaseSubDir);\r\n try {\r\n if (!IModelJsFs.lstatSync(bcPath)?.isDirectory)\r\n continue;\r\n } catch (err) {\r\n continue;\r\n }\r\n\r\n const briefcases = IModelJsFs.readdirSync(bcPath);\r\n for (const briefcaseName of briefcases) {\r\n if (briefcaseName.endsWith(\".bim\")) {\r\n try {\r\n const fileName = path.join(bcPath, briefcaseName);\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const db = IModelDb.openDgnDb({ path: fileName }, OpenMode.Readonly);\r\n briefcaseList.push({ fileName, iTwinId: db.getITwinId(), iModelId: db.getIModelId(), briefcaseId: db.getBriefcaseId(), changeset: db.getCurrentChangeset(), fileSize });\r\n db.closeIModel();\r\n } catch (_err) {\r\n }\r\n }\r\n }\r\n }\r\n return briefcaseList;\r\n }\r\n\r\n private static _cacheDir: LocalDirName;\r\n /** Get the root directory for the briefcase cache */\r\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\r\n\r\n /** Determine whether the supplied briefcaseId is in the range of assigned BriefcaseIds issued by iModelHub\r\n * @note this does check whether the id was actually acquired by the caller.\r\n */\r\n public static isValidBriefcaseId(id: BriefcaseId) {\r\n return id >= BriefcaseIdValue.FirstValid && id <= BriefcaseIdValue.LastValid;\r\n }\r\n\r\n /** Acquire a new briefcaseId from iModelHub for the supplied iModelId\r\n * @note usually there should only be one briefcase per iModel per user. If a single user acquires more than one briefcaseId,\r\n * it's a good idea to supply different aliases for each of them.\r\n */\r\n public static async acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId> {\r\n return IModelHost.hubAccess.acquireNewBriefcaseId(arg);\r\n }\r\n\r\n /**\r\n * Download a new briefcase from iModelHub for the supplied iModelId.\r\n *\r\n * Briefcases are local files holding a copy of an iModel.\r\n * Briefcases may either be specific to an individual user (so that it can be modified to create changesets), or it can be readonly so it can accept but not create changesets.\r\n * Every briefcase internally holds its [[BriefcaseId]]. Writeable briefcases have a `BriefcaseId` \"assigned\" to them by iModelHub. No two users will ever have the same BriefcaseId.\r\n * Readonly briefcases are \"unassigned\" with the special value [[BriefcaseId.Unassigned]].\r\n *\r\n * Typically a given user will have only one briefcase on their machine for a given iModelId. Rarely, it may be necessary to use more than one\r\n * briefcase to make isolated independent sets of changes, but that is exceedingly complicated and rare.\r\n *\r\n * Callers of this method may supply a BriefcaseId, or if none is supplied, a new one is acquired from iModelHub.\r\n *\r\n * @param arg The arguments that specify the briefcase file to be downloaded.\r\n * @returns The properties of the local briefcase in a Promise that is resolved after the briefcase is fully downloaded and the briefcase file is ready for use via [BriefcaseDb.open]($backend).\r\n * @note The location of the local file to hold the briefcase is arbitrary and may be any valid *local* path on your machine. If you don't supply\r\n * a filename, the local briefcase cache is used by creating a file with the briefcaseId as its name in the `briefcases` folder below the folder named\r\n * for the IModelId.\r\n * @note *It is invalid to edit briefcases on a shared network drive* and that is a sure way to corrupt your briefcase (see https://www.sqlite.org/howtocorrupt.html)\r\n */\r\n public static async downloadBriefcase(arg: RequestNewBriefcaseArg): Promise<LocalBriefcaseProps> {\r\n const briefcaseId = arg.briefcaseId ?? await this.acquireNewBriefcaseId(arg);\r\n const fileName = arg.fileName ?? this.getFileName({ ...arg, briefcaseId });\r\n\r\n if (IModelJsFs.existsSync(fileName))\r\n throw new IModelError(IModelStatus.FileAlreadyExists, `Briefcase \"${fileName}\" already exists`);\r\n\r\n const asOf = arg.asOf ?? IModelVersion.latest().toJSON();\r\n const changeset = await IModelHost.hubAccess.getChangesetFromVersion({ ...arg, version: IModelVersion.fromJSON(asOf) });\r\n const checkpoint: CheckpointProps = { ...arg, changeset };\r\n\r\n try {\r\n await CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });\r\n } catch (error: unknown) {\r\n if (arg.accessToken && arg.briefcaseId === undefined)\r\n await this.releaseBriefcase(arg.accessToken, { briefcaseId, iModelId: arg.iModelId });\r\n\r\n throw error;\r\n }\r\n\r\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\r\n const response: LocalBriefcaseProps = {\r\n fileName,\r\n briefcaseId,\r\n iModelId: arg.iModelId,\r\n iTwinId: arg.iTwinId,\r\n changeset: checkpoint.changeset,\r\n fileSize,\r\n };\r\n\r\n // now open the downloaded checkpoint and reset its BriefcaseId\r\n const nativeDb = new IModelHost.platform.DgnDb();\r\n try {\r\n nativeDb.openIModel(fileName, OpenMode.ReadWrite);\r\n } catch (err: any) {\r\n throw new IModelError(err.errorNumber, `Could not open downloaded briefcase for write access: ${fileName}, err=${err.message}`);\r\n }\r\n try {\r\n nativeDb.resetBriefcaseId(briefcaseId);\r\n if (nativeDb.getCurrentChangeset().id !== checkpoint.changeset.id)\r\n throw new IModelError(IModelStatus.InvalidId, `Downloaded briefcase has wrong changesetId: ${fileName}`);\r\n } finally {\r\n nativeDb.saveChanges();\r\n nativeDb.closeIModel();\r\n }\r\n return response;\r\n }\r\n\r\n /** Deletes change sets of an iModel from local disk\r\n * @internal\r\n */\r\n public static deleteChangeSetsFromLocalDisk(iModelId: string) {\r\n const changesetsPath = BriefcaseManager.getChangeSetsPath(iModelId);\r\n BriefcaseManager.deleteFolderAndContents(changesetsPath);\r\n }\r\n\r\n /** Releases a briefcaseId from iModelHub. After this call it is illegal to generate changesets for the released briefcaseId.\r\n * @note generally, this method should not be called directly. Instead use [[deleteBriefcaseFiles]].\r\n * @see deleteBriefcaseFiles\r\n */\r\n public static async releaseBriefcase(accessToken: AccessToken, briefcase: BriefcaseProps): Promise<void> {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId))\r\n return IModelHost.hubAccess.releaseBriefcase({ accessToken, iModelId: briefcase.iModelId, briefcaseId: briefcase.briefcaseId });\r\n }\r\n\r\n /**\r\n * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.\r\n * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and\r\n * associated files (that is, all files in the same directory that start with the briefcase name).\r\n * @param filePath the full file name of the Briefcase to delete\r\n * @param accessToken for releasing the briefcaseId\r\n */\r\n public static async deleteBriefcaseFiles(filePath: LocalFileName, accessToken?: AccessToken): Promise<void> {\r\n try {\r\n const db = IModelDb.openDgnDb({ path: filePath }, OpenMode.Readonly);\r\n const briefcase: BriefcaseProps = {\r\n iModelId: db.getIModelId(),\r\n briefcaseId: db.getBriefcaseId(),\r\n };\r\n db.closeIModel();\r\n\r\n if (accessToken) {\r\n if (this.isValidBriefcaseId(briefcase.briefcaseId)) {\r\n await BriefcaseManager.releaseBriefcase(accessToken, briefcase);\r\n }\r\n }\r\n } catch (error) {\r\n }\r\n\r\n // first try to delete the briefcase file\r\n try {\r\n if (IModelJsFs.existsSync(filePath))\r\n IModelJsFs.unlinkSync(filePath);\r\n } catch (err) {\r\n throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);\r\n }\r\n\r\n // next, delete all files that start with the briefcase's filePath (e.g. \"a.bim-locks\", \"a.bim-journal\", etc.)\r\n try {\r\n const dirName = path.dirname(filePath);\r\n const fileName = path.basename(filePath);\r\n const files = IModelJsFs.readdirSync(dirName);\r\n for (const file of files) {\r\n if (file.startsWith(fileName))\r\n this.deleteFile(path.join(dirName, file)); // don't throw on error\r\n }\r\n } catch (err) {\r\n }\r\n }\r\n\r\n /** Deletes a file\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFile(pathname: LocalFileName): boolean {\r\n try {\r\n IModelJsFs.unlinkSync(pathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes a folder, checking if it's empty\r\n * - Does not throw any error, but logs it instead\r\n * - Returns true if the delete was successful\r\n */\r\n private static deleteFolderIfEmpty(folderPathname: LocalDirName): boolean {\r\n try {\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n if (files.length > 0)\r\n return false;\r\n\r\n IModelJsFs.rmdirSync(folderPathname);\r\n } catch (error) {\r\n Logger.logError(loggerCategory, `Cannot delete folder: ${folderPathname}`);\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n /** Deletes the contents of a folder, but not the folder itself\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return false;\r\n\r\n let status = true;\r\n const files = IModelJsFs.readdirSync(folderPathname);\r\n for (const file of files) {\r\n const curPath = path.join(folderPathname, file);\r\n const locStatus = (IModelJsFs.lstatSync(curPath)?.isDirectory) ? BriefcaseManager.deleteFolderAndContents(curPath) : BriefcaseManager.deleteFile(curPath);\r\n if (!locStatus)\r\n status = false;\r\n }\r\n return status;\r\n }\r\n\r\n /** Deletes a folder and all it's contents.\r\n * - Does not throw any errors, but logs them.\r\n * - returns true if the delete was successful.\r\n */\r\n private static deleteFolderAndContents(folderPathname: LocalDirName): boolean {\r\n if (!IModelJsFs.existsSync(folderPathname))\r\n return true;\r\n\r\n let status = false;\r\n status = BriefcaseManager.deleteFolderContents(folderPathname);\r\n if (!status)\r\n return false;\r\n\r\n status = BriefcaseManager.deleteFolderIfEmpty(folderPathname);\r\n return status;\r\n }\r\n\r\n private static async applySingleChangeset(db: IModelDb, changesetFile: ChangesetFileProps) {\r\n if (changesetFile.changesType === ChangesetType.Schema)\r\n db.clearCaches(); // for schema changesets, statement caches may become invalid. Do this *before* applying, in case db needs to be closed (open statements hold db open.)\r\n\r\n db.nativeDb.applyChangeset(changesetFile);\r\n db.changeset = db.nativeDb.getCurrentChangeset();\r\n\r\n // we're done with this changeset, delete it\r\n IModelJsFs.removeSync(changesetFile.pathname);\r\n }\r\n\r\n /** @internal */\r\n public static async pullAndApplyChangesets(db: IModelDb, arg: PullChangesArgs): Promise<void> {\r\n if (!db.isOpen || db.nativeDb.isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true\r\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to process change sets\");\r\n\r\n let currentIndex = db.changeset.index;\r\n if (currentIndex === undefined)\r\n currentIndex = (await IModelHost.hubAccess.queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\r\n\r\n const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;\r\n\r\n // Download change sets\r\n const changesets = await IModelHost.hubAccess.downloadChangesets({\r\n accessToken: arg.accessToken,\r\n iModelId: db.iModelId,\r\n range: { first: reverse ? arg.toIndex! + 1 : currentIndex + 1, end: reverse ? currentIndex : arg.toIndex }, // eslint-disable-line @typescript-eslint/no-non-null-assertion\r\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\r\n progressCallback: arg.onProgress,\r\n });\r\n\r\n if (changesets.length === 0)\r\n return; // nothing to apply\r\n\r\n if (reverse)\r\n changesets.reverse();\r\n\r\n for (const changeset of changesets)\r\n await this.applySingleChangeset(db, changeset);\r\n\r\n // notify listeners\r\n db.notifyChangesetApplied();\r\n }\r\n\r\n /** create a changeset from the current changes, and push it to iModelHub */\r\n private static async pushChanges(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n const changesetProps = db.nativeDb.startCreateChangeset();\r\n changesetProps.briefcaseId = db.briefcaseId;\r\n changesetProps.description = arg.description;\r\n changesetProps.size = IModelJsFs.lstatSync(changesetProps.pathname)?.size;\r\n if (!changesetProps.size) // either undefined or 0 means error\r\n throw new IModelError(IModelStatus.NoContent, \"error creating changeset\");\r\n\r\n let retryCount = arg.pushRetryCount ?? 3;\r\n while (true) {\r\n try {\r\n const accessToken = await IModelHost.getAccessToken();\r\n const index = await IModelHost.hubAccess.pushChangeset({ accessToken, iModelId: db.iModelId, changesetProps });\r\n db.nativeDb.completeCreateChangeset({ index });\r\n db.changeset = db.nativeDb.getCurrentChangeset();\r\n if (!arg.retainLocks)\r\n await db.locks.releaseAllLocks();\r\n\r\n return;\r\n } catch (err: any) {\r\n const shouldRetry = () => {\r\n if (retryCount-- <= 0)\r\n return false;\r\n switch (err.errorNumber) {\r\n case IModelHubStatus.AnotherUserPushing:\r\n case IModelHubStatus.DatabaseTemporarilyLocked:\r\n case IModelHubStatus.OperationFailed:\r\n return true;\r\n }\r\n return false;\r\n };\r\n\r\n if (!shouldRetry()) {\r\n db.nativeDb.abandonCreateChangeset();\r\n throw err;\r\n }\r\n } finally {\r\n IModelJsFs.removeSync(changesetProps.pathname);\r\n }\r\n }\r\n }\r\n\r\n /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]\r\n * @internal\r\n */\r\n public static async pullMergePush(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\r\n let retryCount = arg.mergeRetryCount ?? 5;\r\n while (true) {\r\n try {\r\n await BriefcaseManager.pullAndApplyChangesets(db, arg);\r\n return await BriefcaseManager.pushChanges(db, arg);\r\n } catch (err: any) {\r\n if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)\r\n throw (err);\r\n await (arg.mergeRetryDelay ?? BeDuration.fromSeconds(3)).wait();\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n public static logUsage(imodel: IModelDb, activity?: RpcActivity) {\r\n\r\n const telemetryEvent = new TelemetryEvent(\r\n \"core-backend - Open iModel\",\r\n \"7a6424d1-2114-4e89-b13b-43670a38ccd4\", // Feature: \"iModel Use\"\r\n imodel.iTwinId,\r\n imodel.iModelId,\r\n imodel.changeset?.id,\r\n );\r\n activity = activity ?? {\r\n activityId: \"\",\r\n applicationId: IModelHost.applicationId,\r\n applicationVersion: IModelHost.applicationVersion,\r\n sessionId: IModelHost.sessionId,\r\n accessToken: \"\", // IModelHost.getAccessToken(); ACCESS_TOKEN_NEEDS_WORK\r\n };\r\n\r\n IModelHost.telemetry.postTelemetry(activity, telemetryEvent); // eslint-disable-line @typescript-eslint/no-floating-promises\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BriefcaseManager.js","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,qCAAqC;AAErC,6BAA6B;AAC7B,sDAE6B;AAC7B,oDAG4B;AAC5B,0DAAuD;AAEvD,mEAAgE;AAChE,2DAA2F;AAC3F,yCAA6D;AAC7D,6CAA0C;AAC1C,6CAA0C;AAE1C,MAAM,cAAc,GAAG,6CAAqB,CAAC,QAAQ,CAAC;AAkDtD;;GAEG;AACH,MAAa,gBAAgB;IAC3B,wFAAwF;IACjF,MAAM,CAAC,aAAa,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;IAE/G,gBAAgB;IACT,MAAM,CAAC,iBAAiB,CAAC,QAAoB,IAAkB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IAErI,gBAAgB;IACT,MAAM,CAAC,sBAAsB,CAAC,QAAoB,IAAmB,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhK,gBAAgB;IACT,MAAM,CAAC,0BAA0B,CA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GAAG,MAAA,GAAG,CAAC,eAAe,mCAAI,CAAC,CAAC;QAC1C,OAAO,IAAI,EAAE;YACX,IAAI;gBACF,MAAM,gBAAgB,CAAC,sBAAsB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;gBACvD,OAAO,MAAM,gBAAgB,CAAC,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;aACpD;YAAC,OAAO,GAAQ,EAAE;gBACjB,IAAI,UAAU,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,WAAW,KAAK,8BAAe,CAAC,cAAc;oBACzE,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,MAAM,CAAC,MAAA,GAAG,CAAC,eAAe,mCAAI,yBAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;aACjE;SACF;IACH,CAAC;IAED,gBAAgB;IACT,MAAM,CAAC,QAAQ,CAAC,MAAgB,EAAE,QAAsB;;QAE7D,MAAM,cAAc,GAAG,IAAI,+BAAc,CACvC,4BAA4B,EAC5B,sCAAsC,EAAE,wBAAwB;QAChE,MAAM,CAAC,OAAO,EACd,MAAM,CAAC,QAAQ,EACf,MAAA,MAAM,CAAC,SAAS,0CAAE,EAAE,CACrB,CAAC;QACF,QAAQ,GAAG,QAAQ,aAAR,QAAQ,cAAR,QAAQ,GAAI;YACrB,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,uBAAU,CAAC,aAAa;YACvC,kBAAkB,EAAE,uBAAU,CAAC,kBAAkB;YACjD,SAAS,EAAE,uBAAU,CAAC,SAAS;YAC/B,WAAW,EAAE,EAAE,EAAE,uDAAuD;SACzE,CAAC;QAEF,uBAAU,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,CAAC,8DAA8D;IAC9H,CAAC;;AA3aH,4CA4aC;AA/ZgB,iCAAgB,GAAG,YAAY,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module iModels\n */\n\n// cspell:ignore cset csets ecchanges\n\nimport * as path from \"path\";\nimport {\n AccessToken, BeDuration, ChangeSetStatus, GuidString, IModelHubStatus, IModelStatus, Logger, OpenMode,\n} from \"@itwin/core-bentley\";\nimport {\n BriefcaseId, BriefcaseIdValue, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetType, IModelError, IModelVersion, LocalBriefcaseProps,\n LocalDirName, LocalFileName, RequestNewBriefcaseProps, RpcActivity,\n} from \"@itwin/core-common\";\nimport { TelemetryEvent } from \"@itwin/core-telemetry\";\nimport { AcquireNewBriefcaseIdArg } from \"./BackendHubAccess\";\nimport { BackendLoggerCategory } from \"./BackendLoggerCategory\";\nimport { CheckpointManager, CheckpointProps, ProgressFunction } from \"./CheckpointManager\";\nimport { BriefcaseDb, IModelDb, TokenArg } from \"./IModelDb\";\nimport { IModelHost } from \"./IModelHost\";\nimport { IModelJsFs } from \"./IModelJsFs\";\n\nconst loggerCategory = BackendLoggerCategory.IModelDb;\n\n/** The argument for [[BriefcaseManager.downloadBriefcase]]\n * @public\n*/\nexport interface RequestNewBriefcaseArg extends TokenArg, RequestNewBriefcaseProps {\n /** If present, a function called periodically during the download to indicate progress.\n * @note return non-zero from this function to abort the download.\n */\n onProgress?: ProgressFunction;\n}\n\n/**\n * Parameters for pushing changesets to iModelHub\n * @public\n */\nexport interface PushChangesArgs extends TokenArg {\n /** A description of the changes. This is visible on the iModel's timeline. */\n description: string;\n /** if present, the locks are retained after the operation. Otherwise, *all* locks are released after the changeset is successfully pushed. */\n retainLocks?: true;\n /** number of times to retry pull/merge if other users are pushing at the same time. Default is 5 */\n mergeRetryCount?: number;\n /** delay to wait between pull/merge retry attempts. Default is 3 seconds */\n mergeRetryDelay?: BeDuration;\n /** the number of time to attempt to retry to push the changeset upon failure. Default is 3 */\n pushRetryCount?: number;\n /** The delay to wait between retry attempts on failed pushes. Default is 3 seconds. */\n pushRetryDelay?: BeDuration;\n}\n\n/**\n * Specifies a specific index for pulling changes.\n * @public\n */\nexport interface ToChangesetArgs extends TokenArg {\n /** The last ChangesetIndex to pull. If not present, pull *all* newer changesets. */\n toIndex?: ChangesetIndex;\n}\n\n/** Arguments for [[BriefcaseManager.pullAndApplyChangesets]]\n * @public\n */\nexport type PullChangesArgs = ToChangesetArgs & {\n /** If present, a function called periodically during the download to indicate progress.\n * @note return non-zero from this function to abort the download.\n */\n onProgress?: ProgressFunction;\n};\n\n/** Manages downloading Briefcases and downloading and uploading changesets.\n * @public\n */\nexport class BriefcaseManager {\n /** Get the local path of the folder storing files that are associated with an imodel */\n public static getIModelPath(iModelId: GuidString): LocalDirName { return path.join(this._cacheDir, iModelId); }\n\n /** @internal */\n public static getChangeSetsPath(iModelId: GuidString): LocalDirName { return path.join(this.getIModelPath(iModelId), \"changesets\"); }\n\n /** @internal */\n public static getChangeCachePathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.ecchanges\")); }\n\n /** @internal */\n public static getChangedElementsPathName(iModelId: GuidString): LocalFileName { return path.join(this.getIModelPath(iModelId), iModelId.concat(\".bim.elems\")); }\n\n private static _briefcaseSubDir = \"briefcases\";\n /** @internal */\n public static getBriefcaseBasePath(iModelId: GuidString): LocalDirName {\n return path.join(this.getIModelPath(iModelId), this._briefcaseSubDir);\n }\n\n /** Get the name of the local file that holds, or will hold, a local briefcase in the briefcase cache.\n * @note The briefcase cache is a local directory established in the call to [[BriefcaseManager.initialize]].\n * @param briefcase the iModelId and BriefcaseId for the filename\n * @see getIModelPath\n */\n public static getFileName(briefcase: BriefcaseProps): LocalFileName {\n return path.join(this.getBriefcaseBasePath(briefcase.iModelId), `${briefcase.briefcaseId}.bim`);\n }\n\n private static setupCacheDir(cacheRootDir: LocalDirName) {\n this._cacheDir = cacheRootDir;\n IModelJsFs.recursiveMkDirSync(this._cacheDir);\n }\n\n private static _initialized?: boolean;\n /** Initialize BriefcaseManager\n * @param cacheRootDir The root directory for storing a cache of downloaded briefcase files on the local computer.\n * Briefcases are stored relative to this path in sub-folders organized by IModelId.\n * @note It is perfectly valid for applications to store briefcases in locations they manage, outside of `cacheRootDir`.\n */\n public static initialize(cacheRootDir: LocalDirName) {\n if (this._initialized)\n return;\n this.setupCacheDir(cacheRootDir);\n IModelHost.onBeforeShutdown.addOnce(this.finalize, this);\n this._initialized = true;\n }\n\n private static finalize() {\n this._initialized = false;\n }\n\n /** Get a list of the local briefcase held in the briefcase cache, optionally for a single iModelId\n * @param iModelId if present, only briefcases for this iModelId are returned, otherwise all briefcases for all\n * iModels in the briefcase cache are returned.\n * @note usually there should only be one briefcase per iModel.\n */\n public static getCachedBriefcases(iModelId?: GuidString): LocalBriefcaseProps[] {\n const briefcaseList: LocalBriefcaseProps[] = [];\n const iModelDirs = IModelJsFs.readdirSync(this._cacheDir);\n for (const iModelDir of iModelDirs) {\n if (iModelId && iModelId !== iModelDir)\n continue;\n const bcPath = path.join(this._cacheDir, iModelDir, this._briefcaseSubDir);\n try {\n if (!IModelJsFs.lstatSync(bcPath)?.isDirectory)\n continue;\n } catch (err) {\n continue;\n }\n\n const briefcases = IModelJsFs.readdirSync(bcPath);\n for (const briefcaseName of briefcases) {\n if (briefcaseName.endsWith(\".bim\")) {\n try {\n const fileName = path.join(bcPath, briefcaseName);\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\n const db = IModelDb.openDgnDb({ path: fileName }, OpenMode.Readonly);\n briefcaseList.push({ fileName, iTwinId: db.getITwinId(), iModelId: db.getIModelId(), briefcaseId: db.getBriefcaseId(), changeset: db.getCurrentChangeset(), fileSize });\n db.closeIModel();\n } catch (_err) {\n }\n }\n }\n }\n return briefcaseList;\n }\n\n private static _cacheDir: LocalDirName;\n /** Get the root directory for the briefcase cache */\n public static get cacheDir(): LocalDirName { return this._cacheDir; }\n\n /** Determine whether the supplied briefcaseId is in the range of assigned BriefcaseIds issued by iModelHub\n * @note this does check whether the id was actually acquired by the caller.\n */\n public static isValidBriefcaseId(id: BriefcaseId) {\n return id >= BriefcaseIdValue.FirstValid && id <= BriefcaseIdValue.LastValid;\n }\n\n /** Acquire a new briefcaseId from iModelHub for the supplied iModelId\n * @note usually there should only be one briefcase per iModel per user. If a single user acquires more than one briefcaseId,\n * it's a good idea to supply different aliases for each of them.\n */\n public static async acquireNewBriefcaseId(arg: AcquireNewBriefcaseIdArg): Promise<BriefcaseId> {\n return IModelHost.hubAccess.acquireNewBriefcaseId(arg);\n }\n\n /**\n * Download a new briefcase from iModelHub for the supplied iModelId.\n *\n * Briefcases are local files holding a copy of an iModel.\n * Briefcases may either be specific to an individual user (so that it can be modified to create changesets), or it can be readonly so it can accept but not create changesets.\n * Every briefcase internally holds its [[BriefcaseId]]. Writeable briefcases have a `BriefcaseId` \"assigned\" to them by iModelHub. No two users will ever have the same BriefcaseId.\n * Readonly briefcases are \"unassigned\" with the special value [[BriefcaseId.Unassigned]].\n *\n * Typically a given user will have only one briefcase on their machine for a given iModelId. Rarely, it may be necessary to use more than one\n * briefcase to make isolated independent sets of changes, but that is exceedingly complicated and rare.\n *\n * Callers of this method may supply a BriefcaseId, or if none is supplied, a new one is acquired from iModelHub.\n *\n * @param arg The arguments that specify the briefcase file to be downloaded.\n * @returns The properties of the local briefcase in a Promise that is resolved after the briefcase is fully downloaded and the briefcase file is ready for use via [BriefcaseDb.open]($backend).\n * @note The location of the local file to hold the briefcase is arbitrary and may be any valid *local* path on your machine. If you don't supply\n * a filename, the local briefcase cache is used by creating a file with the briefcaseId as its name in the `briefcases` folder below the folder named\n * for the IModelId.\n * @note *It is invalid to edit briefcases on a shared network drive* and that is a sure way to corrupt your briefcase (see https://www.sqlite.org/howtocorrupt.html)\n */\n public static async downloadBriefcase(arg: RequestNewBriefcaseArg): Promise<LocalBriefcaseProps> {\n const briefcaseId = arg.briefcaseId ?? await this.acquireNewBriefcaseId(arg);\n const fileName = arg.fileName ?? this.getFileName({ ...arg, briefcaseId });\n\n if (IModelJsFs.existsSync(fileName))\n throw new IModelError(IModelStatus.FileAlreadyExists, `Briefcase \"${fileName}\" already exists`);\n\n const asOf = arg.asOf ?? IModelVersion.latest().toJSON();\n const changeset = await IModelHost.hubAccess.getChangesetFromVersion({ ...arg, version: IModelVersion.fromJSON(asOf) });\n const checkpoint: CheckpointProps = { ...arg, changeset };\n\n try {\n await CheckpointManager.downloadCheckpoint({ localFile: fileName, checkpoint, onProgress: arg.onProgress });\n } catch (error: unknown) {\n if (arg.accessToken && arg.briefcaseId === undefined)\n await this.releaseBriefcase(arg.accessToken, { briefcaseId, iModelId: arg.iModelId });\n\n throw error;\n }\n\n const fileSize = IModelJsFs.lstatSync(fileName)?.size ?? 0;\n const response: LocalBriefcaseProps = {\n fileName,\n briefcaseId,\n iModelId: arg.iModelId,\n iTwinId: arg.iTwinId,\n changeset: checkpoint.changeset,\n fileSize,\n };\n\n // now open the downloaded checkpoint and reset its BriefcaseId\n const nativeDb = new IModelHost.platform.DgnDb();\n try {\n nativeDb.openIModel(fileName, OpenMode.ReadWrite);\n } catch (err: any) {\n throw new IModelError(err.errorNumber, `Could not open downloaded briefcase for write access: ${fileName}, err=${err.message}`);\n }\n try {\n nativeDb.resetBriefcaseId(briefcaseId);\n if (nativeDb.getCurrentChangeset().id !== checkpoint.changeset.id)\n throw new IModelError(IModelStatus.InvalidId, `Downloaded briefcase has wrong changesetId: ${fileName}`);\n } finally {\n nativeDb.saveChanges();\n nativeDb.closeIModel();\n }\n return response;\n }\n\n /** Deletes change sets of an iModel from local disk\n * @internal\n */\n public static deleteChangeSetsFromLocalDisk(iModelId: string) {\n const changesetsPath = BriefcaseManager.getChangeSetsPath(iModelId);\n BriefcaseManager.deleteFolderAndContents(changesetsPath);\n }\n\n /** Releases a briefcaseId from iModelHub. After this call it is illegal to generate changesets for the released briefcaseId.\n * @note generally, this method should not be called directly. Instead use [[deleteBriefcaseFiles]].\n * @see deleteBriefcaseFiles\n */\n public static async releaseBriefcase(accessToken: AccessToken, briefcase: BriefcaseProps): Promise<void> {\n if (this.isValidBriefcaseId(briefcase.briefcaseId))\n return IModelHost.hubAccess.releaseBriefcase({ accessToken, iModelId: briefcase.iModelId, briefcaseId: briefcase.briefcaseId });\n }\n\n /**\n * Delete and clean up a briefcase and all of its associated files. First, this method opens the supplied filename to determine its briefcaseId.\n * Then, if a requestContext is supplied, it releases a BriefcaseId from iModelHub. Finally it deletes the local briefcase file and\n * associated files (that is, all files in the same directory that start with the briefcase name).\n * @param filePath the full file name of the Briefcase to delete\n * @param accessToken for releasing the briefcaseId\n */\n public static async deleteBriefcaseFiles(filePath: LocalFileName, accessToken?: AccessToken): Promise<void> {\n try {\n const db = IModelDb.openDgnDb({ path: filePath }, OpenMode.Readonly);\n const briefcase: BriefcaseProps = {\n iModelId: db.getIModelId(),\n briefcaseId: db.getBriefcaseId(),\n };\n db.closeIModel();\n\n if (accessToken) {\n if (this.isValidBriefcaseId(briefcase.briefcaseId)) {\n await BriefcaseManager.releaseBriefcase(accessToken, briefcase);\n }\n }\n } catch (error) {\n }\n\n // first try to delete the briefcase file\n try {\n if (IModelJsFs.existsSync(filePath))\n IModelJsFs.unlinkSync(filePath);\n } catch (err) {\n throw new IModelError(IModelStatus.BadRequest, `cannot delete briefcase file ${err}`);\n }\n\n // next, delete all files that start with the briefcase's filePath (e.g. \"a.bim-locks\", \"a.bim-journal\", etc.)\n try {\n const dirName = path.dirname(filePath);\n const fileName = path.basename(filePath);\n const files = IModelJsFs.readdirSync(dirName);\n for (const file of files) {\n if (file.startsWith(fileName))\n this.deleteFile(path.join(dirName, file)); // don't throw on error\n }\n } catch (err) {\n }\n }\n\n /** Deletes a file\n * - Does not throw any error, but logs it instead\n * - Returns true if the delete was successful\n */\n private static deleteFile(pathname: LocalFileName): boolean {\n try {\n IModelJsFs.unlinkSync(pathname);\n } catch (error) {\n Logger.logError(loggerCategory, `Cannot delete file ${pathname}, ${error}`);\n return false;\n }\n return true;\n }\n\n /** Deletes a folder, checking if it's empty\n * - Does not throw any error, but logs it instead\n * - Returns true if the delete was successful\n */\n private static deleteFolderIfEmpty(folderPathname: LocalDirName): boolean {\n try {\n const files = IModelJsFs.readdirSync(folderPathname);\n if (files.length > 0)\n return false;\n\n IModelJsFs.rmdirSync(folderPathname);\n } catch (error) {\n Logger.logError(loggerCategory, `Cannot delete folder: ${folderPathname}`);\n return false;\n }\n return true;\n }\n\n /** Deletes the contents of a folder, but not the folder itself\n * - Does not throw any errors, but logs them.\n * - returns true if the delete was successful.\n */\n private static deleteFolderContents(folderPathname: LocalDirName): boolean {\n if (!IModelJsFs.existsSync(folderPathname))\n return false;\n\n let status = true;\n const files = IModelJsFs.readdirSync(folderPathname);\n for (const file of files) {\n const curPath = path.join(folderPathname, file);\n const locStatus = (IModelJsFs.lstatSync(curPath)?.isDirectory) ? BriefcaseManager.deleteFolderAndContents(curPath) : BriefcaseManager.deleteFile(curPath);\n if (!locStatus)\n status = false;\n }\n return status;\n }\n\n /** Deletes a folder and all it's contents.\n * - Does not throw any errors, but logs them.\n * - returns true if the delete was successful.\n */\n private static deleteFolderAndContents(folderPathname: LocalDirName): boolean {\n if (!IModelJsFs.existsSync(folderPathname))\n return true;\n\n let status = false;\n status = BriefcaseManager.deleteFolderContents(folderPathname);\n if (!status)\n return false;\n\n status = BriefcaseManager.deleteFolderIfEmpty(folderPathname);\n return status;\n }\n\n private static async applySingleChangeset(db: IModelDb, changesetFile: ChangesetFileProps) {\n if (changesetFile.changesType === ChangesetType.Schema)\n db.clearCaches(); // for schema changesets, statement caches may become invalid. Do this *before* applying, in case db needs to be closed (open statements hold db open.)\n\n db.nativeDb.applyChangeset(changesetFile);\n db.changeset = db.nativeDb.getCurrentChangeset();\n\n // we're done with this changeset, delete it\n IModelJsFs.removeSync(changesetFile.pathname);\n }\n\n /** @internal */\n public static async pullAndApplyChangesets(db: IModelDb, arg: PullChangesArgs): Promise<void> {\n if (!db.isOpen || db.nativeDb.isReadonly()) // don't use db.isReadonly - we reopen the file writable just for this operation but db.isReadonly is still true\n throw new IModelError(ChangeSetStatus.ApplyError, \"Briefcase must be open ReadWrite to process change sets\");\n\n let currentIndex = db.changeset.index;\n if (currentIndex === undefined)\n currentIndex = (await IModelHost.hubAccess.queryChangeset({ accessToken: arg.accessToken, iModelId: db.iModelId, changeset: { id: db.changeset.id } })).index;\n\n const reverse = (arg.toIndex && arg.toIndex < currentIndex) ? true : false;\n\n // Download change sets\n const changesets = await IModelHost.hubAccess.downloadChangesets({\n accessToken: arg.accessToken,\n iModelId: db.iModelId,\n range: { first: reverse ? arg.toIndex! + 1 : currentIndex + 1, end: reverse ? currentIndex : arg.toIndex }, // eslint-disable-line @typescript-eslint/no-non-null-assertion\n targetDir: BriefcaseManager.getChangeSetsPath(db.iModelId),\n progressCallback: arg.onProgress,\n });\n\n if (changesets.length === 0)\n return; // nothing to apply\n\n if (reverse)\n changesets.reverse();\n\n for (const changeset of changesets)\n await this.applySingleChangeset(db, changeset);\n\n // notify listeners\n db.notifyChangesetApplied();\n }\n\n /** create a changeset from the current changes, and push it to iModelHub */\n private static async pushChanges(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\n const changesetProps = db.nativeDb.startCreateChangeset();\n changesetProps.briefcaseId = db.briefcaseId;\n changesetProps.description = arg.description;\n changesetProps.size = IModelJsFs.lstatSync(changesetProps.pathname)?.size;\n if (!changesetProps.size) // either undefined or 0 means error\n throw new IModelError(IModelStatus.NoContent, \"error creating changeset\");\n\n let retryCount = arg.pushRetryCount ?? 3;\n while (true) {\n try {\n const accessToken = await IModelHost.getAccessToken();\n const index = await IModelHost.hubAccess.pushChangeset({ accessToken, iModelId: db.iModelId, changesetProps });\n db.nativeDb.completeCreateChangeset({ index });\n db.changeset = db.nativeDb.getCurrentChangeset();\n if (!arg.retainLocks)\n await db.locks.releaseAllLocks();\n\n return;\n } catch (err: any) {\n const shouldRetry = () => {\n if (retryCount-- <= 0)\n return false;\n switch (err.errorNumber) {\n case IModelHubStatus.AnotherUserPushing:\n case IModelHubStatus.DatabaseTemporarilyLocked:\n case IModelHubStatus.OperationFailed:\n return true;\n }\n return false;\n };\n\n if (!shouldRetry()) {\n db.nativeDb.abandonCreateChangeset();\n throw err;\n }\n } finally {\n IModelJsFs.removeSync(changesetProps.pathname);\n }\n }\n }\n\n /** Pull/merge (if necessary), then push all local changes as a changeset. Called by [[BriefcaseDb.pushChanges]]\n * @internal\n */\n public static async pullMergePush(db: BriefcaseDb, arg: PushChangesArgs): Promise<void> {\n let retryCount = arg.mergeRetryCount ?? 5;\n while (true) {\n try {\n await BriefcaseManager.pullAndApplyChangesets(db, arg);\n return await BriefcaseManager.pushChanges(db, arg);\n } catch (err: any) {\n if (retryCount-- <= 0 || err.errorNumber !== IModelHubStatus.PullIsRequired)\n throw (err);\n await (arg.mergeRetryDelay ?? BeDuration.fromSeconds(3)).wait();\n }\n }\n }\n\n /** @internal */\n public static logUsage(imodel: IModelDb, activity?: RpcActivity) {\n\n const telemetryEvent = new TelemetryEvent(\n \"core-backend - Open iModel\",\n \"7a6424d1-2114-4e89-b13b-43670a38ccd4\", // Feature: \"iModel Use\"\n imodel.iTwinId,\n imodel.iModelId,\n imodel.changeset?.id,\n );\n activity = activity ?? {\n activityId: \"\",\n applicationId: IModelHost.applicationId,\n applicationVersion: IModelHost.applicationVersion,\n sessionId: IModelHost.sessionId,\n accessToken: \"\", // IModelHost.getAccessToken(); ACCESS_TOKEN_NEEDS_WORK\n };\n\n IModelHost.telemetry.postTelemetry(activity, telemetryEvent); // eslint-disable-line @typescript-eslint/no-floating-promises\n }\n}\n"]}
|
package/lib/cjs/Category.d.ts
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Categories
|
|
3
|
-
*/
|
|
4
|
-
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
-
import { CategoryProps, Code, CodeScopeProps, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps } from "@itwin/core-common";
|
|
6
|
-
import { DefinitionElement } from "./Element";
|
|
7
|
-
import { IModelDb } from "./IModelDb";
|
|
8
|
-
/** Defines the appearance for graphics in Geometric elements
|
|
9
|
-
* @public
|
|
10
|
-
*/
|
|
11
|
-
export declare class SubCategory extends DefinitionElement {
|
|
12
|
-
/** @internal */
|
|
13
|
-
static get className(): string;
|
|
14
|
-
/** The Appearance parameters for this SubCategory */
|
|
15
|
-
appearance: SubCategoryAppearance;
|
|
16
|
-
/** Optional description of this SubCategory. */
|
|
17
|
-
description?: string;
|
|
18
|
-
/** @internal */
|
|
19
|
-
constructor(props: SubCategoryProps, iModel: IModelDb);
|
|
20
|
-
/** @internal */
|
|
21
|
-
toJSON(): SubCategoryProps;
|
|
22
|
-
/** Get the SubCategory's name (its Code value). */
|
|
23
|
-
getSubCategoryName(): string;
|
|
24
|
-
/** Get the Id of the SubCategory. */
|
|
25
|
-
getSubCategoryId(): Id64String;
|
|
26
|
-
/** Get the Id of this SubCategory's parent Category. */
|
|
27
|
-
getCategoryId(): Id64String;
|
|
28
|
-
/** Check if this is the default SubCategory of its parent Category. */
|
|
29
|
-
get isDefaultSubCategory(): boolean;
|
|
30
|
-
/** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.
|
|
31
|
-
* @param iModel The IModel
|
|
32
|
-
* @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.
|
|
33
|
-
* @param codeValue The name of the SubCategory
|
|
34
|
-
*/
|
|
35
|
-
static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code;
|
|
36
|
-
/** Create a new SubCategory
|
|
37
|
-
* @param iModelDb The iModel
|
|
38
|
-
* @param parentCategoryId Create the new SubCategory as a child of this [[Category]]
|
|
39
|
-
* @param name The name of the SubCategory
|
|
40
|
-
* @param appearance The appearance settings to use for this SubCategory
|
|
41
|
-
* @returns The newly constructed SubCategory element.
|
|
42
|
-
* @throws [[IModelError]] if unable to create the element.
|
|
43
|
-
*/
|
|
44
|
-
static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory;
|
|
45
|
-
/** Insert a new SubCategory
|
|
46
|
-
* @param iModelDb Insert into this iModel
|
|
47
|
-
* @param parentCategoryId Insert the new SubCategory as a child of this Category
|
|
48
|
-
* @param name The name of the SubCategory
|
|
49
|
-
* @param appearance The appearance settings to use for this SubCategory
|
|
50
|
-
* @returns The Id of the newly inserted SubCategory element.
|
|
51
|
-
* @throws [[IModelError]] if unable to insert the element.
|
|
52
|
-
*/
|
|
53
|
-
static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
54
|
-
}
|
|
55
|
-
/** A Category element is the target of the `category` member of [[GeometricElement]].
|
|
56
|
-
* @public
|
|
57
|
-
*/
|
|
58
|
-
export declare class Category extends DefinitionElement {
|
|
59
|
-
/** @internal */
|
|
60
|
-
static get className(): string;
|
|
61
|
-
rank: Rank;
|
|
62
|
-
description?: string;
|
|
63
|
-
/** @internal */
|
|
64
|
-
constructor(props: CategoryProps, iModel: IModelDb);
|
|
65
|
-
/** @internal */
|
|
66
|
-
toJSON(): CategoryProps;
|
|
67
|
-
/** Get the Id of the default SubCategory for this Category. */
|
|
68
|
-
myDefaultSubCategoryId(): Id64String;
|
|
69
|
-
/** Set the appearance of the default SubCategory for this Category */
|
|
70
|
-
setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;
|
|
71
|
-
}
|
|
72
|
-
/** Categorizes 2d GeometricElements.
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
export declare class DrawingCategory extends Category {
|
|
76
|
-
/** @internal */
|
|
77
|
-
static get className(): string;
|
|
78
|
-
/** Construct a DrawingCategory
|
|
79
|
-
* @param opts The properties of the new DrawingCategory
|
|
80
|
-
* @param iModel The IModelDb where the DrawingCategory may be inserted.
|
|
81
|
-
* @internal
|
|
82
|
-
*/
|
|
83
|
-
constructor(opts: ElementProps, iModel: IModelDb);
|
|
84
|
-
/** Get the name of the CodeSpec that is used by DrawingCategory objects. */
|
|
85
|
-
static getCodeSpecName(): string;
|
|
86
|
-
/** Looks up the CategoryId of a DrawingCategory by model and name */
|
|
87
|
-
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
|
|
88
|
-
/** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
89
|
-
* @param iModel The IModel
|
|
90
|
-
* @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.
|
|
91
|
-
* @param codeValue The name of the category
|
|
92
|
-
* @return A drawing category Code
|
|
93
|
-
*/
|
|
94
|
-
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
|
|
95
|
-
/** Create a new DrawingCategory
|
|
96
|
-
* @param iModelDb The iModel
|
|
97
|
-
* @param definitionModelId The [[DefinitionModel]]
|
|
98
|
-
* @param name The name of the DrawingCategory
|
|
99
|
-
* @returns The newly constructed DrawingCategory element.
|
|
100
|
-
* @throws [[IModelError]] if unable to create the element.
|
|
101
|
-
*/
|
|
102
|
-
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory;
|
|
103
|
-
/** Insert a new DrawingCategory
|
|
104
|
-
* @param iModelDb Insert into this iModel
|
|
105
|
-
* @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]
|
|
106
|
-
* @param name The name of the DrawingCategory
|
|
107
|
-
* @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory
|
|
108
|
-
* @returns The Id of the newly inserted DrawingCategory element.
|
|
109
|
-
* @throws [[IModelError]] if unable to insert the element.
|
|
110
|
-
*/
|
|
111
|
-
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
112
|
-
}
|
|
113
|
-
/** Categorizes SpatialElements. See [how to create a SpatialCategory]$(docs/learning/backend/CreateElements.md#SpatialCategory).
|
|
114
|
-
* @public
|
|
115
|
-
*/
|
|
116
|
-
export declare class SpatialCategory extends Category {
|
|
117
|
-
/** @internal */
|
|
118
|
-
static get className(): string;
|
|
119
|
-
/** Construct a SpatialCategory
|
|
120
|
-
* @param opts The properties of the new SpatialCategory
|
|
121
|
-
* @param iModel The IModelDb where the SpatialCategory may be inserted.
|
|
122
|
-
* @internal
|
|
123
|
-
*/
|
|
124
|
-
constructor(opts: ElementProps, iModel: IModelDb);
|
|
125
|
-
/** Get the name of the CodeSpec that is used by SpatialCategory objects. */
|
|
126
|
-
static getCodeSpecName(): string;
|
|
127
|
-
/** Looks up the CategoryId of a SpatialCategory by model and name */
|
|
128
|
-
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
|
|
129
|
-
/** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
130
|
-
* @param iModel The IModel
|
|
131
|
-
* @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.
|
|
132
|
-
* @param codeValue The name of the category
|
|
133
|
-
* @return A spatial category Code
|
|
134
|
-
*/
|
|
135
|
-
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
|
|
136
|
-
/** Create a new SpatialCategory
|
|
137
|
-
* @param iModelDb The iModel
|
|
138
|
-
* @param definitionModelId The [[DefinitionModel]]
|
|
139
|
-
* @param name The name/CodeValue of the SpatialCategory
|
|
140
|
-
* @returns The newly constructed SpatialCategory element.
|
|
141
|
-
* @throws [[IModelError]] if unable to create the element.
|
|
142
|
-
*/
|
|
143
|
-
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory;
|
|
144
|
-
/** Insert a new SpatialCategory
|
|
145
|
-
* @param iModelDb Insert into this iModel
|
|
146
|
-
* @param definitionModelId Insert the new SpatialCategory into this DefinitionModel
|
|
147
|
-
* @param name The name of the SpatialCategory
|
|
148
|
-
* @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory
|
|
149
|
-
* @returns The Id of the newly inserted SpatialCategory element.
|
|
150
|
-
* @throws [[IModelError]] if unable to insert the element.
|
|
151
|
-
*/
|
|
152
|
-
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
153
|
-
}
|
|
1
|
+
/** @packageDocumentation
|
|
2
|
+
* @module Categories
|
|
3
|
+
*/
|
|
4
|
+
import { Id64String } from "@itwin/core-bentley";
|
|
5
|
+
import { CategoryProps, Code, CodeScopeProps, ElementProps, Rank, SubCategoryAppearance, SubCategoryProps } from "@itwin/core-common";
|
|
6
|
+
import { DefinitionElement } from "./Element";
|
|
7
|
+
import { IModelDb } from "./IModelDb";
|
|
8
|
+
/** Defines the appearance for graphics in Geometric elements
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export declare class SubCategory extends DefinitionElement {
|
|
12
|
+
/** @internal */
|
|
13
|
+
static get className(): string;
|
|
14
|
+
/** The Appearance parameters for this SubCategory */
|
|
15
|
+
appearance: SubCategoryAppearance;
|
|
16
|
+
/** Optional description of this SubCategory. */
|
|
17
|
+
description?: string;
|
|
18
|
+
/** @internal */
|
|
19
|
+
constructor(props: SubCategoryProps, iModel: IModelDb);
|
|
20
|
+
/** @internal */
|
|
21
|
+
toJSON(): SubCategoryProps;
|
|
22
|
+
/** Get the SubCategory's name (its Code value). */
|
|
23
|
+
getSubCategoryName(): string;
|
|
24
|
+
/** Get the Id of the SubCategory. */
|
|
25
|
+
getSubCategoryId(): Id64String;
|
|
26
|
+
/** Get the Id of this SubCategory's parent Category. */
|
|
27
|
+
getCategoryId(): Id64String;
|
|
28
|
+
/** Check if this is the default SubCategory of its parent Category. */
|
|
29
|
+
get isDefaultSubCategory(): boolean;
|
|
30
|
+
/** Create a Code for a SubCategory given a name that is meant to be unique within the scope of the specified parent Category.
|
|
31
|
+
* @param iModel The IModel
|
|
32
|
+
* @param parentCategoryId The Id of the parent Category that owns the SubCategory and provides the scope for its name.
|
|
33
|
+
* @param codeValue The name of the SubCategory
|
|
34
|
+
*/
|
|
35
|
+
static createCode(iModel: IModelDb, parentCategoryId: CodeScopeProps, codeValue: string): Code;
|
|
36
|
+
/** Create a new SubCategory
|
|
37
|
+
* @param iModelDb The iModel
|
|
38
|
+
* @param parentCategoryId Create the new SubCategory as a child of this [[Category]]
|
|
39
|
+
* @param name The name of the SubCategory
|
|
40
|
+
* @param appearance The appearance settings to use for this SubCategory
|
|
41
|
+
* @returns The newly constructed SubCategory element.
|
|
42
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
43
|
+
*/
|
|
44
|
+
static create(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): SubCategory;
|
|
45
|
+
/** Insert a new SubCategory
|
|
46
|
+
* @param iModelDb Insert into this iModel
|
|
47
|
+
* @param parentCategoryId Insert the new SubCategory as a child of this Category
|
|
48
|
+
* @param name The name of the SubCategory
|
|
49
|
+
* @param appearance The appearance settings to use for this SubCategory
|
|
50
|
+
* @returns The Id of the newly inserted SubCategory element.
|
|
51
|
+
* @throws [[IModelError]] if unable to insert the element.
|
|
52
|
+
*/
|
|
53
|
+
static insert(iModelDb: IModelDb, parentCategoryId: Id64String, name: string, appearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
54
|
+
}
|
|
55
|
+
/** A Category element is the target of the `category` member of [[GeometricElement]].
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
export declare class Category extends DefinitionElement {
|
|
59
|
+
/** @internal */
|
|
60
|
+
static get className(): string;
|
|
61
|
+
rank: Rank;
|
|
62
|
+
description?: string;
|
|
63
|
+
/** @internal */
|
|
64
|
+
constructor(props: CategoryProps, iModel: IModelDb);
|
|
65
|
+
/** @internal */
|
|
66
|
+
toJSON(): CategoryProps;
|
|
67
|
+
/** Get the Id of the default SubCategory for this Category. */
|
|
68
|
+
myDefaultSubCategoryId(): Id64String;
|
|
69
|
+
/** Set the appearance of the default SubCategory for this Category */
|
|
70
|
+
setDefaultAppearance(props: SubCategoryAppearance.Props | SubCategoryAppearance): void;
|
|
71
|
+
}
|
|
72
|
+
/** Categorizes 2d GeometricElements.
|
|
73
|
+
* @public
|
|
74
|
+
*/
|
|
75
|
+
export declare class DrawingCategory extends Category {
|
|
76
|
+
/** @internal */
|
|
77
|
+
static get className(): string;
|
|
78
|
+
/** Construct a DrawingCategory
|
|
79
|
+
* @param opts The properties of the new DrawingCategory
|
|
80
|
+
* @param iModel The IModelDb where the DrawingCategory may be inserted.
|
|
81
|
+
* @internal
|
|
82
|
+
*/
|
|
83
|
+
constructor(opts: ElementProps, iModel: IModelDb);
|
|
84
|
+
/** Get the name of the CodeSpec that is used by DrawingCategory objects. */
|
|
85
|
+
static getCodeSpecName(): string;
|
|
86
|
+
/** Looks up the CategoryId of a DrawingCategory by model and name */
|
|
87
|
+
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
|
|
88
|
+
/** Create a Code for a DrawingCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
89
|
+
* @param iModel The IModel
|
|
90
|
+
* @param scopeModelId The Id of the DefinitionModel that contains the DrawingCategory and provides the scope for its name.
|
|
91
|
+
* @param codeValue The name of the category
|
|
92
|
+
* @return A drawing category Code
|
|
93
|
+
*/
|
|
94
|
+
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
|
|
95
|
+
/** Create a new DrawingCategory
|
|
96
|
+
* @param iModelDb The iModel
|
|
97
|
+
* @param definitionModelId The [[DefinitionModel]]
|
|
98
|
+
* @param name The name of the DrawingCategory
|
|
99
|
+
* @returns The newly constructed DrawingCategory element.
|
|
100
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
101
|
+
*/
|
|
102
|
+
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): DrawingCategory;
|
|
103
|
+
/** Insert a new DrawingCategory
|
|
104
|
+
* @param iModelDb Insert into this iModel
|
|
105
|
+
* @param definitionModelId Insert the new DrawingCategory into this [[DefinitionModel]]
|
|
106
|
+
* @param name The name of the DrawingCategory
|
|
107
|
+
* @param defaultAppearance The appearance settings to use for the default SubCategory of this DrawingCategory
|
|
108
|
+
* @returns The Id of the newly inserted DrawingCategory element.
|
|
109
|
+
* @throws [[IModelError]] if unable to insert the element.
|
|
110
|
+
*/
|
|
111
|
+
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
112
|
+
}
|
|
113
|
+
/** Categorizes SpatialElements. See [how to create a SpatialCategory]$(docs/learning/backend/CreateElements.md#SpatialCategory).
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
export declare class SpatialCategory extends Category {
|
|
117
|
+
/** @internal */
|
|
118
|
+
static get className(): string;
|
|
119
|
+
/** Construct a SpatialCategory
|
|
120
|
+
* @param opts The properties of the new SpatialCategory
|
|
121
|
+
* @param iModel The IModelDb where the SpatialCategory may be inserted.
|
|
122
|
+
* @internal
|
|
123
|
+
*/
|
|
124
|
+
constructor(opts: ElementProps, iModel: IModelDb);
|
|
125
|
+
/** Get the name of the CodeSpec that is used by SpatialCategory objects. */
|
|
126
|
+
static getCodeSpecName(): string;
|
|
127
|
+
/** Looks up the CategoryId of a SpatialCategory by model and name */
|
|
128
|
+
static queryCategoryIdByName(iModel: IModelDb, scopeModelId: Id64String, categoryName: string): Id64String | undefined;
|
|
129
|
+
/** Create a Code for a SpatialCategory given a name that is meant to be unique within the scope of the specified DefinitionModel.
|
|
130
|
+
* @param iModel The IModel
|
|
131
|
+
* @param scopeModelId The Id of the DefinitionModel that contains the SpatialCategory and provides the scope for its name.
|
|
132
|
+
* @param codeValue The name of the category
|
|
133
|
+
* @return A spatial category Code
|
|
134
|
+
*/
|
|
135
|
+
static createCode(iModel: IModelDb, scopeModelId: CodeScopeProps, codeValue: string): Code;
|
|
136
|
+
/** Create a new SpatialCategory
|
|
137
|
+
* @param iModelDb The iModel
|
|
138
|
+
* @param definitionModelId The [[DefinitionModel]]
|
|
139
|
+
* @param name The name/CodeValue of the SpatialCategory
|
|
140
|
+
* @returns The newly constructed SpatialCategory element.
|
|
141
|
+
* @throws [[IModelError]] if unable to create the element.
|
|
142
|
+
*/
|
|
143
|
+
static create(iModelDb: IModelDb, definitionModelId: Id64String, name: string): SpatialCategory;
|
|
144
|
+
/** Insert a new SpatialCategory
|
|
145
|
+
* @param iModelDb Insert into this iModel
|
|
146
|
+
* @param definitionModelId Insert the new SpatialCategory into this DefinitionModel
|
|
147
|
+
* @param name The name of the SpatialCategory
|
|
148
|
+
* @param defaultAppearance The appearance settings to use for the default SubCategory of this SpatialCategory
|
|
149
|
+
* @returns The Id of the newly inserted SpatialCategory element.
|
|
150
|
+
* @throws [[IModelError]] if unable to insert the element.
|
|
151
|
+
*/
|
|
152
|
+
static insert(iModelDb: IModelDb, definitionModelId: Id64String, name: string, defaultAppearance: SubCategoryAppearance.Props | SubCategoryAppearance): Id64String;
|
|
153
|
+
}
|
|
154
154
|
//# sourceMappingURL=Category.d.ts.map
|