@itwin/core-backend 5.3.0-dev.21 → 5.3.0-dev.23
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/IModelDb.d.ts.map +1 -1
- package/lib/cjs/IModelDb.js +11 -0
- package/lib/cjs/IModelDb.js.map +1 -1
- package/lib/cjs/TxnManager.d.ts +2 -0
- package/lib/cjs/TxnManager.d.ts.map +1 -1
- package/lib/cjs/TxnManager.js +10 -2
- package/lib/cjs/TxnManager.js.map +1 -1
- package/lib/esm/IModelDb.d.ts.map +1 -1
- package/lib/esm/IModelDb.js +11 -0
- package/lib/esm/IModelDb.js.map +1 -1
- package/lib/esm/TxnManager.d.ts +2 -0
- package/lib/esm/TxnManager.d.ts.map +1 -1
- package/lib/esm/TxnManager.js +10 -2
- package/lib/esm/TxnManager.js.map +1 -1
- package/lib/esm/test/ElementDrivesElement.test.d.ts +93 -0
- package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -0
- package/lib/esm/test/ElementDrivesElement.test.js +862 -0
- package/lib/esm/test/ElementDrivesElement.test.js.map +1 -0
- package/lib/esm/test/ElementLRUCache.test.js +13 -0
- package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js +2 -2
- package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
- package/lib/esm/test/hubaccess/Rebase.test.js +30 -2
- package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
- package/lib/esm/test/imodel/IModel.test.js +27 -0
- package/lib/esm/test/imodel/IModel.test.js.map +1 -1
- package/lib/esm/test/standalone/ChangesetReader.test.js +40 -46
- package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
- package/lib/esm/test/standalone/ElementGraphics.test.js +75 -6
- package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
- package/package.json +13 -13
|
@@ -163,38 +163,24 @@ describe("Changeset Reader API", async () => {
|
|
|
163
163
|
expect(rwIModel[_nativeDb].executeSql("UPDATE ec_Table SET ExclusiveRootClassId=NULL WHERE Name='bis_GeometricElement2d_Overflow'")).to.be.eq(DbResult.BE_SQLITE_OK);
|
|
164
164
|
const adaptor = new ECChangesetAdaptor(reader);
|
|
165
165
|
let assertOnOverflowTable = false;
|
|
166
|
-
const expectedInserted = {
|
|
167
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
168
|
-
ECClassId: undefined,
|
|
169
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
170
|
-
ECInstanceId: "",
|
|
171
|
-
$meta: {
|
|
172
|
-
tables: ["bis_GeometricElement2d_Overflow"],
|
|
173
|
-
op: "Updated",
|
|
174
|
-
classFullName: "BisCore:GeometricElement2d",
|
|
175
|
-
fallbackClassId: "0x5e",
|
|
176
|
-
changeIndexes: [3],
|
|
177
|
-
stage: "New",
|
|
178
|
-
},
|
|
179
|
-
};
|
|
180
|
-
const expectedDeleted = {
|
|
181
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
182
|
-
ECClassId: undefined,
|
|
183
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
184
|
-
ECInstanceId: "",
|
|
185
|
-
$meta: {
|
|
186
|
-
tables: ["bis_GeometricElement2d_Overflow"],
|
|
187
|
-
op: "Updated",
|
|
188
|
-
classFullName: "BisCore:GeometricElement2d",
|
|
189
|
-
fallbackClassId: "0x5e",
|
|
190
|
-
changeIndexes: [3],
|
|
191
|
-
stage: "Old",
|
|
192
|
-
},
|
|
193
|
-
};
|
|
194
166
|
while (adaptor.step()) {
|
|
195
167
|
if (adaptor.op === "Updated" && adaptor.inserted?.$meta?.tables[0] === "bis_GeometricElement2d_Overflow") {
|
|
196
|
-
assert.
|
|
197
|
-
assert.
|
|
168
|
+
assert.isUndefined(adaptor.inserted.ECClassId);
|
|
169
|
+
assert.equal(adaptor.inserted.ECInstanceId, "");
|
|
170
|
+
assert.deepEqual(adaptor.inserted.$meta?.tables, ["bis_GeometricElement2d_Overflow"]);
|
|
171
|
+
assert.equal(adaptor.inserted.$meta?.op, "Updated");
|
|
172
|
+
assert.equal(adaptor.inserted.$meta?.classFullName, "BisCore:GeometricElement2d");
|
|
173
|
+
assert.isTrue(adaptor.inserted.$meta.fallbackClassId.startsWith("0x"));
|
|
174
|
+
assert.deepEqual(adaptor.inserted.$meta?.changeIndexes, [3]);
|
|
175
|
+
assert.equal(adaptor.inserted.$meta?.stage, "New");
|
|
176
|
+
assert.equal(adaptor.deleted.ECInstanceId, "");
|
|
177
|
+
assert.isUndefined(adaptor.deleted.ECClassId);
|
|
178
|
+
assert.deepEqual(adaptor.deleted.$meta?.tables, ["bis_GeometricElement2d_Overflow"]);
|
|
179
|
+
assert.equal(adaptor.deleted.$meta?.op, "Updated");
|
|
180
|
+
assert.equal(adaptor.deleted.$meta?.classFullName, "BisCore:GeometricElement2d");
|
|
181
|
+
assert.isTrue(adaptor.deleted.$meta.fallbackClassId.startsWith("0x"));
|
|
182
|
+
assert.deepEqual(adaptor.deleted.$meta?.changeIndexes, [3]);
|
|
183
|
+
assert.equal(adaptor.deleted.$meta?.stage, "Old");
|
|
198
184
|
assertOnOverflowTable = true;
|
|
199
185
|
}
|
|
200
186
|
}
|
|
@@ -319,7 +305,8 @@ describe("Changeset Reader API", async () => {
|
|
|
319
305
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
320
306
|
assert.deepEqual(el.BBoxHigh, { X: 15, Y: 15 });
|
|
321
307
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
322
|
-
assert.
|
|
308
|
+
assert.equal(el.Category.Id, "0x20000000002");
|
|
309
|
+
assert.isTrue(el.Category.RelECClassId.startsWith("0x"));
|
|
323
310
|
assert.equal(el.s, "xxxxxxxxx");
|
|
324
311
|
assert.isNull(el.CodeValue);
|
|
325
312
|
assert.isNull(el.UserLabel);
|
|
@@ -332,11 +319,14 @@ describe("Changeset Reader API", async () => {
|
|
|
332
319
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
333
320
|
assert.deepEqual(el.TypeDefinition, { Id: null, RelECClassId: null });
|
|
334
321
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
335
|
-
assert.
|
|
322
|
+
assert.equal(el.Category.Id, "0x20000000002");
|
|
323
|
+
assert.isTrue(el.Category.RelECClassId.startsWith("0x"));
|
|
336
324
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
337
|
-
assert.
|
|
325
|
+
assert.equal(el.CodeSpec.Id, "0x1");
|
|
326
|
+
assert.isTrue(el.CodeSpec.RelECClassId.startsWith("0x"));
|
|
338
327
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
339
|
-
assert.
|
|
328
|
+
assert.equal(el.CodeScope.Id, "0x1");
|
|
329
|
+
assert.isTrue(el.CodeScope.RelECClassId.startsWith("0x"));
|
|
340
330
|
assert.deepEqual(el.$meta, {
|
|
341
331
|
tables: [
|
|
342
332
|
"bis_GeometricElement2d",
|
|
@@ -542,7 +532,8 @@ describe("Changeset Reader API", async () => {
|
|
|
542
532
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
543
533
|
assert.deepEqual(el.BBoxHigh, { X: 15, Y: 15 });
|
|
544
534
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
545
|
-
assert.
|
|
535
|
+
assert.equal(el.Category.Id, "0x20000000002");
|
|
536
|
+
assert.isTrue(el.Category.RelECClassId.startsWith("0x"));
|
|
546
537
|
assert.equal(el.s, "xxxxxxxxx");
|
|
547
538
|
assert.isNull(el.CodeValue);
|
|
548
539
|
assert.isNull(el.UserLabel);
|
|
@@ -555,11 +546,14 @@ describe("Changeset Reader API", async () => {
|
|
|
555
546
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
556
547
|
assert.deepEqual(el.TypeDefinition, { Id: null, RelECClassId: null });
|
|
557
548
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
558
|
-
assert.
|
|
549
|
+
assert.equal(el.Category.Id, "0x20000000002");
|
|
550
|
+
assert.isTrue(el.Category.RelECClassId.startsWith("0x"));
|
|
559
551
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
560
|
-
assert.
|
|
552
|
+
assert.equal(el.CodeSpec.Id, "0x1");
|
|
553
|
+
assert.isTrue(el.CodeSpec.RelECClassId.startsWith("0x"));
|
|
561
554
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
562
|
-
assert.
|
|
555
|
+
assert.equal(el.CodeScope.Id, "0x1");
|
|
556
|
+
assert.isTrue(el.CodeScope.RelECClassId.startsWith("0x"));
|
|
563
557
|
assert.deepEqual(el.$meta, {
|
|
564
558
|
tables: [
|
|
565
559
|
"bis_GeometricElement2d",
|
|
@@ -1284,15 +1278,15 @@ describe("Changeset Reader API", async () => {
|
|
|
1284
1278
|
assert.equal(secondBriefcaseChangesets.length, 2);
|
|
1285
1279
|
const [secondBriefcaseChangeset1, secondBriefcaseChangeset2] = secondBriefcaseChangesets;
|
|
1286
1280
|
expect(secondBriefcaseChangeset1.uncompressedSizeBytes).to.be.greaterThan(40000);
|
|
1287
|
-
expect(secondBriefcaseChangeset1.insertedRows).to.be.
|
|
1281
|
+
expect(secondBriefcaseChangeset1.insertedRows).to.be.eql(0);
|
|
1288
1282
|
expect(secondBriefcaseChangeset1.updatedRows).to.be.greaterThanOrEqual(921);
|
|
1289
|
-
expect(secondBriefcaseChangeset1.deletedRows).to.be.
|
|
1283
|
+
expect(secondBriefcaseChangeset1.deletedRows).to.be.greaterThanOrEqual(52);
|
|
1290
1284
|
expect(secondBriefcaseChangeset1.totalFullTableScans).to.be.eql(0);
|
|
1291
1285
|
expect(secondBriefcaseChangeset1.perStatementStats.length).to.be.eql(11);
|
|
1292
1286
|
expect(secondBriefcaseChangeset2.uncompressedSizeBytes).to.be.greaterThan(40000);
|
|
1293
|
-
expect(secondBriefcaseChangeset2.insertedRows).to.be.
|
|
1287
|
+
expect(secondBriefcaseChangeset2.insertedRows).to.be.greaterThanOrEqual(52);
|
|
1294
1288
|
expect(secondBriefcaseChangeset2.updatedRows).to.be.greaterThanOrEqual(921);
|
|
1295
|
-
expect(secondBriefcaseChangeset2.deletedRows).to.be.
|
|
1289
|
+
expect(secondBriefcaseChangeset2.deletedRows).to.be.eql(0);
|
|
1296
1290
|
expect(secondBriefcaseChangeset2.totalFullTableScans).to.be.eql(0);
|
|
1297
1291
|
expect(secondBriefcaseChangeset2.perStatementStats.length).to.be.eql(11);
|
|
1298
1292
|
// Cleanup
|
|
@@ -1362,7 +1356,7 @@ describe("Changeset Reader API", async () => {
|
|
|
1362
1356
|
expect(testEl.$meta?.op).to.equals("Inserted");
|
|
1363
1357
|
expect(testEl.$meta?.classFullName).to.equals("TestDomain:Test2dElement");
|
|
1364
1358
|
expect(testEl.$meta?.stage).to.equals("New");
|
|
1365
|
-
expect(testEl.ECClassId
|
|
1359
|
+
expect(testEl.ECClassId.startsWith("0x")).to.be.true;
|
|
1366
1360
|
expect(testEl.ECInstanceId).to.equals(e1id);
|
|
1367
1361
|
expect(testEl.Model.Id).to.equals(drawingModelId);
|
|
1368
1362
|
expect(testEl.Category.Id).to.equals(drawingCategoryId);
|
|
@@ -1395,7 +1389,7 @@ describe("Changeset Reader API", async () => {
|
|
|
1395
1389
|
expect(drawingModelElNew.$meta?.op).to.equals("Updated");
|
|
1396
1390
|
expect(drawingModelElNew.$meta?.classFullName).to.equals("BisCore:DrawingModel");
|
|
1397
1391
|
expect(drawingModelElNew.$meta?.stage).to.equals("New");
|
|
1398
|
-
expect(drawingModelElNew.ECClassId
|
|
1392
|
+
expect(drawingModelElNew.ECClassId.startsWith("0x")).to.be.true;
|
|
1399
1393
|
expect(drawingModelElNew.ECInstanceId).to.equals(drawingModelId);
|
|
1400
1394
|
expect(drawingModelElNew.LastMod).to.exist;
|
|
1401
1395
|
expect(drawingModelElNew.GeometryGuid).to.exist;
|
|
@@ -1404,7 +1398,7 @@ describe("Changeset Reader API", async () => {
|
|
|
1404
1398
|
expect(drawingModelElOld.$meta?.op).to.equals("Updated");
|
|
1405
1399
|
expect(drawingModelElOld.$meta?.classFullName).to.equals("BisCore:DrawingModel");
|
|
1406
1400
|
expect(drawingModelElOld.$meta?.stage).to.equals("Old");
|
|
1407
|
-
expect(drawingModelElOld.ECClassId
|
|
1401
|
+
expect(drawingModelElOld.ECClassId.startsWith("0x")).to.be.true;
|
|
1408
1402
|
expect(drawingModelElOld.ECInstanceId).to.equals(drawingModelId);
|
|
1409
1403
|
expect(drawingModelElOld.LastMod).to.null;
|
|
1410
1404
|
expect(drawingModelElOld.GeometryGuid).to.null;
|
|
@@ -1413,7 +1407,7 @@ describe("Changeset Reader API", async () => {
|
|
|
1413
1407
|
expect(testEl.$meta?.op).to.equals("Inserted");
|
|
1414
1408
|
expect(testEl.$meta?.classFullName).to.equals("TestDomain:Test2dElement");
|
|
1415
1409
|
expect(testEl.$meta?.stage).to.equals("New");
|
|
1416
|
-
expect(testEl.ECClassId
|
|
1410
|
+
expect(testEl.ECClassId.startsWith("0x")).to.be.true;
|
|
1417
1411
|
expect(testEl.ECInstanceId).to.equals(e1id);
|
|
1418
1412
|
expect(testEl.Model.Id).to.equals(drawingModelId);
|
|
1419
1413
|
expect(testEl.Category.Id).to.equals(drawingCategoryId);
|