diff --git a/libs/admin-console/src/common/collections/models/collection.spec.ts b/libs/admin-console/src/common/collections/models/collection.spec.ts index 925490d22b9..fb38f1507f9 100644 --- a/libs/admin-console/src/common/collections/models/collection.spec.ts +++ b/libs/admin-console/src/common/collections/models/collection.spec.ts @@ -54,7 +54,7 @@ describe("Collection", () => { it("Decrypt", async () => { const collection = new Collection(); - collection.id = "id"; + collection.id = "id" as CollectionId; collection.organizationId = "orgId" as OrganizationId; collection.name = mockEnc("encName"); collection.externalId = "extId"; diff --git a/libs/importer/src/importers/keeper/keeper-csv-importer.spec.ts b/libs/importer/src/importers/keeper/keeper-csv-importer.spec.ts index d7a4d487bcb..c1999fc0ae8 100644 --- a/libs/importer/src/importers/keeper/keeper-csv-importer.spec.ts +++ b/libs/importer/src/importers/keeper/keeper-csv-importer.spec.ts @@ -1,4 +1,5 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { testData as TestData, @@ -103,7 +104,7 @@ describe("Keeper CSV Importer", () => { }); it("should create collections, with subcollections and relationships", async () => { - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(TestData); expect(result != null).toBe(true); @@ -126,7 +127,7 @@ describe("Keeper CSV Importer", () => { }); it("should create collections tree, with child collections and relationships", async () => { - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(testDataMultiCollection); expect(result != null).toBe(true); diff --git a/libs/importer/src/importers/keeper/keeper-json-importer.spec.ts b/libs/importer/src/importers/keeper/keeper-json-importer.spec.ts index 31169021e0c..ace2cf721c4 100644 --- a/libs/importer/src/importers/keeper/keeper-json-importer.spec.ts +++ b/libs/importer/src/importers/keeper/keeper-json-importer.spec.ts @@ -1,4 +1,5 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { testData as TestData } from "../spec-data/keeper-json/testdata.json"; @@ -93,7 +94,7 @@ describe("Keeper Json Importer", () => { }); it("should create collections if part of an organization", async () => { - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(testDataJson); expect(result != null).toBe(true); diff --git a/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.spec.ts b/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.spec.ts index 8736b3df0c8..93a6fd33421 100644 --- a/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.spec.ts +++ b/libs/importer/src/importers/netwrix/netwrix-passwordsecure-csv-importer.spec.ts @@ -1,4 +1,5 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { credentialsData, @@ -93,7 +94,7 @@ describe("Netwrix Password Secure CSV Importer", () => { }); it("should parse multiple collections", async () => { - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(credentialsDataWithFolders); expect(result).not.toBeNull(); diff --git a/libs/importer/src/importers/nordpass-csv-importer.spec.ts b/libs/importer/src/importers/nordpass-csv-importer.spec.ts index cadc7bca28c..e633310e6ee 100644 --- a/libs/importer/src/importers/nordpass-csv-importer.spec.ts +++ b/libs/importer/src/importers/nordpass-csv-importer.spec.ts @@ -1,4 +1,5 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { SecureNoteType, CipherType, FieldType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { IdentityView } from "@bitwarden/common/vault/models/view/identity.view"; @@ -224,7 +225,7 @@ describe("NordPass CSV Importer", () => { }); it("should parse an item and create a collection if organizationId is set", async () => { - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(secureNoteData); expect(result).not.toBeNull(); diff --git a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.spec.ts b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.spec.ts index d4976f7a198..1ca12a9ce69 100644 --- a/libs/importer/src/importers/onepassword/onepassword-1pux-importer.spec.ts +++ b/libs/importer/src/importers/onepassword/onepassword-1pux-importer.spec.ts @@ -1,4 +1,5 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { FieldType, SecureNoteType, CipherType } from "@bitwarden/common/vault/enums"; import { FieldView } from "@bitwarden/common/vault/models/view/field.view"; @@ -691,7 +692,7 @@ describe("1Password 1Pux Importer", () => { it("should create collections if part of an organization", async () => { const importer = new OnePassword1PuxImporter(); - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(SanitizedExportJson); expect(result != null).toBe(true); diff --git a/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.spec.ts b/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.spec.ts index 12cfbbe62bb..687558b2f59 100644 --- a/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.spec.ts +++ b/libs/importer/src/importers/passsordxp/passwordxp-csv-importer.spec.ts @@ -1,3 +1,4 @@ +import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherType } from "@bitwarden/common/vault/enums"; import { ImportResult } from "../../models/import-result"; @@ -172,7 +173,7 @@ describe("PasswordXPCsvImporter", () => { }); it("should convert multi-level folders to collections when importing into an organization", async () => { - importer.organizationId = "someOrg"; + importer.organizationId = "someOrg" as OrganizationId; const result: ImportResult = await importer.parse(withMultipleFolders); expect(result.success).toBe(true); expect(result.ciphers.length).toBe(5); diff --git a/libs/importer/src/importers/password-depot/password-depot-17-xml-importer.spec.ts b/libs/importer/src/importers/password-depot/password-depot-17-xml-importer.spec.ts index ea84603aef4..dc438c0edee 100644 --- a/libs/importer/src/importers/password-depot/password-depot-17-xml-importer.spec.ts +++ b/libs/importer/src/importers/password-depot/password-depot-17-xml-importer.spec.ts @@ -1,6 +1,7 @@ // This import has been flagged as unallowed for this class. It may be involved in a circular dependency loop. // eslint-disable-next-line no-restricted-imports import { CollectionView } from "@bitwarden/admin-console/common"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { FieldType, SecureNoteType } from "@bitwarden/common/vault/enums"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { CipherType } from "@bitwarden/sdk-internal"; @@ -485,7 +486,7 @@ describe("Password Depot 17 Xml Importer", () => { it("should parse groups nodes into collections when importing into an organization", async () => { const importer = new PasswordDepot17XmlImporter(); - importer.organizationId = "someOrgId"; + importer.organizationId = "someOrgId" as OrganizationId; const collection = new CollectionView(); collection.name = "tempDB"; const actual = [collection]; diff --git a/libs/importer/src/importers/protonpass/protonpass-json-importer.spec.ts b/libs/importer/src/importers/protonpass/protonpass-json-importer.spec.ts index b8550bcb191..a97239fbd10 100644 --- a/libs/importer/src/importers/protonpass/protonpass-json-importer.spec.ts +++ b/libs/importer/src/importers/protonpass/protonpass-json-importer.spec.ts @@ -2,6 +2,7 @@ import { MockProxy } from "jest-mock-extended"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { OrganizationId } from "@bitwarden/common/types/guid"; import { FieldType, CipherType } from "@bitwarden/common/vault/enums"; import { testData } from "../spec-data/protonpass-json/protonpass.json"; @@ -90,7 +91,7 @@ describe("Protonpass Json Importer", () => { it("should create collections if part of an organization", async () => { const testDataJson = JSON.stringify(testData); - importer.organizationId = Utils.newGuid(); + importer.organizationId = Utils.newGuid() as OrganizationId; const result = await importer.parse(testDataJson); expect(result != null).toBe(true); diff --git a/libs/importer/src/importers/zohovault-csv-importer.spec.ts b/libs/importer/src/importers/zohovault-csv-importer.spec.ts index e49b527cbbf..d3904fb521a 100644 --- a/libs/importer/src/importers/zohovault-csv-importer.spec.ts +++ b/libs/importer/src/importers/zohovault-csv-importer.spec.ts @@ -1,3 +1,4 @@ +import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view"; import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; @@ -73,7 +74,7 @@ describe("Zoho Vault CSV Importer", () => { it("should create collection and assign ciphers when importing into an organization", async () => { const importer = new ZohoVaultCsvImporter(); - importer.organizationId = "someOrgId"; + importer.organizationId = "someOrgId" as OrganizationId; const result = await importer.parse(samplezohovaultcsvdata); expect(result != null).toBe(true); expect(result.success).toBe(true); diff --git a/libs/importer/src/services/import.service.spec.ts b/libs/importer/src/services/import.service.spec.ts index f71c34bf209..ad48386fcf4 100644 --- a/libs/importer/src/services/import.service.spec.ts +++ b/libs/importer/src/services/import.service.spec.ts @@ -9,6 +9,7 @@ import { EncryptService } from "@bitwarden/common/key-management/crypto/abstract import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { MockSdkService } from "@bitwarden/common/platform/spec/mock-sdk.service"; +import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; @@ -63,7 +64,7 @@ describe("ImportService", () => { describe("getImporterInstance", () => { describe("Get bitPasswordProtected importer", () => { let importer: Importer; - const organizationId = Utils.newGuid(); + const organizationId = Utils.newGuid() as OrganizationId; const password = Utils.newGuid(); const promptForPassword_callback = async () => { return password; @@ -94,7 +95,7 @@ describe("ImportService", () => { }); describe("setImportTarget", () => { - const organizationId = Utils.newGuid(); + const organizationId = Utils.newGuid() as OrganizationId; let importResult: ImportResult; @@ -141,17 +142,17 @@ describe("ImportService", () => { }); const mockImportTargetCollection = new CollectionView(); - mockImportTargetCollection.id = "myImportTarget"; + mockImportTargetCollection.id = "myImportTarget" as CollectionId; mockImportTargetCollection.name = "myImportTarget"; mockImportTargetCollection.organizationId = organizationId; const mockCollection1 = new CollectionView(); - mockCollection1.id = "collection1"; + mockCollection1.id = "collection1" as CollectionId; mockCollection1.name = "collection1"; mockCollection1.organizationId = organizationId; const mockCollection2 = new CollectionView(); - mockCollection1.id = "collection2"; + mockCollection1.id = "collection2" as CollectionId; mockCollection1.name = "collection2"; mockCollection1.organizationId = organizationId;