@itwin/core-backend 4.8.0-dev.9 → 4.9.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -1
- package/lib/cjs/BackendHubAccess.d.ts +18 -16
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js +16 -15
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +19 -11
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +0 -6
- package/lib/cjs/Category.d.ts.map +1 -1
- package/lib/cjs/Category.js +0 -6
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.d.ts.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +13 -11
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsDb.d.ts.map +1 -1
- package/lib/cjs/ChangedElementsDb.js +5 -3
- package/lib/cjs/ChangedElementsDb.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +242 -237
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.d.ts +4 -26
- package/lib/cjs/ChannelControl.d.ts.map +1 -1
- package/lib/cjs/ChannelControl.js +2 -101
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.d.ts.map +1 -1
- package/lib/cjs/CheckpointManager.js +5 -3
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +8 -7
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +2 -2
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.d.ts.map +1 -1
- package/lib/cjs/DevTools.js +2 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +0 -3
- package/lib/cjs/DisplayStyle.d.ts.map +1 -1
- package/lib/cjs/DisplayStyle.js +0 -3
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +6 -1
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +19 -14
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js +2 -2
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts +6 -3
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js +3 -3
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +2 -59
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +7 -63
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +0 -5
- package/lib/cjs/ElementAspect.d.ts.map +1 -1
- package/lib/cjs/ElementAspect.js +4 -8
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/ElementGraphics.js +2 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +19 -0
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +23 -9
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/Entity.js.map +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.d.ts.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +2 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +2 -2
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/GeometrySummary.d.ts.map +1 -1
- package/lib/cjs/GeometrySummary.js +49 -48
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelCloneContext.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +24 -94
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +196 -151
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js +5 -4
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +5 -3
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +16 -18
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +15 -13
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.d.ts +2 -2
- package/lib/cjs/LocalHub.d.ts.map +1 -1
- package/lib/cjs/LocalHub.js +18 -18
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/LockControl.d.ts +73 -0
- package/lib/cjs/LockControl.d.ts.map +1 -0
- package/lib/cjs/LockControl.js +11 -0
- package/lib/cjs/LockControl.js.map +1 -0
- package/lib/cjs/Material.d.ts +2 -5
- package/lib/cjs/Material.d.ts.map +1 -1
- package/lib/cjs/Material.js +1 -4
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +0 -22
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +5 -26
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.d.ts +0 -12
- package/lib/cjs/Relationship.d.ts.map +1 -1
- package/lib/cjs/Relationship.js +5 -16
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/RpcBackend.js.map +1 -1
- package/lib/cjs/SQLiteDb.d.ts +6 -1
- package/lib/cjs/SQLiteDb.d.ts.map +1 -1
- package/lib/cjs/SQLiteDb.js +23 -16
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.d.ts +3 -0
- package/lib/cjs/SchemaSync.d.ts.map +1 -1
- package/lib/cjs/SchemaSync.js +24 -11
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/SchemaUtils.js +3 -3
- package/lib/cjs/SchemaUtils.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +2 -2
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/SqliteStatement.js +2 -2
- package/lib/cjs/SqliteStatement.js.map +1 -1
- package/lib/cjs/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/TextAnnotationLayout.js.map +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +4 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +1 -18
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +1 -18
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +6 -5
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/assets/IModelChange.02.00.00.ecschema.xml +90 -90
- package/lib/cjs/assets/Settings/Schemas/Base.Schema.json +32 -32
- package/lib/cjs/assets/Settings/Schemas/Gcs.schema.json +27 -27
- package/lib/cjs/assets/Settings/Schemas/Workspace.Schema.json +94 -94
- package/lib/cjs/assets/Settings/backend.setting.json5 +21 -21
- package/lib/cjs/core-backend.d.ts +2 -1
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -5
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +0 -10
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +0 -10
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js +2 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +0 -18
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js +0 -18
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts +24 -0
- package/lib/cjs/internal/ChangesetConflictArgs.d.ts.map +1 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js +7 -0
- package/lib/cjs/internal/ChangesetConflictArgs.js.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts +34 -0
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -0
- package/lib/cjs/internal/ChannelAdmin.js +117 -0
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -0
- package/lib/cjs/internal/NativePlatform.d.ts +15 -0
- package/lib/cjs/internal/NativePlatform.d.ts.map +1 -0
- package/lib/cjs/internal/NativePlatform.js +49 -0
- package/lib/cjs/internal/NativePlatform.js.map +1 -0
- package/lib/cjs/internal/NoLocks.d.ts +6 -0
- package/lib/cjs/internal/NoLocks.d.ts.map +1 -0
- package/lib/cjs/internal/NoLocks.js +31 -0
- package/lib/cjs/internal/NoLocks.js.map +1 -0
- package/lib/cjs/{ServerBasedLocks.d.ts → internal/ServerBasedLocks.d.ts} +10 -16
- package/lib/cjs/internal/ServerBasedLocks.d.ts.map +1 -0
- package/lib/cjs/{ServerBasedLocks.js → internal/ServerBasedLocks.js} +29 -18
- package/lib/cjs/internal/ServerBasedLocks.js.map +1 -0
- package/lib/cjs/internal/Symbols.d.ts +11 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -0
- package/lib/cjs/internal/Symbols.js +21 -0
- package/lib/cjs/internal/Symbols.js.map +1 -0
- package/lib/cjs/internal/cross-package.d.ts +4 -0
- package/lib/cjs/internal/cross-package.d.ts.map +1 -0
- package/lib/cjs/internal/cross-package.js +16 -0
- package/lib/cjs/internal/cross-package.js.map +1 -0
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts +2 -2
- package/lib/cjs/internal/workspace/SettingsImpl.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/SettingsImpl.js +3 -3
- package/lib/cjs/internal/workspace/SettingsImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js +2 -2
- package/lib/cjs/internal/workspace/SettingsSchemasImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js +14 -14
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.d.ts.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js +2 -1
- package/lib/cjs/internal/workspace/WorkspaceSqliteDb.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.d.ts.map +1 -1
- package/lib/cjs/rpc/tracing.js +5 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js.map +1 -1
- package/lib/cjs/rpc/web/request.js.map +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/DevToolsRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts +1 -0
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.d.ts.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js +9 -4
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.d.ts.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.js.map +1 -1
- package/lib/cjs/rpc-impl/SnapshotIModelRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/WipRpcImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +3 -3
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +2 -2
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +4 -4
- package/lib/cjs/workspace/Workspace.d.ts.map +1 -1
- package/lib/cjs/workspace/Workspace.js +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.d.ts +2 -2
- package/lib/cjs/workspace/WorkspaceEditor.d.ts.map +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js +1 -1
- package/lib/cjs/workspace/WorkspaceEditor.js.map +1 -1
- package/package.json +13 -13
- package/lib/cjs/ServerBasedLocks.d.ts.map +0 -1
- package/lib/cjs/ServerBasedLocks.js.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.d.ts +0 -44
- package/lib/cjs/internal/ImplementationProhibited.d.ts.map +0 -1
- package/lib/cjs/internal/ImplementationProhibited.js +0 -51
- package/lib/cjs/internal/ImplementationProhibited.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-backend",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.9.0-dev.1",
|
|
4
4
|
"description": "iTwin.js backend components",
|
|
5
5
|
"main": "lib/cjs/core-backend.js",
|
|
6
6
|
"typings": "lib/cjs/core-backend",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"url": "http://www.bentley.com"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@itwin/core-bentley": "^4.
|
|
29
|
-
"@itwin/core-common": "^4.
|
|
30
|
-
"@itwin/core-geometry": "^4.
|
|
28
|
+
"@itwin/core-bentley": "^4.9.0-dev.1",
|
|
29
|
+
"@itwin/core-common": "^4.9.0-dev.1",
|
|
30
|
+
"@itwin/core-geometry": "^4.9.0-dev.1",
|
|
31
31
|
"@opentelemetry/api": "^1.0.4"
|
|
32
32
|
},
|
|
33
33
|
"peerDependenciesMeta": {
|
|
@@ -69,16 +69,16 @@
|
|
|
69
69
|
"ts-node": "^10.8.2",
|
|
70
70
|
"typescript": "~5.3.3",
|
|
71
71
|
"webpack": "^5.76.0",
|
|
72
|
-
"@itwin/build-tools": "4.
|
|
73
|
-
"@itwin/core-bentley": "4.
|
|
74
|
-
"@itwin/core-common": "4.
|
|
75
|
-
"@itwin/core-geometry": "4.
|
|
76
|
-
"@itwin/core-webpack-tools": "4.
|
|
77
|
-
"
|
|
78
|
-
"
|
|
72
|
+
"@itwin/build-tools": "4.9.0-dev.1",
|
|
73
|
+
"@itwin/core-bentley": "4.9.0-dev.1",
|
|
74
|
+
"@itwin/core-common": "4.9.0-dev.1",
|
|
75
|
+
"@itwin/core-geometry": "4.9.0-dev.1",
|
|
76
|
+
"@itwin/core-webpack-tools": "4.9.0-dev.1",
|
|
77
|
+
"internal-tools": "3.0.0-dev.69",
|
|
78
|
+
"@itwin/ecsql-common": "4.9.0-dev.1"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"@bentley/imodeljs-native": "4.
|
|
81
|
+
"@bentley/imodeljs-native": "4.9.0",
|
|
82
82
|
"@itwin/cloud-agnostic-core": "^2.1.0",
|
|
83
83
|
"@itwin/object-storage-azure": "^2.2.2",
|
|
84
84
|
"@itwin/object-storage-core": "^2.2.2",
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"semver": "^7.3.5",
|
|
93
93
|
"touch": "^3.1.0",
|
|
94
94
|
"ws": "^7.5.10",
|
|
95
|
-
"@itwin/core-telemetry": "4.
|
|
95
|
+
"@itwin/core-telemetry": "4.9.0-dev.1"
|
|
96
96
|
},
|
|
97
97
|
"nyc": {
|
|
98
98
|
"extends": "./node_modules/@itwin/build-tools/.nycrc"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ServerBasedLocks.d.ts","sourceRoot":"","sources":["../../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BAAY,CAAC,WAAW,EAAE,8BAA8B,IAAI,QAAQ,SAAS,QAAQ,EAAE,GAAG,CAAC,CAAC;IACtH,CAAC;IAED,kGAAkG;IAC3F,eAAe,CAAC,EAAc,EAAE,IAAY,EAAE,SAAiB;QACpE,IAAI,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,CAAC;YACrD,MAAM,IAAI,yBAAW,CAAC,2BAAY,CAAC,WAAW,EAAE,2BAA2B,IAAI,QAAQ,SAAS,QAAQ,EAAE,GAAG,CAAC,CAAC;IACnH,CAAC;CAEF;AAlLD,4CAkLC","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\n/** @packageDocumentation\n * @module iModels\n */\n\nimport { DbResult, Id64, Id64Arg, Id64String, IModelStatus, OpenMode } from \"@itwin/core-bentley\";\nimport { IModel, IModelError } from \"@itwin/core-common\";\nimport { LockMap, LockState } from \"./BackendHubAccess\";\nimport { BriefcaseDb, LockControl } from \"./IModelDb\";\nimport { IModelHost } from \"./IModelHost\";\nimport { SQLiteDb } from \"./SQLiteDb\";\n\n/**\n * Both the Model and Parent of an element are considered \"owners\" of their member elements. That means:\n * 1) they must hold at least a shared lock before an exclusive lock can be acquired for their members\n * 2) if they hold an exclusive lock, then all of their members are exclusively locked implicitly.\n * @internal\n */\nexport interface ElementOwners {\n readonly modelId: Id64String;\n readonly parentId: Id64String | undefined;\n}\n\n// eslint-disable-next-line no-restricted-syntax\nconst enum LockOrigin {\n Acquired = 0,\n NewElement = 1,\n Discovered = 2,\n}\n\n/** @internal */\nexport class ServerBasedLocks implements LockControl {\n public get isServerBased() { return true; }\n protected readonly lockDb = new SQLiteDb();\n protected readonly briefcase: BriefcaseDb;\n\n public constructor(iModel: BriefcaseDb) {\n this.briefcase = iModel;\n const dbName = `${iModel.nativeDb.getTempFileBaseName()}-locks`;\n try {\n this.lockDb.openDb(dbName, OpenMode.ReadWrite);\n } catch (_e) {\n this.lockDb.createDb(dbName);\n this.lockDb.executeSQL(\"CREATE TABLE locks(id INTEGER PRIMARY KEY NOT NULL,state INTEGER NOT NULL,origin INTEGER)\");\n this.lockDb.saveChanges();\n }\n }\n\n public close() {\n if (this.lockDb.isOpen)\n this.lockDb.closeDb();\n }\n\n private getOwners(id: Id64String): ElementOwners {\n return this.briefcase.withPreparedSqliteStatement(\"SELECT ModelId,ParentId FROM bis_Element WHERE id=?\", (stmt) => {\n stmt.bindId(1, id);\n const rc = stmt.step();\n if (DbResult.BE_SQLITE_ROW !== rc)\n throw new IModelError(rc, `element ${id} not found`);\n\n return { modelId: stmt.getValueId(0), parentId: stmt.getValueId(1) };\n });\n }\n\n private getLockState(id?: Id64String): LockState | undefined {\n return (id === undefined || !Id64.isValid(id)) ? undefined : this.lockDb.withPreparedSqliteStatement(\"SELECT state FROM locks WHERE id=?\", (stmt) => {\n stmt.bindId(1, id);\n return (DbResult.BE_SQLITE_ROW === stmt.step()) ? stmt.getValueInteger(0) : undefined;\n });\n }\n\n /** Clear the cache of locally held locks.\n * Note: does *not* release locks from server.\n */\n private clearAllLocks() {\n this.lockDb.executeSQL(\"DELETE FROM locks\");\n this.lockDb.saveChanges();\n }\n\n /** only for tests */\n public getLockCount(state: LockState): number {\n return this.lockDb.withSqliteStatement(\"SELECT count(*) FROM locks WHERE state=?\", (stmt) => {\n stmt.bindInteger(1, state);\n stmt.step();\n return stmt.getValueInteger(0);\n });\n }\n\n public async releaseAllLocks(): Promise<void> {\n await IModelHost.hubAccess.releaseAllLocks(this.briefcase); // throws if unsuccessful\n this.clearAllLocks();\n }\n\n private insertLock(id: Id64String, state: LockState, origin: LockOrigin): true {\n this.lockDb.withPreparedSqliteStatement(\"INSERT INTO locks(id,state,origin) VALUES (?,?,?) ON CONFLICT(id) DO UPDATE SET state=excluded.state,origin=excluded.origin\", (stmt) => {\n stmt.bindId(1, id);\n stmt.bindInteger(2, state);\n stmt.bindInteger(3, origin);\n const rc = stmt.step();\n if (DbResult.BE_SQLITE_DONE !== rc)\n throw new IModelError(rc, \"can't insert lock into database\");\n });\n return true;\n }\n\n private ownerHoldsExclusiveLock(id: Id64String | undefined): boolean {\n if (id === undefined || id === IModel.rootSubjectId)\n return false; // has no owners\n\n const { modelId, parentId } = this.getOwners(id);\n if (this.getLockState(modelId) === LockState.Exclusive || this.getLockState(parentId) === LockState.Exclusive)\n return true;\n\n // see if this model is exclusively locked by one of its owners. If so, save that fact on modelId so future tests won't have to descend.\n if (this.ownerHoldsExclusiveLock(modelId))\n return this.insertLock(modelId, LockState.Exclusive, LockOrigin.Discovered);\n\n // see if the parent is exclusively locked by one of its owners. If so, save that fact on parentId so future tests won't have to descend.\n return this.ownerHoldsExclusiveLock(parentId) ? this.insertLock(parentId!, LockState.Exclusive, LockOrigin.Discovered) : false; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }\n\n /** Determine whether an the exclusive lock is already held by an element (or one of its owners) */\n public holdsExclusiveLock(id: Id64String): boolean {\n // see if we hold the exclusive lock. or if one of the element's owners is exclusively locked (recursively)\n return this.getLockState(id) === LockState.Exclusive || this.ownerHoldsExclusiveLock(id);\n }\n\n public holdsSharedLock(id: Id64String): boolean {\n const state = this.getLockState(id);\n // see if we hold shared or exclusive lock, or if an owner has exclusive lock. If so we implicitly have shared lock, but owner holding shared lock doesn't help.\n return (state === LockState.Shared || state === LockState.Exclusive) || this.ownerHoldsExclusiveLock(id);\n }\n\n /** if the shared lock on the element supplied is not already held, add it to the set of shared locks required. Then, check owners. */\n private addSharedLock(id: Id64String | undefined, locks: Set<Id64String>) {\n // if the id is not valid, or of the lock is already in the set, or if we already hold a shared lock, we're done\n // Note: if we hold a shared lock, it is guaranteed that we also hold all required shared locks on owners.\n if (id === undefined || !Id64.isValid(id) || locks.has(id) || this.holdsSharedLock(id))\n return;\n\n locks.add(id); // add to set of needed shared locks\n this.addOwnerSharedLocks(id, locks); // check parent models and groups\n }\n\n /** add owners (recursively) of an element to a list of required shared locks, if not already held. */\n private addOwnerSharedLocks(id: Id64String, locks: Set<Id64String>) {\n const el = this.getOwners(id);\n this.addSharedLock(el.parentId, locks); // if this element is in a group\n this.addSharedLock(el.modelId, locks); // check its model\n }\n\n /** attempt to acquire all necessary locks for a set of elements */\n private async acquireAllLocks(locks: LockMap) {\n if (locks.size === 0) // no locks are required.\n return;\n\n const sharedLocks = new Set<Id64String>();\n for (const lock of locks)\n this.addOwnerSharedLocks(lock[0], sharedLocks);\n\n for (const shared of sharedLocks) {\n if (!locks.has(shared)) // we may already be asking for exclusive lock\n locks.set(shared, LockState.Shared);\n }\n\n await IModelHost.hubAccess.acquireLocks(this.briefcase, locks); // throws if unsuccessful\n for (const lock of locks)\n this.insertLock(lock[0], lock[1], LockOrigin.Acquired);\n this.lockDb.saveChanges();\n }\n\n public async acquireLocks(arg: { shared?: Id64Arg, exclusive?: Id64Arg }): Promise<void> {\n const locks = new Map<Id64String, LockState>();\n if (arg.shared) {\n for (const id of Id64.iterable(arg.shared)) {\n if (!this.holdsSharedLock(id))\n locks.set(id, LockState.Shared);\n }\n }\n if (arg.exclusive) {\n for (const id of Id64.iterable(arg.exclusive)) {\n if (!this.holdsExclusiveLock(id))\n locks.set(id, LockState.Exclusive);\n }\n }\n return this.acquireAllLocks(locks);\n }\n\n /** When an element is newly created in a session, we hold the lock on it implicitly. Save that fact. */\n public elementWasCreated(id: Id64String) {\n this.insertLock(id, LockState.Exclusive, LockOrigin.NewElement);\n this.lockDb.saveChanges();\n }\n\n /** locks are not necessary during change propagation. */\n private get _locksAreRequired() { return !this.briefcase.txns.isIndirectChanges; }\n\n /** throw if locks are currently required and the exclusive lock is not held on the supplied element */\n public checkExclusiveLock(id: Id64String, type: string, operation: string) {\n if (this._locksAreRequired && !this.holdsExclusiveLock(id))\n throw new IModelError(IModelStatus.LockNotHeld, `exclusive lock not held on ${type} for ${operation} (id=${id})`);\n }\n\n /** throw if locks are currently required and a shared lock is not held on the supplied element */\n public checkSharedLock(id: Id64String, type: string, operation: string) {\n if (this._locksAreRequired && !this.holdsSharedLock(id))\n throw new IModelError(IModelStatus.LockNotHeld, `shared lock not held on ${type} for ${operation} (id=${id})`);\n }\n\n}\n\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/** @packageDocumentation
|
|
2
|
-
* @module Workspace
|
|
3
|
-
*/
|
|
4
|
-
/** A symbol used to prevent implementations of an interface from being created outside of the package that defines the interface.
|
|
5
|
-
* This is useful when a package defines a public interface with one or more private implementations.
|
|
6
|
-
* The only way for users of the package to obtain an implementation of the interface is by calling a method in the package's public API that returns one.
|
|
7
|
-
* It permits the package to add new required properties and methods to the interface without breaking API compatibility, because no one
|
|
8
|
-
* else can possibly have created their own implementations lacking those new properties or methods.
|
|
9
|
-
*
|
|
10
|
-
* Simple example:
|
|
11
|
-
* ```ts
|
|
12
|
-
* // @public
|
|
13
|
-
* interface Thing {
|
|
14
|
-
* name: string;
|
|
15
|
-
* [implementationProhibited]: unknown;
|
|
16
|
-
* }
|
|
17
|
-
*
|
|
18
|
-
* // Not exported
|
|
19
|
-
* class ThingImpl implements Thing {
|
|
20
|
-
* constructor(public name: string) { }
|
|
21
|
-
* public readonly [implementationProhibited] = undefined;
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* // @public
|
|
25
|
-
* export function getThing(name: string): Thing { return new ThingImpl(name); }
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* This effectively turns the interface into a nominal type, bypassing TypeScript's structural typing.
|
|
29
|
-
* If someone attempts to supply their own implementation of `Thing`:
|
|
30
|
-
*
|
|
31
|
-
* ```ts
|
|
32
|
-
* const thing: Thing = { name: "my thing" };
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* ...they will receive a compiler error. Because they cannot access the `implementationProhibited` symbol,
|
|
36
|
-
* they will not be able to appease the compiler except by casting to `any`.
|
|
37
|
-
*
|
|
38
|
-
* Of course, you must make sure not to export the symbol from the package - that would defeat the whole purpose.
|
|
39
|
-
* It is exported here from the internal API for consumption inside the package only. It is not exported from the package's barrel file.
|
|
40
|
-
*
|
|
41
|
-
* The vast majority of interfaces do not need this.
|
|
42
|
-
*/
|
|
43
|
-
export declare const implementationProhibited: unique symbol;
|
|
44
|
-
//# sourceMappingURL=ImplementationProhibited.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImplementationProhibited.d.ts","sourceRoot":"","sources":["../../../src/internal/ImplementationProhibited.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,wBAAwB,eAAsC,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*---------------------------------------------------------------------------------------------
|
|
3
|
-
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
4
|
-
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
5
|
-
*--------------------------------------------------------------------------------------------*/
|
|
6
|
-
/** @packageDocumentation
|
|
7
|
-
* @module Workspace
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.implementationProhibited = void 0;
|
|
11
|
-
/** A symbol used to prevent implementations of an interface from being created outside of the package that defines the interface.
|
|
12
|
-
* This is useful when a package defines a public interface with one or more private implementations.
|
|
13
|
-
* The only way for users of the package to obtain an implementation of the interface is by calling a method in the package's public API that returns one.
|
|
14
|
-
* It permits the package to add new required properties and methods to the interface without breaking API compatibility, because no one
|
|
15
|
-
* else can possibly have created their own implementations lacking those new properties or methods.
|
|
16
|
-
*
|
|
17
|
-
* Simple example:
|
|
18
|
-
* ```ts
|
|
19
|
-
* // @public
|
|
20
|
-
* interface Thing {
|
|
21
|
-
* name: string;
|
|
22
|
-
* [implementationProhibited]: unknown;
|
|
23
|
-
* }
|
|
24
|
-
*
|
|
25
|
-
* // Not exported
|
|
26
|
-
* class ThingImpl implements Thing {
|
|
27
|
-
* constructor(public name: string) { }
|
|
28
|
-
* public readonly [implementationProhibited] = undefined;
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
* // @public
|
|
32
|
-
* export function getThing(name: string): Thing { return new ThingImpl(name); }
|
|
33
|
-
* ```
|
|
34
|
-
*
|
|
35
|
-
* This effectively turns the interface into a nominal type, bypassing TypeScript's structural typing.
|
|
36
|
-
* If someone attempts to supply their own implementation of `Thing`:
|
|
37
|
-
*
|
|
38
|
-
* ```ts
|
|
39
|
-
* const thing: Thing = { name: "my thing" };
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* ...they will receive a compiler error. Because they cannot access the `implementationProhibited` symbol,
|
|
43
|
-
* they will not be able to appease the compiler except by casting to `any`.
|
|
44
|
-
*
|
|
45
|
-
* Of course, you must make sure not to export the symbol from the package - that would defeat the whole purpose.
|
|
46
|
-
* It is exported here from the internal API for consumption inside the package only. It is not exported from the package's barrel file.
|
|
47
|
-
*
|
|
48
|
-
* The vast majority of interfaces do not need this.
|
|
49
|
-
*/
|
|
50
|
-
exports.implementationProhibited = Symbol("implementation prohibited");
|
|
51
|
-
//# sourceMappingURL=ImplementationProhibited.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImplementationProhibited.js","sourceRoot":"","sources":["../../../src/internal/ImplementationProhibited.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACU,QAAA,wBAAwB,GAAG,MAAM,CAAC,2BAA2B,CAAC,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 Workspace\n */\n\n/** A symbol used to prevent implementations of an interface from being created outside of the package that defines the interface.\n * This is useful when a package defines a public interface with one or more private implementations.\n * The only way for users of the package to obtain an implementation of the interface is by calling a method in the package's public API that returns one.\n * It permits the package to add new required properties and methods to the interface without breaking API compatibility, because no one\n * else can possibly have created their own implementations lacking those new properties or methods.\n *\n * Simple example:\n * ```ts\n * // @public\n * interface Thing {\n * name: string;\n * [implementationProhibited]: unknown;\n * }\n *\n * // Not exported\n * class ThingImpl implements Thing {\n * constructor(public name: string) { }\n * public readonly [implementationProhibited] = undefined;\n * }\n *\n * // @public\n * export function getThing(name: string): Thing { return new ThingImpl(name); }\n * ```\n *\n * This effectively turns the interface into a nominal type, bypassing TypeScript's structural typing.\n * If someone attempts to supply their own implementation of `Thing`:\n *\n * ```ts\n * const thing: Thing = { name: \"my thing\" };\n * ```\n *\n * ...they will receive a compiler error. Because they cannot access the `implementationProhibited` symbol,\n * they will not be able to appease the compiler except by casting to `any`.\n *\n * Of course, you must make sure not to export the symbol from the package - that would defeat the whole purpose.\n * It is exported here from the internal API for consumption inside the package only. It is not exported from the package's barrel file.\n *\n * The vast majority of interfaces do not need this.\n */\nexport const implementationProhibited = Symbol(\"implementation prohibited\");\n"]}
|