@itwin/core-backend 4.6.0-dev.9 → 4.7.0-dev.3
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 +11 -1
- package/lib/cjs/BackendHubAccess.js +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js +1 -1
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BisCoreSchema.d.ts.map +1 -1
- package/lib/cjs/BisCoreSchema.js +2 -0
- package/lib/cjs/BisCoreSchema.js.map +1 -1
- package/lib/cjs/BlobContainerService.js +1 -1
- package/lib/cjs/BlobContainerService.js.map +1 -1
- package/lib/cjs/BriefcaseManager.js +2 -2
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +1 -1
- package/lib/cjs/Category.js +1 -1
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangeSummaryManager.js +1 -1
- package/lib/cjs/ChangeSummaryManager.js.map +1 -1
- package/lib/cjs/ChangedElementsManager.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +2 -2
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChannelControl.js +2 -2
- package/lib/cjs/ChannelControl.js.map +1 -1
- package/lib/cjs/CheckpointManager.js +4 -4
- package/lib/cjs/CheckpointManager.js.map +1 -1
- package/lib/cjs/ClassRegistry.d.ts +3 -0
- package/lib/cjs/ClassRegistry.d.ts.map +1 -1
- package/lib/cjs/ClassRegistry.js +19 -8
- package/lib/cjs/ClassRegistry.js.map +1 -1
- package/lib/cjs/CloudSqlite.js +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeService.js +1 -1
- package/lib/cjs/CodeService.js.map +1 -1
- package/lib/cjs/CodeSpecs.js +1 -1
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/CustomViewState3dCreator.js.map +1 -1
- package/lib/cjs/DevTools.js +2 -2
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECDb.js +1 -1
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/ECSchemaXmlContext.js.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/Element.d.ts +0 -16
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +7 -23
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.js +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.d.ts +0 -3
- package/lib/cjs/ElementGraphics.d.ts.map +1 -1
- package/lib/cjs/ElementGraphics.js +2 -5
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts.map +1 -1
- package/lib/cjs/ElementTreeWalker.js +5 -0
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/EntityReferences.js +1 -1
- package/lib/cjs/EntityReferences.js.map +1 -1
- package/lib/cjs/ExportGraphics.d.ts +1 -1
- package/lib/cjs/ExportGraphics.js +2 -2
- package/lib/cjs/ExportGraphics.js.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeoCoordConfig.js +1 -1
- package/lib/cjs/GeoCoordConfig.js.map +1 -1
- package/lib/cjs/GeometrySummary.js +5 -5
- package/lib/cjs/GeometrySummary.js.map +1 -1
- package/lib/cjs/HubMock.js +1 -1
- package/lib/cjs/HubMock.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +8 -2
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +62 -21
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelElementCloneContext.js.map +1 -1
- package/lib/cjs/IModelHost.js +2 -2
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.js +1 -1
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +1 -1
- package/lib/cjs/LineStyle.js +2 -2
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/LocalHub.js.map +1 -1
- package/lib/cjs/LocalhostIpcHost.js +1 -1
- package/lib/cjs/LocalhostIpcHost.js.map +1 -1
- package/lib/cjs/Material.js +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/NativeAppStorage.js +1 -1
- package/lib/cjs/NativeAppStorage.js.map +1 -1
- package/lib/cjs/NativeHost.js +1 -1
- package/lib/cjs/NativeHost.js.map +1 -1
- package/lib/cjs/NavigationRelationship.js +21 -21
- package/lib/cjs/NavigationRelationship.js.map +1 -1
- package/lib/cjs/PromiseMemoizer.d.ts +0 -3
- package/lib/cjs/PromiseMemoizer.d.ts.map +1 -1
- package/lib/cjs/PromiseMemoizer.js +2 -5
- package/lib/cjs/PromiseMemoizer.js.map +1 -1
- package/lib/cjs/PropertyStore.js +1 -1
- package/lib/cjs/PropertyStore.js.map +1 -1
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/SQLiteDb.js +2 -2
- package/lib/cjs/SQLiteDb.js.map +1 -1
- package/lib/cjs/Schema.js +1 -1
- package/lib/cjs/Schema.js.map +1 -1
- package/lib/cjs/SchemaSync.js +1 -1
- package/lib/cjs/SchemaSync.js.map +1 -1
- package/lib/cjs/ServerBasedLocks.js.map +1 -1
- 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.d.ts +54 -0
- package/lib/cjs/TextAnnotationElement.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationElement.js +94 -0
- package/lib/cjs/TextAnnotationElement.js.map +1 -0
- package/lib/cjs/TextAnnotationGeometry.d.ts +28 -0
- package/lib/cjs/TextAnnotationGeometry.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationGeometry.js +155 -0
- package/lib/cjs/TextAnnotationGeometry.js.map +1 -0
- package/lib/cjs/TextAnnotationLayout.d.ts +141 -0
- package/lib/cjs/TextAnnotationLayout.d.ts.map +1 -0
- package/lib/cjs/TextAnnotationLayout.js +414 -0
- package/lib/cjs/TextAnnotationLayout.js.map +1 -0
- package/lib/cjs/TileStorage.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +53 -1
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.js +4 -4
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStateHydrator.d.ts +1 -0
- package/lib/cjs/ViewStateHydrator.d.ts.map +1 -1
- package/lib/cjs/ViewStateHydrator.js +1 -0
- package/lib/cjs/ViewStateHydrator.js.map +1 -1
- package/lib/cjs/ViewStore.js +1 -1
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +47 -61
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +49 -62
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/FunctionalSchema.js.map +1 -1
- package/lib/cjs/domains/GenericSchema.js.map +1 -1
- package/lib/cjs/rpc/multipart.js.map +1 -1
- package/lib/cjs/rpc/tracing.js +2 -2
- package/lib/cjs/rpc/tracing.js.map +1 -1
- package/lib/cjs/rpc/web/logging.js +2 -2
- 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 +1 -1
- package/lib/cjs/rpc/web/response.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelReadRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/IModelTileRpcImpl.js.map +1 -1
- package/lib/cjs/rpc-impl/RpcBriefcaseUtility.js +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/workspace/Settings.js +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.d.ts +0 -5
- package/lib/cjs/workspace/SettingsSchemas.d.ts.map +1 -1
- package/lib/cjs/workspace/SettingsSchemas.js +1 -10
- package/lib/cjs/workspace/SettingsSchemas.js.map +1 -1
- package/lib/cjs/workspace/Workspace.js +4 -4
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/package.json +14 -14
package/lib/cjs/IModelDb.js
CHANGED
|
@@ -61,7 +61,7 @@ var BriefcaseLocalValue;
|
|
|
61
61
|
(function (BriefcaseLocalValue) {
|
|
62
62
|
BriefcaseLocalValue["StandaloneEdit"] = "StandaloneEdit";
|
|
63
63
|
BriefcaseLocalValue["NoLocking"] = "NoLocking";
|
|
64
|
-
})(BriefcaseLocalValue
|
|
64
|
+
})(BriefcaseLocalValue || (exports.BriefcaseLocalValue = BriefcaseLocalValue = {}));
|
|
65
65
|
// function to open an briefcaseDb, perform an operation, and then close it.
|
|
66
66
|
const withBriefcaseDb = async (briefcase, fn) => {
|
|
67
67
|
const db = await BriefcaseDb.open(briefcase);
|
|
@@ -187,7 +187,10 @@ class IModelDb extends core_common_1.IModel {
|
|
|
187
187
|
/** Event called when the iModel is about to be closed. */
|
|
188
188
|
this.onBeforeClose = new core_bentley_1.BeEvent();
|
|
189
189
|
this.nativeDb = args.nativeDb;
|
|
190
|
-
//
|
|
190
|
+
// it is illegal to create an IModelDb unless the nativeDb has been opened. Throw otherwise.
|
|
191
|
+
if (!this.isOpen)
|
|
192
|
+
throw new Error("cannot create an IModelDb unless it has already been opened");
|
|
193
|
+
// PR https://github.com/iTwin/imodel-native/pull/558 renamed closeIModel to closeFile because it changed its behavior.
|
|
191
194
|
// Ideally, nobody outside of core-backend would be calling it, but somebody important is.
|
|
192
195
|
// Make closeIModel available so their code doesn't break.
|
|
193
196
|
this.nativeDb.closeIModel = () => {
|
|
@@ -718,7 +721,8 @@ class IModelDb extends core_common_1.IModel {
|
|
|
718
721
|
*/
|
|
719
722
|
static findByFilename(fileName) {
|
|
720
723
|
for (const entry of this._openDbs) {
|
|
721
|
-
if
|
|
724
|
+
// It shouldn't be possible for anything in _openDbs to not be open, but if so just skip them because `pathName` will throw an exception.
|
|
725
|
+
if (entry[1].isOpen && entry[1].pathName === fileName)
|
|
722
726
|
return entry[1];
|
|
723
727
|
}
|
|
724
728
|
return undefined;
|
|
@@ -884,6 +888,15 @@ class IModelDb extends core_common_1.IModel {
|
|
|
884
888
|
}
|
|
885
889
|
return metadata;
|
|
886
890
|
}
|
|
891
|
+
/** Identical to [[getMetaData]], except it returns `undefined` instead of throwing an error if the metadata cannot be found nor loaded. */
|
|
892
|
+
tryGetMetaData(classFullName) {
|
|
893
|
+
try {
|
|
894
|
+
return this.getMetaData(classFullName);
|
|
895
|
+
}
|
|
896
|
+
catch (_) {
|
|
897
|
+
return undefined;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
887
900
|
/** Invoke a callback on each property of the specified class, optionally including superclass properties.
|
|
888
901
|
* @param iModel The IModel that contains the schema
|
|
889
902
|
* @param classFullName The full class name to load the metadata, if necessary
|
|
@@ -1168,13 +1181,21 @@ class IModelDb extends core_common_1.IModel {
|
|
|
1168
1181
|
set codeValueBehavior(newBehavior) {
|
|
1169
1182
|
this.nativeDb.setCodeValueBehavior(newBehavior);
|
|
1170
1183
|
}
|
|
1184
|
+
/** @internal */
|
|
1185
|
+
computeRangesForText(args) {
|
|
1186
|
+
const props = this.nativeDb.computeRangesForText(args.chars, args.fontId, args.bold, args.italic, args.widthFactor, args.lineHeight);
|
|
1187
|
+
return {
|
|
1188
|
+
layout: core_geometry_1.Range2d.fromJSON(props.layout),
|
|
1189
|
+
justification: core_geometry_1.Range2d.fromJSON(props.justification),
|
|
1190
|
+
};
|
|
1191
|
+
}
|
|
1171
1192
|
}
|
|
1193
|
+
exports.IModelDb = IModelDb;
|
|
1172
1194
|
/** Keep track of open imodels to support `tryFind` for RPC purposes */
|
|
1173
1195
|
IModelDb._openDbs = new Map();
|
|
1174
1196
|
IModelDb.defaultLimit = 1000; // default limit for batching queries
|
|
1175
1197
|
IModelDb.maxLimit = 10000; // maximum limit for batching queries
|
|
1176
1198
|
IModelDb._settingPropNamespace = "settings";
|
|
1177
|
-
exports.IModelDb = IModelDb;
|
|
1178
1199
|
/** @public */
|
|
1179
1200
|
(function (IModelDb) {
|
|
1180
1201
|
/** The collection of models in an [[IModelDb]].
|
|
@@ -1257,7 +1278,7 @@ exports.IModelDb = IModelDb;
|
|
|
1257
1278
|
getModelJson(modelIdArg) {
|
|
1258
1279
|
const modelJson = this.tryGetModelJson(modelIdArg);
|
|
1259
1280
|
if (undefined === modelJson) {
|
|
1260
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Model
|
|
1281
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Model=(id: ${modelIdArg.id}, code: ${modelIdArg.code})`);
|
|
1261
1282
|
}
|
|
1262
1283
|
return modelJson;
|
|
1263
1284
|
}
|
|
@@ -1414,7 +1435,7 @@ exports.IModelDb = IModelDb;
|
|
|
1414
1435
|
getElementJson(elementId) {
|
|
1415
1436
|
const elementProps = this.tryGetElementJson(elementId);
|
|
1416
1437
|
if (undefined === elementProps)
|
|
1417
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `reading element
|
|
1438
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `reading element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code: ${elementId.code}}`);
|
|
1418
1439
|
return elementProps;
|
|
1419
1440
|
}
|
|
1420
1441
|
/** Read element data from the iModel as JSON
|
|
@@ -1472,8 +1493,12 @@ exports.IModelDb = IModelDb;
|
|
|
1472
1493
|
*/
|
|
1473
1494
|
getElement(elementId, elementClass) {
|
|
1474
1495
|
const element = this.tryGetElement(elementId, elementClass);
|
|
1475
|
-
if (undefined === element)
|
|
1476
|
-
|
|
1496
|
+
if (undefined === element) {
|
|
1497
|
+
if (typeof elementId === "string" || elementId instanceof core_common_1.Code)
|
|
1498
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Element=${elementId}`);
|
|
1499
|
+
else
|
|
1500
|
+
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.NotFound, `Element={id: ${elementId.id} federationGuid: ${elementId.federationGuid}, code: ${elementId.code}}`);
|
|
1501
|
+
}
|
|
1477
1502
|
return element;
|
|
1478
1503
|
}
|
|
1479
1504
|
/** Get an element by Id, FederationGuid, or Code
|
|
@@ -1807,7 +1832,7 @@ exports.IModelDb = IModelDb;
|
|
|
1807
1832
|
UNION ALL
|
|
1808
1833
|
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
1809
1834
|
if (allAspects.length === 0)
|
|
1810
|
-
core_bentley_1.Logger.
|
|
1835
|
+
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
1811
1836
|
return allAspects;
|
|
1812
1837
|
}
|
|
1813
1838
|
// Check if class is abstract
|
|
@@ -1843,7 +1868,7 @@ exports.IModelDb = IModelDb;
|
|
|
1843
1868
|
SELECT ECInstanceId, ECClassId FROM Bis.ElementUniqueAspect WHERE Element.Id = :elementId AND ECClassId IN (${classIdList})
|
|
1844
1869
|
) OPTIONS USE_JS_PROP_NAMES DO_NOT_TRUNCATE_BLOB`, elementId, excludedClassFullNames);
|
|
1845
1870
|
if (aspects.length === 0)
|
|
1846
|
-
core_bentley_1.Logger.
|
|
1871
|
+
core_bentley_1.Logger.logInfo(BackendLoggerCategory_1.BackendLoggerCategory.ECDb, `No aspects found for class ${aspectClassFullName} and element ${elementId}`);
|
|
1847
1872
|
return aspects;
|
|
1848
1873
|
}
|
|
1849
1874
|
/** Insert a new ElementAspect into the iModel.
|
|
@@ -2170,8 +2195,7 @@ exports.IModelDb = IModelDb;
|
|
|
2170
2195
|
}
|
|
2171
2196
|
}
|
|
2172
2197
|
IModelDb.Tiles = Tiles;
|
|
2173
|
-
})(IModelDb
|
|
2174
|
-
exports.IModelDb = IModelDb;
|
|
2198
|
+
})(IModelDb || (exports.IModelDb = IModelDb = {}));
|
|
2175
2199
|
/**
|
|
2176
2200
|
* A local copy of an iModel from iModelHub that can pull and potentially push changesets.
|
|
2177
2201
|
* BriefcaseDb raises a set of events to allow apps and subsystems to track its object life cycle, including [[onOpen]] and [[onOpened]].
|
|
@@ -2200,7 +2224,12 @@ class BriefcaseDb extends IModelDb {
|
|
|
2200
2224
|
* - the "no locking" flag is not present. This is a property of an iModel, established when the iModel is created in IModelHub.
|
|
2201
2225
|
*/
|
|
2202
2226
|
get useLockServer() {
|
|
2203
|
-
return !this.isReadonly && (this.briefcaseId !== core_common_1.BriefcaseIdValue.Unassigned) && (undefined === this.nativeDb.queryLocalValue(BriefcaseLocalValue.NoLocking));
|
|
2227
|
+
return !this.nativeDb.isReadonly() && (this.briefcaseId !== core_common_1.BriefcaseIdValue.Unassigned) && (undefined === this.nativeDb.queryLocalValue(BriefcaseLocalValue.NoLocking));
|
|
2228
|
+
}
|
|
2229
|
+
// if the iModel uses a lock server, create a ServerBasedLocks LockControl for this BriefcaseDb.
|
|
2230
|
+
makeLockControl() {
|
|
2231
|
+
if (this.useLockServer)
|
|
2232
|
+
this._locks = new ServerBasedLocks_1.ServerBasedLocks(this);
|
|
2204
2233
|
}
|
|
2205
2234
|
constructor(args) {
|
|
2206
2235
|
super({ ...args, changeset: args.nativeDb.getCurrentChangeset() });
|
|
@@ -2210,8 +2239,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2210
2239
|
this.onClosed = new core_bentley_1.BeEvent();
|
|
2211
2240
|
this._openMode = args.openMode;
|
|
2212
2241
|
this.briefcaseId = args.briefcaseId;
|
|
2213
|
-
|
|
2214
|
-
this._locks = new ServerBasedLocks_1.ServerBasedLocks(this);
|
|
2242
|
+
this.makeLockControl();
|
|
2215
2243
|
}
|
|
2216
2244
|
/** Upgrades the profile or domain schemas. File must be closed before this call and is always left closed. */
|
|
2217
2245
|
static async doUpgrade(briefcase, upgradeOptions, description) {
|
|
@@ -2444,14 +2472,24 @@ class BriefcaseDb extends IModelDb {
|
|
|
2444
2472
|
*/
|
|
2445
2473
|
async executeWritable(func) {
|
|
2446
2474
|
const fileName = this.pathName;
|
|
2475
|
+
const isReadonly = this.isReadonly;
|
|
2476
|
+
let locks;
|
|
2447
2477
|
try {
|
|
2448
|
-
if (
|
|
2478
|
+
if (isReadonly) {
|
|
2449
2479
|
this.closeAndReopen(core_bentley_1.OpenMode.ReadWrite, fileName);
|
|
2480
|
+
locks = this.locks;
|
|
2481
|
+
this.makeLockControl(); // create a ServerBasedLocks, if necessary
|
|
2482
|
+
}
|
|
2450
2483
|
await func();
|
|
2451
2484
|
}
|
|
2452
2485
|
finally {
|
|
2453
|
-
if (
|
|
2486
|
+
if (isReadonly) {
|
|
2487
|
+
if (locks !== this._locks) { // did we have to create a ServerBasedLocks?
|
|
2488
|
+
this.locks.close(); // yes, close it and reset back to previous
|
|
2489
|
+
this._locks = locks;
|
|
2490
|
+
}
|
|
2454
2491
|
this.closeAndReopen(core_bentley_1.OpenMode.Readonly, fileName);
|
|
2492
|
+
}
|
|
2455
2493
|
}
|
|
2456
2494
|
}
|
|
2457
2495
|
closeAndReopen(openMode, fileName) {
|
|
@@ -2479,8 +2517,11 @@ class BriefcaseDb extends IModelDb {
|
|
|
2479
2517
|
throw new core_common_1.IModelError(core_bentley_1.ChangeSetStatus.HasUncommittedChanges, "Cannot push with unsaved changes");
|
|
2480
2518
|
if (!this.nativeDb.hasPendingTxns())
|
|
2481
2519
|
return; // nothing to push
|
|
2482
|
-
|
|
2483
|
-
this.
|
|
2520
|
+
// pushing changes requires a writeable briefcase
|
|
2521
|
+
await this.executeWritable(async () => {
|
|
2522
|
+
await BriefcaseManager_1.BriefcaseManager.pullMergePush(this, arg);
|
|
2523
|
+
this.initializeIModelDb();
|
|
2524
|
+
});
|
|
2484
2525
|
const changeset = this.changeset;
|
|
2485
2526
|
IpcHost_1.IpcHost.notifyTxns(this, "notifyPushedChanges", changeset);
|
|
2486
2527
|
}
|
|
@@ -2489,6 +2530,7 @@ class BriefcaseDb extends IModelDb {
|
|
|
2489
2530
|
this.onClosed.raiseEvent();
|
|
2490
2531
|
}
|
|
2491
2532
|
}
|
|
2533
|
+
exports.BriefcaseDb = BriefcaseDb;
|
|
2492
2534
|
/**
|
|
2493
2535
|
* Event raised just before a BriefcaseDb is opened. Supplies the arguments that will be used to open the BriefcaseDb.
|
|
2494
2536
|
* Throw an exception to stop the open.
|
|
@@ -2510,7 +2552,6 @@ BriefcaseDb.onOpen = new core_bentley_1.BeEvent();
|
|
|
2510
2552
|
BriefcaseDb.onOpened = new core_bentley_1.BeEvent();
|
|
2511
2553
|
/** @alpha */
|
|
2512
2554
|
BriefcaseDb.onCodeServiceCreated = new core_bentley_1.BeEvent();
|
|
2513
|
-
exports.BriefcaseDb = BriefcaseDb;
|
|
2514
2555
|
/** Used to reattach Daemon from a user's accessToken for V2 checkpoints.
|
|
2515
2556
|
* @note Reattach only happens if the previous access token either has expired or is about to expire within an application-supplied safety duration.
|
|
2516
2557
|
*/
|
|
@@ -2698,9 +2739,9 @@ class SnapshotDb extends IModelDb {
|
|
|
2698
2739
|
}
|
|
2699
2740
|
}
|
|
2700
2741
|
}
|
|
2742
|
+
exports.SnapshotDb = SnapshotDb;
|
|
2701
2743
|
SnapshotDb.onOpen = new core_bentley_1.BeEvent();
|
|
2702
2744
|
SnapshotDb.onOpened = new core_bentley_1.BeEvent();
|
|
2703
|
-
exports.SnapshotDb = SnapshotDb;
|
|
2704
2745
|
/**
|
|
2705
2746
|
* Standalone iModels are read/write files that are not associated with an iTwin or managed by iModelHub.
|
|
2706
2747
|
* They are relevant only for testing, or for small-scale single-user scenarios.
|