@itwin/core-frontend 5.7.0-dev.1 → 5.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/lib/cjs/BriefcaseTxns.d.ts +76 -1
- package/lib/cjs/BriefcaseTxns.d.ts.map +1 -1
- package/lib/cjs/BriefcaseTxns.js +118 -7
- package/lib/cjs/BriefcaseTxns.js.map +1 -1
- package/lib/esm/BriefcaseTxns.d.ts +76 -1
- package/lib/esm/BriefcaseTxns.d.ts.map +1 -1
- package/lib/esm/BriefcaseTxns.js +118 -7
- package/lib/esm/BriefcaseTxns.js.map +1 -1
- package/package.json +20 -20
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module IModelConnection
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, IModelStatus } from "@itwin/core-bentley";
|
|
5
|
-
import { ChangesetIndexAndId, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RootSubjectProps, TxnNotifications } from "@itwin/core-common";
|
|
5
|
+
import { ChangesetIdWithIndex, ChangesetIndexAndId, ChangesetProps, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RootSubjectProps, TxnNotifications, TxnProps } from "@itwin/core-common";
|
|
6
6
|
import { Range3dProps, XYZProps } from "@itwin/core-geometry";
|
|
7
7
|
import { BriefcaseConnection } from "./BriefcaseConnection";
|
|
8
8
|
import { NotificationHandler } from "./IpcApp";
|
|
@@ -82,6 +82,57 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
|
|
|
82
82
|
* @see [[BriefcaseConnection.pushChanges]].
|
|
83
83
|
*/
|
|
84
84
|
readonly onChangesPushed: BeEvent<(parentChangeset: ChangesetIndexAndId) => void>;
|
|
85
|
+
/** Event raised before pull merge process begins.
|
|
86
|
+
* @alpha
|
|
87
|
+
*/
|
|
88
|
+
readonly onPullMergeBegin: BeEvent<(changeset: ChangesetIdWithIndex) => void>;
|
|
89
|
+
/** Event raised before a rebase operation begins.
|
|
90
|
+
* @alpha
|
|
91
|
+
*/
|
|
92
|
+
readonly onRebaseBegin: BeEvent<(txns: TxnProps[]) => void>;
|
|
93
|
+
/** Event raised before a transaction is rebased.
|
|
94
|
+
* @alpha
|
|
95
|
+
*/
|
|
96
|
+
readonly onRebaseTxnBegin: BeEvent<(txnProps: TxnProps) => void>;
|
|
97
|
+
/**
|
|
98
|
+
* Event raised after a transaction is rebased.
|
|
99
|
+
* @alpha
|
|
100
|
+
*/
|
|
101
|
+
readonly onRebaseTxnEnd: BeEvent<(txnProps: TxnProps) => void>;
|
|
102
|
+
/**
|
|
103
|
+
* Event raised after a rebase operation ends.
|
|
104
|
+
* @alpha
|
|
105
|
+
*/
|
|
106
|
+
readonly onRebaseEnd: BeEvent<(txns: TxnProps[]) => void>;
|
|
107
|
+
/**
|
|
108
|
+
* Event raised after the pull merge process ends.
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
readonly onPullMergeEnd: BeEvent<(changeset: ChangesetIdWithIndex) => void>;
|
|
112
|
+
/** Event raised before incoming changes are applied.
|
|
113
|
+
* @alpha
|
|
114
|
+
*/
|
|
115
|
+
readonly onApplyIncomingChangesBegin: BeEvent<(changesets: ChangesetProps[]) => void>;
|
|
116
|
+
/** Event raised after incoming changes are applied.
|
|
117
|
+
* @alpha
|
|
118
|
+
*/
|
|
119
|
+
readonly onApplyIncomingChangesEnd: BeEvent<(changes: ChangesetProps[]) => void>;
|
|
120
|
+
/** Event raised before local changes are reversed.
|
|
121
|
+
* @alpha
|
|
122
|
+
*/
|
|
123
|
+
readonly onReverseLocalChangesBegin: BeEvent<() => void>;
|
|
124
|
+
/** Event raised after local changes are reversed.
|
|
125
|
+
* @alpha
|
|
126
|
+
*/
|
|
127
|
+
readonly onReverseLocalChangesEnd: BeEvent<(txns: TxnProps[]) => void>;
|
|
128
|
+
/** Event raised before downloading changesets begins.
|
|
129
|
+
* @alpha
|
|
130
|
+
*/
|
|
131
|
+
readonly onDownloadChangesetsBegin: BeEvent<() => void>;
|
|
132
|
+
/** Event raised after downloading changesets ends.
|
|
133
|
+
* @alpha
|
|
134
|
+
*/
|
|
135
|
+
readonly onDownloadChangesetsEnd: BeEvent<() => void>;
|
|
85
136
|
/** @internal */
|
|
86
137
|
constructor(iModel: BriefcaseConnection);
|
|
87
138
|
/** @internal */
|
|
@@ -176,5 +227,29 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
|
|
|
176
227
|
notifyEcefLocationChanged(ecef: EcefLocationProps | undefined): void;
|
|
177
228
|
/** @internal */
|
|
178
229
|
notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined): void;
|
|
230
|
+
/** @internal */
|
|
231
|
+
notifyPullMergeBegin(changeset: ChangesetIdWithIndex): void;
|
|
232
|
+
/** @internal */
|
|
233
|
+
notifyPullMergeEnd(changeset: ChangesetIdWithIndex): void;
|
|
234
|
+
/** @internal */
|
|
235
|
+
notifyApplyIncomingChangesBegin(changes: ChangesetProps[]): void;
|
|
236
|
+
/** @internal */
|
|
237
|
+
notifyApplyIncomingChangesEnd(changes: ChangesetProps[]): void;
|
|
238
|
+
/** @internal */
|
|
239
|
+
notifyReverseLocalChangesBegin(): void;
|
|
240
|
+
/** @internal */
|
|
241
|
+
notifyReverseLocalChangesEnd(txns: TxnProps[]): void;
|
|
242
|
+
/** @internal */
|
|
243
|
+
notifyDownloadChangesetsBegin(): void;
|
|
244
|
+
/** @internal */
|
|
245
|
+
notifyDownloadChangesetsEnd(): void;
|
|
246
|
+
/** @internal */
|
|
247
|
+
notifyRebaseBegin(txns: TxnProps[]): void;
|
|
248
|
+
/** @internal */
|
|
249
|
+
notifyRebaseEnd(txns: TxnProps[]): void;
|
|
250
|
+
/** @internal */
|
|
251
|
+
notifyRebaseTxnBegin(txn: TxnProps): void;
|
|
252
|
+
/** @internal */
|
|
253
|
+
notifyRebaseTxnEnd(txn: TxnProps): void;
|
|
179
254
|
}
|
|
180
255
|
//# sourceMappingURL=BriefcaseTxns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseTxns.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EAAgB,iBAAiB,EAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"BriefcaseTxns.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EAAE,cAAc,EAAgB,iBAAiB,EAAiB,kBAAkB,EACvG,sBAAsB,EAAE,yBAAyB,EAAkB,gBAAgB,EAAE,gBAAgB,EACrG,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAU,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAiB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH,8BAAsB,4BAA6B,SAAQ,mBAAmB;IAChE,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IAChC,aAAoB,oBAAoB,IAAI,MAAM,CAAC;IACnD,IAAW,WAAW,WAA0D;CACjF;AAED;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,4BAA6B,YAAW,gBAAgB;IACzF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,CAAiB;IAElC,gBAAgB;IAChB,IAAW,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I,EAAE,QAAQ,EAAE;IAGzC,gBAAgB;IACT,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGvC,gBAAgB;IACT,oBAAoB,CAAC,GAAG,EAAE,QAAQ;IAGzC,gBAAgB;IACT,kBAAkB,CAAC,GAAG,EAAE,QAAQ;CAGxC"}
|
package/lib/cjs/BriefcaseTxns.js
CHANGED
|
@@ -93,6 +93,57 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
93
93
|
* @see [[BriefcaseConnection.pushChanges]].
|
|
94
94
|
*/
|
|
95
95
|
onChangesPushed = new core_bentley_1.BeEvent();
|
|
96
|
+
/** Event raised before pull merge process begins.
|
|
97
|
+
* @alpha
|
|
98
|
+
*/
|
|
99
|
+
onPullMergeBegin = new core_bentley_1.BeEvent();
|
|
100
|
+
/** Event raised before a rebase operation begins.
|
|
101
|
+
* @alpha
|
|
102
|
+
*/
|
|
103
|
+
onRebaseBegin = new core_bentley_1.BeEvent();
|
|
104
|
+
/** Event raised before a transaction is rebased.
|
|
105
|
+
* @alpha
|
|
106
|
+
*/
|
|
107
|
+
onRebaseTxnBegin = new core_bentley_1.BeEvent();
|
|
108
|
+
/**
|
|
109
|
+
* Event raised after a transaction is rebased.
|
|
110
|
+
* @alpha
|
|
111
|
+
*/
|
|
112
|
+
onRebaseTxnEnd = new core_bentley_1.BeEvent();
|
|
113
|
+
/**
|
|
114
|
+
* Event raised after a rebase operation ends.
|
|
115
|
+
* @alpha
|
|
116
|
+
*/
|
|
117
|
+
onRebaseEnd = new core_bentley_1.BeEvent();
|
|
118
|
+
/**
|
|
119
|
+
* Event raised after the pull merge process ends.
|
|
120
|
+
* @alpha
|
|
121
|
+
*/
|
|
122
|
+
onPullMergeEnd = new core_bentley_1.BeEvent();
|
|
123
|
+
/** Event raised before incoming changes are applied.
|
|
124
|
+
* @alpha
|
|
125
|
+
*/
|
|
126
|
+
onApplyIncomingChangesBegin = new core_bentley_1.BeEvent();
|
|
127
|
+
/** Event raised after incoming changes are applied.
|
|
128
|
+
* @alpha
|
|
129
|
+
*/
|
|
130
|
+
onApplyIncomingChangesEnd = new core_bentley_1.BeEvent();
|
|
131
|
+
/** Event raised before local changes are reversed.
|
|
132
|
+
* @alpha
|
|
133
|
+
*/
|
|
134
|
+
onReverseLocalChangesBegin = new core_bentley_1.BeEvent();
|
|
135
|
+
/** Event raised after local changes are reversed.
|
|
136
|
+
* @alpha
|
|
137
|
+
*/
|
|
138
|
+
onReverseLocalChangesEnd = new core_bentley_1.BeEvent();
|
|
139
|
+
/** Event raised before downloading changesets begins.
|
|
140
|
+
* @alpha
|
|
141
|
+
*/
|
|
142
|
+
onDownloadChangesetsBegin = new core_bentley_1.BeEvent();
|
|
143
|
+
/** Event raised after downloading changesets ends.
|
|
144
|
+
* @alpha
|
|
145
|
+
*/
|
|
146
|
+
onDownloadChangesetsEnd = new core_bentley_1.BeEvent();
|
|
96
147
|
/** @internal */
|
|
97
148
|
constructor(iModel) {
|
|
98
149
|
super(iModel.key);
|
|
@@ -104,16 +155,28 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
104
155
|
if (this._cleanup) {
|
|
105
156
|
this._cleanup();
|
|
106
157
|
this._cleanup = undefined;
|
|
107
|
-
this.onElementsChanged.clear();
|
|
108
|
-
this.onModelsChanged.clear();
|
|
109
|
-
this.onModelGeometryChanged.clear();
|
|
110
|
-
this.onCommit.clear();
|
|
111
|
-
this.onCommitted.clear();
|
|
112
|
-
this.onChangesApplied.clear();
|
|
113
|
-
this.onBeforeUndoRedo.clear();
|
|
114
158
|
this.onAfterUndoRedo.clear();
|
|
159
|
+
this.onApplyIncomingChangesBegin.clear();
|
|
160
|
+
this.onApplyIncomingChangesEnd.clear();
|
|
161
|
+
this.onBeforeUndoRedo.clear();
|
|
162
|
+
this.onChangesApplied.clear();
|
|
115
163
|
this.onChangesPulled.clear();
|
|
116
164
|
this.onChangesPushed.clear();
|
|
165
|
+
this.onCommit.clear();
|
|
166
|
+
this.onCommitted.clear();
|
|
167
|
+
this.onDownloadChangesetsBegin.clear();
|
|
168
|
+
this.onDownloadChangesetsEnd.clear();
|
|
169
|
+
this.onElementsChanged.clear();
|
|
170
|
+
this.onModelGeometryChanged.clear();
|
|
171
|
+
this.onModelsChanged.clear();
|
|
172
|
+
this.onPullMergeBegin.clear();
|
|
173
|
+
this.onPullMergeEnd.clear();
|
|
174
|
+
this.onRebaseBegin.clear();
|
|
175
|
+
this.onRebaseEnd.clear();
|
|
176
|
+
this.onRebaseTxnBegin.clear();
|
|
177
|
+
this.onRebaseTxnEnd.clear();
|
|
178
|
+
this.onReverseLocalChangesBegin.clear();
|
|
179
|
+
this.onReverseLocalChangesEnd.clear();
|
|
117
180
|
}
|
|
118
181
|
}
|
|
119
182
|
/** Query if the briefcase has any pending Txns waiting to be pushed. */
|
|
@@ -262,6 +325,54 @@ class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
262
325
|
notifyGeographicCoordinateSystemChanged(gcs) {
|
|
263
326
|
this._iModel.geographicCoordinateSystem = gcs ? new core_common_1.GeographicCRS(gcs) : undefined;
|
|
264
327
|
}
|
|
328
|
+
/** @internal */
|
|
329
|
+
notifyPullMergeBegin(changeset) {
|
|
330
|
+
this.onPullMergeBegin.raiseEvent(changeset);
|
|
331
|
+
}
|
|
332
|
+
/** @internal */
|
|
333
|
+
notifyPullMergeEnd(changeset) {
|
|
334
|
+
this.onPullMergeEnd.raiseEvent(changeset);
|
|
335
|
+
}
|
|
336
|
+
/** @internal */
|
|
337
|
+
notifyApplyIncomingChangesBegin(changes) {
|
|
338
|
+
this.onApplyIncomingChangesBegin.raiseEvent(changes);
|
|
339
|
+
}
|
|
340
|
+
/** @internal */
|
|
341
|
+
notifyApplyIncomingChangesEnd(changes) {
|
|
342
|
+
this.onApplyIncomingChangesEnd.raiseEvent(changes);
|
|
343
|
+
}
|
|
344
|
+
/** @internal */
|
|
345
|
+
notifyReverseLocalChangesBegin() {
|
|
346
|
+
this.onReverseLocalChangesBegin.raiseEvent();
|
|
347
|
+
}
|
|
348
|
+
/** @internal */
|
|
349
|
+
notifyReverseLocalChangesEnd(txns) {
|
|
350
|
+
this.onReverseLocalChangesEnd.raiseEvent(txns);
|
|
351
|
+
}
|
|
352
|
+
/** @internal */
|
|
353
|
+
notifyDownloadChangesetsBegin() {
|
|
354
|
+
this.onDownloadChangesetsBegin.raiseEvent();
|
|
355
|
+
}
|
|
356
|
+
/** @internal */
|
|
357
|
+
notifyDownloadChangesetsEnd() {
|
|
358
|
+
this.onDownloadChangesetsEnd.raiseEvent();
|
|
359
|
+
}
|
|
360
|
+
/** @internal */
|
|
361
|
+
notifyRebaseBegin(txns) {
|
|
362
|
+
this.onRebaseBegin.raiseEvent(txns);
|
|
363
|
+
}
|
|
364
|
+
/** @internal */
|
|
365
|
+
notifyRebaseEnd(txns) {
|
|
366
|
+
this.onRebaseEnd.raiseEvent(txns);
|
|
367
|
+
}
|
|
368
|
+
/** @internal */
|
|
369
|
+
notifyRebaseTxnBegin(txn) {
|
|
370
|
+
this.onRebaseTxnBegin.raiseEvent(txn);
|
|
371
|
+
}
|
|
372
|
+
/** @internal */
|
|
373
|
+
notifyRebaseTxnEnd(txn) {
|
|
374
|
+
this.onRebaseTxnEnd.raiseEvent(txn);
|
|
375
|
+
}
|
|
265
376
|
}
|
|
266
377
|
exports.BriefcaseTxns = BriefcaseTxns;
|
|
267
378
|
//# sourceMappingURL=BriefcaseTxns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,oDAG4B;AAC5B,wDAAgF;AAEhF,qCAAuD;AACvD,yDAAqE;AAErE;;;;GAIG;AACH,MAAsB,4BAA6B,SAAQ,4BAAmB;IACxD;IAApB,YAAoB,IAAY;QAAI,KAAK,EAAE,CAAC;QAAxB,SAAI,GAAJ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AAI,CAAC,OAAO,CAAC,cAAc,GAAG,uBAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;IACT,yBAAyB,CAAC,MAAgB;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,uBAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,gBAAgB;IACT,yBAAyB,CAAC,IAAmC;QAClE,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,0BAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,CAAC;IAED,gBAAgB;IACT,uCAAuC,CAAC,GAAmC;QAChF,IAAI,CAAC,OAAO,CAAC,0BAA0B,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,2BAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrF,CAAC;CACF;AAlRD,sCAkRC","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 IModelConnection\r\n */\r\n\r\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndexAndId, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\r\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RemoveFunction, RootSubjectProps, TxnNotifications,\r\n} from \"@itwin/core-common\";\r\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\r\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\r\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\r\n\r\n/**\r\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\r\n * @see [[BriefcaseTxns]].\r\n * @public\r\n */\r\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\r\n constructor(private _key: string) { super(); }\r\n public abstract get briefcaseChannelName(): string;\r\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\r\n * @see [[BriefcaseConnection.txns]].\r\n * @see [TxnManager]($backend) for the backend counterpart.\r\n * @public\r\n */\r\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\r\n private readonly _iModel: BriefcaseConnection;\r\n private _cleanup?: RemoveFunction;\r\n\r\n /** @internal */\r\n public get briefcaseChannelName() {\r\n return ipcAppChannels.txns;\r\n }\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\r\n * @see [[onCommitted]] for the event raised after the operation.\r\n */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n\r\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\r\n * The event supplies the following information:\r\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\r\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\r\n * @see [[onCommit]] for the event raised before the operation.\r\n */\r\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised after a changeset has been applied to the briefcase.\r\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\r\n */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n\r\n /** Event raised before an undo/redo operation is performed.\r\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\r\n */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after an undo/redo operation is performed.\r\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after changes are pulled and merged into the briefcase.\r\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\r\n */\r\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised after the briefcase's local changes are pushed.\r\n * @see [[BriefcaseConnection.pushChanges]].\r\n */\r\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** @internal */\r\n public constructor(iModel: BriefcaseConnection) {\r\n super(iModel.key);\r\n this._iModel = iModel;\r\n this._cleanup = this.registerImpl();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n if (this._cleanup) {\r\n this._cleanup();\r\n this._cleanup = undefined;\r\n\r\n this.onElementsChanged.clear();\r\n this.onModelsChanged.clear();\r\n this.onModelGeometryChanged.clear();\r\n this.onCommit.clear();\r\n this.onCommitted.clear();\r\n this.onChangesApplied.clear();\r\n this.onBeforeUndoRedo.clear();\r\n this.onAfterUndoRedo.clear();\r\n this.onChangesPulled.clear();\r\n this.onChangesPushed.clear();\r\n }\r\n }\r\n\r\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reversible (undoable) changes exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reinstatable (redoable) changes exist.\r\n * @see [[reinstateTxn]] to redo changes.\r\n */\r\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\r\n }\r\n\r\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public async getUndoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\r\n }\r\n\r\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public async getRedoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation.\r\n * @see [[reinstateTxn]] to redo operations.\r\n * @see [[reverseAll]] to undo all operations.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseSingleTxn(): Promise<IModelStatus> {\r\n return this.reverseTxns(1);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if [[reinstateTxn]] is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the number of reversible operations are reversed.\r\n */\r\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\r\n }\r\n\r\n /** Reverse (undo) all changes back to the beginning of the session.\r\n * @see [[reinstateTxn]] to redo changes.\r\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseAll(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\r\n }\r\n\r\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async reinstateTxn(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\r\n }\r\n\r\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public async restartTxnSession(): Promise<void> {\r\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\r\n }\r\n\r\n /** @internal */\r\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n }\r\n\r\n /** @internal */\r\n public notifyCommit() {\r\n this.onCommit.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\r\n this.onCommitted.raiseEvent(hasPendingTxns, time);\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyChangesApplied() {\r\n this.onChangesApplied.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyAfterUndoRedo(isUndo: boolean) {\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPulled.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPushed.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyIModelNameChanged(name: string) {\r\n this._iModel.name = name;\r\n }\r\n\r\n /** @internal */\r\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\r\n this._iModel.rootSubject = subject;\r\n }\r\n\r\n /** @internal */\r\n public notifyProjectExtentsChanged(range: Range3dProps) {\r\n this._iModel.projectExtents = Range3d.fromJSON(range);\r\n }\r\n\r\n /** @internal */\r\n public notifyGlobalOriginChanged(origin: XYZProps) {\r\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\r\n }\r\n\r\n /** @internal */\r\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\r\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\r\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA4D;AAC5D,oDAK4B;AAC5B,wDAAgF;AAEhF,qCAAuD;AACvD,yDAAqE;AAErE;;;;GAIG;AACH,MAAsB,4BAA6B,SAAQ,4BAAmB;IACxD;IAApB,YAAoB,IAAY;QAAI,KAAK,EAAE,CAAC;QAAxB,SAAI,GAAJ,IAAI,CAAQ;IAAa,CAAC;IAE9C,IAAW,WAAW,KAAK,OAAO,GAAG,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;CACjF;AAJD,oEAIC;AAED;;;;GAIG;AACH,MAAa,aAAc,SAAQ,4BAA4B;IAC5C,OAAO,CAAsB;IACtC,QAAQ,CAAkB;IAElC,gBAAgB;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UAAU,EAAE,CAAC;IAC5C,CAAC;IACD,gBAAgB;IACT,iBAAiB,CAAC,IAAgB;QACvC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,gBAAgB;IACT,eAAe,CAAC,IAAgB;QACrC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,gBAAgB;IACT,oBAAoB,CAAC,GAAa;QACvC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IACT,kBAAkB,CAAC,GAAa;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF;AA9YD,sCA8YC","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 IModelConnection\r\n */\r\n\r\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIdWithIndex,\r\n ChangesetIndexAndId, ChangesetProps, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\r\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RemoveFunction, RootSubjectProps, TxnNotifications,\r\n TxnProps,\r\n} from \"@itwin/core-common\";\r\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\r\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\r\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\r\n\r\n/**\r\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\r\n * @see [[BriefcaseTxns]].\r\n * @public\r\n */\r\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\r\n constructor(private _key: string) { super(); }\r\n public abstract get briefcaseChannelName(): string;\r\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\r\n * @see [[BriefcaseConnection.txns]].\r\n * @see [TxnManager]($backend) for the backend counterpart.\r\n * @public\r\n */\r\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\r\n private readonly _iModel: BriefcaseConnection;\r\n private _cleanup?: RemoveFunction;\r\n\r\n /** @internal */\r\n public get briefcaseChannelName() {\r\n return ipcAppChannels.txns;\r\n }\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\r\n * @see [[onCommitted]] for the event raised after the operation.\r\n */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n\r\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\r\n * The event supplies the following information:\r\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\r\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\r\n * @see [[onCommit]] for the event raised before the operation.\r\n */\r\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised after a changeset has been applied to the briefcase.\r\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\r\n */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n\r\n /** Event raised before an undo/redo operation is performed.\r\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\r\n */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after an undo/redo operation is performed.\r\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after changes are pulled and merged into the briefcase.\r\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\r\n */\r\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised after the briefcase's local changes are pushed.\r\n * @see [[BriefcaseConnection.pushChanges]].\r\n */\r\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised before pull merge process begins.\r\n * @alpha\r\n */\r\n public readonly onPullMergeBegin = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Event raised before a rebase operation begins.\r\n * @alpha\r\n */\r\n public readonly onRebaseBegin = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /** Event raised before a transaction is rebased.\r\n * @alpha\r\n */\r\n public readonly onRebaseTxnBegin = new BeEvent<(txnProps: TxnProps) => void>();\r\n\r\n /**\r\n * Event raised after a transaction is rebased.\r\n * @alpha\r\n */\r\n public readonly onRebaseTxnEnd = new BeEvent<(txnProps: TxnProps) => void>();\r\n\r\n /**\r\n * Event raised after a rebase operation ends.\r\n * @alpha\r\n */\r\n public readonly onRebaseEnd = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /**\r\n * Event raised after the pull merge process ends.\r\n * @alpha\r\n */\r\n public readonly onPullMergeEnd = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Event raised before incoming changes are applied.\r\n * @alpha\r\n */\r\n public readonly onApplyIncomingChangesBegin = new BeEvent<(changesets: ChangesetProps[]) => void>();\r\n\r\n /** Event raised after incoming changes are applied.\r\n * @alpha\r\n */\r\n public readonly onApplyIncomingChangesEnd = new BeEvent<(changes: ChangesetProps[]) => void>();\r\n\r\n /** Event raised before local changes are reversed.\r\n * @alpha\r\n */\r\n public readonly onReverseLocalChangesBegin = new BeEvent<() => void>();\r\n\r\n /** Event raised after local changes are reversed.\r\n * @alpha\r\n */\r\n public readonly onReverseLocalChangesEnd = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /** Event raised before downloading changesets begins.\r\n * @alpha\r\n */\r\n public readonly onDownloadChangesetsBegin = new BeEvent<() => void>();\r\n\r\n /** Event raised after downloading changesets ends.\r\n * @alpha\r\n */\r\n public readonly onDownloadChangesetsEnd = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public constructor(iModel: BriefcaseConnection) {\r\n super(iModel.key);\r\n this._iModel = iModel;\r\n this._cleanup = this.registerImpl();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n if (this._cleanup) {\r\n this._cleanup();\r\n this._cleanup = undefined;\r\n\r\n this.onAfterUndoRedo.clear();\r\n this.onApplyIncomingChangesBegin.clear();\r\n this.onApplyIncomingChangesEnd.clear();\r\n this.onBeforeUndoRedo.clear();\r\n this.onChangesApplied.clear();\r\n this.onChangesPulled.clear();\r\n this.onChangesPushed.clear();\r\n this.onCommit.clear();\r\n this.onCommitted.clear();\r\n this.onDownloadChangesetsBegin.clear();\r\n this.onDownloadChangesetsEnd.clear();\r\n this.onElementsChanged.clear();\r\n this.onModelGeometryChanged.clear();\r\n this.onModelsChanged.clear();\r\n this.onPullMergeBegin.clear();\r\n this.onPullMergeEnd.clear();\r\n this.onRebaseBegin.clear();\r\n this.onRebaseEnd.clear();\r\n this.onRebaseTxnBegin.clear();\r\n this.onRebaseTxnEnd.clear();\r\n this.onReverseLocalChangesBegin.clear();\r\n this.onReverseLocalChangesEnd.clear();\r\n }\r\n }\r\n\r\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reversible (undoable) changes exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reinstatable (redoable) changes exist.\r\n * @see [[reinstateTxn]] to redo changes.\r\n */\r\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\r\n }\r\n\r\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public async getUndoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\r\n }\r\n\r\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public async getRedoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation.\r\n * @see [[reinstateTxn]] to redo operations.\r\n * @see [[reverseAll]] to undo all operations.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseSingleTxn(): Promise<IModelStatus> {\r\n return this.reverseTxns(1);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if [[reinstateTxn]] is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the number of reversible operations are reversed.\r\n */\r\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\r\n }\r\n\r\n /** Reverse (undo) all changes back to the beginning of the session.\r\n * @see [[reinstateTxn]] to redo changes.\r\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseAll(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\r\n }\r\n\r\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async reinstateTxn(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\r\n }\r\n\r\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public async restartTxnSession(): Promise<void> {\r\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\r\n }\r\n\r\n /** @internal */\r\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n }\r\n\r\n /** @internal */\r\n public notifyCommit() {\r\n this.onCommit.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\r\n this.onCommitted.raiseEvent(hasPendingTxns, time);\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyChangesApplied() {\r\n this.onChangesApplied.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyAfterUndoRedo(isUndo: boolean) {\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPulled.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPushed.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyIModelNameChanged(name: string) {\r\n this._iModel.name = name;\r\n }\r\n\r\n /** @internal */\r\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\r\n this._iModel.rootSubject = subject;\r\n }\r\n\r\n /** @internal */\r\n public notifyProjectExtentsChanged(range: Range3dProps) {\r\n this._iModel.projectExtents = Range3d.fromJSON(range);\r\n }\r\n\r\n /** @internal */\r\n public notifyGlobalOriginChanged(origin: XYZProps) {\r\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\r\n }\r\n\r\n /** @internal */\r\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\r\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\r\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyPullMergeBegin(changeset: ChangesetIdWithIndex) {\r\n this.onPullMergeBegin.raiseEvent(changeset);\r\n }\r\n /** @internal */\r\n public notifyPullMergeEnd(changeset: ChangesetIdWithIndex) {\r\n this.onPullMergeEnd.raiseEvent(changeset);\r\n }\r\n /** @internal */\r\n public notifyApplyIncomingChangesBegin(changes: ChangesetProps[]) {\r\n this.onApplyIncomingChangesBegin.raiseEvent(changes);\r\n }\r\n /** @internal */\r\n public notifyApplyIncomingChangesEnd(changes: ChangesetProps[]) {\r\n this.onApplyIncomingChangesEnd.raiseEvent(changes);\r\n }\r\n /** @internal */\r\n public notifyReverseLocalChangesBegin() {\r\n this.onReverseLocalChangesBegin.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyReverseLocalChangesEnd(txns: TxnProps[]) {\r\n this.onReverseLocalChangesEnd.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyDownloadChangesetsBegin() {\r\n this.onDownloadChangesetsBegin.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyDownloadChangesetsEnd() {\r\n this.onDownloadChangesetsEnd.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyRebaseBegin(txns: TxnProps[]) {\r\n this.onRebaseBegin.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyRebaseEnd(txns: TxnProps[]) {\r\n this.onRebaseEnd.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyRebaseTxnBegin(txn: TxnProps) {\r\n this.onRebaseTxnBegin.raiseEvent(txn);\r\n }\r\n /** @internal */\r\n public notifyRebaseTxnEnd(txn: TxnProps) {\r\n this.onRebaseTxnEnd.raiseEvent(txn);\r\n }\r\n}\r\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module IModelConnection
|
|
3
3
|
*/
|
|
4
4
|
import { BeEvent, IModelStatus } from "@itwin/core-bentley";
|
|
5
|
-
import { ChangesetIndexAndId, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RootSubjectProps, TxnNotifications } from "@itwin/core-common";
|
|
5
|
+
import { ChangesetIdWithIndex, ChangesetIndexAndId, ChangesetProps, EcefLocationProps, GeographicCRSProps, ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RootSubjectProps, TxnNotifications, TxnProps } from "@itwin/core-common";
|
|
6
6
|
import { Range3dProps, XYZProps } from "@itwin/core-geometry";
|
|
7
7
|
import { BriefcaseConnection } from "./BriefcaseConnection";
|
|
8
8
|
import { NotificationHandler } from "./IpcApp";
|
|
@@ -82,6 +82,57 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
|
|
|
82
82
|
* @see [[BriefcaseConnection.pushChanges]].
|
|
83
83
|
*/
|
|
84
84
|
readonly onChangesPushed: BeEvent<(parentChangeset: ChangesetIndexAndId) => void>;
|
|
85
|
+
/** Event raised before pull merge process begins.
|
|
86
|
+
* @alpha
|
|
87
|
+
*/
|
|
88
|
+
readonly onPullMergeBegin: BeEvent<(changeset: ChangesetIdWithIndex) => void>;
|
|
89
|
+
/** Event raised before a rebase operation begins.
|
|
90
|
+
* @alpha
|
|
91
|
+
*/
|
|
92
|
+
readonly onRebaseBegin: BeEvent<(txns: TxnProps[]) => void>;
|
|
93
|
+
/** Event raised before a transaction is rebased.
|
|
94
|
+
* @alpha
|
|
95
|
+
*/
|
|
96
|
+
readonly onRebaseTxnBegin: BeEvent<(txnProps: TxnProps) => void>;
|
|
97
|
+
/**
|
|
98
|
+
* Event raised after a transaction is rebased.
|
|
99
|
+
* @alpha
|
|
100
|
+
*/
|
|
101
|
+
readonly onRebaseTxnEnd: BeEvent<(txnProps: TxnProps) => void>;
|
|
102
|
+
/**
|
|
103
|
+
* Event raised after a rebase operation ends.
|
|
104
|
+
* @alpha
|
|
105
|
+
*/
|
|
106
|
+
readonly onRebaseEnd: BeEvent<(txns: TxnProps[]) => void>;
|
|
107
|
+
/**
|
|
108
|
+
* Event raised after the pull merge process ends.
|
|
109
|
+
* @alpha
|
|
110
|
+
*/
|
|
111
|
+
readonly onPullMergeEnd: BeEvent<(changeset: ChangesetIdWithIndex) => void>;
|
|
112
|
+
/** Event raised before incoming changes are applied.
|
|
113
|
+
* @alpha
|
|
114
|
+
*/
|
|
115
|
+
readonly onApplyIncomingChangesBegin: BeEvent<(changesets: ChangesetProps[]) => void>;
|
|
116
|
+
/** Event raised after incoming changes are applied.
|
|
117
|
+
* @alpha
|
|
118
|
+
*/
|
|
119
|
+
readonly onApplyIncomingChangesEnd: BeEvent<(changes: ChangesetProps[]) => void>;
|
|
120
|
+
/** Event raised before local changes are reversed.
|
|
121
|
+
* @alpha
|
|
122
|
+
*/
|
|
123
|
+
readonly onReverseLocalChangesBegin: BeEvent<() => void>;
|
|
124
|
+
/** Event raised after local changes are reversed.
|
|
125
|
+
* @alpha
|
|
126
|
+
*/
|
|
127
|
+
readonly onReverseLocalChangesEnd: BeEvent<(txns: TxnProps[]) => void>;
|
|
128
|
+
/** Event raised before downloading changesets begins.
|
|
129
|
+
* @alpha
|
|
130
|
+
*/
|
|
131
|
+
readonly onDownloadChangesetsBegin: BeEvent<() => void>;
|
|
132
|
+
/** Event raised after downloading changesets ends.
|
|
133
|
+
* @alpha
|
|
134
|
+
*/
|
|
135
|
+
readonly onDownloadChangesetsEnd: BeEvent<() => void>;
|
|
85
136
|
/** @internal */
|
|
86
137
|
constructor(iModel: BriefcaseConnection);
|
|
87
138
|
/** @internal */
|
|
@@ -176,5 +227,29 @@ export declare class BriefcaseTxns extends BriefcaseNotificationHandler implemen
|
|
|
176
227
|
notifyEcefLocationChanged(ecef: EcefLocationProps | undefined): void;
|
|
177
228
|
/** @internal */
|
|
178
229
|
notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined): void;
|
|
230
|
+
/** @internal */
|
|
231
|
+
notifyPullMergeBegin(changeset: ChangesetIdWithIndex): void;
|
|
232
|
+
/** @internal */
|
|
233
|
+
notifyPullMergeEnd(changeset: ChangesetIdWithIndex): void;
|
|
234
|
+
/** @internal */
|
|
235
|
+
notifyApplyIncomingChangesBegin(changes: ChangesetProps[]): void;
|
|
236
|
+
/** @internal */
|
|
237
|
+
notifyApplyIncomingChangesEnd(changes: ChangesetProps[]): void;
|
|
238
|
+
/** @internal */
|
|
239
|
+
notifyReverseLocalChangesBegin(): void;
|
|
240
|
+
/** @internal */
|
|
241
|
+
notifyReverseLocalChangesEnd(txns: TxnProps[]): void;
|
|
242
|
+
/** @internal */
|
|
243
|
+
notifyDownloadChangesetsBegin(): void;
|
|
244
|
+
/** @internal */
|
|
245
|
+
notifyDownloadChangesetsEnd(): void;
|
|
246
|
+
/** @internal */
|
|
247
|
+
notifyRebaseBegin(txns: TxnProps[]): void;
|
|
248
|
+
/** @internal */
|
|
249
|
+
notifyRebaseEnd(txns: TxnProps[]): void;
|
|
250
|
+
/** @internal */
|
|
251
|
+
notifyRebaseTxnBegin(txn: TxnProps): void;
|
|
252
|
+
/** @internal */
|
|
253
|
+
notifyRebaseTxnEnd(txn: TxnProps): void;
|
|
179
254
|
}
|
|
180
255
|
//# sourceMappingURL=BriefcaseTxns.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseTxns.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,mBAAmB,EAAgB,iBAAiB,EAAiB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"BriefcaseTxns.d.ts","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACL,oBAAoB,EACpB,mBAAmB,EAAE,cAAc,EAAgB,iBAAiB,EAAiB,kBAAkB,EACvG,sBAAsB,EAAE,yBAAyB,EAAkB,gBAAgB,EAAE,gBAAgB,EACrG,QAAQ,EACT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAoB,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAU,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EAAiB,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAErE;;;;GAIG;AACH,8BAAsB,4BAA6B,SAAQ,mBAAmB;IAChE,OAAO,CAAC,IAAI;gBAAJ,IAAI,EAAE,MAAM;IAChC,aAAoB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gB;IACT,6BAA6B,CAAC,OAAO,EAAE,cAAc,EAAE;IAG9D,gBAAgB;IACT,8BAA8B;IAGrC,gBAAgB;IACT,4BAA4B,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGpD,gBAAgB;IACT,6BAA6B;IAGpC,gBAAgB;IACT,2BAA2B;IAGlC,gBAAgB;IACT,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGzC,gBAAgB;IACT,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE;IAGvC,gBAAgB;IACT,oBAAoB,CAAC,GAAG,EAAE,QAAQ;IAGzC,gBAAgB;IACT,kBAAkB,CAAC,GAAG,EAAE,QAAQ;CAGxC"}
|
package/lib/esm/BriefcaseTxns.js
CHANGED
|
@@ -89,6 +89,57 @@ export class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
89
89
|
* @see [[BriefcaseConnection.pushChanges]].
|
|
90
90
|
*/
|
|
91
91
|
onChangesPushed = new BeEvent();
|
|
92
|
+
/** Event raised before pull merge process begins.
|
|
93
|
+
* @alpha
|
|
94
|
+
*/
|
|
95
|
+
onPullMergeBegin = new BeEvent();
|
|
96
|
+
/** Event raised before a rebase operation begins.
|
|
97
|
+
* @alpha
|
|
98
|
+
*/
|
|
99
|
+
onRebaseBegin = new BeEvent();
|
|
100
|
+
/** Event raised before a transaction is rebased.
|
|
101
|
+
* @alpha
|
|
102
|
+
*/
|
|
103
|
+
onRebaseTxnBegin = new BeEvent();
|
|
104
|
+
/**
|
|
105
|
+
* Event raised after a transaction is rebased.
|
|
106
|
+
* @alpha
|
|
107
|
+
*/
|
|
108
|
+
onRebaseTxnEnd = new BeEvent();
|
|
109
|
+
/**
|
|
110
|
+
* Event raised after a rebase operation ends.
|
|
111
|
+
* @alpha
|
|
112
|
+
*/
|
|
113
|
+
onRebaseEnd = new BeEvent();
|
|
114
|
+
/**
|
|
115
|
+
* Event raised after the pull merge process ends.
|
|
116
|
+
* @alpha
|
|
117
|
+
*/
|
|
118
|
+
onPullMergeEnd = new BeEvent();
|
|
119
|
+
/** Event raised before incoming changes are applied.
|
|
120
|
+
* @alpha
|
|
121
|
+
*/
|
|
122
|
+
onApplyIncomingChangesBegin = new BeEvent();
|
|
123
|
+
/** Event raised after incoming changes are applied.
|
|
124
|
+
* @alpha
|
|
125
|
+
*/
|
|
126
|
+
onApplyIncomingChangesEnd = new BeEvent();
|
|
127
|
+
/** Event raised before local changes are reversed.
|
|
128
|
+
* @alpha
|
|
129
|
+
*/
|
|
130
|
+
onReverseLocalChangesBegin = new BeEvent();
|
|
131
|
+
/** Event raised after local changes are reversed.
|
|
132
|
+
* @alpha
|
|
133
|
+
*/
|
|
134
|
+
onReverseLocalChangesEnd = new BeEvent();
|
|
135
|
+
/** Event raised before downloading changesets begins.
|
|
136
|
+
* @alpha
|
|
137
|
+
*/
|
|
138
|
+
onDownloadChangesetsBegin = new BeEvent();
|
|
139
|
+
/** Event raised after downloading changesets ends.
|
|
140
|
+
* @alpha
|
|
141
|
+
*/
|
|
142
|
+
onDownloadChangesetsEnd = new BeEvent();
|
|
92
143
|
/** @internal */
|
|
93
144
|
constructor(iModel) {
|
|
94
145
|
super(iModel.key);
|
|
@@ -100,16 +151,28 @@ export class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
100
151
|
if (this._cleanup) {
|
|
101
152
|
this._cleanup();
|
|
102
153
|
this._cleanup = undefined;
|
|
103
|
-
this.onElementsChanged.clear();
|
|
104
|
-
this.onModelsChanged.clear();
|
|
105
|
-
this.onModelGeometryChanged.clear();
|
|
106
|
-
this.onCommit.clear();
|
|
107
|
-
this.onCommitted.clear();
|
|
108
|
-
this.onChangesApplied.clear();
|
|
109
|
-
this.onBeforeUndoRedo.clear();
|
|
110
154
|
this.onAfterUndoRedo.clear();
|
|
155
|
+
this.onApplyIncomingChangesBegin.clear();
|
|
156
|
+
this.onApplyIncomingChangesEnd.clear();
|
|
157
|
+
this.onBeforeUndoRedo.clear();
|
|
158
|
+
this.onChangesApplied.clear();
|
|
111
159
|
this.onChangesPulled.clear();
|
|
112
160
|
this.onChangesPushed.clear();
|
|
161
|
+
this.onCommit.clear();
|
|
162
|
+
this.onCommitted.clear();
|
|
163
|
+
this.onDownloadChangesetsBegin.clear();
|
|
164
|
+
this.onDownloadChangesetsEnd.clear();
|
|
165
|
+
this.onElementsChanged.clear();
|
|
166
|
+
this.onModelGeometryChanged.clear();
|
|
167
|
+
this.onModelsChanged.clear();
|
|
168
|
+
this.onPullMergeBegin.clear();
|
|
169
|
+
this.onPullMergeEnd.clear();
|
|
170
|
+
this.onRebaseBegin.clear();
|
|
171
|
+
this.onRebaseEnd.clear();
|
|
172
|
+
this.onRebaseTxnBegin.clear();
|
|
173
|
+
this.onRebaseTxnEnd.clear();
|
|
174
|
+
this.onReverseLocalChangesBegin.clear();
|
|
175
|
+
this.onReverseLocalChangesEnd.clear();
|
|
113
176
|
}
|
|
114
177
|
}
|
|
115
178
|
/** Query if the briefcase has any pending Txns waiting to be pushed. */
|
|
@@ -258,5 +321,53 @@ export class BriefcaseTxns extends BriefcaseNotificationHandler {
|
|
|
258
321
|
notifyGeographicCoordinateSystemChanged(gcs) {
|
|
259
322
|
this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;
|
|
260
323
|
}
|
|
324
|
+
/** @internal */
|
|
325
|
+
notifyPullMergeBegin(changeset) {
|
|
326
|
+
this.onPullMergeBegin.raiseEvent(changeset);
|
|
327
|
+
}
|
|
328
|
+
/** @internal */
|
|
329
|
+
notifyPullMergeEnd(changeset) {
|
|
330
|
+
this.onPullMergeEnd.raiseEvent(changeset);
|
|
331
|
+
}
|
|
332
|
+
/** @internal */
|
|
333
|
+
notifyApplyIncomingChangesBegin(changes) {
|
|
334
|
+
this.onApplyIncomingChangesBegin.raiseEvent(changes);
|
|
335
|
+
}
|
|
336
|
+
/** @internal */
|
|
337
|
+
notifyApplyIncomingChangesEnd(changes) {
|
|
338
|
+
this.onApplyIncomingChangesEnd.raiseEvent(changes);
|
|
339
|
+
}
|
|
340
|
+
/** @internal */
|
|
341
|
+
notifyReverseLocalChangesBegin() {
|
|
342
|
+
this.onReverseLocalChangesBegin.raiseEvent();
|
|
343
|
+
}
|
|
344
|
+
/** @internal */
|
|
345
|
+
notifyReverseLocalChangesEnd(txns) {
|
|
346
|
+
this.onReverseLocalChangesEnd.raiseEvent(txns);
|
|
347
|
+
}
|
|
348
|
+
/** @internal */
|
|
349
|
+
notifyDownloadChangesetsBegin() {
|
|
350
|
+
this.onDownloadChangesetsBegin.raiseEvent();
|
|
351
|
+
}
|
|
352
|
+
/** @internal */
|
|
353
|
+
notifyDownloadChangesetsEnd() {
|
|
354
|
+
this.onDownloadChangesetsEnd.raiseEvent();
|
|
355
|
+
}
|
|
356
|
+
/** @internal */
|
|
357
|
+
notifyRebaseBegin(txns) {
|
|
358
|
+
this.onRebaseBegin.raiseEvent(txns);
|
|
359
|
+
}
|
|
360
|
+
/** @internal */
|
|
361
|
+
notifyRebaseEnd(txns) {
|
|
362
|
+
this.onRebaseEnd.raiseEvent(txns);
|
|
363
|
+
}
|
|
364
|
+
/** @internal */
|
|
365
|
+
notifyRebaseTxnBegin(txn) {
|
|
366
|
+
this.onRebaseTxnBegin.raiseEvent(txn);
|
|
367
|
+
}
|
|
368
|
+
/** @internal */
|
|
369
|
+
notifyRebaseTxnEnd(txn) {
|
|
370
|
+
this.onRebaseTxnEnd.raiseEvent(txn);
|
|
371
|
+
}
|
|
261
372
|
}
|
|
262
373
|
//# sourceMappingURL=BriefcaseTxns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EACgB,YAAY,EAAqB,aAAa,EAAsB,cAAc,GAExG,MAAM,oBAAoB,CAAC;AAC5B,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AC;IACnD,CAAC;IAED,gBAAgB;IACT,uBAAuB,CAAC,IAAY;QACzC,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;IAC3B,CAAC;IAED,gBAAgB;IACT,wBAAwB,CAAC,OAAyB;QACvD,IAAI,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC;IACrC,CAAC;IAED,gBAAgB;IACT,2BAA2B,CAAC,KAAmB;QACpD,IAAI,CAAC,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IAED,gBAAgB;IACT,yBAAyB,CAAC,MAAgB;QAC/C,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvD,CAAC;IAED,gBAAgB;IACT,yBAAyB,CAAC,IAAmC;QAClE,IAAI,CAAC,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACxE,CAAC;IAED,gBAAgB;IACT,uCAAuC,CAAC,GAAmC;QAChF,IAAI,CAAC,OAAO,CAAC,0BAA0B,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrF,CAAC;CACF","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 IModelConnection\r\n */\r\n\r\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIndexAndId, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\r\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RemoveFunction, RootSubjectProps, TxnNotifications,\r\n} from \"@itwin/core-common\";\r\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\r\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\r\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\r\n\r\n/**\r\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\r\n * @see [[BriefcaseTxns]].\r\n * @public\r\n */\r\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\r\n constructor(private _key: string) { super(); }\r\n public abstract get briefcaseChannelName(): string;\r\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\r\n * @see [[BriefcaseConnection.txns]].\r\n * @see [TxnManager]($backend) for the backend counterpart.\r\n * @public\r\n */\r\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\r\n private readonly _iModel: BriefcaseConnection;\r\n private _cleanup?: RemoveFunction;\r\n\r\n /** @internal */\r\n public get briefcaseChannelName() {\r\n return ipcAppChannels.txns;\r\n }\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\r\n * @see [[onCommitted]] for the event raised after the operation.\r\n */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n\r\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\r\n * The event supplies the following information:\r\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\r\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\r\n * @see [[onCommit]] for the event raised before the operation.\r\n */\r\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised after a changeset has been applied to the briefcase.\r\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\r\n */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n\r\n /** Event raised before an undo/redo operation is performed.\r\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\r\n */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after an undo/redo operation is performed.\r\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after changes are pulled and merged into the briefcase.\r\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\r\n */\r\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised after the briefcase's local changes are pushed.\r\n * @see [[BriefcaseConnection.pushChanges]].\r\n */\r\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** @internal */\r\n public constructor(iModel: BriefcaseConnection) {\r\n super(iModel.key);\r\n this._iModel = iModel;\r\n this._cleanup = this.registerImpl();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n if (this._cleanup) {\r\n this._cleanup();\r\n this._cleanup = undefined;\r\n\r\n this.onElementsChanged.clear();\r\n this.onModelsChanged.clear();\r\n this.onModelGeometryChanged.clear();\r\n this.onCommit.clear();\r\n this.onCommitted.clear();\r\n this.onChangesApplied.clear();\r\n this.onBeforeUndoRedo.clear();\r\n this.onAfterUndoRedo.clear();\r\n this.onChangesPulled.clear();\r\n this.onChangesPushed.clear();\r\n }\r\n }\r\n\r\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reversible (undoable) changes exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reinstatable (redoable) changes exist.\r\n * @see [[reinstateTxn]] to redo changes.\r\n */\r\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\r\n }\r\n\r\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public async getUndoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\r\n }\r\n\r\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public async getRedoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation.\r\n * @see [[reinstateTxn]] to redo operations.\r\n * @see [[reverseAll]] to undo all operations.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseSingleTxn(): Promise<IModelStatus> {\r\n return this.reverseTxns(1);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if [[reinstateTxn]] is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the number of reversible operations are reversed.\r\n */\r\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\r\n }\r\n\r\n /** Reverse (undo) all changes back to the beginning of the session.\r\n * @see [[reinstateTxn]] to redo changes.\r\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseAll(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\r\n }\r\n\r\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async reinstateTxn(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\r\n }\r\n\r\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public async restartTxnSession(): Promise<void> {\r\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\r\n }\r\n\r\n /** @internal */\r\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n }\r\n\r\n /** @internal */\r\n public notifyCommit() {\r\n this.onCommit.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\r\n this.onCommitted.raiseEvent(hasPendingTxns, time);\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyChangesApplied() {\r\n this.onChangesApplied.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyAfterUndoRedo(isUndo: boolean) {\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPulled.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPushed.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyIModelNameChanged(name: string) {\r\n this._iModel.name = name;\r\n }\r\n\r\n /** @internal */\r\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\r\n this._iModel.rootSubject = subject;\r\n }\r\n\r\n /** @internal */\r\n public notifyProjectExtentsChanged(range: Range3dProps) {\r\n this._iModel.projectExtents = Range3d.fromJSON(range);\r\n }\r\n\r\n /** @internal */\r\n public notifyGlobalOriginChanged(origin: XYZProps) {\r\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\r\n }\r\n\r\n /** @internal */\r\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\r\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\r\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"BriefcaseTxns.js","sourceRoot":"","sources":["../../src/BriefcaseTxns.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAgB,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAEgC,YAAY,EAAqB,aAAa,EAAsB,cAAc,GAGxH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,OAAO,EAA0B,MAAM,sBAAsB,CAAC;A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BAA6B,CAAC,OAAyB;QAC5D,IAAI,CAAC,yBAAyB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IACD,gBAAgB;IACT,8BAA8B;QACnC,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,CAAC;IAC/C,CAAC;IACD,gBAAgB;IACT,4BAA4B,CAAC,IAAgB;QAClD,IAAI,CAAC,wBAAwB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACD,gBAAgB;IACT,6BAA6B;QAClC,IAAI,CAAC,yBAAyB,CAAC,UAAU,EAAE,CAAC;IAC9C,CAAC;IACD,gBAAgB;IACT,2BAA2B;QAChC,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,CAAC;IAC5C,CAAC;IACD,gBAAgB;IACT,iBAAiB,CAAC,IAAgB;QACvC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IACD,gBAAgB;IACT,eAAe,CAAC,IAAgB;QACrC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACpC,CAAC;IACD,gBAAgB;IACT,oBAAoB,CAAC,GAAa;QACvC,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,gBAAgB;IACT,kBAAkB,CAAC,GAAa;QACrC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC;CACF","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 IModelConnection\r\n */\r\n\r\nimport { BeEvent, IModelStatus } from \"@itwin/core-bentley\";\r\nimport {\r\n ChangesetIdWithIndex,\r\n ChangesetIndexAndId, ChangesetProps, EcefLocation, EcefLocationProps, GeographicCRS, GeographicCRSProps, ipcAppChannels,\r\n ModelIdAndGeometryGuid, NotifyEntitiesChangedArgs, RemoveFunction, RootSubjectProps, TxnNotifications,\r\n TxnProps,\r\n} from \"@itwin/core-common\";\r\nimport { Point3d, Range3d, Range3dProps, XYZProps } from \"@itwin/core-geometry\";\r\nimport { BriefcaseConnection } from \"./BriefcaseConnection\";\r\nimport { IpcApp, NotificationHandler } from \"./IpcApp\";\r\nimport { EntityChanges, TxnEntityChanges } from \"./TxnEntityChanges\";\r\n\r\n/**\r\n * Base class for notification handlers for events from the backend that are specific to a [[BriefcaseConnection]].\r\n * @see [[BriefcaseTxns]].\r\n * @public\r\n */\r\nexport abstract class BriefcaseNotificationHandler extends NotificationHandler {\r\n constructor(private _key: string) { super(); }\r\n public abstract get briefcaseChannelName(): string;\r\n public get channelName() { return `${this.briefcaseChannelName}/${this._key}`; }\r\n}\r\n\r\n/** Manages local changes to a [[BriefcaseConnection]] via [Txns]($docs/learning/InteractiveEditing.md).\r\n * @see [[BriefcaseConnection.txns]].\r\n * @see [TxnManager]($backend) for the backend counterpart.\r\n * @public\r\n */\r\nexport class BriefcaseTxns extends BriefcaseNotificationHandler implements TxnNotifications {\r\n private readonly _iModel: BriefcaseConnection;\r\n private _cleanup?: RemoveFunction;\r\n\r\n /** @internal */\r\n public get briefcaseChannelName() {\r\n return ipcAppChannels.txns;\r\n }\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed elements.\r\n * @note If there are many changed elements in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onElementsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after Txn validation or changeset application to indicate the set of changed models.\r\n * @note If there are many changed models in a single Txn, the notifications are sent in batches so this event *may be called multiple times* per Txn.\r\n */\r\n public readonly onModelsChanged = new BeEvent<(changes: TxnEntityChanges) => void>();\r\n\r\n /** Event raised after the geometry within one or more [[GeometricModelState]]s is modified by applying a changeset or validation of a transaction.\r\n * A model's geometry can change as a result of:\r\n * - Insertion or deletion of a geometric element within the model; or\r\n * - Modification of an existing element's geometric properties; or\r\n * - An explicit request to flag it as changed via [IModelDb.Models.updateModel]($backend).\r\n */\r\n public readonly onModelGeometryChanged = new BeEvent<(changes: ReadonlyArray<ModelIdAndGeometryGuid>) => void>();\r\n\r\n /** Event raised before a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], unless there are no changes to save.\r\n * @see [[onCommitted]] for the event raised after the operation.\r\n */\r\n public readonly onCommit = new BeEvent<() => void>();\r\n\r\n /** Event raised after a commit operation is performed. Initiated by a call to [[BriefcaseConnection.saveChanges]], even if there were no changes to save.\r\n * The event supplies the following information:\r\n * - `hasPendingTxns`: true if the briefcase has local changes not yet pushed to the server.\r\n * - `time`: the time at which changes were saved on the backend (obtained via `Date.now()`).\r\n * @see [[onCommit]] for the event raised before the operation.\r\n */\r\n public readonly onCommitted = new BeEvent<(hasPendingTxns: boolean, time: number) => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayedExternalTxns]] for the event raised after all such changes have been applied.\r\n */\r\n public readonly onReplayExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised for a read-only briefcase that was opened with the `watchForChanges` flag enabled when changes made by another connection are applied to the briefcase.\r\n * @see [[onReplayExternalTxns]] for the event raised before the changes are applied.\r\n */\r\n public readonly onReplayedExternalTxns = new BeEvent<() => void>();\r\n\r\n /** Event raised after a changeset has been applied to the briefcase.\r\n * Changesets may be applied as a result of [[BriefcaseConnection.pullChanges]], or by undo/redo operations.\r\n */\r\n public readonly onChangesApplied = new BeEvent<() => void>();\r\n\r\n /** Event raised before an undo/redo operation is performed.\r\n * @see [[onAfterUndoRedo]] for the event raised after the operation.\r\n */\r\n public readonly onBeforeUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after an undo/redo operation is performed.\r\n * @see [[onBeforeUndoRedo]] for the event raised before to the operation.\r\n */\r\n public readonly onAfterUndoRedo = new BeEvent<(isUndo: boolean) => void>();\r\n\r\n /** Event raised after changes are pulled and merged into the briefcase.\r\n * @see [[BriefcaseConnection.pullAndMergeChanges]].\r\n */\r\n public readonly onChangesPulled = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised after the briefcase's local changes are pushed.\r\n * @see [[BriefcaseConnection.pushChanges]].\r\n */\r\n public readonly onChangesPushed = new BeEvent<(parentChangeset: ChangesetIndexAndId) => void>();\r\n\r\n /** Event raised before pull merge process begins.\r\n * @alpha\r\n */\r\n public readonly onPullMergeBegin = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Event raised before a rebase operation begins.\r\n * @alpha\r\n */\r\n public readonly onRebaseBegin = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /** Event raised before a transaction is rebased.\r\n * @alpha\r\n */\r\n public readonly onRebaseTxnBegin = new BeEvent<(txnProps: TxnProps) => void>();\r\n\r\n /**\r\n * Event raised after a transaction is rebased.\r\n * @alpha\r\n */\r\n public readonly onRebaseTxnEnd = new BeEvent<(txnProps: TxnProps) => void>();\r\n\r\n /**\r\n * Event raised after a rebase operation ends.\r\n * @alpha\r\n */\r\n public readonly onRebaseEnd = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /**\r\n * Event raised after the pull merge process ends.\r\n * @alpha\r\n */\r\n public readonly onPullMergeEnd = new BeEvent<(changeset: ChangesetIdWithIndex) => void>();\r\n\r\n /** Event raised before incoming changes are applied.\r\n * @alpha\r\n */\r\n public readonly onApplyIncomingChangesBegin = new BeEvent<(changesets: ChangesetProps[]) => void>();\r\n\r\n /** Event raised after incoming changes are applied.\r\n * @alpha\r\n */\r\n public readonly onApplyIncomingChangesEnd = new BeEvent<(changes: ChangesetProps[]) => void>();\r\n\r\n /** Event raised before local changes are reversed.\r\n * @alpha\r\n */\r\n public readonly onReverseLocalChangesBegin = new BeEvent<() => void>();\r\n\r\n /** Event raised after local changes are reversed.\r\n * @alpha\r\n */\r\n public readonly onReverseLocalChangesEnd = new BeEvent<(txns: TxnProps[]) => void>();\r\n\r\n /** Event raised before downloading changesets begins.\r\n * @alpha\r\n */\r\n public readonly onDownloadChangesetsBegin = new BeEvent<() => void>();\r\n\r\n /** Event raised after downloading changesets ends.\r\n * @alpha\r\n */\r\n public readonly onDownloadChangesetsEnd = new BeEvent<() => void>();\r\n\r\n /** @internal */\r\n public constructor(iModel: BriefcaseConnection) {\r\n super(iModel.key);\r\n this._iModel = iModel;\r\n this._cleanup = this.registerImpl();\r\n }\r\n\r\n /** @internal */\r\n public [Symbol.dispose](): void {\r\n if (this._cleanup) {\r\n this._cleanup();\r\n this._cleanup = undefined;\r\n\r\n this.onAfterUndoRedo.clear();\r\n this.onApplyIncomingChangesBegin.clear();\r\n this.onApplyIncomingChangesEnd.clear();\r\n this.onBeforeUndoRedo.clear();\r\n this.onChangesApplied.clear();\r\n this.onChangesPulled.clear();\r\n this.onChangesPushed.clear();\r\n this.onCommit.clear();\r\n this.onCommitted.clear();\r\n this.onDownloadChangesetsBegin.clear();\r\n this.onDownloadChangesetsEnd.clear();\r\n this.onElementsChanged.clear();\r\n this.onModelGeometryChanged.clear();\r\n this.onModelsChanged.clear();\r\n this.onPullMergeBegin.clear();\r\n this.onPullMergeEnd.clear();\r\n this.onRebaseBegin.clear();\r\n this.onRebaseEnd.clear();\r\n this.onRebaseTxnBegin.clear();\r\n this.onRebaseTxnEnd.clear();\r\n this.onReverseLocalChangesBegin.clear();\r\n this.onReverseLocalChangesEnd.clear();\r\n }\r\n }\r\n\r\n /** Query if the briefcase has any pending Txns waiting to be pushed. */\r\n public async hasPendingTxns(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.hasPendingTxns(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reversible (undoable) changes exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async isUndoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isUndoPossible(this._iModel.key);\r\n }\r\n\r\n /** Determine if any reinstatable (redoable) changes exist.\r\n * @see [[reinstateTxn]] to redo changes.\r\n */\r\n public async isRedoPossible(): Promise<boolean> { // eslint-disable-line @itwin/prefer-get\r\n return IpcApp.appFunctionIpc.isRedoPossible(this._iModel.key);\r\n }\r\n\r\n /** Get the description of the operation that would be reversed by calling [[reverseTxns]]`(1)`.\r\n * This is useful for showing the operation that would be undone, for example in a menu.\r\n */\r\n public async getUndoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getUndoString(this._iModel.key);\r\n }\r\n\r\n /** Get a description of the operation that would be reinstated by calling [[reinstateTxn]].\r\n * This is useful for showing the operation that would be redone, in a pull-down menu for example.\r\n */\r\n public async getRedoString(): Promise<string> {\r\n return IpcApp.appFunctionIpc.getRedoString(this._iModel.key);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation.\r\n * @see [[reinstateTxn]] to redo operations.\r\n * @see [[reverseAll]] to undo all operations.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseSingleTxn(): Promise<IModelStatus> {\r\n return this.reverseTxns(1);\r\n }\r\n\r\n /** Reverse (undo) the most recent operation(s) to the briefcase in the current session.\r\n * @param numOperations the number of operations to reverse. If this is greater than 1, the entire set of operations will\r\n * be reinstated together when/if [[reinstateTxn]] is called.\r\n * @note If there are any outstanding uncommitted changes, they are reversed.\r\n * @note The term \"operation\" is used rather than Txn, since multiple Txns can be grouped together via [TxnManager.beginMultiTxnOperation]($backend). So,\r\n * even if numOperations is 1, multiple Txns may be reversed if they were grouped together when they were made.\r\n * @note If numOperations is too large only the number of reversible operations are reversed.\r\n */\r\n public async reverseTxns(numOperations: number): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseTxns(this._iModel.key, numOperations);\r\n }\r\n\r\n /** Reverse (undo) all changes back to the beginning of the session.\r\n * @see [[reinstateTxn]] to redo changes.\r\n * @see [[reverseSingleTxn]] to undo only the most recent operation.\r\n * @see [[isUndoPossible]] to determine if any reversible operations exist.\r\n */\r\n public async reverseAll(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reverseAllTxn(this._iModel.key);\r\n }\r\n\r\n /** Reinstate (redo) the most recently reversed transaction. Since at any time multiple transactions can be reversed, it\r\n * may take multiple calls to this method to reinstate all reversed operations.\r\n * @returns Success if a reversed transaction was reinstated, error status otherwise.\r\n * @note If there are any outstanding uncommitted changes, they are canceled before the Txn is reinstated.\r\n * @see [[isRedoPossible]] to determine if any reinstatable operations exist.\r\n * @see [[reverseSingleTxn]] or [[reverseAll]] to undo changes.\r\n */\r\n public async reinstateTxn(): Promise<IModelStatus> {\r\n return IpcApp.appFunctionIpc.reinstateTxn(this._iModel.key);\r\n }\r\n\r\n /** Restart the current TxnManager session. This causes all Txns in the current session to no longer be undoable (as if the file was closed\r\n * and reopened.)\r\n * @note This can be quite disconcerting to the user expecting to be able to undo previously made changes. It should only be used\r\n * under extreme circumstances where damage to the file or session could happen if the currently committed are reversed. Use sparingly and with care.\r\n * Probably a good idea to alert the user it happened.\r\n */\r\n public async restartTxnSession(): Promise<void> {\r\n await IpcApp.appFunctionIpc.restartTxnSession(this._iModel.key);\r\n }\r\n\r\n /** @internal */\r\n public notifyElementsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onElementsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyModelsChanged(changed: NotifyEntitiesChangedArgs): void {\r\n this.onModelsChanged.raiseEvent(new EntityChanges(changed));\r\n }\r\n\r\n /** @internal */\r\n public notifyGeometryGuidsChanged(changes: ModelIdAndGeometryGuid[]): void {\r\n this.onModelGeometryChanged.raiseEvent(changes);\r\n }\r\n\r\n /** @internal */\r\n public notifyCommit() {\r\n this.onCommit.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyCommitted(hasPendingTxns: boolean, time: number) {\r\n this.onCommitted.raiseEvent(hasPendingTxns, time);\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayExternalTxns() {\r\n this.onReplayExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyReplayedExternalTxns() {\r\n this.onReplayedExternalTxns.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyChangesApplied() {\r\n this.onChangesApplied.raiseEvent();\r\n }\r\n\r\n /** @internal */\r\n public notifyBeforeUndoRedo(isUndo: boolean) {\r\n this.onBeforeUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyAfterUndoRedo(isUndo: boolean) {\r\n this.onAfterUndoRedo.raiseEvent(isUndo);\r\n }\r\n\r\n /** @internal */\r\n public notifyPulledChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPulled.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyPushedChanges(parentChangeset: ChangesetIndexAndId) {\r\n this.onChangesPushed.raiseEvent(parentChangeset);\r\n }\r\n\r\n /** @internal */\r\n public notifyIModelNameChanged(name: string) {\r\n this._iModel.name = name;\r\n }\r\n\r\n /** @internal */\r\n public notifyRootSubjectChanged(subject: RootSubjectProps) {\r\n this._iModel.rootSubject = subject;\r\n }\r\n\r\n /** @internal */\r\n public notifyProjectExtentsChanged(range: Range3dProps) {\r\n this._iModel.projectExtents = Range3d.fromJSON(range);\r\n }\r\n\r\n /** @internal */\r\n public notifyGlobalOriginChanged(origin: XYZProps) {\r\n this._iModel.globalOrigin = Point3d.fromJSON(origin);\r\n }\r\n\r\n /** @internal */\r\n public notifyEcefLocationChanged(ecef: EcefLocationProps | undefined) {\r\n this._iModel.ecefLocation = ecef ? new EcefLocation(ecef) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyGeographicCoordinateSystemChanged(gcs: GeographicCRSProps | undefined) {\r\n this._iModel.geographicCoordinateSystem = gcs ? new GeographicCRS(gcs) : undefined;\r\n }\r\n\r\n /** @internal */\r\n public notifyPullMergeBegin(changeset: ChangesetIdWithIndex) {\r\n this.onPullMergeBegin.raiseEvent(changeset);\r\n }\r\n /** @internal */\r\n public notifyPullMergeEnd(changeset: ChangesetIdWithIndex) {\r\n this.onPullMergeEnd.raiseEvent(changeset);\r\n }\r\n /** @internal */\r\n public notifyApplyIncomingChangesBegin(changes: ChangesetProps[]) {\r\n this.onApplyIncomingChangesBegin.raiseEvent(changes);\r\n }\r\n /** @internal */\r\n public notifyApplyIncomingChangesEnd(changes: ChangesetProps[]) {\r\n this.onApplyIncomingChangesEnd.raiseEvent(changes);\r\n }\r\n /** @internal */\r\n public notifyReverseLocalChangesBegin() {\r\n this.onReverseLocalChangesBegin.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyReverseLocalChangesEnd(txns: TxnProps[]) {\r\n this.onReverseLocalChangesEnd.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyDownloadChangesetsBegin() {\r\n this.onDownloadChangesetsBegin.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyDownloadChangesetsEnd() {\r\n this.onDownloadChangesetsEnd.raiseEvent();\r\n }\r\n /** @internal */\r\n public notifyRebaseBegin(txns: TxnProps[]) {\r\n this.onRebaseBegin.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyRebaseEnd(txns: TxnProps[]) {\r\n this.onRebaseEnd.raiseEvent(txns);\r\n }\r\n /** @internal */\r\n public notifyRebaseTxnBegin(txn: TxnProps) {\r\n this.onRebaseTxnBegin.raiseEvent(txn);\r\n }\r\n /** @internal */\r\n public notifyRebaseTxnEnd(txn: TxnProps) {\r\n this.onRebaseTxnEnd.raiseEvent(txn);\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itwin/core-frontend",
|
|
3
|
-
"version": "5.7.0-dev.
|
|
3
|
+
"version": "5.7.0-dev.3",
|
|
4
4
|
"description": "iTwin.js frontend components",
|
|
5
5
|
"main": "lib/cjs/core-frontend.js",
|
|
6
6
|
"module": "lib/esm/core-frontend.js",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"url": "http://www.bentley.com"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@itwin/appui-abstract": "5.7.0-dev.
|
|
27
|
-
"@itwin/core-bentley": "5.7.0-dev.
|
|
28
|
-
"@itwin/
|
|
29
|
-
"@itwin/core-orbitgt": "5.7.0-dev.
|
|
30
|
-
"@itwin/
|
|
31
|
-
"@itwin/
|
|
32
|
-
"@itwin/
|
|
33
|
-
"@itwin/core-
|
|
26
|
+
"@itwin/appui-abstract": "5.7.0-dev.3",
|
|
27
|
+
"@itwin/core-bentley": "5.7.0-dev.3",
|
|
28
|
+
"@itwin/core-geometry": "5.7.0-dev.3",
|
|
29
|
+
"@itwin/core-orbitgt": "5.7.0-dev.3",
|
|
30
|
+
"@itwin/ecschema-rpcinterface-common": "5.7.0-dev.3",
|
|
31
|
+
"@itwin/ecschema-metadata": "5.7.0-dev.3",
|
|
32
|
+
"@itwin/core-quantity": "5.7.0-dev.3",
|
|
33
|
+
"@itwin/core-common": "5.7.0-dev.3"
|
|
34
34
|
},
|
|
35
35
|
"//devDependencies": [
|
|
36
36
|
"NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install",
|
|
@@ -57,15 +57,15 @@
|
|
|
57
57
|
"vite-multiple-assets": "^1.3.1",
|
|
58
58
|
"vite-plugin-static-copy": "2.2.0",
|
|
59
59
|
"webpack": "^5.97.1",
|
|
60
|
-
"@itwin/
|
|
61
|
-
"@itwin/
|
|
62
|
-
"@itwin/core-
|
|
63
|
-
"@itwin/build-tools": "5.7.0-dev.
|
|
64
|
-
"@itwin/
|
|
65
|
-
"@itwin/core-
|
|
66
|
-
"@itwin/
|
|
67
|
-
"@itwin/
|
|
68
|
-
"@itwin/
|
|
60
|
+
"@itwin/core-bentley": "5.7.0-dev.3",
|
|
61
|
+
"@itwin/appui-abstract": "5.7.0-dev.3",
|
|
62
|
+
"@itwin/core-common": "5.7.0-dev.3",
|
|
63
|
+
"@itwin/build-tools": "5.7.0-dev.3",
|
|
64
|
+
"@itwin/core-geometry": "5.7.0-dev.3",
|
|
65
|
+
"@itwin/core-quantity": "5.7.0-dev.3",
|
|
66
|
+
"@itwin/core-orbitgt": "5.7.0-dev.3",
|
|
67
|
+
"@itwin/ecschema-rpcinterface-common": "5.7.0-dev.3",
|
|
68
|
+
"@itwin/ecschema-metadata": "5.7.0-dev.3"
|
|
69
69
|
},
|
|
70
70
|
"//dependencies": [
|
|
71
71
|
"NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API",
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"@loaders.gl/draco": "^4.3.4",
|
|
77
77
|
"fuse.js": "^3.3.0",
|
|
78
78
|
"wms-capabilities": "0.4.0",
|
|
79
|
-
"@itwin/core-i18n": "5.7.0-dev.
|
|
80
|
-
"@itwin/webgl-compatibility": "5.7.0-dev.
|
|
79
|
+
"@itwin/core-i18n": "5.7.0-dev.3",
|
|
80
|
+
"@itwin/webgl-compatibility": "5.7.0-dev.3"
|
|
81
81
|
},
|
|
82
82
|
"scripts": {
|
|
83
83
|
"build": "npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers && npm run -s copy:draco",
|