@itwin/core-backend 5.14.0-dev.2 → 5.14.0-dev.4

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.
Files changed (59) hide show
  1. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  2. package/lib/cjs/BriefcaseManager.js +11 -5
  3. package/lib/cjs/BriefcaseManager.js.map +1 -1
  4. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  5. package/lib/cjs/CloudSqlite.js +9 -2
  6. package/lib/cjs/CloudSqlite.js.map +1 -1
  7. package/lib/cjs/ECDb.d.ts.map +1 -1
  8. package/lib/cjs/ECDb.js +1 -0
  9. package/lib/cjs/ECDb.js.map +1 -1
  10. package/lib/cjs/IModelDb.d.ts +42 -7
  11. package/lib/cjs/IModelDb.d.ts.map +1 -1
  12. package/lib/cjs/IModelDb.js +175 -74
  13. package/lib/cjs/IModelDb.js.map +1 -1
  14. package/lib/cjs/SchemaSync.d.ts +126 -18
  15. package/lib/cjs/SchemaSync.d.ts.map +1 -1
  16. package/lib/cjs/SchemaSync.js +303 -81
  17. package/lib/cjs/SchemaSync.js.map +1 -1
  18. package/lib/cjs/TxnManager.d.ts.map +1 -1
  19. package/lib/cjs/TxnManager.js +2 -5
  20. package/lib/cjs/TxnManager.js.map +1 -1
  21. package/lib/cjs/internal/SchemaSyncReservations.d.ts.map +1 -1
  22. package/lib/cjs/internal/SchemaSyncReservations.js +13 -3
  23. package/lib/cjs/internal/SchemaSyncReservations.js.map +1 -1
  24. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  25. package/lib/esm/BriefcaseManager.js +11 -5
  26. package/lib/esm/BriefcaseManager.js.map +1 -1
  27. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  28. package/lib/esm/CloudSqlite.js +10 -3
  29. package/lib/esm/CloudSqlite.js.map +1 -1
  30. package/lib/esm/ECDb.d.ts.map +1 -1
  31. package/lib/esm/ECDb.js +1 -0
  32. package/lib/esm/ECDb.js.map +1 -1
  33. package/lib/esm/IModelDb.d.ts +42 -7
  34. package/lib/esm/IModelDb.d.ts.map +1 -1
  35. package/lib/esm/IModelDb.js +175 -74
  36. package/lib/esm/IModelDb.js.map +1 -1
  37. package/lib/esm/SchemaSync.d.ts +126 -18
  38. package/lib/esm/SchemaSync.d.ts.map +1 -1
  39. package/lib/esm/SchemaSync.js +304 -82
  40. package/lib/esm/SchemaSync.js.map +1 -1
  41. package/lib/esm/TxnManager.d.ts.map +1 -1
  42. package/lib/esm/TxnManager.js +2 -5
  43. package/lib/esm/TxnManager.js.map +1 -1
  44. package/lib/esm/internal/SchemaSyncReservations.d.ts.map +1 -1
  45. package/lib/esm/internal/SchemaSyncReservations.js +13 -3
  46. package/lib/esm/internal/SchemaSyncReservations.js.map +1 -1
  47. package/lib/esm/test/hubaccess/Rebase.test.js +3 -1
  48. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  49. package/lib/esm/test/hubaccess/SemanticRebase.test.js +29 -28
  50. package/lib/esm/test/hubaccess/SemanticRebase.test.js.map +1 -1
  51. package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.d.ts +3 -0
  52. package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.d.ts.map +1 -0
  53. package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.js +15 -0
  54. package/lib/esm/test/hubaccess/SemanticRebaseTestUtils.js.map +1 -0
  55. package/lib/esm/test/standalone/SchemaSyncDb.test.js +5 -25
  56. package/lib/esm/test/standalone/SchemaSyncDb.test.js.map +1 -1
  57. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js +1 -0
  58. package/lib/esm/test/standalone/SchemaSyncElementReservation.test.js.map +1 -1
  59. package/package.json +13 -13
@@ -11,6 +11,7 @@ import { EditTxn, withEditTxn } from "../../EditTxn";
11
11
  import { HubMock } from "../../internal/HubMock";
12
12
  import { EntityClass } from "@itwin/ecschema-metadata";
13
13
  import { TestUtils } from "../TestUtils";
14
+ import { semanticRebaseExtendedDescribe, semanticRebaseExtendedIt } from "./SemanticRebaseTestUtils";
14
15
  function startTestTxn(iModel, description = "semantic rebase") {
15
16
  const txn = new EditTxn(iModel, description);
16
17
  txn.start();
@@ -739,7 +740,7 @@ describe("Semantic Rebase", function () {
739
740
  chai.expect(element2.propA).to.equal("local_update_a", "Element 2 local update should be preserved");
740
741
  chai.expect(element2.propC).to.equal("value_c2", "Element 2 propC should be unchanged");
741
742
  });
742
- it("local trivial schema changes onto incoming trivial schema changes (local newer)", async () => {
743
+ semanticRebaseExtendedIt("local trivial schema changes onto incoming trivial schema changes (local newer)", async () => {
743
744
  t = await TestIModel.initialize("TrivialSchemaLocalNewer");
744
745
  const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes local newer local");
745
746
  const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes local newer far");
@@ -764,7 +765,7 @@ describe("Semantic Rebase", function () {
764
765
  const schema = t.local.getSchemaProps("TestDomain");
765
766
  chai.expect(schema.version).to.equal("01.00.02", "Local schema (newer) should be preserved");
766
767
  });
767
- it("local trivial schema changes onto incoming trivial schema changes (incoming newer)", async () => {
768
+ semanticRebaseExtendedIt("local trivial schema changes onto incoming trivial schema changes (incoming newer)", async () => {
768
769
  t = await TestIModel.initialize("TrivialSchemaIncomingNewer");
769
770
  const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming trivial schema changes incoming newer local");
770
771
  const farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming trivial schema changes incoming newer far");
@@ -790,7 +791,7 @@ describe("Semantic Rebase", function () {
790
791
  const schema = t.local.getSchemaProps("TestDomain");
791
792
  chai.expect(schema.version).to.equal("01.00.02", "Incoming schema (newer) should win, local should not override");
792
793
  });
793
- it("local trivial schema changes onto incoming identical schema changes with data changes on both sides", async () => {
794
+ semanticRebaseExtendedIt("local trivial schema changes onto incoming identical schema changes with data changes on both sides", async () => {
794
795
  t = await TestIModel.initialize("TrivialSchemaIdenticalWithData");
795
796
  const localTxn = startTestTxn(t.local, "local trivial schema changes onto incoming identical schema changes with data local");
796
797
  let farTxn = startTestTxn(t.far, "local trivial schema changes onto incoming identical schema changes with data far");
@@ -841,7 +842,7 @@ describe("Semantic Rebase", function () {
841
842
  chai.expect(localElement.propC).to.equal("local_value_c", "Local element propC should be preserved");
842
843
  chai.expect(localElement.propC2).to.equal("local_value_c2", "Local element propC2 should be preserved");
843
844
  });
844
- it("both add different properties, increment to same version number", async () => {
845
+ semanticRebaseExtendedIt("both add different properties, increment to same version number", async () => {
845
846
  t = await TestIModel.initialize("TrivialSchemaIncompatible");
846
847
  const localTxn = startTestTxn(t.local, "both add different properties increment to same version local");
847
848
  const farTxn = startTestTxn(t.far, "both add different properties increment to same version far");
@@ -853,7 +854,7 @@ describe("Semantic Rebase", function () {
853
854
  const schema = t.local.getSchemaProps("TestDomain");
854
855
  chai.expect(schema.version).to.equal("01.00.01", "Schema should be v01.00.01");
855
856
  });
856
- it("both add compatible properties, local version number higher", async () => {
857
+ semanticRebaseExtendedIt("both add compatible properties, local version number higher", async () => {
857
858
  t = await TestIModel.initialize("CompatibleSchemaLocalHigher");
858
859
  const localTxn = startTestTxn(t.local, "both add compatible properties local version higher local");
859
860
  const farTxn = startTestTxn(t.far, "both add compatible properties local version higher far");
@@ -874,7 +875,7 @@ describe("Semantic Rebase", function () {
874
875
  chai.expect(classD).to.not.be.undefined;
875
876
  chai.expect(await classD.getProperty("PropD2")).to.exist;
876
877
  });
877
- it("both add compatible properties, incoming version number higher", async () => {
878
+ semanticRebaseExtendedIt("both add compatible properties, incoming version number higher", async () => {
878
879
  t = await TestIModel.initialize("CompatibleSchemaIncomingHigher");
879
880
  const localTxn = startTestTxn(t.local, "both add compatible properties incoming version higher local");
880
881
  const farTxn = startTestTxn(t.far, "both add compatible properties incoming version higher far");
@@ -905,7 +906,7 @@ describe("Semantic Rebase", function () {
905
906
  // Local pulls and rebases - this should detect the incompatibility and fail
906
907
  await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
907
908
  });
908
- it("both add same but incompatible property, incoming version number higher", async () => {
909
+ semanticRebaseExtendedIt("both add same but incompatible property, incoming version number higher", async () => {
909
910
  t = await TestIModel.initialize("TrivialSchemaIncompatible");
910
911
  const localTxn = startTestTxn(t.local, "both add same but incompatible property incoming version higher local");
911
912
  const farTxn = startTestTxn(t.far, "both add same but incompatible property incoming version higher far");
@@ -917,7 +918,7 @@ describe("Semantic Rebase", function () {
917
918
  // Local pulls and rebases - this should detect the incompatibility and fail
918
919
  await chai.expect(pullChanges(localTxn)).to.be.rejectedWith("ECSchema Upgrade failed");
919
920
  });
920
- it("local transforming schema change onto incoming trivial schema change", async () => {
921
+ semanticRebaseExtendedIt("local transforming schema change onto incoming trivial schema change", async () => {
921
922
  t = await TestIModel.initialize("LocalTransformIncomingTrivial");
922
923
  const farTxn = startTestTxn(t.far, "local transforming schema change onto incoming trivial schema change far");
923
924
  const localTxn = startTestTxn(t.local, "local transforming schema change onto incoming trivial schema change local");
@@ -959,7 +960,7 @@ describe("Semantic Rebase", function () {
959
960
  chai.expect(localElement.propA).to.equal("local_value_a", "Local element propA should be preserved");
960
961
  chai.expect(localElement.propC).to.equal("local_value_c", "Local element propC should be preserved after transform");
961
962
  });
962
- it("local trivial schema change onto incoming transforming schema change", async () => {
963
+ semanticRebaseExtendedIt("local trivial schema change onto incoming transforming schema change", async () => {
963
964
  t = await TestIModel.initialize("LocalTrivialIncomingTransform");
964
965
  const farTxn = startTestTxn(t.far, "local trivial schema change onto incoming transforming schema change far");
965
966
  const localTxn = startTestTxn(t.local, "local trivial schema change onto incoming transforming schema change local");
@@ -1099,7 +1100,7 @@ describe("Semantic Rebase", function () {
1099
1100
  const schema = t.local.getSchemaProps("TestDomain");
1100
1101
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be transformed to v01.00.02");
1101
1102
  });
1102
- it("Incoming data update onto local transforming schema change", async () => {
1103
+ semanticRebaseExtendedIt("Incoming data update onto local transforming schema change", async () => {
1103
1104
  t = await TestIModel.initialize("IncomingDataLocalTransform");
1104
1105
  const farTxn = startTestTxn(t.far, "Incoming data update onto local transforming schema change far");
1105
1106
  const localTxn = startTestTxn(t.local, "Incoming data update onto local transforming schema change local");
@@ -1138,7 +1139,7 @@ describe("Semantic Rebase", function () {
1138
1139
  const schema = t.local.getSchemaProps("TestDomain");
1139
1140
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be transformed to v01.00.02");
1140
1141
  });
1141
- it("Check if associated rebase folders get deleted when a briefcase is deleted or not", async () => {
1142
+ semanticRebaseExtendedIt("Check if associated rebase folders get deleted when a briefcase is deleted or not", async () => {
1142
1143
  t = await TestIModel.initialize("IncomingDataLocalTransform");
1143
1144
  // Must close briefcases before deleting their files - on Windows, open files are locked by the OS.
1144
1145
  // Save paths before closing since pathName getter throws on closed dbs.
@@ -1153,7 +1154,7 @@ describe("Semantic Rebase", function () {
1153
1154
  await BriefcaseManager.deleteBriefcaseFiles(farPath);
1154
1155
  chai.expect(IModelJsFs.existsSync(farRebasePath)).to.be.false; // after briefcase deletion the rebase folder should also be deleted
1155
1156
  });
1156
- it("local multiple data transactions onto incoming transforming schema change", async () => {
1157
+ semanticRebaseExtendedIt("local multiple data transactions onto incoming transforming schema change", async () => {
1157
1158
  t = await TestIModel.initialize("LocalMultipleDataIncomingTransform");
1158
1159
  let farTxn = startTestTxn(t.far, "local multiple data transactions onto incoming transforming schema change far");
1159
1160
  let localTxn = startTestTxn(t.local, "local multiple data transactions onto incoming transforming schema change local");
@@ -1195,7 +1196,7 @@ describe("Semantic Rebase", function () {
1195
1196
  const schema = t.local.getSchemaProps("TestDomain");
1196
1197
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be transformed to v01.00.02");
1197
1198
  });
1198
- it("local transforming schema change onto incoming multiple data transactions", async () => {
1199
+ semanticRebaseExtendedIt("local transforming schema change onto incoming multiple data transactions", async () => {
1199
1200
  t = await TestIModel.initialize("LocalTransformIncomingMultipleData");
1200
1201
  let farTxn = startTestTxn(t.far, "local transforming schema change onto incoming multiple data transactions far");
1201
1202
  let localTxn = startTestTxn(t.local, "local transforming schema change onto incoming multiple data transactions local");
@@ -1237,7 +1238,7 @@ describe("Semantic Rebase", function () {
1237
1238
  const schema = t.local.getSchemaProps("TestDomain");
1238
1239
  chai.expect(schema.version).to.equal("01.00.02", "Local schema transformation should be preserved");
1239
1240
  });
1240
- it("bulk local elements survive semantic rebase with incoming transforming schema change", async function () {
1241
+ semanticRebaseExtendedIt("bulk local elements survive semantic rebase with incoming transforming schema change", async function () {
1241
1242
  const runBulkRebaseTest = async (count) => {
1242
1243
  t = await TestIModel.initialize(`BulkElements${count}`);
1243
1244
  const farTxn = startTestTxn(t.far, `${count} elements rebase far`);
@@ -1269,7 +1270,7 @@ describe("Semantic Rebase", function () {
1269
1270
  await runBulkRebaseTest(100);
1270
1271
  await runBulkRebaseTest(101);
1271
1272
  });
1272
- it("should fail when importing schema with unsaved data changes", async () => {
1273
+ semanticRebaseExtendedIt("should fail when importing schema with unsaved data changes", async () => {
1273
1274
  t = await TestIModel.initialize("UnsavedDataChangesSchemaImport");
1274
1275
  const localTxn = startTestTxn(t.local, "should fail when importing schema with unsaved data changes local");
1275
1276
  // Create element but DO NOT save changes
@@ -1290,7 +1291,7 @@ describe("Semantic Rebase", function () {
1290
1291
  /**
1291
1292
  * Test suite for tests related to rebase logic with schema changes (for indirect changes) that require data transformations.
1292
1293
  */
1293
- describe("Semantic Rebase with indirect changes", function () {
1294
+ semanticRebaseExtendedDescribe("Semantic Rebase with indirect changes", function () {
1294
1295
  this.timeout(90000); // operations can be slow
1295
1296
  let t;
1296
1297
  before(async () => {
@@ -1575,7 +1576,7 @@ describe("Semantic Rebase with indirect changes", function () {
1575
1576
  /**
1576
1577
  * Test suite for data conflicts, conflict handlers, lifecycle events, and mixed schema+conflict scenarios during semantic rebase.
1577
1578
  */
1578
- describe("Semantic Rebase - Data Correctness Under Conflict", function () {
1579
+ semanticRebaseExtendedDescribe("Semantic Rebase - Data Correctness Under Conflict", function () {
1579
1580
  this.timeout(90000);
1580
1581
  let t;
1581
1582
  before(async () => {
@@ -1787,7 +1788,7 @@ describe("Semantic Rebase - Data Correctness Under Conflict", function () {
1787
1788
  * Multi-step schema upgrade chains.
1788
1789
  * Tests scenarios where one or both sides import schemas in multiple sequential steps before the rebase.
1789
1790
  */
1790
- describe("Semantic Rebase - Multi-Step Schema Upgrade Chains", function () {
1791
+ semanticRebaseExtendedDescribe("Semantic Rebase - Multi-Step Schema Upgrade Chains", function () {
1791
1792
  this.timeout(90000);
1792
1793
  let t;
1793
1794
  before(async () => {
@@ -1971,7 +1972,7 @@ describe("Semantic Rebase - Multi-Step Schema Upgrade Chains", function () {
1971
1972
  * ElementAspect changes during semantic rebase.
1972
1973
  * Tests that aspect insert/update/delete operations are correctly captured and reinstated.
1973
1974
  */
1974
- describe("Semantic Rebase - ElementAspect Changes", function () {
1975
+ semanticRebaseExtendedDescribe("Semantic Rebase - ElementAspect Changes", function () {
1975
1976
  this.timeout(90000);
1976
1977
  let t;
1977
1978
  before(async () => {
@@ -2178,7 +2179,7 @@ describe("Semantic Rebase - ElementAspect Changes", function () {
2178
2179
  * Property type variations during semantic rebase.
2179
2180
  * Ensures int, double, and boolean property values are preserved correctly through rebase.
2180
2181
  */
2181
- describe("Semantic Rebase - Property Type Variations", function () {
2182
+ semanticRebaseExtendedDescribe("Semantic Rebase - Property Type Variations", function () {
2182
2183
  this.timeout(90000);
2183
2184
  let t;
2184
2185
  before(async () => {
@@ -2366,7 +2367,7 @@ describe("Semantic Rebase - Property Type Variations", function () {
2366
2367
  * Both sides delete the same element.
2367
2368
  * Edge case where both local and far delete the same element independently.
2368
2369
  */
2369
- describe("Semantic Rebase - Both Sides Delete Same Element", function () {
2370
+ semanticRebaseExtendedDescribe("Semantic Rebase - Both Sides Delete Same Element", function () {
2370
2371
  this.timeout(90000);
2371
2372
  let t;
2372
2373
  before(async () => {
@@ -2424,7 +2425,7 @@ describe("Semantic Rebase - Both Sides Delete Same Element", function () {
2424
2425
  * Three-briefcase scenarios.
2425
2426
  * Tests interactions when three separate briefcases are involved in schema+data operations.
2426
2427
  */
2427
- describe("Semantic Rebase - Three Briefcase Scenarios", function () {
2428
+ semanticRebaseExtendedDescribe("Semantic Rebase - Three Briefcase Scenarios", function () {
2428
2429
  this.timeout(90000);
2429
2430
  let t;
2430
2431
  before(async () => {
@@ -2540,7 +2541,7 @@ describe("Semantic Rebase - Three Briefcase Scenarios", function () {
2540
2541
  * Tests that semantic rebase state is handled correctly when the local briefcase
2541
2542
  * pulls multiple times before pushing, accumulating rebase operations.
2542
2543
  */
2543
- describe("Semantic Rebase - Multiple Pulls Without Push", function () {
2544
+ semanticRebaseExtendedDescribe("Semantic Rebase - Multiple Pulls Without Push", function () {
2544
2545
  this.timeout(90000);
2545
2546
  let t;
2546
2547
  before(async () => {
@@ -2623,7 +2624,7 @@ describe("Semantic Rebase - Multiple Pulls Without Push", function () {
2623
2624
  * New class addition to schema.
2624
2625
  * Tests that newly added entity classes and their instances survive semantic rebase.
2625
2626
  */
2626
- describe("Semantic Rebase - New Class Addition to Schema", function () {
2627
+ semanticRebaseExtendedDescribe("Semantic Rebase - New Class Addition to Schema", function () {
2627
2628
  this.timeout(90000);
2628
2629
  let t;
2629
2630
  before(async () => {
@@ -2751,7 +2752,7 @@ describe("Semantic Rebase - New Class Addition to Schema", function () {
2751
2752
  * Guard conditions and error paths for semantic rebase.
2752
2753
  * Tests boundary conditions like importing schema while rebasing, concurrent pull attempts, etc.
2753
2754
  */
2754
- describe("Semantic Rebase - Guard Conditions and Error Paths", function () {
2755
+ semanticRebaseExtendedDescribe("Semantic Rebase - Guard Conditions and Error Paths", function () {
2755
2756
  this.timeout(90000);
2756
2757
  let t;
2757
2758
  before(async () => {
@@ -2871,7 +2872,7 @@ describe("Semantic Rebase - Guard Conditions and Error Paths", function () {
2871
2872
  * Tests scenarios where local txns contain a mix of insert, update, and delete operations
2872
2873
  * that need to be correctly captured and reinstated during semantic rebase.
2873
2874
  */
2874
- describe("Semantic Rebase - Complex Insert-Update-Delete Sequences", function () {
2875
+ semanticRebaseExtendedDescribe("Semantic Rebase - Complex Insert-Update-Delete Sequences", function () {
2875
2876
  this.timeout(90000);
2876
2877
  let t;
2877
2878
  before(async () => {
@@ -3036,7 +3037,7 @@ describe("Semantic Rebase - Complex Insert-Update-Delete Sequences", function ()
3036
3037
  * Cleanup and folder lifecycle edge cases.
3037
3038
  * Tests that rebase folder state is correctly managed in unusual lifecycle scenarios.
3038
3039
  */
3039
- describe("Semantic Rebase - Cleanup and Folder Lifecycle", function () {
3040
+ semanticRebaseExtendedDescribe("Semantic Rebase - Cleanup and Folder Lifecycle", function () {
3040
3041
  this.timeout(90000);
3041
3042
  let t;
3042
3043
  before(async () => {
@@ -3129,7 +3130,7 @@ describe("Semantic Rebase - Cleanup and Folder Lifecycle", function () {
3129
3130
  chai.expect(schema.version).to.equal("01.00.02", "Schema should be at v02 after cycle 2");
3130
3131
  });
3131
3132
  });
3132
- describe("Semantic Rebase - Multi-Pull Verification", function () {
3133
+ semanticRebaseExtendedDescribe("Semantic Rebase - Multi-Pull Verification", function () {
3133
3134
  this.timeout(120000);
3134
3135
  let t;
3135
3136
  before(async () => {