@itwin/core-backend 5.2.0-dev.8 → 5.3.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -1
- package/lib/cjs/BackendHubAccess.d.ts +2 -0
- package/lib/cjs/BackendHubAccess.d.ts.map +1 -1
- package/lib/cjs/BackendHubAccess.js.map +1 -1
- package/lib/cjs/BackendLoggerCategory.d.ts +6 -0
- package/lib/cjs/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/cjs/BackendLoggerCategory.js +6 -0
- package/lib/cjs/BackendLoggerCategory.js.map +1 -1
- package/lib/cjs/BriefcaseManager.d.ts +57 -3
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +151 -42
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/CloudSqlite.d.ts +4 -0
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/ECDb.d.ts +8 -0
- package/lib/cjs/ECDb.d.ts.map +1 -1
- package/lib/cjs/ECDb.js +22 -0
- package/lib/cjs/ECDb.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +2 -0
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +54 -3
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +87 -9
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelHost.d.ts +11 -1
- package/lib/cjs/IModelHost.d.ts.map +1 -1
- package/lib/cjs/IModelHost.js +5 -0
- package/lib/cjs/IModelHost.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts +1 -5
- package/lib/cjs/IModelIncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js +0 -6
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts +8 -0
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +11 -0
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/StashManager.d.ts +175 -0
- package/lib/cjs/StashManager.d.ts.map +1 -0
- package/lib/cjs/StashManager.js +306 -0
- package/lib/cjs/StashManager.js.map +1 -0
- package/lib/cjs/TxnManager.d.ts +226 -15
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +249 -23
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +10 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +15 -6
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.d.ts +3 -2
- package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/LeaderGeometry.js +5 -4
- package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.d.ts +52 -24
- package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js +49 -59
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts +2 -0
- package/lib/cjs/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextAnnotationGeometry.js +26 -19
- package/lib/cjs/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockGeometry.js +8 -0
- package/lib/cjs/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.d.ts +49 -36
- package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/cjs/annotations/TextBlockLayout.js +204 -135
- package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/Symbols.d.ts +1 -0
- package/lib/cjs/internal/Symbols.d.ts.map +1 -1
- package/lib/cjs/internal/Symbols.js +2 -1
- package/lib/cjs/internal/Symbols.js.map +1 -1
- package/lib/cjs/internal/annotations/fields.d.ts +2 -12
- package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
- package/lib/cjs/internal/annotations/fields.js +49 -45
- package/lib/cjs/internal/annotations/fields.js.map +1 -1
- package/lib/cjs/workspace/Workspace.d.ts +1 -1
- package/lib/cjs/workspace/Workspace.js.map +1 -1
- package/lib/esm/BackendHubAccess.d.ts +2 -0
- package/lib/esm/BackendHubAccess.d.ts.map +1 -1
- package/lib/esm/BackendHubAccess.js.map +1 -1
- package/lib/esm/BackendLoggerCategory.d.ts +6 -0
- package/lib/esm/BackendLoggerCategory.d.ts.map +1 -1
- package/lib/esm/BackendLoggerCategory.js +6 -0
- package/lib/esm/BackendLoggerCategory.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +57 -3
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +152 -43
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/CloudSqlite.d.ts +4 -0
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/ECDb.d.ts +8 -0
- package/lib/esm/ECDb.d.ts.map +1 -1
- package/lib/esm/ECDb.js +22 -0
- package/lib/esm/ECDb.js.map +1 -1
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +2 -0
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +54 -3
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +88 -10
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelHost.d.ts +11 -1
- package/lib/esm/IModelHost.d.ts.map +1 -1
- package/lib/esm/IModelHost.js +5 -0
- package/lib/esm/IModelHost.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts +1 -5
- package/lib/esm/IModelIncrementalSchemaLocater.d.ts.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js +0 -6
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.d.ts +8 -0
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +11 -0
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/StashManager.d.ts +175 -0
- package/lib/esm/StashManager.d.ts.map +1 -0
- package/lib/esm/StashManager.js +301 -0
- package/lib/esm/StashManager.js.map +1 -0
- package/lib/esm/TxnManager.d.ts +226 -15
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +247 -21
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +10 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js +13 -5
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.d.ts +3 -2
- package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/LeaderGeometry.js +5 -4
- package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.d.ts +52 -24
- package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js +51 -61
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts +2 -0
- package/lib/esm/annotations/TextAnnotationGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextAnnotationGeometry.js +26 -19
- package/lib/esm/annotations/TextAnnotationGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockGeometry.js +8 -0
- package/lib/esm/annotations/TextBlockGeometry.js.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.d.ts +49 -36
- package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
- package/lib/esm/annotations/TextBlockLayout.js +205 -136
- package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/Symbols.d.ts +1 -0
- package/lib/esm/internal/Symbols.d.ts.map +1 -1
- package/lib/esm/internal/Symbols.js +1 -0
- package/lib/esm/internal/Symbols.js.map +1 -1
- package/lib/esm/internal/annotations/fields.d.ts +2 -12
- package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
- package/lib/esm/internal/annotations/fields.js +51 -47
- package/lib/esm/internal/annotations/fields.js.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts +5 -1
- package/lib/esm/test/AnnotationTestUtils.d.ts.map +1 -1
- package/lib/esm/test/AnnotationTestUtils.js +6 -1
- package/lib/esm/test/AnnotationTestUtils.js.map +1 -1
- package/lib/esm/test/annotations/Fields.test.js +163 -46
- package/lib/esm/test/annotations/Fields.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +12 -10
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/annotations/TextAnnotation.test.js +299 -43
- package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
- package/lib/esm/test/annotations/TextBlock.test.js +453 -86
- package/lib/esm/test/annotations/TextBlock.test.js.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts +46 -0
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.d.ts.map +1 -1
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js +20 -2
- package/lib/esm/test/assets/IncrementalSchemaLocater/configs/simple.config.js.map +1 -1
- package/lib/esm/test/ecdb/ECDb.test.js +71 -1
- package/lib/esm/test/ecdb/ECDb.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.d.ts +2 -0
- package/lib/esm/test/hubaccess/Rebase.test.d.ts.map +1 -0
- package/lib/esm/test/hubaccess/Rebase.test.js +640 -0
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -0
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js +20 -20
- package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js +3 -3
- package/lib/esm/test/incrementalSchemaLocater/IncrementalLoading.test.js.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts +16 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.d.ts.map +1 -1
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js +47 -0
- package/lib/esm/test/incrementalSchemaLocater/utils/TestSqlSchemaLocater.js.map +1 -1
- package/lib/esm/test/standalone/ChangeMerge.test.js +15 -19
- package/lib/esm/test/standalone/ChangeMerge.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +131 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/MergeConflict.test.js +3 -3
- package/lib/esm/test/standalone/MergeConflict.test.js.map +1 -1
- package/lib/esm/workspace/Workspace.d.ts +1 -1
- package/lib/esm/workspace/Workspace.js.map +1 -1
- package/package.json +13 -13
package/lib/cjs/TxnManager.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, DbConflictResolution, DbResult, Id64String, IModelStatus } from "@itwin/core-bentley";
|
|
5
5
|
import { EntityIdAndClassIdIterable, ModelGeometryChangesProps, ModelIdAndGeometryGuid } from "@itwin/core-common";
|
|
6
|
-
import { BriefcaseDb, StandaloneDb } from "./IModelDb";
|
|
6
|
+
import { BriefcaseDb, SaveChangesArgs, StandaloneDb } from "./IModelDb";
|
|
7
7
|
import { RelationshipProps } from "./Relationship";
|
|
8
|
-
import { DbRebaseChangesetConflictArgs, RebaseChangesetConflictArgs
|
|
8
|
+
import { DbRebaseChangesetConflictArgs, RebaseChangesetConflictArgs } from "./internal/ChangesetConflictArgs";
|
|
9
9
|
/** A string that identifies a Txn.
|
|
10
10
|
* @public @preview
|
|
11
11
|
*/
|
|
@@ -58,20 +58,163 @@ export interface ChangeInstanceKey {
|
|
|
58
58
|
/** Strictly for tests. @internal */
|
|
59
59
|
export declare function setMaxEntitiesPerEvent(max: number): number;
|
|
60
60
|
/**
|
|
61
|
-
* @
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
64
|
-
export
|
|
61
|
+
* @alpha
|
|
62
|
+
* Transaction types
|
|
63
|
+
*/
|
|
64
|
+
export type TxnType = "Data" | "ECSchema" | "Ddl";
|
|
65
|
+
/**
|
|
66
|
+
* @alpha
|
|
67
|
+
* Transaction modes
|
|
68
|
+
*/
|
|
69
|
+
export type TxnMode = "direct" | "indirect";
|
|
70
|
+
/**
|
|
71
|
+
* @alpha
|
|
72
|
+
* Represents the properties of a transaction within the transaction manager.
|
|
73
|
+
*
|
|
74
|
+
* @property id - The unique identifier for the transaction.
|
|
75
|
+
* @property sessionId - The identifier of the session to which the transaction belongs.
|
|
76
|
+
* @property nextId - (Optional) The identifier of the next transaction in the sequence.
|
|
77
|
+
* @property prevId - (Optional) The identifier of the previous transaction in the sequence.
|
|
78
|
+
* @property props - The arguments or properties associated with the save changes operation.
|
|
79
|
+
* @property type - The type of transaction, which can be "Data", "ECSchema", or "Ddl".
|
|
80
|
+
* @property reversed - Indicates whether the transaction has been reversed.
|
|
81
|
+
* @property grouped - Indicates whether the transaction is grouped with others.
|
|
82
|
+
* @property timestamp - The timestamp when the transaction was created.
|
|
83
|
+
*/
|
|
84
|
+
export interface TxnProps {
|
|
85
|
+
id: TxnIdString;
|
|
86
|
+
sessionId: number;
|
|
87
|
+
nextId?: TxnIdString;
|
|
88
|
+
prevId?: TxnIdString;
|
|
89
|
+
props: SaveChangesArgs;
|
|
90
|
+
type: TxnType;
|
|
91
|
+
reversed: boolean;
|
|
92
|
+
grouped: boolean;
|
|
93
|
+
timestamp: string;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Manages the process of merging and rebasing local changes (transactions) in a [[BriefcaseDb]] or [[StandaloneDb]].
|
|
97
|
+
*
|
|
98
|
+
* The `RebaseManager` coordinates the rebase of local transactions when pulling and merging changes from other sources,
|
|
99
|
+
* such as remote repositories or other users. It provides mechanisms to handle transaction conflicts, register custom conflict
|
|
100
|
+
* handlers, and manage the rebase workflow. This includes resuming rebases, invoking user-defined handlers for conflict resolution,
|
|
101
|
+
* and tracking the current merge/rebase state.
|
|
102
|
+
*
|
|
103
|
+
* Key responsibilities:
|
|
104
|
+
* - Orchestrates the rebase of local transactions after a pull/merge operation.
|
|
105
|
+
* - Allows registration and removal of custom conflict handlers to resolve changeset conflicts during rebase.
|
|
106
|
+
* - Provides methods to check the current merge/rebase state.
|
|
107
|
+
* - Raises events before and after each transaction is rebased.
|
|
108
|
+
* - Ensures changes are saved or aborted appropriately based on the outcome of the rebase process.
|
|
109
|
+
*
|
|
110
|
+
* @alpha
|
|
111
|
+
*/
|
|
112
|
+
export declare class RebaseManager {
|
|
65
113
|
private _iModel;
|
|
66
114
|
private _conflictHandlers?;
|
|
115
|
+
private _customHandler?;
|
|
67
116
|
constructor(_iModel: BriefcaseDb | StandaloneDb);
|
|
68
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Resumes the rebase process for the current iModel, applying any pending local changes
|
|
119
|
+
* on top of the latest pulled changes from the remote source.
|
|
120
|
+
*
|
|
121
|
+
* This method performs the following steps:
|
|
122
|
+
* 1. Begins the rebase process using the native database.
|
|
123
|
+
* 2. Iterates through each transaction that needs to be rebased:
|
|
124
|
+
* - Retrieves transaction properties.
|
|
125
|
+
* - Raises events before and after rebasing each transaction.
|
|
126
|
+
* - Optionally reinstates local changes based on the rebase handler.
|
|
127
|
+
* - Optionally recomputes transaction data using the rebase handler.
|
|
128
|
+
* - Updates the transaction in the native database.
|
|
129
|
+
* 3. Ends the rebase process and saves changes if the database is not read-only.
|
|
130
|
+
* 4. Drops any restore point associated with the pull-merge operation.
|
|
131
|
+
*
|
|
132
|
+
* If an error occurs during the process, the rebase is aborted and the error is rethrown.
|
|
133
|
+
*
|
|
134
|
+
* @throws {Error} If a transaction cannot be found or if any step in the rebase process fails.
|
|
135
|
+
*/
|
|
136
|
+
resume(): Promise<void>;
|
|
137
|
+
/**
|
|
138
|
+
* Determines whether the current transaction can be aborted.
|
|
139
|
+
*
|
|
140
|
+
* This method checks if a transaction is currently in progress and if a specific restore point,
|
|
141
|
+
* identified by `BriefcaseManager.PULL_MERGE_RESTORE_POINT_NAME`, exists in the briefcase manager.
|
|
142
|
+
*
|
|
143
|
+
* @returns {boolean} Returns `true` if a transaction is in progress and the required restore point exists; otherwise, returns `false`.
|
|
144
|
+
*/
|
|
145
|
+
canAbort(): boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Aborts the current transaction by restoring the iModel to a predefined restore point.
|
|
148
|
+
*
|
|
149
|
+
* If a restore point is available (as determined by `canAbort()`), this method restores the iModel
|
|
150
|
+
* to the state saved at the restore point named by `BriefcaseManager.PULL_MERGE_RESTORE_POINT_NAME`.
|
|
151
|
+
* If no restore point is available, an error is thrown.
|
|
152
|
+
*
|
|
153
|
+
* @returns A promise that resolves when the restore operation is complete.
|
|
154
|
+
* @throws {Error} If there is no restore point to abort to.
|
|
155
|
+
*/
|
|
156
|
+
abort(): Promise<void>;
|
|
157
|
+
/**
|
|
158
|
+
* Sets the handler to be invoked for rebase operations.
|
|
159
|
+
*
|
|
160
|
+
* @param handler - The {@link RebaseHandler} to handle rebase events.
|
|
161
|
+
*/
|
|
162
|
+
setCustomHandler(handler: RebaseHandler): void;
|
|
163
|
+
/**
|
|
164
|
+
* Determines whether a transaction is currently in progress.
|
|
165
|
+
*
|
|
166
|
+
* @returns {boolean} Returns `true` if there is an active transaction stage, otherwise `false`.
|
|
167
|
+
*/
|
|
69
168
|
inProgress(): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Indicates whether the current transaction manager is in the "Rebasing" stage.
|
|
171
|
+
*
|
|
172
|
+
* This property checks the internal native database's merge stage to determine if a rebase operation is in progress.
|
|
173
|
+
*
|
|
174
|
+
* @returns `true` if the transaction manager is currently rebasing; otherwise, `false`.
|
|
175
|
+
*/
|
|
176
|
+
get isRebasing(): boolean;
|
|
177
|
+
/**
|
|
178
|
+
* Indicates whether the current iModel is in the process of merging changes from a pull operation.
|
|
179
|
+
*
|
|
180
|
+
* @returns `true` if the iModel is currently merging changes; otherwise, `false`.
|
|
181
|
+
*/
|
|
182
|
+
get isMerging(): boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Attempts to resolve a changeset conflict by invoking registered conflict handlers in sequence.
|
|
185
|
+
*
|
|
186
|
+
* Iterates through the linked list of conflict handlers, passing the provided conflict arguments to each handler.
|
|
187
|
+
* If a handler returns a defined resolution, logs the resolution and returns it immediately.
|
|
188
|
+
* If no handler resolves the conflict, returns `undefined`.
|
|
189
|
+
*
|
|
190
|
+
* @param args - The arguments describing the changeset conflict to resolve.
|
|
191
|
+
* @returns The conflict resolution provided by a handler, or `undefined` if no handler resolves the conflict.
|
|
192
|
+
*/
|
|
70
193
|
onConflict(args: RebaseChangesetConflictArgs): DbConflictResolution | undefined;
|
|
194
|
+
/**
|
|
195
|
+
* Registers a new conflict handler for rebase changeset conflicts.
|
|
196
|
+
*
|
|
197
|
+
* @param args - An object containing:
|
|
198
|
+
* - `id`: A unique identifier for the conflict handler.
|
|
199
|
+
* - `handler`: A function that handles rebase changeset conflicts and returns a `DbConflictResolution` or `undefined`.
|
|
200
|
+
* @throws IModelError if a conflict handler with the same `id` already exists.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Conflict handlers are used during changeset rebase operations to resolve conflicts.
|
|
204
|
+
* Each handler must have a unique `id`. Attempting to register a handler with a duplicate `id` will result in an error.
|
|
205
|
+
*/
|
|
71
206
|
addConflictHandler(args: {
|
|
72
207
|
id: string;
|
|
73
208
|
handler: (args: RebaseChangesetConflictArgs) => DbConflictResolution | undefined;
|
|
74
209
|
}): void;
|
|
210
|
+
/**
|
|
211
|
+
* Removes a conflict handler from the internal linked list by its identifier.
|
|
212
|
+
*
|
|
213
|
+
* @param id - The unique identifier of the conflict handler to remove.
|
|
214
|
+
*
|
|
215
|
+
* If the handler with the specified `id` exists in the list, it will be removed.
|
|
216
|
+
* If no handler with the given `id` is found, the method does nothing.
|
|
217
|
+
*/
|
|
75
218
|
removeConflictHandler(id: string): void;
|
|
76
219
|
}
|
|
77
220
|
/** Manages local changes to a [[BriefcaseDb]] or [[StandaloneDb]] via [Txns]($docs/learning/InteractiveEditing.md)
|
|
@@ -84,7 +227,7 @@ export declare class TxnManager {
|
|
|
84
227
|
/** @internal */
|
|
85
228
|
get isDisposed(): boolean;
|
|
86
229
|
/** @internal */
|
|
87
|
-
readonly
|
|
230
|
+
readonly rebaser: RebaseManager;
|
|
88
231
|
/** @internal */
|
|
89
232
|
constructor(_iModel: BriefcaseDb | StandaloneDb);
|
|
90
233
|
/** Array of errors from dependency propagation */
|
|
@@ -129,9 +272,29 @@ export declare class TxnManager {
|
|
|
129
272
|
protected _onBeforeUndoRedo(isUndo: boolean): void;
|
|
130
273
|
/** @internal */
|
|
131
274
|
protected _onAfterUndoRedo(isUndo: boolean): void;
|
|
132
|
-
private _onRebaseTxnBegin;
|
|
133
|
-
private _onRebaseTxnEnd;
|
|
134
275
|
private _onRebaseLocalTxnConflict;
|
|
276
|
+
/**
|
|
277
|
+
* @alpha
|
|
278
|
+
* Retrieves the txn properties for a given txn ID.
|
|
279
|
+
*
|
|
280
|
+
* @param id - The unique identifier of the transaction.
|
|
281
|
+
* @returns The properties of the transaction if found; otherwise, `undefined`.
|
|
282
|
+
*/
|
|
283
|
+
getTxnProps(id: TxnIdString): TxnProps | undefined;
|
|
284
|
+
/**
|
|
285
|
+
* @alpha
|
|
286
|
+
* Iterates over all transactions in the sequence, yielding each transaction's properties.
|
|
287
|
+
*
|
|
288
|
+
* @yields {TxnProps} The properties of each transaction in the sequence.
|
|
289
|
+
*/
|
|
290
|
+
queryTxns(): Generator<TxnProps>;
|
|
291
|
+
/**
|
|
292
|
+
* @alpha
|
|
293
|
+
* Retrieves the properties of the last saved txn via `IModelDb.saveChanges()`, if available.
|
|
294
|
+
*
|
|
295
|
+
* @returns The properties of the last saved txn, or `undefined` if none exist.
|
|
296
|
+
*/
|
|
297
|
+
getLastSavedTxnProps(): TxnProps | undefined;
|
|
135
298
|
/** Dependency handlers may call method this to report a validation error.
|
|
136
299
|
* @param error The error. If error.fatal === true, the transaction will cancel rather than commit.
|
|
137
300
|
*/
|
|
@@ -178,12 +341,18 @@ export declare class TxnManager {
|
|
|
178
341
|
* @see [[onReplayExternalTxns]] for the event raised before the changes are applied.
|
|
179
342
|
*/
|
|
180
343
|
readonly onReplayedExternalTxns: BeEvent<() => void>;
|
|
181
|
-
/** @internal */
|
|
182
|
-
readonly onRebaseTxnBegin: BeEvent<(txn: TxnArgs) => void>;
|
|
183
|
-
/** @internal */
|
|
184
|
-
readonly onRebaseTxnEnd: BeEvent<(txn: TxnArgs) => void>;
|
|
185
344
|
/**
|
|
186
|
-
*
|
|
345
|
+
* @alpha
|
|
346
|
+
* Event raised when a rebase transaction begins.
|
|
347
|
+
*/
|
|
348
|
+
readonly onRebaseTxnBegin: BeEvent<(txn: TxnProps) => void>;
|
|
349
|
+
/**
|
|
350
|
+
* @alpha
|
|
351
|
+
* Event raised when a rebase transaction ends.
|
|
352
|
+
*/
|
|
353
|
+
readonly onRebaseTxnEnd: BeEvent<(txn: TxnProps) => void>;
|
|
354
|
+
/**
|
|
355
|
+
* if handler is set and it does not return undefined then default handler will not be called
|
|
187
356
|
* @internal
|
|
188
357
|
* */
|
|
189
358
|
appCustomConflictHandler?: (args: DbRebaseChangesetConflictArgs) => DbConflictResolution | undefined;
|
|
@@ -259,6 +428,11 @@ export declare class TxnManager {
|
|
|
259
428
|
queryPreviousTxnId(txnId: TxnIdString): TxnIdString;
|
|
260
429
|
/** Get the Id of the current (tip) transaction. */
|
|
261
430
|
getCurrentTxnId(): TxnIdString;
|
|
431
|
+
/**
|
|
432
|
+
* @alpha
|
|
433
|
+
* Get the Id of the current session.
|
|
434
|
+
*/
|
|
435
|
+
getCurrentSessionId(): number;
|
|
262
436
|
/** Get the description that was supplied when the specified transaction was saved. */
|
|
263
437
|
getTxnDescription(txnId: TxnIdString): string;
|
|
264
438
|
/** Test if a TxnId is valid */
|
|
@@ -272,6 +446,11 @@ export declare class TxnManager {
|
|
|
272
446
|
* @see [[IModelDb.saveChanges]]
|
|
273
447
|
*/
|
|
274
448
|
get hasUnsavedChanges(): boolean;
|
|
449
|
+
/**
|
|
450
|
+
* @alpha
|
|
451
|
+
* Query if there are any pending schema changes in this IModelDb.
|
|
452
|
+
*/
|
|
453
|
+
get hasPendingSchemaChanges(): boolean;
|
|
275
454
|
/**
|
|
276
455
|
* Query if there are changes in memory that have not been saved to the iModelDb or if there are Txns that are waiting to be pushed.
|
|
277
456
|
* @see [[IModelDb.saveChanges]]
|
|
@@ -292,5 +471,37 @@ export declare class TxnManager {
|
|
|
292
471
|
* changes to the iModel, for debugging/diagnostic purposes, as reported by [sqlite3session_memory_used](https://www.sqlite.org/session/sqlite3session_memory_used.html).
|
|
293
472
|
*/
|
|
294
473
|
getChangeTrackingMemoryUsed(): number;
|
|
474
|
+
/**
|
|
475
|
+
* @alpha
|
|
476
|
+
* Get the current transaction mode.
|
|
477
|
+
* @returns The current transaction mode, either "direct" or "indirect".
|
|
478
|
+
*/
|
|
479
|
+
getMode(): TxnMode;
|
|
480
|
+
/**
|
|
481
|
+
* @alpha
|
|
482
|
+
* Execute a series of changes in an indirect transaction.
|
|
483
|
+
* @param callback The function containing the changes to make.
|
|
484
|
+
*/
|
|
485
|
+
withIndirectTxnMode(callback: () => void): void;
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Interface for handling rebase operations on transactions.
|
|
489
|
+
* @alpha
|
|
490
|
+
*/
|
|
491
|
+
export interface RebaseHandler {
|
|
492
|
+
/**
|
|
493
|
+
* Determine whether a transaction should be reinstated during a rebase operation.
|
|
494
|
+
* @param txn The transaction to check.
|
|
495
|
+
*
|
|
496
|
+
* @alpha
|
|
497
|
+
*/
|
|
498
|
+
shouldReinstate(txn: TxnProps): boolean;
|
|
499
|
+
/**
|
|
500
|
+
* Recompute the changes for a given transaction.
|
|
501
|
+
* @param txn The transaction to recompute.
|
|
502
|
+
*
|
|
503
|
+
* @alpha
|
|
504
|
+
*/
|
|
505
|
+
recompute(txn: TxnProps): Promise<void>;
|
|
295
506
|
}
|
|
296
507
|
//# sourceMappingURL=TxnManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TxnManager.d.ts","sourceRoot":"","sources":["../../src/TxnManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EACG,OAAO,EAAmD,oBAAoB,EAAE,QAAQ,EAAa,UAAU,EAAE,YAAY,EACtI,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,0BAA0B,EAAe,yBAAyB,EAAE,sBAAsB,EAA4D,MAAM,oBAAoB,CAAC;AAE1L,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CA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