From 09d6d33a5d666eaeac83b95a8bd336ce82c0b58e Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Mon, 22 Jan 2024 14:14:59 +0200 Subject: [PATCH 01/15] Changes in BigMap to implement not extend Map --- packages/transformer/src/BigMap.ts | 49 +++++++++-- .../src/test/standalone/BigMap.test.ts | 85 +++++++++++++++++++ 2 files changed, 125 insertions(+), 9 deletions(-) create mode 100644 packages/transformer/src/test/standalone/BigMap.test.ts diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index 6554ed0a..dbcae160 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -14,16 +14,15 @@ import { Id64String } from "@itwin/core-bentley"; * replace this stopgap with a more robust solution, utilizing a temporary SQLite database (https://github.com/iTwin/imodel-transformer/issues/83). * @internal */ -export class BigMap extends Map { +export class BigMap implements Map { private _maps: Record>; private _size: number; - public override get size(): number { + public get size(): number { return this._size; } public constructor() { - super(); this._maps = { 0: new Map(), 1: new Map(), @@ -45,12 +44,12 @@ export class BigMap extends Map { this._size = 0; } - public override clear(): void { + public clear(): void { Object.values(this._maps).forEach((m) => m.clear()); this._size = 0; } - public override delete(key: Id64String): boolean { + public delete(key: Id64String): boolean { const wasDeleted = this._maps[key[key.length - 1]].delete(key); if (wasDeleted) { this._size--; @@ -59,21 +58,21 @@ export class BigMap extends Map { return wasDeleted; } - public override forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { + public forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { Object.values(this._maps).forEach((m) => { m.forEach(callbackfn, thisArg); }); } - public override get(key: Id64String): V | undefined { + public get(key: Id64String): V | undefined { return this._maps[key[key.length - 1]].get(key); } - public override has(key: Id64String): boolean { + public has(key: Id64String): boolean { return this._maps[key[key.length - 1]].has(key); } - public override set(key: Id64String, value: V): this { + public set(key: Id64String, value: V): this { const mapForKey = this._maps[key[key.length - 1]]; if (mapForKey === undefined) throw Error(`Tried to set ${key}, but that key has no submap`); @@ -83,4 +82,36 @@ export class BigMap extends Map { this._size += (afterSize - beforeSize); return this; } + + [Symbol.iterator](): IterableIterator<[Id64String, V]>{ + return this.entries(); + } + + get [Symbol.toStringTag]() { + return 'BigMap'; + } + + *entries(): IterableIterator<[Id64String, V]> { + var maps = Object.values(this._maps); + for (var map of maps) { + for (let [key, value] of map.entries()) + yield [key, value]; + } + } + + *keys(): IterableIterator { + var maps = Object.values(this._maps); + for (var map of maps) { + for (let key of map.keys()) + yield key; + } + } + + *values(): IterableIterator { + var maps = Object.values(this._maps); + for (var map of maps) { + for (let value of map.values()) + yield value; + } + } } diff --git a/packages/transformer/src/test/standalone/BigMap.test.ts b/packages/transformer/src/test/standalone/BigMap.test.ts new file mode 100644 index 00000000..69fece4a --- /dev/null +++ b/packages/transformer/src/test/standalone/BigMap.test.ts @@ -0,0 +1,85 @@ +/*--------------------------------------------------------------------------------------------- +* Copyright (c) Bentley Systems, Incorporated. All rights reserved. +* See LICENSE.md in the project root for license terms and full copyright notice. +*--------------------------------------------------------------------------------------------*/ + +import { BigMap } from "../../BigMap"; +import { assert } from "chai"; + +describe ("BigMap", function () { + + // Test map keys will be assigned into 2 different submaps when BigMap is created + const testMap = new Map ([["0x123f", "testVal1"], ["0x1231", "testVal2"]]); + + const createBigMap = (map: Map) : BigMap => { + const bigMap = new BigMap (); + for (let entry of map.entries ()) { + bigMap.set(entry[0], entry[1]); + } + return bigMap; + } + + describe ("keys", function () { + it("should iterate all keys", async function () { + const bigMap = createBigMap (testMap); + assert.sameMembers([...bigMap.keys()], [...testMap.keys()]); + }); + }); + + describe ("values", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); + assert.sameMembers([...bigMap.values()], [...testMap.values()]); + }); + }); + + describe ("entries", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); + const actualMap = new Map([...bigMap.entries()]); + assert.deepEqual(actualMap, testMap); + }); + }); + + describe ("iterator", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); + + const actualMap = new Map(); + for (let entry of bigMap) { + actualMap.set(entry[0], entry[1]); + } + assert.deepEqual(actualMap, testMap); + }); + }); + + describe ("toStringTag", function () { + it("should return type name", async function () { + const typeName = Object.prototype.toString.call(new BigMap ()); + assert.equal(typeName, "[object BigMap]"); + }); + }); + + describe ("has", function () { + it("should return true when value was set", async function () { + const bigMap = new BigMap (); + const key = "0x123f"; + bigMap.set(key, "12134"); + assert.isTrue (bigMap.has(key)); + }); + }); + + describe ("set", function () { + it("should set when key has submap", async function () { + const bigMap = new BigMap (); + assert.doesNotThrow(() => bigMap.set("0x13", "12134")); + assert.equal(bigMap.size, 1); + }); + + it("should throw when key has no submap", async function () { + const bigMap = new BigMap (); + assert.throw(() => bigMap.set("g", "12134"), "Tried to set g, but that key has no submap"); + }); + }); + +}); From de6966efabdb7e7a41a8bfcf321482572bdd152e Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Mon, 22 Jan 2024 14:16:13 +0200 Subject: [PATCH 02/15] closeIModel() is renamed to closeFile() https://github.com/iTwin/imodel-native/pull/558 --- .../transformer/src/test/standalone/IModelTransformer.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 933fc235..1acab338 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -1089,7 +1089,7 @@ describe("IModelTransformer", () => { nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); nativeDb.saveChanges(); // save change to briefcaseId - nativeDb.closeIModel(); + nativeDb.closeFile(); } it("biscore update is valid", async () => { @@ -1108,7 +1108,7 @@ describe("IModelTransformer", () => { // StandaloneDb.upgradeStandaloneSchemas is the suggested method to handle a profile upgrade but that will also upgrade // the BisCore schema. This test is explicitly testing that the BisCore schema will be updated from the source iModel const nativeDb = StandaloneDb.openDgnDb({path: targetDbPath}, OpenMode.ReadWrite, {profile: ProfileOptions.Upgrade, schemaLockHeld: true}); - nativeDb.closeIModel(); + nativeDb.closeFile(); const targetDb = StandaloneDb.openFile(targetDbPath); assert( From ae47a5d74599d1890f11ded3f8e01b9ced1078c8 Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Mon, 22 Jan 2024 14:43:34 +0200 Subject: [PATCH 03/15] Revert "closeIModel() is renamed to closeFile()" This reverts commit de6966efabdb7e7a41a8bfcf321482572bdd152e. --- .../transformer/src/test/standalone/IModelTransformer.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 1acab338..933fc235 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -1089,7 +1089,7 @@ describe("IModelTransformer", () => { nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); nativeDb.saveChanges(); // save change to briefcaseId - nativeDb.closeFile(); + nativeDb.closeIModel(); } it("biscore update is valid", async () => { @@ -1108,7 +1108,7 @@ describe("IModelTransformer", () => { // StandaloneDb.upgradeStandaloneSchemas is the suggested method to handle a profile upgrade but that will also upgrade // the BisCore schema. This test is explicitly testing that the BisCore schema will be updated from the source iModel const nativeDb = StandaloneDb.openDgnDb({path: targetDbPath}, OpenMode.ReadWrite, {profile: ProfileOptions.Upgrade, schemaLockHeld: true}); - nativeDb.closeFile(); + nativeDb.closeIModel(); const targetDb = StandaloneDb.openFile(targetDbPath); assert( From a071041b0a5cbc5df8f8f9b6a3921177b698cf45 Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Tue, 2 Jan 2024 15:00:01 -0500 Subject: [PATCH 04/15] handle cross-version usage of internal closeIModel API --- .../src/test/standalone/IModelTransformer.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 933fc235..6f54446a 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -1089,7 +1089,9 @@ describe("IModelTransformer", () => { nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); nativeDb.saveChanges(); // save change to briefcaseId - nativeDb.closeIModel(); + // handle cross-version usage of internal API + (nativeDb as any)?.closeIModel(); + (nativeDb as any)?.closeFile(); } it("biscore update is valid", async () => { @@ -1108,7 +1110,9 @@ describe("IModelTransformer", () => { // StandaloneDb.upgradeStandaloneSchemas is the suggested method to handle a profile upgrade but that will also upgrade // the BisCore schema. This test is explicitly testing that the BisCore schema will be updated from the source iModel const nativeDb = StandaloneDb.openDgnDb({path: targetDbPath}, OpenMode.ReadWrite, {profile: ProfileOptions.Upgrade, schemaLockHeld: true}); - nativeDb.closeIModel(); + // handle cross-version usage of internal API + (nativeDb as any)?.closeIModel(); + (nativeDb as any)?.closeFile(); const targetDb = StandaloneDb.openFile(targetDbPath); assert( From 76fc21182f1a7cd744b826445db374bb178e2040 Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 11:17:34 -0500 Subject: [PATCH 05/15] handle cross-version usage of internal API better --- packages/performance-tests/test/iModelUtils.ts | 4 +++- .../src/test/standalone/IModelTransformer.test.ts | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/performance-tests/test/iModelUtils.ts b/packages/performance-tests/test/iModelUtils.ts index f56fe3a9..225e7e26 100644 --- a/packages/performance-tests/test/iModelUtils.ts +++ b/packages/performance-tests/test/iModelUtils.ts @@ -27,7 +27,9 @@ export function setToStandalone(iModelPath: string) { nativeDb.resetBriefcaseId(BriefcaseIdValue.Unassigned); // standalone iModels should always have BriefcaseId unassigned nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); nativeDb.saveChanges(); // save change to briefcaseId - nativeDb.closeIModel(); + // handle cross-version usage of internal API + (nativeDb as any)?.closeIModel?.(); + (nativeDb as any)?.closeFile?.(); } export function generateTestIModel(iModelParam: IModelParams): TestIModel { diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 6f54446a..408eb189 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -1090,8 +1090,8 @@ describe("IModelTransformer", () => { nativeDb.saveLocalValue("StandaloneEdit", JSON.stringify({ txns: true })); nativeDb.saveChanges(); // save change to briefcaseId // handle cross-version usage of internal API - (nativeDb as any)?.closeIModel(); - (nativeDb as any)?.closeFile(); + (nativeDb as any)?.closeIModel?.(); + (nativeDb as any)?.closeFile?.(); } it("biscore update is valid", async () => { @@ -1111,8 +1111,8 @@ describe("IModelTransformer", () => { // the BisCore schema. This test is explicitly testing that the BisCore schema will be updated from the source iModel const nativeDb = StandaloneDb.openDgnDb({path: targetDbPath}, OpenMode.ReadWrite, {profile: ProfileOptions.Upgrade, schemaLockHeld: true}); // handle cross-version usage of internal API - (nativeDb as any)?.closeIModel(); - (nativeDb as any)?.closeFile(); + (nativeDb as any)?.closeIModel?.(); + (nativeDb as any)?.closeFile?.(); const targetDb = StandaloneDb.openFile(targetDbPath); assert( From 9cf2cd279d65d329daa5c3e25417036c8a621bb1 Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 11:31:50 -0500 Subject: [PATCH 06/15] use eslint fix --- packages/transformer/src/BigMap.ts | 20 +-- .../src/test/standalone/BigMap.test.ts | 114 +++++++++--------- 2 files changed, 67 insertions(+), 67 deletions(-) diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index dbcae160..4cfbd027 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -88,29 +88,29 @@ export class BigMap implements Map { } get [Symbol.toStringTag]() { - return 'BigMap'; + return "BigMap"; } *entries(): IterableIterator<[Id64String, V]> { - var maps = Object.values(this._maps); - for (var map of maps) { - for (let [key, value] of map.entries()) + const maps = Object.values(this._maps); + for (const map of maps) { + for (const [key, value] of map.entries()) yield [key, value]; } } *keys(): IterableIterator { - var maps = Object.values(this._maps); - for (var map of maps) { - for (let key of map.keys()) + const maps = Object.values(this._maps); + for (const map of maps) { + for (const key of map.keys()) yield key; } } *values(): IterableIterator { - var maps = Object.values(this._maps); - for (var map of maps) { - for (let value of map.values()) + const maps = Object.values(this._maps); + for (const map of maps) { + for (const value of map.values()) yield value; } } diff --git a/packages/transformer/src/test/standalone/BigMap.test.ts b/packages/transformer/src/test/standalone/BigMap.test.ts index 69fece4a..4f2c37b5 100644 --- a/packages/transformer/src/test/standalone/BigMap.test.ts +++ b/packages/transformer/src/test/standalone/BigMap.test.ts @@ -8,78 +8,78 @@ import { assert } from "chai"; describe ("BigMap", function () { - // Test map keys will be assigned into 2 different submaps when BigMap is created - const testMap = new Map ([["0x123f", "testVal1"], ["0x1231", "testVal2"]]); - - const createBigMap = (map: Map) : BigMap => { - const bigMap = new BigMap (); - for (let entry of map.entries ()) { - bigMap.set(entry[0], entry[1]); - } - return bigMap; - } + // Test map keys will be assigned into 2 different submaps when BigMap is created + const testMap = new Map ([["0x123f", "testVal1"], ["0x1231", "testVal2"]]); - describe ("keys", function () { - it("should iterate all keys", async function () { - const bigMap = createBigMap (testMap); - assert.sameMembers([...bigMap.keys()], [...testMap.keys()]); - }); + const createBigMap = (map: Map): BigMap => { + const bigMap = new BigMap (); + for (const entry of map.entries ()) { + bigMap.set(entry[0], entry[1]); + } + return bigMap; + }; + + describe ("keys", function () { + it("should iterate all keys", async function () { + const bigMap = createBigMap (testMap); + assert.sameMembers([...bigMap.keys()], [...testMap.keys()]); }); + }); - describe ("values", function () { - it("should get all values", async function () { - const bigMap = createBigMap (testMap); - assert.sameMembers([...bigMap.values()], [...testMap.values()]); - }); + describe ("values", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); + assert.sameMembers([...bigMap.values()], [...testMap.values()]); }); + }); - describe ("entries", function () { - it("should get all values", async function () { - const bigMap = createBigMap (testMap); - const actualMap = new Map([...bigMap.entries()]); - assert.deepEqual(actualMap, testMap); - }); + describe ("entries", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); + const actualMap = new Map([...bigMap.entries()]); + assert.deepEqual(actualMap, testMap); }); + }); - describe ("iterator", function () { - it("should get all values", async function () { - const bigMap = createBigMap (testMap); + describe ("iterator", function () { + it("should get all values", async function () { + const bigMap = createBigMap (testMap); - const actualMap = new Map(); - for (let entry of bigMap) { - actualMap.set(entry[0], entry[1]); - } - assert.deepEqual(actualMap, testMap); - }); + const actualMap = new Map(); + for (const entry of bigMap) { + actualMap.set(entry[0], entry[1]); + } + assert.deepEqual(actualMap, testMap); }); + }); - describe ("toStringTag", function () { - it("should return type name", async function () { - const typeName = Object.prototype.toString.call(new BigMap ()); - assert.equal(typeName, "[object BigMap]"); - }); + describe ("toStringTag", function () { + it("should return type name", async function () { + const typeName = Object.prototype.toString.call(new BigMap ()); + assert.equal(typeName, "[object BigMap]"); }); + }); - describe ("has", function () { - it("should return true when value was set", async function () { - const bigMap = new BigMap (); - const key = "0x123f"; - bigMap.set(key, "12134"); - assert.isTrue (bigMap.has(key)); - }); + describe ("has", function () { + it("should return true when value was set", async function () { + const bigMap = new BigMap (); + const key = "0x123f"; + bigMap.set(key, "12134"); + assert.isTrue (bigMap.has(key)); }); + }); - describe ("set", function () { - it("should set when key has submap", async function () { - const bigMap = new BigMap (); - assert.doesNotThrow(() => bigMap.set("0x13", "12134")); - assert.equal(bigMap.size, 1); - }); + describe ("set", function () { + it("should set when key has submap", async function () { + const bigMap = new BigMap (); + assert.doesNotThrow(() => bigMap.set("0x13", "12134")); + assert.equal(bigMap.size, 1); + }); - it("should throw when key has no submap", async function () { - const bigMap = new BigMap (); - assert.throw(() => bigMap.set("g", "12134"), "Tried to set g, but that key has no submap"); - }); + it("should throw when key has no submap", async function () { + const bigMap = new BigMap (); + assert.throw(() => bigMap.set("g", "12134"), "Tried to set g, but that key has no submap"); }); + }); }); From 0d732997df86499627754c17abf9effeb2b7431b Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 11:32:49 -0500 Subject: [PATCH 07/15] fix remaining lint errors manually --- packages/transformer/src/BigMap.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index 4cfbd027..d311f779 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -83,15 +83,15 @@ export class BigMap implements Map { return this; } - [Symbol.iterator](): IterableIterator<[Id64String, V]>{ + public [Symbol.iterator](): IterableIterator<[Id64String, V]>{ return this.entries(); } - get [Symbol.toStringTag]() { + public get [Symbol.toStringTag]() { return "BigMap"; } - *entries(): IterableIterator<[Id64String, V]> { + public *entries(): IterableIterator<[Id64String, V]> { const maps = Object.values(this._maps); for (const map of maps) { for (const [key, value] of map.entries()) @@ -99,7 +99,7 @@ export class BigMap implements Map { } } - *keys(): IterableIterator { + public *keys(): IterableIterator { const maps = Object.values(this._maps); for (const map of maps) { for (const key of map.keys()) @@ -107,7 +107,7 @@ export class BigMap implements Map { } } - *values(): IterableIterator { + public *values(): IterableIterator { const maps = Object.values(this._maps); for (const map of maps) { for (const value of map.values()) From 595dd8b3f3159b6d173d3434968fefd4e059ef7e Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 12:41:16 -0500 Subject: [PATCH 08/15] make new update_deps script and use it to update deps to 4.3 --- pnpm-lock.yaml | 227 ++++++++++++++++++++++------------------- scripts/update_deps.sh | 6 ++ 2 files changed, 126 insertions(+), 107 deletions(-) create mode 100755 scripts/update_deps.sh diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0e9b59b5..6b82a6c8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -28,7 +28,7 @@ importers: typescript: ^5.0.2 devDependencies: '@itwin/build-tools': 4.1.1_@types+node@18.16.14 - '@itwin/core-backend': 4.1.1 + '@itwin/core-backend': 4.3.3 '@types/node': 18.16.14 typescript: 5.1.3 @@ -65,16 +65,16 @@ importers: typescript: ^5.0.2 yargs: ^16.0.0 dependencies: - '@itwin/core-backend': 4.1.1_gbuep6d2vehqhhbd7fgq3gptdy - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y - '@itwin/core-geometry': 4.1.1 - '@itwin/core-quantity': 4.1.1_@itwin+core-bentley@4.1.1 - '@itwin/ecschema-metadata': 4.1.1_xa7h3ubkcwg2ghrmdeixqy4vme + '@itwin/core-backend': 4.3.3_7qfebkgfkytmdr5gckh4dqdaey + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 + '@itwin/core-geometry': 4.3.3 + '@itwin/core-quantity': 4.3.3_@itwin+core-bentley@4.3.3 + '@itwin/ecschema-metadata': 4.3.3_sdm5gegleenbqnydb5oklqjdwi '@itwin/imodel-transformer': link:../transformer - '@itwin/imodels-access-backend': 2.3.0_u57if3ps4gurukqatctgxhghxi + '@itwin/imodels-access-backend': 2.3.0_5xnr4beoei3a7phgmgwcw7s27q '@itwin/imodels-client-authoring': 2.3.0 - '@itwin/node-cli-authorization': 0.9.2_@itwin+core-bentley@4.1.1 + '@itwin/node-cli-authorization': 0.9.2_@itwin+core-bentley@4.3.3 '@itwin/perf-tools': 3.7.2 dotenv: 10.0.0 dotenv-expand: 5.1.0 @@ -83,7 +83,7 @@ importers: devDependencies: '@itwin/build-tools': 4.1.1_@types+node@14.14.31 '@itwin/eslint-plugin': 3.7.8_nydeehezxge4zglz7xgffbdlvu - '@itwin/oidc-signin-tool': 3.7.2_2dlnqk3h6wil4io5pqf6n55z2y + '@itwin/oidc-signin-tool': 3.7.2_dg7g5ezpru5bq5yk7sprirsab4 '@itwin/projects-client': 0.6.0 '@types/chai': 4.3.1 '@types/fs-extra': 4.0.12 @@ -126,14 +126,14 @@ importers: typescript: ^5.0.2 yargs: ^17.4.0 dependencies: - '@itwin/core-backend': 4.1.1_gbuep6d2vehqhhbd7fgq3gptdy - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y - '@itwin/core-geometry': 4.1.1 + '@itwin/core-backend': 4.3.3_7qfebkgfkytmdr5gckh4dqdaey + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 + '@itwin/core-geometry': 4.3.3 '@itwin/imodel-transformer': link:../transformer - '@itwin/imodels-access-backend': 2.3.0_u57if3ps4gurukqatctgxhghxi + '@itwin/imodels-access-backend': 2.3.0_5xnr4beoei3a7phgmgwcw7s27q '@itwin/imodels-client-authoring': 2.3.0 - '@itwin/node-cli-authorization': 0.9.2_@itwin+core-bentley@4.1.1 + '@itwin/node-cli-authorization': 0.9.2_@itwin+core-bentley@4.3.3 dotenv: 10.0.0 dotenv-expand: 5.1.0 fs-extra: 8.1.0 @@ -188,12 +188,12 @@ importers: semver: 7.5.1 devDependencies: '@itwin/build-tools': 4.0.0-dev.86_@types+node@18.16.16 - '@itwin/core-backend': 4.1.1_gbuep6d2vehqhhbd7fgq3gptdy - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y - '@itwin/core-geometry': 4.1.1 - '@itwin/core-quantity': 4.1.1_@itwin+core-bentley@4.1.1 - '@itwin/ecschema-metadata': 4.0.2_xa7h3ubkcwg2ghrmdeixqy4vme + '@itwin/core-backend': 4.3.3_7qfebkgfkytmdr5gckh4dqdaey + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 + '@itwin/core-geometry': 4.3.3 + '@itwin/core-quantity': 4.3.3_@itwin+core-bentley@4.3.3 + '@itwin/ecschema-metadata': 4.3.3_sdm5gegleenbqnydb5oklqjdwi '@itwin/eslint-plugin': 3.7.8_nydeehezxge4zglz7xgffbdlvu '@types/chai': 4.3.1 '@types/chai-as-promised': 7.1.5 @@ -236,7 +236,7 @@ packages: engines: {node: '>=12.0.0'} dependencies: '@azure/abort-controller': 1.1.0 - tslib: 2.5.3 + tslib: 2.6.1 dev: false /@azure/core-auth/1.5.0: @@ -328,7 +328,7 @@ packages: engines: {node: '>=14.0.0'} dependencies: '@azure/abort-controller': 1.1.0 - tslib: 2.5.3 + tslib: 2.6.1 dev: false /@azure/core-util/1.4.0: @@ -604,8 +604,8 @@ packages: to-fast-properties: 2.0.0 dev: true - /@bentley/imodeljs-native/4.1.9: - resolution: {integrity: sha512-Ym675wTR7ck6/BiAZeaiXiubgNk/N5jU1dvhldfYP+gOVoKaGT4sSqGZRxIlvB00pINytW4RI7OYDhgz1RT39A==} + /@bentley/imodeljs-native/4.3.6: + resolution: {integrity: sha512-c0DKEqyUpGOqu2NNU9IFJ96IcmIYA0eyl7rBmmeu9B4mmLW1n8ktdAPVIqd6jxbM+sdmiVwQIZOkAKk1DQpU3Q==} requiresBuild: true /@cspotcode/source-map-support/0.8.1: @@ -825,21 +825,21 @@ packages: inversify: 6.0.1 reflect-metadata: 0.1.13 - /@itwin/core-backend/4.1.1: - resolution: {integrity: sha512-whSB5SfZeIsE5EPnyByd4IpLIQpIp/d7TpBDOude7yCuNOQB+MRLx3XV7JWcUBjZPmjEQSulVFsPFZkMoLu/HA==} - engines: {node: ^18.0.0} + /@itwin/core-backend/4.3.3: + resolution: {integrity: sha512-zhKqmnUQsgwWMbbMD17eK2gbZ39/N5hKiFLP4l5dfAZBDgk0VPHhHo4uwsh6izloT6x7Wox9RnrVGVP6n39S+A==} + engines: {node: ^18.0.0 || ^20.0.0} peerDependencies: - '@itwin/core-bentley': ^4.1.1 - '@itwin/core-common': ^4.1.1 - '@itwin/core-geometry': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 + '@itwin/core-common': ^4.3.3 + '@itwin/core-geometry': ^4.3.3 '@opentelemetry/api': ^1.0.4 peerDependenciesMeta: '@opentelemetry/api': optional: true dependencies: - '@bentley/imodeljs-native': 4.1.9 + '@bentley/imodeljs-native': 4.3.6 '@itwin/cloud-agnostic-core': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u - '@itwin/core-telemetry': 4.1.1 + '@itwin/core-telemetry': 4.3.3 '@itwin/object-storage-azure': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u '@itwin/object-storage-core': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u form-data: 2.5.1 @@ -849,6 +849,7 @@ packages: multiparty: 4.2.3 reflect-metadata: 0.1.13 semver: 7.5.1 + touch: 3.1.0 ws: 7.5.9 transitivePeerDependencies: - bufferutil @@ -857,24 +858,24 @@ packages: - utf-8-validate dev: true - /@itwin/core-backend/4.1.1_gbuep6d2vehqhhbd7fgq3gptdy: - resolution: {integrity: sha512-whSB5SfZeIsE5EPnyByd4IpLIQpIp/d7TpBDOude7yCuNOQB+MRLx3XV7JWcUBjZPmjEQSulVFsPFZkMoLu/HA==} - engines: {node: ^18.0.0} + /@itwin/core-backend/4.3.3_7qfebkgfkytmdr5gckh4dqdaey: + resolution: {integrity: sha512-zhKqmnUQsgwWMbbMD17eK2gbZ39/N5hKiFLP4l5dfAZBDgk0VPHhHo4uwsh6izloT6x7Wox9RnrVGVP6n39S+A==} + engines: {node: ^18.0.0 || ^20.0.0} peerDependencies: - '@itwin/core-bentley': ^4.1.1 - '@itwin/core-common': ^4.1.1 - '@itwin/core-geometry': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 + '@itwin/core-common': ^4.3.3 + '@itwin/core-geometry': ^4.3.3 '@opentelemetry/api': ^1.0.4 peerDependenciesMeta: '@opentelemetry/api': optional: true dependencies: - '@bentley/imodeljs-native': 4.1.9 + '@bentley/imodeljs-native': 4.3.6 '@itwin/cloud-agnostic-core': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y - '@itwin/core-geometry': 4.1.1 - '@itwin/core-telemetry': 4.1.1_@itwin+core-geometry@4.1.1 + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 + '@itwin/core-geometry': 4.3.3 + '@itwin/core-telemetry': 4.3.3_@itwin+core-geometry@4.3.3 '@itwin/object-storage-azure': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u '@itwin/object-storage-core': 2.1.0_scz6qrwecfbbxg4vskopkl3a7u form-data: 2.5.1 @@ -884,6 +885,7 @@ packages: multiparty: 4.2.3 reflect-metadata: 0.1.13 semver: 7.5.1 + touch: 3.1.0 ws: 7.5.9 transitivePeerDependencies: - bufferutil @@ -891,82 +893,70 @@ packages: - encoding - utf-8-validate - /@itwin/core-bentley/4.1.1: - resolution: {integrity: sha512-vn/3nz/Guvlji+u1ttiZ9Wy9J+FjRdEMEmoWa1zM0X+utl7CxE5TRbLEU6/yGPLtH/aFhfqhbj6YmBayiA2Fmg==} + /@itwin/core-bentley/4.3.3: + resolution: {integrity: sha512-7Fs/JFYX3T6HW5zS0YHyUX5beWiT7JHR6v9dKkPk+i27i6bdDrQaVnj+IITe+eYrIQPchOMIxrOpKRZdR5Oz2A==} - /@itwin/core-common/4.1.1_2dlnqk3h6wil4io5pqf6n55z2y: - resolution: {integrity: sha512-c9fh/2iQnh/ZIz2re0UFa9d/tZBEFEPnnJY1F1wupLftcFqOgkrBlVDPoYs1NUi4tQaKdbZNtvMp5ACdKmsIAw==} + /@itwin/core-common/4.3.3_@itwin+core-bentley@4.3.3: + resolution: {integrity: sha512-SwBVWtIyIMC2ww3TWGwqL24kOClT8QOHiNOpOTOSeVkDv1k12+oO4BzpAmMqwyJ/ucC0qlrBLDv+umcr1mQVwg==} peerDependencies: - '@itwin/core-bentley': ^4.1.1 - '@itwin/core-geometry': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 + '@itwin/core-geometry': ^4.3.3 dependencies: - '@itwin/core-bentley': 4.1.1 - '@itwin/core-geometry': 4.1.1 + '@itwin/core-bentley': 4.3.3 flatbuffers: 1.12.0 js-base64: 3.7.5 + dev: true - /@itwin/core-common/4.1.1_@itwin+core-bentley@4.1.1: - resolution: {integrity: sha512-c9fh/2iQnh/ZIz2re0UFa9d/tZBEFEPnnJY1F1wupLftcFqOgkrBlVDPoYs1NUi4tQaKdbZNtvMp5ACdKmsIAw==} + /@itwin/core-common/4.3.3_dg7g5ezpru5bq5yk7sprirsab4: + resolution: {integrity: sha512-SwBVWtIyIMC2ww3TWGwqL24kOClT8QOHiNOpOTOSeVkDv1k12+oO4BzpAmMqwyJ/ucC0qlrBLDv+umcr1mQVwg==} peerDependencies: - '@itwin/core-bentley': ^4.1.1 - '@itwin/core-geometry': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 + '@itwin/core-geometry': ^4.3.3 dependencies: - '@itwin/core-bentley': 4.1.1 + '@itwin/core-bentley': 4.3.3 + '@itwin/core-geometry': 4.3.3 flatbuffers: 1.12.0 js-base64: 3.7.5 - dev: true - /@itwin/core-geometry/4.1.1: - resolution: {integrity: sha512-qJ898D+wftU8IBTYa3RfSQFeiplt+OF0RkDUbcA85y+GvnLvF/dmUKHvwAY7NfVL1+JDJdf3ovERqzFuBM670w==} + /@itwin/core-geometry/4.3.3: + resolution: {integrity: sha512-wGUXSYnll2kJ42XoauEcdCikrll9qiHe2p3zK5vUgIrt9Edggao8t2tmLQxuz1NlxWOxoWDGNCAs665I46GM8w==} dependencies: - '@itwin/core-bentley': 4.1.1 + '@itwin/core-bentley': 4.3.3 flatbuffers: 1.12.0 - /@itwin/core-quantity/4.1.1_@itwin+core-bentley@4.1.1: - resolution: {integrity: sha512-QGgitMX30K8L1xJmzVJ5GQRaBiPn3ihUTQAimz1QEHCIUa49S2UWLbe9oVf+4WREK86wfNDLF4Jadl1VB9gB1w==} + /@itwin/core-quantity/4.3.3_@itwin+core-bentley@4.3.3: + resolution: {integrity: sha512-IIq1iRFqwzwFV4oVj4UyHgwAWCze2jAipJKWnha37BQrYvwaJZP1Pt+6agzbcTaQCOnzubIQoEsxJIQymx4Xpg==} peerDependencies: - '@itwin/core-bentley': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 dependencies: - '@itwin/core-bentley': 4.1.1 + '@itwin/core-bentley': 4.3.3 - /@itwin/core-telemetry/4.1.1: - resolution: {integrity: sha512-TGuZ6A5q12gJhMmd5R7PmNl6TAvnws5BFz70NqPGT+nbcgugZVK0iaHwmNi738XRKRsSdavoAnbNIzGgDJJ2tA==} + /@itwin/core-telemetry/4.3.3: + resolution: {integrity: sha512-M8DxiSBHdsJJjg55bE9/BbrQKug51NpUijJlQoXhOEk1fu2Op8oIRCy0dUATRFbY1mRO/NwdFqsxsBucVgq85A==} dependencies: - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_@itwin+core-bentley@4.1.1 + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_@itwin+core-bentley@4.3.3 transitivePeerDependencies: - '@itwin/core-geometry' dev: true - /@itwin/core-telemetry/4.1.1_@itwin+core-geometry@4.1.1: - resolution: {integrity: sha512-TGuZ6A5q12gJhMmd5R7PmNl6TAvnws5BFz70NqPGT+nbcgugZVK0iaHwmNi738XRKRsSdavoAnbNIzGgDJJ2tA==} + /@itwin/core-telemetry/4.3.3_@itwin+core-geometry@4.3.3: + resolution: {integrity: sha512-M8DxiSBHdsJJjg55bE9/BbrQKug51NpUijJlQoXhOEk1fu2Op8oIRCy0dUATRFbY1mRO/NwdFqsxsBucVgq85A==} dependencies: - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 transitivePeerDependencies: - '@itwin/core-geometry' - /@itwin/ecschema-metadata/4.0.2_xa7h3ubkcwg2ghrmdeixqy4vme: - resolution: {integrity: sha512-NXjY31TofOF5thxfxUUebzv0PbeiHS+rSnIgSVeowY1wWKxBT3GeiueoP2T4lBBCTOwySDnZW6nVkeQp5XepzQ==} - peerDependencies: - '@itwin/core-bentley': ^4.0.2 - '@itwin/core-quantity': ^4.0.2 - dependencies: - '@itwin/core-bentley': 4.1.1 - '@itwin/core-quantity': 4.1.1_@itwin+core-bentley@4.1.1 - almost-equal: 1.1.0 - dev: true - - /@itwin/ecschema-metadata/4.1.1_xa7h3ubkcwg2ghrmdeixqy4vme: - resolution: {integrity: sha512-lt1zamZjgpqQ8N17+R4BfWtNNZyCArZgmS26wJDl36bSIqz0BWD1tH4foeoagr7alkjE233UMjoTJivHfK0Dgw==} + /@itwin/ecschema-metadata/4.3.3_sdm5gegleenbqnydb5oklqjdwi: + resolution: {integrity: sha512-rQx4mm99EahWzUC7l8hZnA1DT+D+/lOxVHxaokFdMxlVYzsyONoRmZPemJln5GkbXOQuI38zCxMCc8AFWGQVzA==} peerDependencies: - '@itwin/core-bentley': ^4.1.1 - '@itwin/core-quantity': ^4.1.1 + '@itwin/core-bentley': ^4.3.3 + '@itwin/core-quantity': ^4.3.3 dependencies: - '@itwin/core-bentley': 4.1.1 - '@itwin/core-quantity': 4.1.1_@itwin+core-bentley@4.1.1 + '@itwin/core-bentley': 4.3.3 + '@itwin/core-quantity': 4.3.3_@itwin+core-bentley@4.3.3 almost-equal: 1.1.0 - dev: false /@itwin/eslint-plugin/3.7.8_nydeehezxge4zglz7xgffbdlvu: resolution: {integrity: sha512-zPgGUZro3NZNH5CVCrzxy+Zyi0CucCMO3aYsPn8eaAvLQE1iqWt+M0XT+ih6FwZXRiHSrPhNrjTvP8cuFC96og==} @@ -995,7 +985,7 @@ packages: - supports-color dev: true - /@itwin/imodels-access-backend/2.3.0_u57if3ps4gurukqatctgxhghxi: + /@itwin/imodels-access-backend/2.3.0_5xnr4beoei3a7phgmgwcw7s27q: resolution: {integrity: sha512-g2Bygiu6Is/Xa6OWUxXN/BZwGU2M4izFl8fdgL1cFWxhoWSYL169bN3V4zvRTUJIqtsNaTyOeRu2mjkRgHY9KQ==} peerDependencies: '@itwin/core-backend': ^3.3.0 @@ -1003,9 +993,9 @@ packages: '@itwin/core-common': ^3.3.0 dependencies: '@azure/abort-controller': 1.1.0 - '@itwin/core-backend': 4.1.1_gbuep6d2vehqhhbd7fgq3gptdy - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y + '@itwin/core-backend': 4.3.3_7qfebkgfkytmdr5gckh4dqdaey + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 '@itwin/imodels-client-authoring': 2.3.0 axios: 0.21.4 transitivePeerDependencies: @@ -1033,12 +1023,12 @@ packages: - debug dev: false - /@itwin/node-cli-authorization/0.9.2_@itwin+core-bentley@4.1.1: + /@itwin/node-cli-authorization/0.9.2_@itwin+core-bentley@4.3.3: resolution: {integrity: sha512-/L1MYQEKlwfBaHhO1OgRvxFOcq77lUyjR1JSeyl9iYLWuxYdwrjuRTObgX/XCGogRm3ZcUHR9YctRJgPrRyjwg==} peerDependencies: '@itwin/core-bentley': ^3.0.0 dependencies: - '@itwin/core-bentley': 4.1.1 + '@itwin/core-bentley': 4.3.3 '@openid/appauth': 1.3.1 keytar: 7.9.0 open: 8.4.2 @@ -1105,15 +1095,15 @@ packages: transitivePeerDependencies: - debug - /@itwin/oidc-signin-tool/3.7.2_2dlnqk3h6wil4io5pqf6n55z2y: + /@itwin/oidc-signin-tool/3.7.2_dg7g5ezpru5bq5yk7sprirsab4: resolution: {integrity: sha512-DA5uWjGKFWP+ISySlLYXsTCHTogJn4O+z+R/XNmcR/8jiRiFMGr3aYmjklgrvUmYDJyl8llxSnVMz9w115+D1w==} requiresBuild: true peerDependencies: '@itwin/core-bentley': '>=3.3.0' dependencies: '@itwin/certa': 3.7.8 - '@itwin/core-bentley': 4.1.1 - '@itwin/core-common': 4.1.1_2dlnqk3h6wil4io5pqf6n55z2y + '@itwin/core-bentley': 4.3.3 + '@itwin/core-common': 4.3.3_dg7g5ezpru5bq5yk7sprirsab4 '@playwright/test': 1.31.2 dotenv: 10.0.0 dotenv-expand: 5.1.0 @@ -1595,8 +1585,8 @@ packages: '@types/yargs-parser': 21.0.0 dev: true - /@types/yauzl/2.10.0: - resolution: {integrity: sha512-Cn6WYCm0tXv8p6k+A8PvbDG763EDpBoTzHdA+Q/MF6H3sapGjCm9NzoaJncJS9tUKSuCoDs9XHxYYsQDgxR6kw==} + /@types/yauzl/2.10.3: + resolution: {integrity: sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==} requiresBuild: true dependencies: '@types/node': 18.16.16 @@ -1841,6 +1831,9 @@ packages: resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} dev: true + /abbrev/1.1.1: + resolution: {integrity: sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==} + /accepts/1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -2355,7 +2348,7 @@ packages: normalize-path: 3.0.0 readdirp: 3.6.0 optionalDependencies: - fsevents: 2.3.2 + fsevents: 2.3.3 dev: true /chownr/1.1.4: @@ -3377,7 +3370,7 @@ packages: get-stream: 5.2.0 yauzl: 2.10.0 optionalDependencies: - '@types/yauzl': 2.10.0 + '@types/yauzl': 2.10.3 transitivePeerDependencies: - supports-color dev: true @@ -3597,6 +3590,14 @@ packages: dev: true optional: true + /fsevents/2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true @@ -3687,7 +3688,7 @@ packages: dev: true /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -4887,6 +4888,12 @@ packages: resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} dev: true + /nopt/1.0.10: + resolution: {integrity: sha512-NWmpvLSqUrgrAC9HCuxEvb+PSloHpqVu+FqcO4eeF2h5qYRhA7ev6KvelyQAKtegUbC6RypJnlEOhd8vloNKYg==} + hasBin: true + dependencies: + abbrev: 1.1.1 + /normalize-package-data/2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: @@ -5667,7 +5674,7 @@ packages: /rxjs/7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} dependencies: - tslib: 2.5.3 + tslib: 2.6.1 dev: true /safe-buffer/5.2.1: @@ -6148,6 +6155,12 @@ packages: resolution: {integrity: sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==} dev: true + /touch/3.1.0: + resolution: {integrity: sha512-WBx8Uy5TLtOSRtIq+M03/sKDrXCLHxwDcquSP2c43Le03/9serjQBIztjRz6FkJez9D/hleyAXTBGLwwZUw9lA==} + hasBin: true + dependencies: + nopt: 1.0.10 + /tough-cookie/4.1.3: resolution: {integrity: sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==} engines: {node: '>=6'} diff --git a/scripts/update_deps.sh b/scripts/update_deps.sh new file mode 100755 index 00000000..f80d3a93 --- /dev/null +++ b/scripts/update_deps.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +# upgrade all itwin dependencies +pnpm dlx pnpm@7 -r update $( git ls-files '*package.json' | xargs -i jq '.dependencies|keys[]' {} | grep itwin | sed 's/"//g') +git stash push '*package.json' +# reinstall old package.json on new updated dev deps +pnpm dlx pnpm@7 install From 6d6382edf9a361c9c3130eeae250f9893d28534c Mon Sep 17 00:00:00 2001 From: Michael Belousov Date: Mon, 22 Jan 2024 12:56:19 -0500 Subject: [PATCH 09/15] cherrypick better prop changes allowed --- .../src/test/IModelTransformerUtils.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/transformer/src/test/IModelTransformerUtils.ts b/packages/transformer/src/test/IModelTransformerUtils.ts index 6eb1cf56..52a2e389 100644 --- a/packages/transformer/src/test/IModelTransformerUtils.ts +++ b/packages/transformer/src/test/IModelTransformerUtils.ts @@ -295,11 +295,16 @@ export async function assertIdentityTransformation( mappedRelationTargetInTargetId ); } else if (!propChangesAllowed) { - // kept for conditional breakpoints - const _propEq = TestUtils.advancedDeepEqual(targetElem.asAny[propName], sourceElem.asAny[propName]); - expect(targetElem.asAny[propName]).to.deep.advancedEqual( - sourceElem.asAny[propName] - ); + try { + expect( + (targetElem as any)[propName], + `${targetElem.id}[${propName}] didn't match ${sourceElem.id}[${propName}]` + ).to.deep.advancedEqual((sourceElem as any)[propName]); + } catch (err) { + // for debugging broken tests + debugger; // eslint-disable-line no-debugger + throw err; + } } } const quickClone = (obj: any) => JSON.parse(JSON.stringify(obj)); From 02052ffb21f594ee7caa328f4b5995c3dd9d9f17 Mon Sep 17 00:00:00 2001 From: "nick.tessier" <22119573+nick4598@users.noreply.github.com> Date: Mon, 22 Jan 2024 13:53:23 -0500 Subject: [PATCH 10/15] allow the alwaysPresentElementIds to have different fed guids --- packages/transformer/src/test/IModelTransformerUtils.ts | 8 +++++++- .../src/test/standalone/IModelTransformer.test.ts | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/transformer/src/test/IModelTransformerUtils.ts b/packages/transformer/src/test/IModelTransformerUtils.ts index 52a2e389..988a23a9 100644 --- a/packages/transformer/src/test/IModelTransformerUtils.ts +++ b/packages/transformer/src/test/IModelTransformerUtils.ts @@ -235,13 +235,18 @@ export async function assertIdentityTransformation( // [IModelTransformerOptions.includeSourceProvenance]$(transformer) is set to true classesToIgnoreMissingEntitiesOfInTarget = [...IModelTransformer.provenanceElementClasses, ...IModelTransformer.provenanceElementAspectClasses], compareElemGeom = false, + ignoreFedGuidsOnAlwaysPresentElementIds = true, }: { expectedElemsOnlyInSource?: Partial[]; /** before checking elements that are only in the source are correct, filter out elements of these classes */ classesToIgnoreMissingEntitiesOfInTarget?: typeof Entity[]; compareElemGeom?: boolean; + /** if true, ignores the fed guids present on always present elements (present even in an empty iModel!). + * That list includes the root subject (0x1), dictionaryModel (0x10) and the realityDataSourcesModel (0xe) */ + ignoreFedGuidsOnAlwaysPresentElementIds?: boolean; } = {} ) { + const alwaysPresentElementIds = new Set(["0x1", "0x10", "0xe"]); const [remapElem, remapCodeSpec, remapAspect] = remapper instanceof IModelTransformer ? [remapper.context.findTargetElementId.bind(remapper.context), @@ -274,7 +279,8 @@ export async function assertIdentityTransformation( // known cases for the prop expecting to have been changed by the transformation under normal circumstances // - federation guid will be generated if it didn't exist // - jsonProperties may include remapped ids - const propChangesAllowed = sourceElem.federationGuid === undefined || propName === "jsonProperties"; + const propChangesAllowed = ((propName === "federationGuid" && (sourceElem.federationGuid === undefined || (ignoreFedGuidsOnAlwaysPresentElementIds && alwaysPresentElementIds.has(sourceElemId)))) + || propName === "jsonProperties"); if (prop.isNavigation) { expect(sourceElem.classFullName).to.equal(targetElem.classFullName); // some custom handled classes make it difficult to inspect the element props directly with the metadata prop name diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 408eb189..10913357 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -1139,11 +1139,19 @@ describe("IModelTransformer", () => { /** gets a mapping of element ids to their invariant content */ async function getAllElementsInvariants(db: IModelDb, filterPredicate?: (element: Element) => boolean) { + // The set of element Ids where the fed guid should be ignored (since it can change between transforms). + const ignoreFedGuidElementIds = new Set([ + IModel.rootSubjectId, + IModel.dictionaryId, + "0xe", // id of realityDataSourcesModel + ]); const result: Record = {}; // eslint-disable-next-line deprecation/deprecation for await (const row of db.query("SELECT * FROM bis.Element", undefined, { rowFormat: QueryRowFormat.UseJsPropertyNames })) { if (!filterPredicate || filterPredicate(db.elements.getElement(row.id))) { const { lastMod: _lastMod, ...invariantPortion } = row; + if (ignoreFedGuidElementIds.has(row.id)) + delete invariantPortion.federationGuid; result[row.id] = invariantPortion; } } From 22303a6c14ff945b753fe3b50f12c25e09bce353 Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Tue, 23 Jan 2024 13:27:05 +0200 Subject: [PATCH 11/15] Added test to verify that unresolved references are logged correctly --- .../test/standalone/IModelTransformer.test.ts | 54 ++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 933fc235..843775d3 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -19,7 +19,7 @@ import { import * as coreBackendPkgJson from "@itwin/core-backend/package.json"; import * as ECSchemaMetaData from "@itwin/ecschema-metadata"; import * as TestUtils from "../TestUtils"; -import { DbResult, Guid, Id64, Id64String, Logger, LogLevel, OpenMode } from "@itwin/core-bentley"; +import { DbResult, Guid, Id64, Id64String, Logger, LogLevel, LoggingMetaData, OpenMode } from "@itwin/core-bentley"; import { AxisAlignedBox3d, BriefcaseIdValue, Code, CodeScopeSpec, CodeSpec, ColorDef, CreateIModelProps, DefinitionElementProps, ElementAspectProps, ElementProps, ExternalSourceAspectProps, GeometricElement2dProps, ImageSourceFormat, IModel, IModelError, InformationPartitionElementProps, ModelProps, PhysicalElementProps, Placement3d, ProfileOptions, QueryRowFormat, RelatedElement, RelationshipProps, RepositoryLinkProps, @@ -71,6 +71,9 @@ describe("IModelTransformer", () => { if (!IModelJsFs.existsSync(outputDir)) { IModelJsFs.mkdirSync(outputDir); } + }); + + beforeEach(async () => { // initialize logging if (process.env.LOG_TRANSFORMER_IN_TESTS) { Logger.initializeToConsole(); @@ -642,6 +645,55 @@ describe("IModelTransformer", () => { iModelShared.close(); }); + it("should log unresolved references", async () => { + const iModelShared: SnapshotDb = IModelTransformerTestUtils.createSharedIModel(outputDir, ["A", "B"]); + const iModelA: SnapshotDb = IModelTransformerTestUtils.createTeamIModel(outputDir, "A", Point3d.create(0, 0, 0), ColorDef.green); + IModelTransformerTestUtils.assertTeamIModelContents(iModelA, "A"); + const iModelExporterA = new IModelExporter(iModelA); + + // Exclude element + const excludedId = iModelA.elements.queryElementIdByCode(Subject.createCode(iModelA, IModel.rootSubjectId, "Context")); + assert.isDefined (excludedId); + iModelExporterA.excludeElement(excludedId!); + + const subjectId: Id64String = IModelTransformerTestUtils.querySubjectId(iModelShared, "A"); + const transformerA2S = new IModelTransformer(iModelExporterA, iModelShared, { targetScopeElementId: subjectId }); + transformerA2S.context.remapElement(IModel.rootSubjectId, subjectId); + + // Configure logger to capture warning message about unresolved references + const messageStart = "The following elements were never fully resolved:\n"; + const messageEnd = "\nThis indicates that either some references were excluded from the transformation\nor the source has dangling references."; + + let unresolvedElementMessage: string | undefined = undefined; + const logWarning = (_category: string, message: string, _metaData: LoggingMetaData) => { + if (message.startsWith (messageStart)) { + unresolvedElementMessage = message; + } + } + Logger.initialize(undefined, logWarning); + Logger.setLevelDefault(LogLevel.Warning); + + // Act + await transformerA2S.processAll(); + + // Collect expected ids + const result = iModelA.queryEntityIds({ from: "BisCore.Element", + where: "Model.Id = :rootId AND ECInstanceId NOT IN (:rootId, :excludedId)", + bindings: {rootId: IModel.rootSubjectId, excludedId: excludedId } }); + const expectedIds = [...result].map (x => `e${x}`); + + // Collect actual ids + assert.isDefined(unresolvedElementMessage); + var actualIds = unresolvedElementMessage!.split(messageStart)[1].split(messageEnd)[0].split(','); + + // Assert + assert.sameMembers(actualIds, expectedIds); + + transformerA2S.dispose(); + iModelA.close(); + iModelShared.close(); + }); + it("should detect conflicting provenance scopes", async () => { const sourceDb1 = IModelTransformerTestUtils.createTeamIModel(outputDir, "S1", Point3d.create(0, 0, 0), ColorDef.green); const sourceDb2 = IModelTransformerTestUtils.createTeamIModel(outputDir, "S2", Point3d.create(0, 10, 0), ColorDef.blue); From 6873ace6acb7f818f1e9ca04bdf2086a4f5e2678 Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Tue, 23 Jan 2024 13:46:47 +0200 Subject: [PATCH 12/15] Run linter --- packages/transformer/src/BigMap.ts | 164 +++++++++--------- .../src/test/standalone/BigMap.test.ts | 17 +- .../test/standalone/IModelTransformer.test.ts | 26 +-- 3 files changed, 103 insertions(+), 104 deletions(-) diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index d311f779..a90d7f78 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -15,103 +15,103 @@ import { Id64String } from "@itwin/core-bentley"; * @internal */ export class BigMap implements Map { - private _maps: Record>; - private _size: number; + private _maps: Record>; + private _size: number; - public get size(): number { - return this._size; - } - - public constructor() { - this._maps = { - 0: new Map(), - 1: new Map(), - 2: new Map(), - 3: new Map(), - 4: new Map(), - 5: new Map(), - 6: new Map(), - 7: new Map(), - 8: new Map(), - 9: new Map(), - a: new Map(), - b: new Map(), - c: new Map(), - d: new Map(), - e: new Map(), - f: new Map(), - }; - this._size = 0; - } + public get size(): number { + return this._size; + } - public clear(): void { - Object.values(this._maps).forEach((m) => m.clear()); - this._size = 0; - } + public constructor() { + this._maps = { + 0: new Map(), + 1: new Map(), + 2: new Map(), + 3: new Map(), + 4: new Map(), + 5: new Map(), + 6: new Map(), + 7: new Map(), + 8: new Map(), + 9: new Map(), + a: new Map(), + b: new Map(), + c: new Map(), + d: new Map(), + e: new Map(), + f: new Map(), + }; + this._size = 0; + } - public delete(key: Id64String): boolean { - const wasDeleted = this._maps[key[key.length - 1]].delete(key); - if (wasDeleted) { - this._size--; - } + public clear(): void { + Object.values(this._maps).forEach((m) => m.clear()); + this._size = 0; + } - return wasDeleted; + public delete(key: Id64String): boolean { + const wasDeleted = this._maps[key[key.length - 1]].delete(key); + if (wasDeleted) { + this._size--; } - public forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { - Object.values(this._maps).forEach((m) => { - m.forEach(callbackfn, thisArg); - }); - } + return wasDeleted; + } - public get(key: Id64String): V | undefined { - return this._maps[key[key.length - 1]].get(key); - } + public forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { + Object.values(this._maps).forEach((m) => { + m.forEach(callbackfn, thisArg); + }); + } - public has(key: Id64String): boolean { - return this._maps[key[key.length - 1]].has(key); - } + public get(key: Id64String): V | undefined { + return this._maps[key[key.length - 1]].get(key); + } - public set(key: Id64String, value: V): this { - const mapForKey = this._maps[key[key.length - 1]]; - if (mapForKey === undefined) - throw Error(`Tried to set ${key}, but that key has no submap`); - const beforeSize = mapForKey.size; - mapForKey.set(key, value); - const afterSize = mapForKey.size; - this._size += (afterSize - beforeSize); - return this; - } + public has(key: Id64String): boolean { + return this._maps[key[key.length - 1]].has(key); + } - public [Symbol.iterator](): IterableIterator<[Id64String, V]>{ - return this.entries(); - } + public set(key: Id64String, value: V): this { + const mapForKey = this._maps[key[key.length - 1]]; + if (mapForKey === undefined) + throw Error(`Tried to set ${key}, but that key has no submap`); + const beforeSize = mapForKey.size; + mapForKey.set(key, value); + const afterSize = mapForKey.size; + this._size += (afterSize - beforeSize); + return this; + } - public get [Symbol.toStringTag]() { - return "BigMap"; - } + public [Symbol.iterator](): IterableIterator<[Id64String, V]>{ + return this.entries(); + } + + public get [Symbol.toStringTag]() { + return "BigMap"; + } - public *entries(): IterableIterator<[Id64String, V]> { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const [key, value] of map.entries()) - yield [key, value]; - } + public *entries(): IterableIterator<[Id64String, V]> { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const [key, value] of map.entries()) + yield [key, value]; } + } - public *keys(): IterableIterator { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const key of map.keys()) - yield key; - } + public *keys(): IterableIterator { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const key of map.keys()) + yield key; } + } - public *values(): IterableIterator { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const value of map.values()) - yield value; - } + public *values(): IterableIterator { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const value of map.values()) + yield value; } + } } diff --git a/packages/transformer/src/test/standalone/BigMap.test.ts b/packages/transformer/src/test/standalone/BigMap.test.ts index 4f2c37b5..b46f2ca5 100644 --- a/packages/transformer/src/test/standalone/BigMap.test.ts +++ b/packages/transformer/src/test/standalone/BigMap.test.ts @@ -6,7 +6,7 @@ import { BigMap } from "../../BigMap"; import { assert } from "chai"; -describe ("BigMap", function () { +describe("BigMap", function () { // Test map keys will be assigned into 2 different submaps when BigMap is created const testMap = new Map ([["0x123f", "testVal1"], ["0x1231", "testVal2"]]); @@ -19,21 +19,21 @@ describe ("BigMap", function () { return bigMap; }; - describe ("keys", function () { + describe("keys", function () { it("should iterate all keys", async function () { const bigMap = createBigMap (testMap); assert.sameMembers([...bigMap.keys()], [...testMap.keys()]); }); }); - describe ("values", function () { + describe("values", function () { it("should get all values", async function () { const bigMap = createBigMap (testMap); assert.sameMembers([...bigMap.values()], [...testMap.values()]); }); }); - describe ("entries", function () { + describe("entries", function () { it("should get all values", async function () { const bigMap = createBigMap (testMap); const actualMap = new Map([...bigMap.entries()]); @@ -41,7 +41,7 @@ describe ("BigMap", function () { }); }); - describe ("iterator", function () { + describe("iterator", function () { it("should get all values", async function () { const bigMap = createBigMap (testMap); @@ -53,14 +53,14 @@ describe ("BigMap", function () { }); }); - describe ("toStringTag", function () { + describe("toStringTag", function () { it("should return type name", async function () { const typeName = Object.prototype.toString.call(new BigMap ()); assert.equal(typeName, "[object BigMap]"); }); }); - describe ("has", function () { + describe("has", function () { it("should return true when value was set", async function () { const bigMap = new BigMap (); const key = "0x123f"; @@ -69,7 +69,7 @@ describe ("BigMap", function () { }); }); - describe ("set", function () { + describe("set", function () { it("should set when key has submap", async function () { const bigMap = new BigMap (); assert.doesNotThrow(() => bigMap.set("0x13", "12134")); @@ -81,5 +81,4 @@ describe ("BigMap", function () { assert.throw(() => bigMap.set("g", "12134"), "Tried to set g, but that key has no submap"); }); }); - }); diff --git a/packages/transformer/src/test/standalone/IModelTransformer.test.ts b/packages/transformer/src/test/standalone/IModelTransformer.test.ts index 6bfea55e..65341aba 100644 --- a/packages/transformer/src/test/standalone/IModelTransformer.test.ts +++ b/packages/transformer/src/test/standalone/IModelTransformer.test.ts @@ -19,7 +19,7 @@ import { import * as coreBackendPkgJson from "@itwin/core-backend/package.json"; import * as ECSchemaMetaData from "@itwin/ecschema-metadata"; import * as TestUtils from "../TestUtils"; -import { DbResult, Guid, Id64, Id64String, Logger, LogLevel, LoggingMetaData, OpenMode } from "@itwin/core-bentley"; +import { DbResult, Guid, Id64, Id64String, Logger, LoggingMetaData, LogLevel, OpenMode } from "@itwin/core-bentley"; import { AxisAlignedBox3d, BriefcaseIdValue, Code, CodeScopeSpec, CodeSpec, ColorDef, CreateIModelProps, DefinitionElementProps, ElementAspectProps, ElementProps, ExternalSourceAspectProps, GeometricElement2dProps, ImageSourceFormat, IModel, IModelError, InformationPartitionElementProps, ModelProps, PhysicalElementProps, Placement3d, ProfileOptions, QueryRowFormat, RelatedElement, RelationshipProps, RepositoryLinkProps, @@ -650,7 +650,7 @@ describe("IModelTransformer", () => { const iModelA: SnapshotDb = IModelTransformerTestUtils.createTeamIModel(outputDir, "A", Point3d.create(0, 0, 0), ColorDef.green); IModelTransformerTestUtils.assertTeamIModelContents(iModelA, "A"); const iModelExporterA = new IModelExporter(iModelA); - + // Exclude element const excludedId = iModelA.elements.queryElementIdByCode(Subject.createCode(iModelA, IModel.rootSubjectId, "Context")); assert.isDefined (excludedId); @@ -659,32 +659,32 @@ describe("IModelTransformer", () => { const subjectId: Id64String = IModelTransformerTestUtils.querySubjectId(iModelShared, "A"); const transformerA2S = new IModelTransformer(iModelExporterA, iModelShared, { targetScopeElementId: subjectId }); transformerA2S.context.remapElement(IModel.rootSubjectId, subjectId); - + // Configure logger to capture warning message about unresolved references const messageStart = "The following elements were never fully resolved:\n"; const messageEnd = "\nThis indicates that either some references were excluded from the transformation\nor the source has dangling references."; - let unresolvedElementMessage: string | undefined = undefined; + let unresolvedElementMessage: string | undefined; const logWarning = (_category: string, message: string, _metaData: LoggingMetaData) => { if (message.startsWith (messageStart)) { unresolvedElementMessage = message; - } - } + } + }; Logger.initialize(undefined, logWarning); Logger.setLevelDefault(LogLevel.Warning); - + // Act await transformerA2S.processAll(); - + // Collect expected ids - const result = iModelA.queryEntityIds({ from: "BisCore.Element", - where: "Model.Id = :rootId AND ECInstanceId NOT IN (:rootId, :excludedId)", - bindings: {rootId: IModel.rootSubjectId, excludedId: excludedId } }); - const expectedIds = [...result].map (x => `e${x}`); + const result = iModelA.queryEntityIds({ from: "BisCore.Element", + where: "Model.Id = :rootId AND ECInstanceId NOT IN (:rootId, :excludedId)", + bindings: {rootId: IModel.rootSubjectId, excludedId } }); + const expectedIds = [...result].map ((x) => `e${x}`); // Collect actual ids assert.isDefined(unresolvedElementMessage); - var actualIds = unresolvedElementMessage!.split(messageStart)[1].split(messageEnd)[0].split(','); + const actualIds = unresolvedElementMessage!.split(messageStart)[1].split(messageEnd)[0].split(","); // Assert assert.sameMembers(actualIds, expectedIds); From e82154cfeb0514be5d1753aee9ee87ba841c7f71 Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Tue, 23 Jan 2024 13:50:43 +0200 Subject: [PATCH 13/15] Reverted linter fixed to BigMap --- packages/transformer/src/BigMap.ts | 166 ++++++++++++++--------------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index a90d7f78..2bc8f0c1 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -15,103 +15,103 @@ import { Id64String } from "@itwin/core-bentley"; * @internal */ export class BigMap implements Map { - private _maps: Record>; - private _size: number; + private _maps: Record>; + private _size: number; - public get size(): number { - return this._size; - } - - public constructor() { - this._maps = { - 0: new Map(), - 1: new Map(), - 2: new Map(), - 3: new Map(), - 4: new Map(), - 5: new Map(), - 6: new Map(), - 7: new Map(), - 8: new Map(), - 9: new Map(), - a: new Map(), - b: new Map(), - c: new Map(), - d: new Map(), - e: new Map(), - f: new Map(), - }; - this._size = 0; - } + public get size(): number { + return this._size; + } - public clear(): void { - Object.values(this._maps).forEach((m) => m.clear()); - this._size = 0; - } + public constructor() { + this._maps = { + 0: new Map(), + 1: new Map(), + 2: new Map(), + 3: new Map(), + 4: new Map(), + 5: new Map(), + 6: new Map(), + 7: new Map(), + 8: new Map(), + 9: new Map(), + a: new Map(), + b: new Map(), + c: new Map(), + d: new Map(), + e: new Map(), + f: new Map(), + }; + this._size = 0; + } - public delete(key: Id64String): boolean { - const wasDeleted = this._maps[key[key.length - 1]].delete(key); - if (wasDeleted) { - this._size--; + public clear(): void { + Object.values(this._maps).forEach((m) => m.clear()); + this._size = 0; } - return wasDeleted; - } + public delete(key: Id64String): boolean { + const wasDeleted = this._maps[key[key.length - 1]].delete(key); + if (wasDeleted) { + this._size--; + } - public forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { - Object.values(this._maps).forEach((m) => { - m.forEach(callbackfn, thisArg); - }); - } + return wasDeleted; + } - public get(key: Id64String): V | undefined { - return this._maps[key[key.length - 1]].get(key); - } + public forEach(callbackfn: (value: V, key: Id64String, map: Map) => void, thisArg?: any): void { + Object.values(this._maps).forEach((m) => { + m.forEach(callbackfn, thisArg); + }); + } - public has(key: Id64String): boolean { - return this._maps[key[key.length - 1]].has(key); - } + public get(key: Id64String): V | undefined { + return this._maps[key[key.length - 1]].get(key); + } - public set(key: Id64String, value: V): this { - const mapForKey = this._maps[key[key.length - 1]]; - if (mapForKey === undefined) - throw Error(`Tried to set ${key}, but that key has no submap`); - const beforeSize = mapForKey.size; - mapForKey.set(key, value); - const afterSize = mapForKey.size; - this._size += (afterSize - beforeSize); - return this; - } + public has(key: Id64String): boolean { + return this._maps[key[key.length - 1]].has(key); + } - public [Symbol.iterator](): IterableIterator<[Id64String, V]>{ - return this.entries(); - } + public set(key: Id64String, value: V): this { + const mapForKey = this._maps[key[key.length - 1]]; + if (mapForKey === undefined) + throw Error(`Tried to set ${key}, but that key has no submap`); + const beforeSize = mapForKey.size; + mapForKey.set(key, value); + const afterSize = mapForKey.size; + this._size += (afterSize - beforeSize); + return this; + } - public get [Symbol.toStringTag]() { - return "BigMap"; - } + public [Symbol.iterator](): IterableIterator<[Id64String, V]>{ + return this.entries(); + } + + public get [Symbol.toStringTag]() { + return "BigMap"; + } - public *entries(): IterableIterator<[Id64String, V]> { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const [key, value] of map.entries()) - yield [key, value]; + public *entries(): IterableIterator<[Id64String, V]> { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const [key, value] of map.entries()) + yield [key, value]; + } } - } - public *keys(): IterableIterator { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const key of map.keys()) - yield key; + public *keys(): IterableIterator { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const key of map.keys()) + yield key; + } } - } - public *values(): IterableIterator { - const maps = Object.values(this._maps); - for (const map of maps) { - for (const value of map.values()) - yield value; + public *values(): IterableIterator { + const maps = Object.values(this._maps); + for (const map of maps) { + for (const value of map.values()) + yield value; + } } - } -} +} \ No newline at end of file From 9807b0af8e9ac3fc342304eacde9c3d054cdba6e Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Tue, 23 Jan 2024 14:00:20 +0200 Subject: [PATCH 14/15] Change files --- ...l-transformer-29a95bab-526a-4bfb-805c-b895d6666c8a.json | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 change/@itwin-imodel-transformer-29a95bab-526a-4bfb-805c-b895d6666c8a.json diff --git a/change/@itwin-imodel-transformer-29a95bab-526a-4bfb-805c-b895d6666c8a.json b/change/@itwin-imodel-transformer-29a95bab-526a-4bfb-805c-b895d6666c8a.json new file mode 100644 index 00000000..ccdb3907 --- /dev/null +++ b/change/@itwin-imodel-transformer-29a95bab-526a-4bfb-805c-b895d6666c8a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "Fixed BigMap class to implement Map (instead of extending it). Added missing method implementations.", + "packageName": "@itwin/imodel-transformer", + "email": "Julija.Ramoskiene@bentley.com", + "dependentChangeType": "patch" +} From 8ea8f69b994321215a2eea9df89ee11045948961 Mon Sep 17 00:00:00 2001 From: Julija Ramoskiene Date: Tue, 23 Jan 2024 16:36:06 +0200 Subject: [PATCH 15/15] Added newline --- packages/transformer/src/BigMap.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/transformer/src/BigMap.ts b/packages/transformer/src/BigMap.ts index 2bc8f0c1..d311f779 100644 --- a/packages/transformer/src/BigMap.ts +++ b/packages/transformer/src/BigMap.ts @@ -114,4 +114,4 @@ export class BigMap implements Map { yield value; } } -} \ No newline at end of file +}