@itwin/core-backend 5.9.0-dev.9 → 5.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -1
- package/lib/cjs/BriefcaseManager.d.ts +14 -62
- package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
- package/lib/cjs/BriefcaseManager.js +29 -159
- package/lib/cjs/BriefcaseManager.js.map +1 -1
- package/lib/cjs/Category.d.ts +4 -4
- package/lib/cjs/Category.js.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts +9 -1
- package/lib/cjs/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/cjs/ChangesetECAdaptor.js +7 -1
- package/lib/cjs/ChangesetECAdaptor.js.map +1 -1
- package/lib/cjs/ChangesetReader.d.ts +186 -0
- package/lib/cjs/ChangesetReader.d.ts.map +1 -0
- package/lib/cjs/ChangesetReader.js +372 -0
- package/lib/cjs/ChangesetReader.js.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts +120 -0
- package/lib/cjs/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/cjs/ChangesetReaderTypes.js +23 -0
- package/lib/cjs/ChangesetReaderTypes.js.map +1 -0
- package/lib/cjs/CloudSqlite.d.ts +1 -1
- package/lib/cjs/CloudSqlite.d.ts.map +1 -1
- package/lib/cjs/CloudSqlite.js +68 -13
- package/lib/cjs/CloudSqlite.js.map +1 -1
- package/lib/cjs/CodeSpecs.d.ts +3 -3
- package/lib/cjs/CodeSpecs.js.map +1 -1
- package/lib/cjs/ConcurrentQuery.js.map +1 -1
- package/lib/cjs/DevTools.js.map +1 -1
- package/lib/cjs/DisplayStyle.d.ts +2 -2
- package/lib/cjs/DisplayStyle.js.map +1 -1
- package/lib/cjs/ECSqlStatement.d.ts.map +1 -1
- package/lib/cjs/ECSqlStatement.js.map +1 -1
- package/lib/cjs/EditTxn.d.ts +55 -1
- package/lib/cjs/EditTxn.d.ts.map +1 -1
- package/lib/cjs/EditTxn.js +43 -1
- package/lib/cjs/EditTxn.js.map +1 -1
- package/lib/cjs/Element.d.ts +79 -10
- package/lib/cjs/Element.d.ts.map +1 -1
- package/lib/cjs/Element.js +38 -2
- package/lib/cjs/Element.js.map +1 -1
- package/lib/cjs/ElementAspect.d.ts +1 -1
- package/lib/cjs/ElementAspect.js.map +1 -1
- package/lib/cjs/ElementGraphics.js.map +1 -1
- package/lib/cjs/ElementTreeWalker.d.ts +5 -5
- package/lib/cjs/ElementTreeWalker.js.map +1 -1
- package/lib/cjs/ExternalSource.d.ts +2 -2
- package/lib/cjs/ExternalSource.d.ts.map +1 -1
- package/lib/cjs/ExternalSource.js.map +1 -1
- package/lib/cjs/GeographicCRSServices.d.ts +15 -0
- package/lib/cjs/GeographicCRSServices.d.ts.map +1 -1
- package/lib/cjs/GeographicCRSServices.js +13 -4
- package/lib/cjs/GeographicCRSServices.js.map +1 -1
- package/lib/cjs/IModelDb.d.ts +31 -23
- package/lib/cjs/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +44 -25
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/cjs/IModelJsFs.d.ts +2 -0
- package/lib/cjs/IModelJsFs.d.ts.map +1 -1
- package/lib/cjs/IModelJsFs.js +14 -0
- package/lib/cjs/IModelJsFs.js.map +1 -1
- package/lib/cjs/IpcHost.d.ts.map +1 -1
- package/lib/cjs/IpcHost.js +20 -9
- package/lib/cjs/IpcHost.js.map +1 -1
- package/lib/cjs/LineStyle.d.ts +6 -6
- package/lib/cjs/LineStyle.js.map +1 -1
- package/lib/cjs/Material.d.ts +1 -1
- package/lib/cjs/Material.js.map +1 -1
- package/lib/cjs/Model.d.ts +40 -6
- package/lib/cjs/Model.d.ts.map +1 -1
- package/lib/cjs/Model.js +24 -0
- package/lib/cjs/Model.js.map +1 -1
- package/lib/cjs/PartialChangeUnifier.d.ts +77 -0
- package/lib/cjs/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/cjs/PartialChangeUnifier.js +234 -0
- package/lib/cjs/PartialChangeUnifier.js.map +1 -0
- package/lib/cjs/Relationship.d.ts +10 -10
- package/lib/cjs/Relationship.js +6 -6
- package/lib/cjs/Relationship.js.map +1 -1
- package/lib/cjs/SheetIndex.d.ts +4 -4
- package/lib/cjs/SheetIndex.d.ts.map +1 -1
- package/lib/cjs/SheetIndex.js.map +1 -1
- package/lib/cjs/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/cjs/SqliteChangesetReader.js +1 -1
- package/lib/cjs/SqliteChangesetReader.js.map +1 -1
- package/lib/cjs/Texture.d.ts +1 -1
- package/lib/cjs/Texture.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +17 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +120 -13
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/cjs/ViewDefinition.d.ts +25 -13
- package/lib/cjs/ViewDefinition.d.ts.map +1 -1
- package/lib/cjs/ViewDefinition.js +77 -25
- package/lib/cjs/ViewDefinition.js.map +1 -1
- package/lib/cjs/ViewStore.d.ts.map +1 -1
- package/lib/cjs/ViewStore.js +63 -21
- package/lib/cjs/ViewStore.js.map +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
- package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/cjs/core-backend.d.ts +3 -0
- package/lib/cjs/core-backend.d.ts.map +1 -1
- package/lib/cjs/core-backend.js +3 -0
- package/lib/cjs/core-backend.js.map +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts +1 -1
- package/lib/cjs/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/cjs/domains/FunctionalElements.js.map +1 -1
- package/lib/cjs/domains/GenericElements.d.ts +2 -2
- package/lib/cjs/domains/GenericElements.d.ts.map +1 -1
- package/lib/cjs/domains/GenericElements.js.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.d.ts +2 -2
- package/lib/cjs/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/cjs/internal/ChannelAdmin.js.map +1 -1
- package/lib/cjs/internal/IntegrityCheck.d.ts +10 -10
- package/lib/cjs/internal/IntegrityCheck.js +22 -22
- package/lib/cjs/internal/IntegrityCheck.js.map +1 -1
- package/lib/cjs/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/cjs/workspace/Settings.d.ts +6 -4
- package/lib/cjs/workspace/Settings.d.ts.map +1 -1
- package/lib/cjs/workspace/Settings.js.map +1 -1
- package/lib/esm/BriefcaseManager.d.ts +14 -62
- package/lib/esm/BriefcaseManager.d.ts.map +1 -1
- package/lib/esm/BriefcaseManager.js +30 -160
- package/lib/esm/BriefcaseManager.js.map +1 -1
- package/lib/esm/Category.d.ts +4 -4
- package/lib/esm/Category.js.map +1 -1
- package/lib/esm/ChangesetECAdaptor.d.ts +9 -1
- package/lib/esm/ChangesetECAdaptor.d.ts.map +1 -1
- package/lib/esm/ChangesetECAdaptor.js +7 -1
- package/lib/esm/ChangesetECAdaptor.js.map +1 -1
- package/lib/esm/ChangesetReader.d.ts +186 -0
- package/lib/esm/ChangesetReader.d.ts.map +1 -0
- package/lib/esm/ChangesetReader.js +368 -0
- package/lib/esm/ChangesetReader.js.map +1 -0
- package/lib/esm/ChangesetReaderTypes.d.ts +120 -0
- package/lib/esm/ChangesetReaderTypes.d.ts.map +1 -0
- package/lib/esm/ChangesetReaderTypes.js +20 -0
- package/lib/esm/ChangesetReaderTypes.js.map +1 -0
- package/lib/esm/CloudSqlite.d.ts +1 -1
- package/lib/esm/CloudSqlite.d.ts.map +1 -1
- package/lib/esm/CloudSqlite.js +69 -14
- package/lib/esm/CloudSqlite.js.map +1 -1
- package/lib/esm/CodeSpecs.d.ts +3 -3
- package/lib/esm/CodeSpecs.js.map +1 -1
- package/lib/esm/ConcurrentQuery.js.map +1 -1
- package/lib/esm/DevTools.js.map +1 -1
- package/lib/esm/DisplayStyle.d.ts +2 -2
- package/lib/esm/DisplayStyle.js.map +1 -1
- package/lib/esm/ECSqlStatement.d.ts.map +1 -1
- package/lib/esm/ECSqlStatement.js.map +1 -1
- package/lib/esm/EditTxn.d.ts +55 -1
- package/lib/esm/EditTxn.d.ts.map +1 -1
- package/lib/esm/EditTxn.js +43 -1
- package/lib/esm/EditTxn.js.map +1 -1
- package/lib/esm/Element.d.ts +79 -10
- package/lib/esm/Element.d.ts.map +1 -1
- package/lib/esm/Element.js +38 -2
- package/lib/esm/Element.js.map +1 -1
- package/lib/esm/ElementAspect.d.ts +1 -1
- package/lib/esm/ElementAspect.js.map +1 -1
- package/lib/esm/ElementGraphics.js.map +1 -1
- package/lib/esm/ElementTreeWalker.d.ts +5 -5
- package/lib/esm/ElementTreeWalker.js.map +1 -1
- package/lib/esm/ExternalSource.d.ts +2 -2
- package/lib/esm/ExternalSource.d.ts.map +1 -1
- package/lib/esm/ExternalSource.js.map +1 -1
- package/lib/esm/GeographicCRSServices.d.ts +15 -0
- package/lib/esm/GeographicCRSServices.d.ts.map +1 -1
- package/lib/esm/GeographicCRSServices.js +12 -4
- package/lib/esm/GeographicCRSServices.js.map +1 -1
- package/lib/esm/IModelDb.d.ts +31 -23
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +45 -26
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/IModelIncrementalSchemaLocater.js.map +1 -1
- package/lib/esm/IModelJsFs.d.ts +2 -0
- package/lib/esm/IModelJsFs.d.ts.map +1 -1
- package/lib/esm/IModelJsFs.js +14 -0
- package/lib/esm/IModelJsFs.js.map +1 -1
- package/lib/esm/IpcHost.d.ts.map +1 -1
- package/lib/esm/IpcHost.js +20 -9
- package/lib/esm/IpcHost.js.map +1 -1
- package/lib/esm/LineStyle.d.ts +6 -6
- package/lib/esm/LineStyle.js.map +1 -1
- package/lib/esm/Material.d.ts +1 -1
- package/lib/esm/Material.js.map +1 -1
- package/lib/esm/Model.d.ts +40 -6
- package/lib/esm/Model.d.ts.map +1 -1
- package/lib/esm/Model.js +24 -0
- package/lib/esm/Model.js.map +1 -1
- package/lib/esm/PartialChangeUnifier.d.ts +77 -0
- package/lib/esm/PartialChangeUnifier.d.ts.map +1 -0
- package/lib/esm/PartialChangeUnifier.js +230 -0
- package/lib/esm/PartialChangeUnifier.js.map +1 -0
- package/lib/esm/Relationship.d.ts +10 -10
- package/lib/esm/Relationship.js +6 -6
- package/lib/esm/Relationship.js.map +1 -1
- package/lib/esm/SheetIndex.d.ts +4 -4
- package/lib/esm/SheetIndex.d.ts.map +1 -1
- package/lib/esm/SheetIndex.js.map +1 -1
- package/lib/esm/SqliteChangesetReader.d.ts.map +1 -1
- package/lib/esm/SqliteChangesetReader.js +1 -1
- package/lib/esm/SqliteChangesetReader.js.map +1 -1
- package/lib/esm/Texture.d.ts +1 -1
- package/lib/esm/Texture.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +17 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +121 -14
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/ViewDefinition.d.ts +25 -13
- package/lib/esm/ViewDefinition.d.ts.map +1 -1
- package/lib/esm/ViewDefinition.js +78 -26
- package/lib/esm/ViewDefinition.js.map +1 -1
- package/lib/esm/ViewStore.d.ts.map +1 -1
- package/lib/esm/ViewStore.js +64 -22
- package/lib/esm/ViewStore.js.map +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +1 -1
- package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
- package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
- package/lib/esm/core-backend.d.ts +3 -0
- package/lib/esm/core-backend.d.ts.map +1 -1
- package/lib/esm/core-backend.js +3 -0
- package/lib/esm/core-backend.js.map +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts +1 -1
- package/lib/esm/domains/FunctionalElements.d.ts.map +1 -1
- package/lib/esm/domains/FunctionalElements.js.map +1 -1
- package/lib/esm/domains/GenericElements.d.ts +2 -2
- package/lib/esm/domains/GenericElements.d.ts.map +1 -1
- package/lib/esm/domains/GenericElements.js.map +1 -1
- package/lib/esm/internal/ChannelAdmin.d.ts +2 -2
- package/lib/esm/internal/ChannelAdmin.d.ts.map +1 -1
- package/lib/esm/internal/ChannelAdmin.js.map +1 -1
- package/lib/esm/internal/IntegrityCheck.d.ts +10 -10
- package/lib/esm/internal/IntegrityCheck.js +22 -22
- package/lib/esm/internal/IntegrityCheck.js.map +1 -1
- package/lib/esm/internal/workspace/WorkspaceImpl.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -1
- package/lib/esm/test/IModelTestUtils.d.ts +1 -0
- package/lib/esm/test/IModelTestUtils.d.ts.map +1 -1
- package/lib/esm/test/IModelTestUtils.js +5 -0
- package/lib/esm/test/IModelTestUtils.js.map +1 -1
- package/lib/esm/test/IpcHost.test.js +112 -0
- package/lib/esm/test/IpcHost.test.js.map +1 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js +0 -1
- package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
- package/lib/esm/test/ecsql/dataset/ECSqlDatasets.js.map +1 -1
- package/lib/esm/test/ecsql/src/ECSqlTestRunner.test.js.map +1 -1
- package/lib/esm/test/element/DeleteDefinitionElements.test.js +819 -26
- package/lib/esm/test/element/DeleteDefinitionElements.test.js.map +1 -1
- package/lib/esm/test/element/ElementRoundTrip.test.js +144 -3
- package/lib/esm/test/element/ElementRoundTrip.test.js.map +1 -1
- package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/hubaccess/SemanticRebase.test.js +2242 -68
- package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +1 -1
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/imodel/SchemaXmlImport.test.js +64 -0
- package/lib/esm/test/imodel/SchemaXmlImport.test.js.map +1 -1
- package/lib/esm/test/misc/GeoServices.test.js +43 -1
- package/lib/esm/test/misc/GeoServices.test.js.map +1 -1
- package/lib/esm/test/sheetindex/SheetIndex.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +4184 -1654
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/DeleteElements.test.d.ts +2 -0
- package/lib/esm/test/standalone/DeleteElements.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/DeleteElements.test.js +625 -0
- package/lib/esm/test/standalone/DeleteElements.test.js.map +1 -0
- package/lib/esm/test/standalone/GeometryStream.test.js.map +1 -1
- package/lib/esm/test/standalone/IntegrityCheck.test.js +214 -5
- package/lib/esm/test/standalone/IntegrityCheck.test.js.map +1 -1
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts +2 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.d.ts.map +1 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js +1862 -0
- package/lib/esm/test/standalone/SQliteChangesetReaderAndChangesetECAdaptor.test.js.map +1 -0
- package/lib/esm/test/standalone/TxnManager.test.js +90 -0
- package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
- package/lib/esm/test/standalone/ViewDefinition.test.js +18 -7
- package/lib/esm/test/standalone/ViewDefinition.test.js.map +1 -1
- package/lib/esm/test/standalone/Workspace.test.js.map +1 -1
- package/lib/esm/workspace/Settings.d.ts +6 -4
- package/lib/esm/workspace/Settings.d.ts.map +1 -1
- package/lib/esm/workspace/Settings.js.map +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,50 @@
|
|
|
1
1
|
# Change Log - @itwin/core-backend
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Tue, 05 May 2026 17:43:30 GMT and should not be manually modified.
|
|
4
|
+
|
|
5
|
+
## 5.9.1
|
|
6
|
+
Tue, 05 May 2026 17:43:30 GMT
|
|
7
|
+
|
|
8
|
+
### Updates
|
|
9
|
+
|
|
10
|
+
- Semantic Rebase uses the new ChangesetReader api. Also while doing semantic rebase we now stream the changed instances onto the temp file while writing as well as stream changed instances from the file while reading.
|
|
11
|
+
|
|
12
|
+
## 5.9.0
|
|
13
|
+
Mon, 04 May 2026 16:32:08 GMT
|
|
14
|
+
|
|
15
|
+
### Updates
|
|
16
|
+
|
|
17
|
+
- Expose unit on list of available GCS; allow filtering GCS by unit
|
|
18
|
+
- Improve IdSet virtual table performance
|
|
19
|
+
- Add dispose method to RebaseManager
|
|
20
|
+
- Added IModelHost APIs to save and delete iTwin-scoped setting dictionaries in SettingsDb.
|
|
21
|
+
- added EditTxn apis
|
|
22
|
+
- Added the ability to release locks associated with reversed Txns.
|
|
23
|
+
- Update integrityCheck to use primary connection
|
|
24
|
+
- Updated TSDoc for Settings and IModelDb to reference current EditTxn APIs instead of deprecated methods.
|
|
25
|
+
- Added deleteElements method for bulk element deletion with automatic cascade, constraint checking, and cleanup.
|
|
26
|
+
- Optimized EditTxn.deleteElements for better performance and clearer reporting; added batch lifecycle callbacks Element.onBulkDeleted, Element.onBulkChildDeleted, and Model.onBulkModelEvents to avoid per-element notification overhead.
|
|
27
|
+
- Added a beta api to allow schema xml serialization to any ECSpecVersion.
|
|
28
|
+
- Added ECSql nav prop corresponding `RelatedElementProps` members to the backend `ViewDefinition`, `SpatialViewDefinition`, and `ViewDefinition2d` classes.
|
|
29
|
+
- Fix nested Error objects losing non-enumerable properties (message, stack) during IPC serialization in IpcHandler
|
|
30
|
+
- Added ChangesetReader api(along with new unifier apis) and deprecated ChangesetECAdaptor apis(including unifier apis)
|
|
31
|
+
|
|
32
|
+
## 5.8.4
|
|
33
|
+
Thu, 23 Apr 2026 18:05:13 GMT
|
|
34
|
+
|
|
35
|
+
_Version update only_
|
|
36
|
+
|
|
37
|
+
## 5.8.3
|
|
38
|
+
Thu, 23 Apr 2026 14:52:42 GMT
|
|
39
|
+
|
|
40
|
+
_Version update only_
|
|
41
|
+
|
|
42
|
+
## 5.8.2
|
|
43
|
+
Thu, 16 Apr 2026 11:05:01 GMT
|
|
44
|
+
|
|
45
|
+
### Updates
|
|
46
|
+
|
|
47
|
+
- Fix nested Error objects losing non-enumerable properties (message, stack) during IPC serialization in IpcHandler
|
|
4
48
|
|
|
5
49
|
## 5.8.1
|
|
6
50
|
Fri, 10 Apr 2026 13:02:00 GMT
|
|
@@ -1,30 +1,13 @@
|
|
|
1
1
|
/** @packageDocumentation
|
|
2
2
|
* @module iModels
|
|
3
3
|
*/
|
|
4
|
-
import { AccessToken, BeDuration, GuidString,
|
|
4
|
+
import { AccessToken, BeDuration, GuidString, Optional } from "@itwin/core-bentley";
|
|
5
5
|
import { BriefcaseId, BriefcaseProps, ChangesetFileProps, ChangesetIndex, ChangesetIndexOrId, ChangesetProps, ChangesetRange, LocalBriefcaseProps, LocalDirName, LocalFileName, RequestNewBriefcaseProps } from "@itwin/core-common";
|
|
6
6
|
import { AcquireNewBriefcaseIdArg, DownloadChangesetArg, DownloadChangesetRangeArg, IModelNameArg } from "./BackendHubAccess";
|
|
7
7
|
import { ProgressFunction } from "./CheckpointManager";
|
|
8
8
|
import { BriefcaseDb, IModelDb, TokenArg } from "./IModelDb";
|
|
9
9
|
import { StashProps } from "./StashManager";
|
|
10
|
-
import {
|
|
11
|
-
/**
|
|
12
|
-
* The argument for identifying an Patch Instance Key
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
interface PatchInstanceKey {
|
|
16
|
-
id: Id64String;
|
|
17
|
-
classFullName: string;
|
|
18
|
-
}
|
|
19
|
-
/** The argument for patch instances during high level rebase application
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export interface InstancePatch {
|
|
23
|
-
key: PatchInstanceKey;
|
|
24
|
-
op: "Inserted" | "Updated" | "Deleted";
|
|
25
|
-
isIndirect: boolean;
|
|
26
|
-
props?: ECSqlRow;
|
|
27
|
-
}
|
|
10
|
+
import { ChangeInstance } from "./ChangesetReaderTypes";
|
|
28
11
|
/** The argument for [[BriefcaseManager.downloadBriefcase]]
|
|
29
12
|
* @public
|
|
30
13
|
*/
|
|
@@ -294,44 +277,14 @@ export declare class BriefcaseManager {
|
|
|
294
277
|
private static readonly SCHEMAS_FOLDER;
|
|
295
278
|
private static readonly DATA_FOLDER;
|
|
296
279
|
private static readonly DATA_FILE_NAME;
|
|
297
|
-
/**
|
|
298
|
-
* Captures the changed instances as patch instances from each data txn in the briefcase db for semantic rebase
|
|
299
|
-
* @param db The {@link BriefcaseDb} instance for which to capture the changed instances as patch instances for all data txns
|
|
300
|
-
* @internal
|
|
301
|
-
*/
|
|
302
|
-
private static capturePatchInstances;
|
|
303
|
-
/**
|
|
304
|
-
* Captures changed instances from a txn as JSON
|
|
305
|
-
* @param txnId The txn id for which to capture changed instances
|
|
306
|
-
* @param db The {@link BriefcaseDb} instance from which to capture changed instances as json
|
|
307
|
-
* @returns changed instances for semantic rebase
|
|
308
|
-
* @internal
|
|
309
|
-
*/
|
|
310
|
-
private static captureChangedInstancesAsJSON;
|
|
311
|
-
/**
|
|
312
|
-
* Constructs patch instances from changed instances
|
|
313
|
-
* @param changedInstances The changed instances from which to construct the patch instances
|
|
314
|
-
* @param db The {@link BriefcaseDb} instance for which to construct the patch instances
|
|
315
|
-
* @returns The {@link InstancePatch} instance patches for semantic rebase
|
|
316
|
-
* @internal
|
|
317
|
-
*/
|
|
318
|
-
private static constructPatchInstances;
|
|
319
|
-
/**
|
|
320
|
-
* Constructs a single patch instance from changed instance
|
|
321
|
-
* @param changedInstance The changed instance from which to construct the patch instance
|
|
322
|
-
* @param db The {@link BriefcaseDb} instance for which to construct the single patch instance
|
|
323
|
-
* @returns a single instance patch {@link InstancePatch}
|
|
324
|
-
* @throws IModelError If cannot determine classId or unknown operation encountered
|
|
325
|
-
*/
|
|
326
|
-
private static constructPatchInstance;
|
|
327
280
|
/**
|
|
328
281
|
* Stores changed instances for semantic rebase locally in appropriate json file in a folder structure
|
|
329
|
-
* @param db The
|
|
282
|
+
* @param db The [BriefcaseDb]($backend) instance for storing the changed instances against a txn
|
|
330
283
|
* @param txnId The txn id for which we are storing the changed instances
|
|
331
|
-
* @param instancePatches The
|
|
284
|
+
* @param instancePatches The [ChangeInstance]($backend) instance patches to be stored
|
|
332
285
|
* @internal
|
|
333
286
|
*/
|
|
334
|
-
|
|
287
|
+
static storeChangedInstancesForSemanticRebase(db: BriefcaseDb, txnId: string, instancePatches: IterableIterator<ChangeInstance>): void;
|
|
335
288
|
/**
|
|
336
289
|
* Gets the base path for semantic rebase local files
|
|
337
290
|
* @param db The {@link BriefcaseDb} instance for which to get the base path
|
|
@@ -341,7 +294,7 @@ export declare class BriefcaseManager {
|
|
|
341
294
|
static getBasePathForSemanticRebaseLocalFiles(db: BriefcaseDb): string;
|
|
342
295
|
/**
|
|
343
296
|
* Stores schemas for semantic rebase locally in appropriate folder structure
|
|
344
|
-
* @param db The
|
|
297
|
+
* @param db The [BriefcaseDb]($backend) instance for storing the schemas against a txn
|
|
345
298
|
* @param txnId The txn id for which we are storing the schemas
|
|
346
299
|
* @param schemaFileNames The schema file paths or schema xml strings to be stored
|
|
347
300
|
* @internal
|
|
@@ -349,7 +302,7 @@ export declare class BriefcaseManager {
|
|
|
349
302
|
static storeSchemasForSemanticRebase<T extends LocalFileName[] | string[]>(db: BriefcaseDb, txnId: string, schemaFileNames: T): void;
|
|
350
303
|
/**
|
|
351
304
|
* Gets schemas for semantic rebase for a txn
|
|
352
|
-
* @param db The
|
|
305
|
+
* @param db The [BriefcaseDb]($backend) instance for getting the locally stored schemas against a txn
|
|
353
306
|
* @param txnId The txn id for which we are getting the schemas
|
|
354
307
|
* @returns the schema file paths
|
|
355
308
|
* @internal
|
|
@@ -357,15 +310,15 @@ export declare class BriefcaseManager {
|
|
|
357
310
|
static getSchemasForTxn(db: BriefcaseDb, txnId: string): string[];
|
|
358
311
|
/**
|
|
359
312
|
* Get the changed instances data for semantic rebase for a txn
|
|
360
|
-
* @param db - The
|
|
313
|
+
* @param db - The [BriefcaseDb]($backend) instance for getting the locally stored changed instances against a txn
|
|
361
314
|
* @param txnId - The txn id for which we are getting the changed instances
|
|
362
315
|
* @returns Instance patches
|
|
363
316
|
* @internal
|
|
364
317
|
*/
|
|
365
|
-
static getChangedInstancesDataForTxn(db: BriefcaseDb, txnId: string):
|
|
318
|
+
static getChangedInstancesDataForTxn(db: BriefcaseDb, txnId: string): AsyncGenerator<ChangeInstance>;
|
|
366
319
|
/**
|
|
367
320
|
* Checks if schema folder exists for semantic rebase for a txn
|
|
368
|
-
* @param db - The
|
|
321
|
+
* @param db - The [BriefcaseDb]($backend) instance for which TO check the schema folder
|
|
369
322
|
* @param txnId - The txn id for which we are check the schema folder
|
|
370
323
|
* @returns true if exists, false otherwise
|
|
371
324
|
* @internal
|
|
@@ -373,7 +326,7 @@ export declare class BriefcaseManager {
|
|
|
373
326
|
static semanticRebaseSchemaFolderExists(db: BriefcaseDb, txnId: string): boolean;
|
|
374
327
|
/**
|
|
375
328
|
* Checks if data folder exists for semantic rebase for a txn
|
|
376
|
-
* @param db The
|
|
329
|
+
* @param db The [BriefcaseDb]($backend) instance for which to check the data folder.
|
|
377
330
|
* @param txnId The txn id for which to check the data folder
|
|
378
331
|
* @returns true if exists, false otherwise
|
|
379
332
|
* @internal
|
|
@@ -381,21 +334,21 @@ export declare class BriefcaseManager {
|
|
|
381
334
|
static semanticRebaseDataFolderExists(db: BriefcaseDb, txnId: string): boolean;
|
|
382
335
|
/**
|
|
383
336
|
* Deletes the schema folder for semantic rebase for a txn
|
|
384
|
-
* @param db The
|
|
337
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the schema folder.
|
|
385
338
|
* @param txnId The txn id for which to delete the schema folder
|
|
386
339
|
* @internal
|
|
387
340
|
*/
|
|
388
341
|
static deleteTxnSchemaFolder(db: BriefcaseDb, txnId: string): void;
|
|
389
342
|
/**
|
|
390
343
|
* Deletes the data folder for semantic rebase for a txn
|
|
391
|
-
* @param db The
|
|
344
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the data folder.
|
|
392
345
|
* @param txnId The txn id for which to delete the data folder
|
|
393
346
|
* @internal
|
|
394
347
|
*/
|
|
395
348
|
static deleteTxnDataFolder(db: BriefcaseDb, txnId: string): void;
|
|
396
349
|
/**
|
|
397
350
|
* Deletes rebase folders for semantic rebase
|
|
398
|
-
* @param db The
|
|
351
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the rebase folders.
|
|
399
352
|
* @param checkIfEmpty If true, only deletes the base folder if it is empty, default is false
|
|
400
353
|
* @internal
|
|
401
354
|
*/
|
|
@@ -408,5 +361,4 @@ export declare class BriefcaseManager {
|
|
|
408
361
|
*/
|
|
409
362
|
private static cleanupRebaseFolders;
|
|
410
363
|
}
|
|
411
|
-
export {};
|
|
412
364
|
//# sourceMappingURL=BriefcaseManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BriefcaseManager.d.ts","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EACL,WAAW,EAAE,UAAU,EAA6B,UAAU,
|
|
1
|
+
{"version":3,"file":"BriefcaseManager.d.ts","sourceRoot":"","sources":["../../src/BriefcaseManager.ts"],"names":[],"mappings":"AAIA;;GAEG;AAMH,OAAO,EACL,WAAW,EAAE,UAAU,EAA6B,UAAU,EAAmD,QAAQ,EAC1H,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAEL,WAAW,EAAoB,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cA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;;;OAMG;WACW,sCAAsC,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IAqB7I;;;;;OAKG;WACW,sCAAsC,CAAC,EAAE,EAAE,WAAW,GAAG,MAAM;IAI7E;;;;;;OAMG;WACW,6BAA6B,CAAC,CAAC,SAAS,aAAa,EAAE,GAAG,MAAM,EAAE,EAAE,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,CAAC,GAAG,IAAI;IAwB3I;;;;;;OAMG;WACW,gBAAgB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE;IAMxE;;;;;;OAMG;WACkB,6BAA6B,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,CAAC,cAAc,CAAC;IAWlH;;;;;;OAMG;WACW,gCAAgC,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAMvF;;;;;;OAMG;WACW,8BAA8B,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO;IAMrF;;;;;OAKG;WACW,qBAAqB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAazE;;;;;MAKE;WACY,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI;IAavE;;;;;OAKG;WACW,mBAAmB,CAAC,EAAE,EAAE,WAAW,EAAE,YAAY,GAAE,OAAe,GAAG,IAAI;IAiBvF;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;CAapC"}
|
|
@@ -6,58 +6,6 @@
|
|
|
6
6
|
/** @packageDocumentation
|
|
7
7
|
* @module iModels
|
|
8
8
|
*/
|
|
9
|
-
var __addDisposableResource = (this && this.__addDisposableResource) || function (env, value, async) {
|
|
10
|
-
if (value !== null && value !== void 0) {
|
|
11
|
-
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
|
|
12
|
-
var dispose, inner;
|
|
13
|
-
if (async) {
|
|
14
|
-
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
|
|
15
|
-
dispose = value[Symbol.asyncDispose];
|
|
16
|
-
}
|
|
17
|
-
if (dispose === void 0) {
|
|
18
|
-
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
|
|
19
|
-
dispose = value[Symbol.dispose];
|
|
20
|
-
if (async) inner = dispose;
|
|
21
|
-
}
|
|
22
|
-
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
|
|
23
|
-
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
|
|
24
|
-
env.stack.push({ value: value, dispose: dispose, async: async });
|
|
25
|
-
}
|
|
26
|
-
else if (async) {
|
|
27
|
-
env.stack.push({ async: true });
|
|
28
|
-
}
|
|
29
|
-
return value;
|
|
30
|
-
};
|
|
31
|
-
var __disposeResources = (this && this.__disposeResources) || (function (SuppressedError) {
|
|
32
|
-
return function (env) {
|
|
33
|
-
function fail(e) {
|
|
34
|
-
env.error = env.hasError ? new SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
|
|
35
|
-
env.hasError = true;
|
|
36
|
-
}
|
|
37
|
-
var r, s = 0;
|
|
38
|
-
function next() {
|
|
39
|
-
while (r = env.stack.pop()) {
|
|
40
|
-
try {
|
|
41
|
-
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
|
|
42
|
-
if (r.dispose) {
|
|
43
|
-
var result = r.dispose.call(r.value);
|
|
44
|
-
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
|
|
45
|
-
}
|
|
46
|
-
else s |= 1;
|
|
47
|
-
}
|
|
48
|
-
catch (e) {
|
|
49
|
-
fail(e);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
|
|
53
|
-
if (env.hasError) throw env.error;
|
|
54
|
-
}
|
|
55
|
-
return next();
|
|
56
|
-
};
|
|
57
|
-
})(typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
58
|
-
var e = new Error(message);
|
|
59
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
60
|
-
});
|
|
61
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
10
|
exports.BriefcaseManager = void 0;
|
|
63
11
|
// cspell:ignore cset csets ecchanges
|
|
@@ -74,8 +22,6 @@ const SchemaSync_1 = require("./SchemaSync");
|
|
|
74
22
|
const Symbols_1 = require("./internal/Symbols");
|
|
75
23
|
const NativePlatform_1 = require("./internal/NativePlatform");
|
|
76
24
|
const StashManager_1 = require("./StashManager");
|
|
77
|
-
const ChangesetECAdaptor_1 = require("./ChangesetECAdaptor");
|
|
78
|
-
const SqliteChangesetReader_1 = require("./SqliteChangesetReader");
|
|
79
25
|
const loggerCategory = BackendLoggerCategory_1.BackendLoggerCategory.IModelDb;
|
|
80
26
|
/** Manages downloading Briefcases and downloading and uploading changesets.
|
|
81
27
|
* @public
|
|
@@ -531,11 +477,8 @@ class BriefcaseManager {
|
|
|
531
477
|
}
|
|
532
478
|
if (!reverse) {
|
|
533
479
|
if (briefcaseDb) {
|
|
534
|
-
if (useSemanticRebase) {
|
|
535
|
-
this.capturePatchInstances(briefcaseDb);
|
|
536
|
-
}
|
|
537
480
|
briefcaseDb.txns.rebaser.notifyReverseLocalChangesBegin();
|
|
538
|
-
const reversedTxns = nativeDb.pullMergeReverseLocalChanges();
|
|
481
|
+
const reversedTxns = nativeDb.pullMergeReverseLocalChanges(useSemanticRebase);
|
|
539
482
|
if (useSemanticRebase) {
|
|
540
483
|
nativeDb.clearECDbCache(); // Clear the ECDb cache after reversing local changes to ensure consistency during semantic rebase with schema changes.
|
|
541
484
|
}
|
|
@@ -760,98 +703,11 @@ class BriefcaseManager {
|
|
|
760
703
|
static SCHEMAS_FOLDER = "schemas";
|
|
761
704
|
static DATA_FOLDER = "data";
|
|
762
705
|
static DATA_FILE_NAME = "data.json";
|
|
763
|
-
/**
|
|
764
|
-
* Captures the changed instances as patch instances from each data txn in the briefcase db for semantic rebase
|
|
765
|
-
* @param db The {@link BriefcaseDb} instance for which to capture the changed instances as patch instances for all data txns
|
|
766
|
-
* @internal
|
|
767
|
-
*/
|
|
768
|
-
static capturePatchInstances(db) {
|
|
769
|
-
const txns = Array.from(db.txns.queryTxns());
|
|
770
|
-
txns.forEach((txn) => {
|
|
771
|
-
if (txn.type !== "Data")
|
|
772
|
-
return;
|
|
773
|
-
// already captured(This actually shows that first rebase operation is already done but during that while reinstating this txns,
|
|
774
|
-
// some error happened so the folder still exists so we don't want to capture again)
|
|
775
|
-
if (this.semanticRebaseDataFolderExists(db, txn.id))
|
|
776
|
-
return;
|
|
777
|
-
const changedInstances = this.captureChangedInstancesAsJSON(db, txn.id);
|
|
778
|
-
const instancePatches = this.constructPatchInstances(db, changedInstances);
|
|
779
|
-
this.storeChangedInstancesForSemanticRebase(db, txn.id, instancePatches);
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Captures changed instances from a txn as JSON
|
|
784
|
-
* @param txnId The txn id for which to capture changed instances
|
|
785
|
-
* @param db The {@link BriefcaseDb} instance from which to capture changed instances as json
|
|
786
|
-
* @returns changed instances for semantic rebase
|
|
787
|
-
* @internal
|
|
788
|
-
*/
|
|
789
|
-
static captureChangedInstancesAsJSON(db, txnId) {
|
|
790
|
-
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
791
|
-
try {
|
|
792
|
-
const reader = SqliteChangesetReader_1.SqliteChangesetReader.openTxn({
|
|
793
|
-
txnId, db, disableSchemaCheck: true
|
|
794
|
-
});
|
|
795
|
-
const adaptor = new ChangesetECAdaptor_1.ChangesetECAdaptor(reader);
|
|
796
|
-
const indirectUnifier = __addDisposableResource(env_1, new ChangesetECAdaptor_1.PartialECChangeUnifier(reader.db, ChangesetECAdaptor_1.ECChangeUnifierCache.createInMemoryCache()), false);
|
|
797
|
-
const directUnifier = __addDisposableResource(env_1, new ChangesetECAdaptor_1.PartialECChangeUnifier(reader.db, ChangesetECAdaptor_1.ECChangeUnifierCache.createInMemoryCache()), false);
|
|
798
|
-
while (adaptor.step()) {
|
|
799
|
-
if (adaptor.reader.isIndirect)
|
|
800
|
-
indirectUnifier.appendFrom(adaptor);
|
|
801
|
-
else
|
|
802
|
-
directUnifier.appendFrom(adaptor);
|
|
803
|
-
}
|
|
804
|
-
return [...Array.from(directUnifier.instances).map((instance) => ({ isIndirect: false, instance })), ...Array.from(indirectUnifier.instances).map((instance) => ({ isIndirect: true, instance }))];
|
|
805
|
-
}
|
|
806
|
-
catch (e_1) {
|
|
807
|
-
env_1.error = e_1;
|
|
808
|
-
env_1.hasError = true;
|
|
809
|
-
}
|
|
810
|
-
finally {
|
|
811
|
-
__disposeResources(env_1);
|
|
812
|
-
}
|
|
813
|
-
}
|
|
814
|
-
/**
|
|
815
|
-
* Constructs patch instances from changed instances
|
|
816
|
-
* @param changedInstances The changed instances from which to construct the patch instances
|
|
817
|
-
* @param db The {@link BriefcaseDb} instance for which to construct the patch instances
|
|
818
|
-
* @returns The {@link InstancePatch} instance patches for semantic rebase
|
|
819
|
-
* @internal
|
|
820
|
-
*/
|
|
821
|
-
static constructPatchInstances(db, changedInstances) {
|
|
822
|
-
return changedInstances
|
|
823
|
-
.filter((changedInstance) => !(changedInstance.instance.$meta?.op === "Updated" && changedInstance.instance.$meta.stage === "Old")) // we will not take the old stage of updated instances
|
|
824
|
-
.map((changedInstance) => this.constructPatchInstance(db, changedInstance));
|
|
825
|
-
}
|
|
826
|
-
/**
|
|
827
|
-
* Constructs a single patch instance from changed instance
|
|
828
|
-
* @param changedInstance The changed instance from which to construct the patch instance
|
|
829
|
-
* @param db The {@link BriefcaseDb} instance for which to construct the single patch instance
|
|
830
|
-
* @returns a single instance patch {@link InstancePatch}
|
|
831
|
-
* @throws IModelError If cannot determine classId or unknown operation encountered
|
|
832
|
-
*/
|
|
833
|
-
static constructPatchInstance(db, changedInstance) {
|
|
834
|
-
const className = (changedInstance.instance.ECClassId && db.getClassNameFromId(changedInstance.instance.ECClassId))
|
|
835
|
-
?? changedInstance.instance.$meta?.classFullName
|
|
836
|
-
?? (changedInstance.instance.$meta?.fallbackClassId && db.getClassNameFromId(changedInstance.instance.$meta.fallbackClassId));
|
|
837
|
-
if (!className)
|
|
838
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, "Cannot determine classId of changed instance");
|
|
839
|
-
const instanceKey = { id: changedInstance.instance.ECInstanceId, classFullName: className };
|
|
840
|
-
const op = changedInstance.instance.$meta?.op;
|
|
841
|
-
if (op !== "Inserted" && op !== "Updated" && op !== "Deleted")
|
|
842
|
-
throw new core_common_1.IModelError(core_bentley_1.IModelStatus.BadArg, `Unknown operation: ${op}`);
|
|
843
|
-
return {
|
|
844
|
-
key: instanceKey,
|
|
845
|
-
op,
|
|
846
|
-
isIndirect: changedInstance.isIndirect,
|
|
847
|
-
props: op !== "Deleted" ? db[Symbols_1._nativeDb].readInstance(instanceKey, { useJsNames: true }) : undefined,
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
706
|
/**
|
|
851
707
|
* Stores changed instances for semantic rebase locally in appropriate json file in a folder structure
|
|
852
|
-
* @param db The
|
|
708
|
+
* @param db The [BriefcaseDb]($backend) instance for storing the changed instances against a txn
|
|
853
709
|
* @param txnId The txn id for which we are storing the changed instances
|
|
854
|
-
* @param instancePatches The
|
|
710
|
+
* @param instancePatches The [ChangeInstance]($backend) instance patches to be stored
|
|
855
711
|
* @internal
|
|
856
712
|
*/
|
|
857
713
|
static storeChangedInstancesForSemanticRebase(db, txnId, instancePatches) {
|
|
@@ -861,7 +717,17 @@ class BriefcaseManager {
|
|
|
861
717
|
if (IModelJsFs_1.IModelJsFs.existsSync(targetDir))
|
|
862
718
|
IModelJsFs_1.IModelJsFs.removeSync(targetDir);
|
|
863
719
|
IModelJsFs_1.IModelJsFs.recursiveMkDirSync(targetDir);
|
|
864
|
-
IModelJsFs_1.IModelJsFs.writeFileSync(filePath,
|
|
720
|
+
IModelJsFs_1.IModelJsFs.writeFileSync(filePath, "[");
|
|
721
|
+
let isFirst = true;
|
|
722
|
+
for (const instancePatch of instancePatches) {
|
|
723
|
+
// we will not take the old stage of updated instances for now, because we still don't have conflict resolution on instance level while using semantic rebase.
|
|
724
|
+
// Once we have conflict resolution on instance level, we can consider taking old stage of updated instances as well.
|
|
725
|
+
if (instancePatch.$meta.op === "Updated" && instancePatch.$meta.stage === "Old")
|
|
726
|
+
continue;
|
|
727
|
+
IModelJsFs_1.IModelJsFs.appendFileSync(filePath, `${isFirst ? "" : ","}\n${JSON.stringify(instancePatch, core_common_1.Base64EncodedString.replacer)}`);
|
|
728
|
+
isFirst = false;
|
|
729
|
+
}
|
|
730
|
+
IModelJsFs_1.IModelJsFs.appendFileSync(filePath, "\n]");
|
|
865
731
|
}
|
|
866
732
|
/**
|
|
867
733
|
* Gets the base path for semantic rebase local files
|
|
@@ -874,7 +740,7 @@ class BriefcaseManager {
|
|
|
874
740
|
}
|
|
875
741
|
/**
|
|
876
742
|
* Stores schemas for semantic rebase locally in appropriate folder structure
|
|
877
|
-
* @param db The
|
|
743
|
+
* @param db The [BriefcaseDb]($backend) instance for storing the schemas against a txn
|
|
878
744
|
* @param txnId The txn id for which we are storing the schemas
|
|
879
745
|
* @param schemaFileNames The schema file paths or schema xml strings to be stored
|
|
880
746
|
* @internal
|
|
@@ -900,7 +766,7 @@ class BriefcaseManager {
|
|
|
900
766
|
}
|
|
901
767
|
/**
|
|
902
768
|
* Gets schemas for semantic rebase for a txn
|
|
903
|
-
* @param db The
|
|
769
|
+
* @param db The [BriefcaseDb]($backend) instance for getting the locally stored schemas against a txn
|
|
904
770
|
* @param txnId The txn id for which we are getting the schemas
|
|
905
771
|
* @returns the schema file paths
|
|
906
772
|
* @internal
|
|
@@ -912,21 +778,25 @@ class BriefcaseManager {
|
|
|
912
778
|
}
|
|
913
779
|
/**
|
|
914
780
|
* Get the changed instances data for semantic rebase for a txn
|
|
915
|
-
* @param db - The
|
|
781
|
+
* @param db - The [BriefcaseDb]($backend) instance for getting the locally stored changed instances against a txn
|
|
916
782
|
* @param txnId - The txn id for which we are getting the changed instances
|
|
917
783
|
* @returns Instance patches
|
|
918
784
|
* @internal
|
|
919
785
|
*/
|
|
920
|
-
static getChangedInstancesDataForTxn(db, txnId) {
|
|
786
|
+
static async *getChangedInstancesDataForTxn(db, txnId) {
|
|
921
787
|
const basePath = BriefcaseManager.getBasePathForSemanticRebaseLocalFiles(db);
|
|
922
788
|
const folderPath = path.join(basePath, txnId, BriefcaseManager.DATA_FOLDER);
|
|
923
789
|
const filePath = path.join(folderPath, BriefcaseManager.DATA_FILE_NAME);
|
|
924
|
-
const
|
|
925
|
-
|
|
790
|
+
for await (const line of IModelJsFs_1.IModelJsFs.readLines(filePath)) {
|
|
791
|
+
if (line === "[" || line === "]" || line === "")
|
|
792
|
+
continue;
|
|
793
|
+
const trimmedLine = line.trim().endsWith(",") ? line.trim().slice(0, -1) : line.trim(); // remove trailing comma if exists
|
|
794
|
+
yield JSON.parse(trimmedLine, core_common_1.Base64EncodedString.reviver);
|
|
795
|
+
}
|
|
926
796
|
}
|
|
927
797
|
/**
|
|
928
798
|
* Checks if schema folder exists for semantic rebase for a txn
|
|
929
|
-
* @param db - The
|
|
799
|
+
* @param db - The [BriefcaseDb]($backend) instance for which TO check the schema folder
|
|
930
800
|
* @param txnId - The txn id for which we are check the schema folder
|
|
931
801
|
* @returns true if exists, false otherwise
|
|
932
802
|
* @internal
|
|
@@ -938,7 +808,7 @@ class BriefcaseManager {
|
|
|
938
808
|
}
|
|
939
809
|
/**
|
|
940
810
|
* Checks if data folder exists for semantic rebase for a txn
|
|
941
|
-
* @param db The
|
|
811
|
+
* @param db The [BriefcaseDb]($backend) instance for which to check the data folder.
|
|
942
812
|
* @param txnId The txn id for which to check the data folder
|
|
943
813
|
* @returns true if exists, false otherwise
|
|
944
814
|
* @internal
|
|
@@ -950,7 +820,7 @@ class BriefcaseManager {
|
|
|
950
820
|
}
|
|
951
821
|
/**
|
|
952
822
|
* Deletes the schema folder for semantic rebase for a txn
|
|
953
|
-
* @param db The
|
|
823
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the schema folder.
|
|
954
824
|
* @param txnId The txn id for which to delete the schema folder
|
|
955
825
|
* @internal
|
|
956
826
|
*/
|
|
@@ -966,7 +836,7 @@ class BriefcaseManager {
|
|
|
966
836
|
}
|
|
967
837
|
/**
|
|
968
838
|
* Deletes the data folder for semantic rebase for a txn
|
|
969
|
-
* @param db The
|
|
839
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the data folder.
|
|
970
840
|
* @param txnId The txn id for which to delete the data folder
|
|
971
841
|
* @internal
|
|
972
842
|
*/
|
|
@@ -982,7 +852,7 @@ class BriefcaseManager {
|
|
|
982
852
|
}
|
|
983
853
|
/**
|
|
984
854
|
* Deletes rebase folders for semantic rebase
|
|
985
|
-
* @param db The
|
|
855
|
+
* @param db The [BriefcaseDb]($backend) instance for which to delete the rebase folders.
|
|
986
856
|
* @param checkIfEmpty If true, only deletes the base folder if it is empty, default is false
|
|
987
857
|
* @internal
|
|
988
858
|
*/
|