From 7c72795d1cb9fb3ad2797636a396a93718d3c86c Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Wed, 9 Oct 2024 00:14:39 +1000 Subject: [PATCH] [PM-12747] Move CollectionService and models to AC Team (#11278) --- .../browser/src/background/main.background.ts | 7 ++-- .../models/browserGroupingsComponentState.ts | 2 +- .../sync/foreground-sync.service.spec.ts | 2 +- .../platform/sync/foreground-sync.service.ts | 2 +- .../src/popup/services/services.module.ts | 2 +- .../assign-collections.component.ts | 2 +- .../vault-v2/view-v2/view-v2.component.ts | 2 +- .../components/vault/add-edit.component.ts | 2 +- .../components/vault/collections.component.ts | 2 +- .../popup/components/vault/share.component.ts | 2 +- .../vault/vault-filter.component.ts | 2 +- .../components/vault/vault-items.component.ts | 3 +- .../vault-popup-items.service.spec.ts | 3 +- .../services/vault-popup-items.service.ts | 2 +- .../vault-popup-list-filters.service.spec.ts | 4 +-- .../vault-popup-list-filters.service.ts | 4 +-- .../vault/popup/views/popup-cipher.view.ts | 2 +- .../vault/services/vault-filter.service.ts | 2 +- .../organization-collection.response.ts | 2 +- apps/cli/src/commands/edit.command.ts | 2 +- apps/cli/src/commands/get.command.ts | 3 +- apps/cli/src/commands/list.command.ts | 16 +++++----- .../service-container/service-container.ts | 6 ++-- apps/cli/src/utils.ts | 2 +- apps/cli/src/vault/create.command.ts | 2 +- .../src/vault/models/collection.response.ts | 2 +- apps/desktop/src/app/app.component.ts | 2 +- .../src/vault/app/vault/add-edit.component.ts | 2 +- .../vault/app/vault/collections.component.ts | 2 +- .../src/vault/app/vault/share.component.ts | 2 +- .../organizations/core/views/group.view.ts | 2 +- .../organizations/manage/groups.component.ts | 16 +++++----- .../member-dialog/member-dialog.component.ts | 2 +- .../members/members.component.ts | 8 ++--- .../unsecured-websites-report.component.ts | 2 +- apps/web/src/app/app.component.ts | 2 +- .../emergency-add-edit-cipher.component.ts | 2 +- apps/web/src/app/core/core.module.ts | 2 +- ...nsecured-websites-report.component.spec.ts | 2 +- .../unsecured-websites-report.component.ts | 3 +- .../collection-dialog.component.ts | 4 +-- .../vault-item-dialog.component.ts | 2 +- .../vault-items/vault-cipher-row.component.ts | 2 +- .../vault-collection-row.component.ts | 3 +- .../vault-items/vault-item-event.ts | 2 +- .../components/vault-items/vault-item.ts | 2 +- .../vault-items/vault-items.component.ts | 3 +- .../add-edit-v2.component.spec.ts | 2 +- .../individual-vault/add-edit.component.ts | 2 +- .../bulk-delete-dialog.component.ts | 3 +- .../bulk-share-dialog.component.ts | 3 +- .../individual-vault/collections.component.ts | 3 +- .../pipes/get-collection-name.pipe.ts | 2 +- .../vault/individual-vault/share.component.ts | 3 +- .../abstractions/vault-filter.service.ts | 3 +- .../services/vault-filter.service.spec.ts | 3 +- .../services/vault-filter.service.ts | 8 +++-- .../shared/models/vault-filter.model.spec.ts | 2 +- .../vault-header/vault-header.component.ts | 3 +- .../vault/individual-vault/vault.component.ts | 12 ++++--- .../individual-vault/view.component.spec.ts | 2 +- .../vault/individual-vault/view.component.ts | 2 +- .../app/vault/org-vault/add-edit.component.ts | 2 +- .../bulk-collections-dialog.component.ts | 2 +- .../collection-name.badge.component.ts | 2 +- .../vault/org-vault/collections.component.ts | 3 +- .../vault-filter/vault-filter.service.ts | 3 +- .../app/vault/org-vault/vault.component.ts | 4 +-- .../app/vault/utils/collection-utils.spec.ts | 2 +- .../src/app/vault/utils/collection-utils.ts | 6 ++-- libs/admin-console/jest.config.js | 10 ++++-- .../abstractions/collection-admin.service.ts | 2 +- .../abstractions/collection.service.ts | 11 +++---- .../common/collections/abstractions/index.ts | 1 + .../models/collection-admin.view.ts | 6 ++-- .../models}/collection-with-id.request.ts | 3 +- .../collections/models}/collection.data.ts | 5 +-- .../collections/models}/collection.request.ts | 5 +-- .../models}/collection.response.ts | 6 ++-- .../collections/models}/collection.spec.ts | 8 ++--- .../common/collections/models}/collection.ts | 11 ++++--- .../collections/models}/collection.view.ts | 11 ++++--- .../src/common/collections/models/index.ts | 6 ++++ .../default-collection-admin.service.ts | 11 +++---- .../default-collection.service.spec.ts} | 32 +++++++++++-------- .../services/default-collection.service.ts} | 28 ++++++++-------- .../src/common/collections/services/index.ts | 1 + .../components/collections.component.ts | 3 +- .../angular/src/components/share.component.ts | 3 +- .../src/services/jslib-services.module.ts | 16 +++++----- .../deprecated-vault-filter.service.ts | 2 +- .../vault/components/add-edit.component.ts | 3 +- .../components/collection-filter.component.ts | 2 +- .../components/vault-filter.component.ts | 2 +- .../services/vault-filter.service.ts | 3 +- libs/common/src/abstractions/api.service.ts | 13 ++++---- .../response/organization-export.response.ts | 3 +- .../export/collection-with-id.export.ts | 3 +- .../src/models/export/collection.export.ts | 4 +-- .../import-organization-ciphers.request.ts | 3 +- .../src/platform/sync/core-sync.service.ts | 3 +- .../src/platform/sync/default-sync.service.ts | 9 ++++-- .../common/src/platform/sync/sync.response.ts | 3 +- libs/common/src/services/api.service.ts | 12 +++---- .../vault-timeout.service.spec.ts | 2 +- .../vault-timeout/vault-timeout.service.ts | 2 +- libs/importer/package.json | 3 +- .../src/components/import.component.ts | 3 +- libs/importer/src/importers/base-importer.ts | 2 +- .../bitwarden/bitwarden-csv-importer.ts | 2 +- .../bitwarden/bitwarden-json-importer.ts | 2 +- .../src/importers/padlock-csv-importer.ts | 2 +- .../src/importers/passpack-csv-importer.ts | 2 +- libs/importer/src/models/import-result.ts | 2 +- .../import-collection.service.abstraction.ts | 2 +- .../services/import.service.abstraction.ts | 2 +- .../src/services/import.service.spec.ts | 3 +- libs/importer/src/services/import.service.ts | 8 +++-- .../vault-export-core/package.json | 3 +- .../src/services/org-vault-export.service.ts | 12 ++++--- .../vault-export/vault-export-ui/package.json | 3 +- .../src/components/export.component.ts | 2 +- .../cipher-form-config.service.ts | 2 +- .../src/cipher-form/cipher-form.stories.ts | 2 +- .../item-details-section.component.spec.ts | 2 +- .../item-details-section.component.ts | 2 +- .../default-cipher-form-config.service.ts | 2 +- .../src/cipher-view/cipher-view.component.ts | 3 +- .../item-details/item-details-v2.component.ts | 2 +- .../assign-collections.component.ts | 3 +- package-lock.json | 7 ++++ 131 files changed, 281 insertions(+), 271 deletions(-) rename libs/{common/src/vault => admin-console/src/common/collections}/abstractions/collection.service.ts (76%) rename libs/{common/src/vault/models/request => admin-console/src/common/collections/models}/collection-with-id.request.ts (84%) rename libs/{common/src/vault/models/data => admin-console/src/common/collections/models}/collection.data.ts (82%) rename libs/{common/src/vault/models/request => admin-console/src/common/collections/models}/collection.request.ts (69%) rename libs/{common/src/vault/models/response => admin-console/src/common/collections/models}/collection.response.ts (87%) rename libs/{common/src/vault/models/domain => admin-console/src/common/collections/models}/collection.spec.ts (86%) rename libs/{common/src/vault/models/domain => admin-console/src/common/collections/models}/collection.ts (71%) rename libs/{common/src/vault/models/view => admin-console/src/common/collections/models}/collection.view.ts (88%) rename libs/{common/src/vault/services/collection.service.spec.ts => admin-console/src/common/collections/services/default-collection.service.spec.ts} (79%) rename libs/{common/src/vault/services/collection.service.ts => admin-console/src/common/collections/services/default-collection.service.ts} (89%) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index ec1842e105..85e1ee19b0 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -1,5 +1,6 @@ import { Subject, filter, firstValueFrom, map, merge, timeout } from "rxjs"; +import { CollectionService, DefaultCollectionService } from "@bitwarden/admin-console/common"; import { PinServiceAbstraction, PinService, @@ -170,7 +171,6 @@ import { InternalSendService as InternalSendServiceAbstraction } from "@bitwarde import { UserId } from "@bitwarden/common/types/guid"; import { VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; import { CipherService as CipherServiceAbstraction } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService as CollectionServiceAbstraction } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherFileUploadService as CipherFileUploadServiceAbstraction } from "@bitwarden/common/vault/abstractions/file-upload/cipher-file-upload.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { InternalFolderService as InternalFolderServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; @@ -178,7 +178,6 @@ import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/vault/a import { VaultSettingsService as VaultSettingsServiceAbstraction } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { CipherService } from "@bitwarden/common/vault/services/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/services/collection.service"; import { CipherFileUploadService } from "@bitwarden/common/vault/services/file-upload/cipher-file-upload.service"; import { FolderApiService } from "@bitwarden/common/vault/services/folder/folder-api.service"; import { FolderService } from "@bitwarden/common/vault/services/folder/folder.service"; @@ -288,7 +287,7 @@ export default class MainBackground { cipherService: CipherServiceAbstraction; folderService: InternalFolderServiceAbstraction; userDecryptionOptionsService: InternalUserDecryptionOptionsServiceAbstraction; - collectionService: CollectionServiceAbstraction; + collectionService: CollectionService; vaultTimeoutService?: VaultTimeoutService; vaultTimeoutSettingsService: VaultTimeoutSettingsServiceAbstraction; passwordGenerationService: PasswordGenerationServiceAbstraction; @@ -699,7 +698,7 @@ export default class MainBackground { ); this.searchService = new SearchService(this.logService, this.i18nService, this.stateProvider); - this.collectionService = new CollectionService( + this.collectionService = new DefaultCollectionService( this.cryptoService, this.encryptService, this.i18nService, diff --git a/apps/browser/src/models/browserGroupingsComponentState.ts b/apps/browser/src/models/browserGroupingsComponentState.ts index 73cc2a3231..36b4cc9ac0 100644 --- a/apps/browser/src/models/browserGroupingsComponentState.ts +++ b/apps/browser/src/models/browserGroupingsComponentState.ts @@ -1,8 +1,8 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { DeepJsonify } from "@bitwarden/common/types/deep-jsonify"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { BrowserComponentState } from "./browserComponentState"; diff --git a/apps/browser/src/platform/sync/foreground-sync.service.spec.ts b/apps/browser/src/platform/sync/foreground-sync.service.spec.ts index 365ce6a83c..e1e921cc3a 100644 --- a/apps/browser/src/platform/sync/foreground-sync.service.spec.ts +++ b/apps/browser/src/platform/sync/foreground-sync.service.spec.ts @@ -1,6 +1,7 @@ import { mock } from "jest-mock-extended"; import { Subject } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; @@ -13,7 +14,6 @@ import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.s import { InternalSendService } from "@bitwarden/common/tools/send/services/send.service.abstraction"; import { UserId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; diff --git a/apps/browser/src/platform/sync/foreground-sync.service.ts b/apps/browser/src/platform/sync/foreground-sync.service.ts index 23c0e1ff9f..a6ed728185 100644 --- a/apps/browser/src/platform/sync/foreground-sync.service.ts +++ b/apps/browser/src/platform/sync/foreground-sync.service.ts @@ -1,5 +1,6 @@ import { filter, firstValueFrom, of, timeout } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { AuthService } from "@bitwarden/common/auth/abstractions/auth.service"; @@ -16,7 +17,6 @@ import { CoreSyncService } from "@bitwarden/common/platform/sync/internal"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { InternalSendService } from "@bitwarden/common/tools/send/services/send.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; diff --git a/apps/browser/src/popup/services/services.module.ts b/apps/browser/src/popup/services/services.module.ts index 65bcd81072..f46386449f 100644 --- a/apps/browser/src/popup/services/services.module.ts +++ b/apps/browser/src/popup/services/services.module.ts @@ -1,6 +1,7 @@ import { APP_INITIALIZER, NgModule, NgZone } from "@angular/core"; import { Subject, merge, of } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ViewCacheService } from "@bitwarden/angular/platform/abstractions/view-cache.service"; import { AngularThemingService } from "@bitwarden/angular/platform/services/theming/angular-theming.service"; import { SafeProvider, safeProvider } from "@bitwarden/angular/platform/utils/safe-provider"; @@ -86,7 +87,6 @@ import { WindowStorageService } from "@bitwarden/common/platform/storage/window- import { SyncService } from "@bitwarden/common/platform/sync"; import { VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService as FolderServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/vault/abstractions/totp.service"; import { TotpService } from "@bitwarden/common/vault/services/totp.service"; diff --git a/apps/browser/src/vault/popup/components/vault-v2/assign-collections/assign-collections.component.ts b/apps/browser/src/vault/popup/components/vault-v2/assign-collections/assign-collections.component.ts index 8c8827336e..202103c16d 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/assign-collections/assign-collections.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/assign-collections/assign-collections.component.ts @@ -5,11 +5,11 @@ import { ReactiveFormsModule } from "@angular/forms"; import { ActivatedRoute } from "@angular/router"; import { Observable, combineLatest, first, map, switchMap } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { ButtonModule, diff --git a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts index 107447c50a..542c4f8243 100644 --- a/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts +++ b/apps/browser/src/vault/popup/components/vault-v2/view-v2/view-v2.component.ts @@ -5,6 +5,7 @@ import { FormsModule } from "@angular/forms"; import { ActivatedRoute, Router } from "@angular/router"; import { firstValueFrom, map, Observable, switchMap } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -17,7 +18,6 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi import { ViewPasswordHistoryService } from "@bitwarden/common/vault/abstractions/view-password-history.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { AsyncActionsModule, diff --git a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts index de8e5615e2..63f46dab74 100644 --- a/apps/browser/src/vault/popup/components/vault/add-edit.component.ts +++ b/apps/browser/src/vault/popup/components/vault/add-edit.component.ts @@ -5,6 +5,7 @@ import qrcodeParser from "qrcode-parser"; import { firstValueFrom } from "rxjs"; import { first } from "rxjs/operators"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { AddEditComponent as BaseAddEditComponent } from "@bitwarden/angular/vault/components/add-edit.component"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; @@ -20,7 +21,6 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view"; diff --git a/apps/browser/src/vault/popup/components/vault/collections.component.ts b/apps/browser/src/vault/popup/components/vault/collections.component.ts index 19d448e603..407f87e996 100644 --- a/apps/browser/src/vault/popup/components/vault/collections.component.ts +++ b/apps/browser/src/vault/popup/components/vault/collections.component.ts @@ -3,6 +3,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; import { first } from "rxjs/operators"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/angular/admin-console/components/collections.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -10,7 +11,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { ToastService } from "@bitwarden/components"; @Component({ diff --git a/apps/browser/src/vault/popup/components/vault/share.component.ts b/apps/browser/src/vault/popup/components/vault/share.component.ts index 44c0a24ab9..8e061665b7 100644 --- a/apps/browser/src/vault/popup/components/vault/share.component.ts +++ b/apps/browser/src/vault/popup/components/vault/share.component.ts @@ -2,6 +2,7 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute, Router } from "@angular/router"; import { first } from "rxjs/operators"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ShareComponent as BaseShareComponent } from "@bitwarden/angular/components/share.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -9,7 +10,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; @Component({ selector: "app-vault-share", diff --git a/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts b/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts index b46b4cf9ff..448f85a8cb 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts +++ b/apps/browser/src/vault/popup/components/vault/vault-filter.component.ts @@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from "@angular/router"; import { BehaviorSubject, Subject, firstValueFrom, from } from "rxjs"; import { first, switchMap, takeUntil } from "rxjs/operators"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { VaultFilter } from "@bitwarden/angular/vault/vault-filter/models/vault-filter.model"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; @@ -14,7 +15,6 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi import { CipherType } from "@bitwarden/common/vault/enums"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { BrowserGroupingsComponentState } from "../../../../models/browserGroupingsComponentState"; diff --git a/apps/browser/src/vault/popup/components/vault/vault-items.component.ts b/apps/browser/src/vault/popup/components/vault/vault-items.component.ts index df78806edf..668d53f5a4 100644 --- a/apps/browser/src/vault/popup/components/vault/vault-items.component.ts +++ b/apps/browser/src/vault/popup/components/vault/vault-items.component.ts @@ -3,6 +3,7 @@ import { ChangeDetectorRef, Component, NgZone, OnDestroy, OnInit } from "@angula import { ActivatedRoute, Router } from "@angular/router"; import { first } from "rxjs/operators"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { VaultItemsComponent as BaseVaultItemsComponent } from "@bitwarden/angular/vault/components/vault-items.component"; import { VaultFilter } from "@bitwarden/angular/vault/vault-filter/models/vault-filter.model"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; @@ -11,11 +12,9 @@ import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broa import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { BrowserComponentState } from "../../../../models/browserComponentState"; diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts index 77a86dd9e8..bd683bf041 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.spec.ts @@ -2,6 +2,7 @@ import { TestBed } from "@angular/core/testing"; import { mock } from "jest-mock-extended"; import { BehaviorSubject, firstValueFrom, timeout } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -10,11 +11,9 @@ import { SyncService } from "@bitwarden/common/platform/sync"; import { ObservableTracker } from "@bitwarden/common/spec"; import { CipherId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { VaultSettingsService } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { BrowserApi } from "../../../platform/browser/browser-api"; diff --git a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts index 3714d07241..414bf02875 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-items.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-items.service.ts @@ -20,13 +20,13 @@ import { withLatestFrom, } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SyncService } from "@bitwarden/common/platform/sync"; import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { VaultSettingsService } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; diff --git a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts index f6573de1c8..5d7e690193 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.spec.ts @@ -2,6 +2,7 @@ import { TestBed } from "@angular/core/testing"; import { FormBuilder } from "@angular/forms"; import { BehaviorSubject, skipWhile } from "rxjs"; +import { CollectionService, Collection, CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; @@ -9,12 +10,9 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { ProductTierType } from "@bitwarden/common/billing/enums"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { MY_VAULT_ID, VaultPopupListFiltersService } from "./vault-popup-list-filters.service"; diff --git a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts index 67213163a6..4059a43b56 100644 --- a/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts +++ b/apps/browser/src/vault/popup/services/vault-popup-list-filters.service.ts @@ -11,6 +11,7 @@ import { tap, } from "rxjs"; +import { CollectionService, Collection, CollectionView } from "@bitwarden/admin-console/common"; import { DynamicTreeNode } from "@bitwarden/angular/vault/vault-filter/models/dynamic-tree-node.model"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; @@ -20,13 +21,10 @@ import { ProductTierType } from "@bitwarden/common/billing/enums"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; import { ITreeNodeObject, TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; import { ChipSelectOption } from "@bitwarden/components"; diff --git a/apps/browser/src/vault/popup/views/popup-cipher.view.ts b/apps/browser/src/vault/popup/views/popup-cipher.view.ts index de371ca65d..25da61b8cb 100644 --- a/apps/browser/src/vault/popup/views/popup-cipher.view.ts +++ b/apps/browser/src/vault/popup/views/popup-cipher.view.ts @@ -1,6 +1,6 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; /** * Extended cipher view for the popup. Includes the associated collections and organization diff --git a/apps/browser/src/vault/services/vault-filter.service.ts b/apps/browser/src/vault/services/vault-filter.service.ts index df278ac172..50858076d7 100644 --- a/apps/browser/src/vault/services/vault-filter.service.ts +++ b/apps/browser/src/vault/services/vault-filter.service.ts @@ -1,3 +1,4 @@ +import { CollectionService } from "@bitwarden/admin-console/common"; import { VaultFilter } from "@bitwarden/angular/vault/vault-filter/models/vault-filter.model"; import { VaultFilterService as BaseVaultFilterService } from "@bitwarden/angular/vault/vault-filter/services/vault-filter.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; @@ -5,7 +6,6 @@ import { PolicyService } from "@bitwarden/common/admin-console/abstractions/poli import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { StateProvider } from "@bitwarden/common/platform/state"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; diff --git a/apps/cli/src/admin-console/models/response/organization-collection.response.ts b/apps/cli/src/admin-console/models/response/organization-collection.response.ts index 730e668909..3d93502af8 100644 --- a/apps/cli/src/admin-console/models/response/organization-collection.response.ts +++ b/apps/cli/src/admin-console/models/response/organization-collection.response.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { CollectionResponse } from "../../../vault/models/collection.response"; import { SelectionReadOnly } from "../selection-read-only"; diff --git a/apps/cli/src/commands/edit.command.ts b/apps/cli/src/commands/edit.command.ts index 84ed7190a5..fe31bba799 100644 --- a/apps/cli/src/commands/edit.command.ts +++ b/apps/cli/src/commands/edit.command.ts @@ -1,5 +1,6 @@ import { firstValueFrom, map } from "rxjs"; +import { CollectionRequest } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { SelectionReadOnlyRequest } from "@bitwarden/common/admin-console/models/request/selection-read-only.request"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -12,7 +13,6 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; -import { CollectionRequest } from "@bitwarden/common/vault/models/request/collection.request"; import { OrganizationCollectionRequest } from "../admin-console/models/request/organization-collection.request"; import { OrganizationCollectionResponse } from "../admin-console/models/response/organization-collection.response"; diff --git a/apps/cli/src/commands/get.command.ts b/apps/cli/src/commands/get.command.ts index 2829b3ee58..1cd1cdc0f7 100644 --- a/apps/cli/src/commands/get.command.ts +++ b/apps/cli/src/commands/get.command.ts @@ -1,5 +1,6 @@ import { firstValueFrom, map } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; @@ -27,12 +28,10 @@ import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; import { SendType } from "@bitwarden/common/tools/send/enums/send-type"; import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { OrganizationCollectionRequest } from "../admin-console/models/request/organization-collection.request"; diff --git a/apps/cli/src/commands/list.command.ts b/apps/cli/src/commands/list.command.ts index 692a5c9bab..9cb36f7149 100644 --- a/apps/cli/src/commands/list.command.ts +++ b/apps/cli/src/commands/list.command.ts @@ -1,6 +1,13 @@ import { firstValueFrom } from "rxjs"; -import { OrganizationUserApiService } from "@bitwarden/admin-console/common"; +import { + OrganizationUserApiService, + CollectionService, + CollectionData, + Collection, + CollectionDetailsResponse as ApiCollectionDetailsResponse, + CollectionResponse as ApiCollectionResponse, +} from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { SearchService } from "@bitwarden/common/abstractions/search.service"; @@ -9,14 +16,7 @@ import { EventType } from "@bitwarden/common/enums"; import { ListResponse as ApiListResponse } from "@bitwarden/common/models/response/list.response"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; -import { - CollectionDetailsResponse as ApiCollectionDetailsResponse, - CollectionResponse as ApiCollectionResponse, -} from "@bitwarden/common/vault/models/response/collection.response"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { OrganizationUserResponse } from "../admin-console/models/response/organization-user.response"; diff --git a/apps/cli/src/service-container/service-container.ts b/apps/cli/src/service-container/service-container.ts index a249a4d3f3..7643683221 100644 --- a/apps/cli/src/service-container/service-container.ts +++ b/apps/cli/src/service-container/service-container.ts @@ -7,6 +7,7 @@ import { firstValueFrom, map } from "rxjs"; import { OrganizationUserApiService, DefaultOrganizationUserApiService, + DefaultCollectionService, } from "@bitwarden/admin-console/common"; import { InternalUserDecryptionOptionsServiceAbstraction, @@ -129,7 +130,6 @@ import { SendService } from "@bitwarden/common/tools/send/services/send.service" import { VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/services/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/services/collection.service"; import { CipherFileUploadService } from "@bitwarden/common/vault/services/file-upload/cipher-file-upload.service"; import { FolderApiService } from "@bitwarden/common/vault/services/folder/folder-api.service"; import { FolderService } from "@bitwarden/common/vault/services/folder/folder.service"; @@ -191,7 +191,7 @@ export class ServiceContainer { cipherService: CipherService; folderService: InternalFolderService; organizationUserApiService: OrganizationUserApiService; - collectionService: CollectionService; + collectionService: DefaultCollectionService; vaultTimeoutService: VaultTimeoutService; masterPasswordService: InternalMasterPasswordServiceAbstraction; vaultTimeoutSettingsService: VaultTimeoutSettingsService; @@ -498,7 +498,7 @@ export class ServiceContainer { this.searchService = new SearchService(this.logService, this.i18nService, this.stateProvider); - this.collectionService = new CollectionService( + this.collectionService = new DefaultCollectionService( this.cryptoService, this.encryptService, this.i18nService, diff --git a/apps/cli/src/utils.ts b/apps/cli/src/utils.ts index 29021629b8..6709036d11 100644 --- a/apps/cli/src/utils.ts +++ b/apps/cli/src/utils.ts @@ -4,10 +4,10 @@ import * as path from "path"; import * as inquirer from "inquirer"; import * as JSZip from "jszip"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { NodeUtils } from "@bitwarden/node/node-utils"; diff --git a/apps/cli/src/vault/create.command.ts b/apps/cli/src/vault/create.command.ts index fc52720f77..74d1a4e0ad 100644 --- a/apps/cli/src/vault/create.command.ts +++ b/apps/cli/src/vault/create.command.ts @@ -3,6 +3,7 @@ import * as path from "path"; import { firstValueFrom, map } from "rxjs"; +import { CollectionRequest } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { SelectionReadOnlyRequest } from "@bitwarden/common/admin-console/models/request/selection-read-only.request"; @@ -17,7 +18,6 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; -import { CollectionRequest } from "@bitwarden/common/vault/models/request/collection.request"; import { OrganizationCollectionRequest } from "../admin-console/models/request/organization-collection.request"; import { OrganizationCollectionResponse } from "../admin-console/models/response/organization-collection.response"; diff --git a/apps/cli/src/vault/models/collection.response.ts b/apps/cli/src/vault/models/collection.response.ts index 4cdb4bb59e..5136e85774 100644 --- a/apps/cli/src/vault/models/collection.response.ts +++ b/apps/cli/src/vault/models/collection.response.ts @@ -1,5 +1,5 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { CollectionWithIdExport } from "@bitwarden/common/models/export/collection-with-id.export"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { BaseResponse } from "../../models/response/base.response"; diff --git a/apps/desktop/src/app/app.component.ts b/apps/desktop/src/app/app.component.ts index 61da12998d..d3b39218b5 100644 --- a/apps/desktop/src/app/app.component.ts +++ b/apps/desktop/src/app/app.component.ts @@ -12,6 +12,7 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { Router } from "@angular/router"; import { catchError, filter, firstValueFrom, map, of, Subject, takeUntil, timeout } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { FingerprintDialogComponent } from "@bitwarden/auth/angular"; @@ -47,7 +48,6 @@ import { SyncService } from "@bitwarden/common/platform/sync"; import { UserId } from "@bitwarden/common/types/guid"; import { VaultTimeout, VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; import { DialogService, ToastOptions, ToastService } from "@bitwarden/components"; diff --git a/apps/desktop/src/vault/app/vault/add-edit.component.ts b/apps/desktop/src/vault/app/vault/add-edit.component.ts index 098316de9e..ae0d9bc5ee 100644 --- a/apps/desktop/src/vault/app/vault/add-edit.component.ts +++ b/apps/desktop/src/vault/app/vault/add-edit.component.ts @@ -2,6 +2,7 @@ import { DatePipe } from "@angular/common"; import { Component, NgZone, OnChanges, OnInit, OnDestroy, ViewChild } from "@angular/core"; import { NgForm } from "@angular/forms"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { AddEditComponent as BaseAddEditComponent } from "@bitwarden/angular/vault/components/add-edit.component"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; @@ -16,7 +17,6 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { DialogService } from "@bitwarden/components"; import { PasswordRepromptService } from "@bitwarden/vault"; diff --git a/apps/desktop/src/vault/app/vault/collections.component.ts b/apps/desktop/src/vault/app/vault/collections.component.ts index 3885ca0057..e7684c3c07 100644 --- a/apps/desktop/src/vault/app/vault/collections.component.ts +++ b/apps/desktop/src/vault/app/vault/collections.component.ts @@ -1,5 +1,6 @@ import { Component } from "@angular/core"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/angular/admin-console/components/collections.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -7,7 +8,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { ToastService } from "@bitwarden/components"; @Component({ diff --git a/apps/desktop/src/vault/app/vault/share.component.ts b/apps/desktop/src/vault/app/vault/share.component.ts index ddaad8337b..6926e7e2ab 100644 --- a/apps/desktop/src/vault/app/vault/share.component.ts +++ b/apps/desktop/src/vault/app/vault/share.component.ts @@ -1,5 +1,6 @@ import { Component } from "@angular/core"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ModalRef } from "@bitwarden/angular/components/modal/modal.ref"; import { ShareComponent as BaseShareComponent } from "@bitwarden/angular/components/share.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; @@ -8,7 +9,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; @Component({ selector: "app-vault-share", diff --git a/apps/web/src/app/admin-console/organizations/core/views/group.view.ts b/apps/web/src/app/admin-console/organizations/core/views/group.view.ts index 67ce47c624..2566e4c4bf 100644 --- a/apps/web/src/app/admin-console/organizations/core/views/group.view.ts +++ b/apps/web/src/app/admin-console/organizations/core/views/group.view.ts @@ -1,5 +1,5 @@ import { CollectionAccessSelectionView } from "@bitwarden/admin-console/common"; -import { View } from "@bitwarden/common/src/models/view/view"; +import { View } from "@bitwarden/common/models/view/view"; import { GroupDetailsResponse, GroupResponse } from "../services/group/responses/group.response"; diff --git a/apps/web/src/app/admin-console/organizations/manage/groups.component.ts b/apps/web/src/app/admin-console/organizations/manage/groups.component.ts index dfb6f349eb..7d660682a2 100644 --- a/apps/web/src/app/admin-console/organizations/manage/groups.component.ts +++ b/apps/web/src/app/admin-console/organizations/manage/groups.component.ts @@ -14,18 +14,18 @@ import { } from "rxjs"; import { debounceTime, first } from "rxjs/operators"; +import { + CollectionService, + CollectionData, + Collection, + CollectionDetailsResponse, + CollectionResponse, + CollectionView, +} from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { ListResponse } from "@bitwarden/common/models/response/list.response"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; -import { - CollectionDetailsResponse, - CollectionResponse, -} from "@bitwarden/common/vault/models/response/collection.response"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService, TableDataSource, ToastService } from "@bitwarden/components"; import { InternalGroupService as GroupService, GroupView } from "../core"; diff --git a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts index aac096189e..8df40e35fe 100644 --- a/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/components/member-dialog/member-dialog.component.ts @@ -18,6 +18,7 @@ import { CollectionAdminService, CollectionAdminView, OrganizationUserApiService, + CollectionView, } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { @@ -29,7 +30,6 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { ProductTierType } from "@bitwarden/common/billing/enums"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService, ToastService } from "@bitwarden/components"; import { diff --git a/apps/web/src/app/admin-console/organizations/members/members.component.ts b/apps/web/src/app/admin-console/organizations/members/members.component.ts index 0ce5ef10c8..698c260632 100644 --- a/apps/web/src/app/admin-console/organizations/members/members.component.ts +++ b/apps/web/src/app/admin-console/organizations/members/members.component.ts @@ -17,6 +17,10 @@ import { OrganizationUserApiService, OrganizationUserConfirmRequest, OrganizationUserUserDetailsResponse, + CollectionService, + CollectionData, + Collection, + CollectionDetailsResponse, } from "@bitwarden/admin-console/common"; import { UserNamePipe } from "@bitwarden/angular/pipes/user-name.pipe"; import { ModalService } from "@bitwarden/angular/services/modal.service"; @@ -43,11 +47,7 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt. import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { ValidationService } from "@bitwarden/common/platform/abstractions/validation.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; -import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response"; import { DialogService, SimpleDialogOptions, ToastService } from "@bitwarden/components"; import { diff --git a/apps/web/src/app/admin-console/organizations/tools/unsecured-websites-report.component.ts b/apps/web/src/app/admin-console/organizations/tools/unsecured-websites-report.component.ts index c520d3dad6..990cf50540 100644 --- a/apps/web/src/app/admin-console/organizations/tools/unsecured-websites-report.component.ts +++ b/apps/web/src/app/admin-console/organizations/tools/unsecured-websites-report.component.ts @@ -1,11 +1,11 @@ import { Component, OnInit } from "@angular/core"; import { ActivatedRoute } from "@angular/router"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { PasswordRepromptService } from "@bitwarden/vault"; diff --git a/apps/web/src/app/app.component.ts b/apps/web/src/app/app.component.ts index 7299c8ece2..e6cd30caee 100644 --- a/apps/web/src/app/app.component.ts +++ b/apps/web/src/app/app.component.ts @@ -5,6 +5,7 @@ import { NavigationEnd, Router } from "@angular/router"; import * as jq from "jquery"; import { Subject, filter, firstValueFrom, map, takeUntil, timeout, catchError, of } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { LogoutReason } from "@bitwarden/auth/common"; import { EventUploadService } from "@bitwarden/common/abstractions/event/event-upload.service"; import { NotificationsService } from "@bitwarden/common/abstractions/notifications.service"; @@ -27,7 +28,6 @@ import { StateService } from "@bitwarden/common/platform/abstractions/state.serv import { StateEventRunnerService } from "@bitwarden/common/platform/state"; import { SyncService } from "@bitwarden/common/platform/sync"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { InternalFolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { DialogService, ToastOptions, ToastService } from "@bitwarden/components"; import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy"; diff --git a/apps/web/src/app/auth/settings/emergency-access/view/emergency-add-edit-cipher.component.ts b/apps/web/src/app/auth/settings/emergency-access/view/emergency-add-edit-cipher.component.ts index f3003151f4..42778179ce 100644 --- a/apps/web/src/app/auth/settings/emergency-access/view/emergency-add-edit-cipher.component.ts +++ b/apps/web/src/app/auth/settings/emergency-access/view/emergency-add-edit-cipher.component.ts @@ -1,6 +1,7 @@ import { DatePipe } from "@angular/common"; import { Component } from "@angular/core"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; @@ -14,7 +15,6 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; diff --git a/apps/web/src/app/core/core.module.ts b/apps/web/src/app/core/core.module.ts index 217b228d32..48377c8e8e 100644 --- a/apps/web/src/app/core/core.module.ts +++ b/apps/web/src/app/core/core.module.ts @@ -6,6 +6,7 @@ import { CollectionAdminService, DefaultCollectionAdminService, OrganizationUserApiService, + CollectionService, } from "@bitwarden/admin-console/common"; import { SafeProvider, safeProvider } from "@bitwarden/angular/platform/utils/safe-provider"; import { @@ -71,7 +72,6 @@ import { ThemeStateService, } from "@bitwarden/common/platform/theming/theme-state.service"; import { VaultTimeout, VaultTimeoutStringType } from "@bitwarden/common/types/vault-timeout.type"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { BiometricsService } from "@bitwarden/key-management"; import { flagEnabled } from "../../utils/flags"; diff --git a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts index a1f631d2b6..5f66814fdf 100644 --- a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts +++ b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.spec.ts @@ -3,12 +3,12 @@ import { ComponentFixture, TestBed } from "@angular/core/testing"; import { MockProxy, mock } from "jest-mock-extended"; import { of } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { I18nPipe } from "@bitwarden/angular/platform/pipes/i18n.pipe"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { PasswordRepromptService } from "@bitwarden/vault"; diff --git a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.ts b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.ts index b2b8ce298a..6a1ba1f633 100644 --- a/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.ts +++ b/apps/web/src/app/tools/reports/pages/unsecured-websites-report.component.ts @@ -1,13 +1,12 @@ import { Component, OnInit } from "@angular/core"; +import { CollectionService, Collection } from "@bitwarden/admin-console/common"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { PasswordRepromptService } from "@bitwarden/vault"; diff --git a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts index 821765ba41..a51d408bc7 100644 --- a/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts +++ b/apps/web/src/app/vault/components/collection-dialog/collection-dialog.component.ts @@ -19,14 +19,14 @@ import { CollectionAdminView, OrganizationUserApiService, OrganizationUserUserMiniResponse, + CollectionResponse, + CollectionView, } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; -import { CollectionResponse } from "@bitwarden/common/vault/models/response/collection.response"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { BitValidators, DialogService } from "@bitwarden/components"; import { GroupService, GroupView } from "../../../admin-console/organizations/core"; diff --git a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts index c1878e2dcb..38416c2c39 100644 --- a/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts +++ b/apps/web/src/app/vault/components/vault-item-dialog/vault-item-dialog.component.ts @@ -5,6 +5,7 @@ import { Router } from "@angular/router"; import { firstValueFrom, Subject } from "rxjs"; import { map } from "rxjs/operators"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions"; @@ -17,7 +18,6 @@ import { PremiumUpgradePromptService } from "@bitwarden/common/vault/abstraction import { ViewPasswordHistoryService } from "@bitwarden/common/vault/abstractions/view-password-history.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { AsyncActionsModule, ButtonModule, diff --git a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts index 3b44662ecd..221a22421b 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-cipher-row.component.ts @@ -1,12 +1,12 @@ import { Component, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { firstValueFrom } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { ConfigService } from "@bitwarden/common/platform/abstractions/config/config.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { VaultItemEvent } from "./vault-item-event"; import { RowHeightClass } from "./vault-items.component"; diff --git a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts index ec38c53480..36cd3679a0 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-collection-row.component.ts @@ -1,9 +1,8 @@ import { Component, EventEmitter, Input, Output } from "@angular/core"; -import { CollectionAdminView, Unassigned } from "@bitwarden/admin-console/common"; +import { CollectionAdminView, Unassigned, CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { GroupView } from "../../../admin-console/organizations/core"; diff --git a/apps/web/src/app/vault/components/vault-items/vault-item-event.ts b/apps/web/src/app/vault/components/vault-items/vault-item-event.ts index 45a1f99c5d..272d1585d9 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-item-event.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-item-event.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/src/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { VaultItem } from "./vault-item"; diff --git a/apps/web/src/app/vault/components/vault-items/vault-item.ts b/apps/web/src/app/vault/components/vault-items/vault-item.ts index 642c707122..6ac198392a 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-item.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-item.ts @@ -1,5 +1,5 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; export interface VaultItem { collection?: CollectionView; diff --git a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts index 6e20ed8c3e..04f2245d26 100644 --- a/apps/web/src/app/vault/components/vault-items/vault-items.component.ts +++ b/apps/web/src/app/vault/components/vault-items/vault-items.component.ts @@ -1,10 +1,9 @@ import { SelectionModel } from "@angular/cdk/collections"; import { Component, EventEmitter, Input, Output } from "@angular/core"; -import { Unassigned } from "@bitwarden/admin-console/common"; +import { Unassigned, CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { TableDataSource } from "@bitwarden/components"; import { GroupView } from "../../../admin-console/organizations/core"; diff --git a/apps/web/src/app/vault/individual-vault/add-edit-v2.component.spec.ts b/apps/web/src/app/vault/individual-vault/add-edit-v2.component.spec.ts index cd3fec7377..25115c29c3 100644 --- a/apps/web/src/app/vault/individual-vault/add-edit-v2.component.spec.ts +++ b/apps/web/src/app/vault/individual-vault/add-edit-v2.component.spec.ts @@ -4,6 +4,7 @@ import { ActivatedRoute, Router } from "@angular/router"; import { mock, MockProxy } from "jest-mock-extended"; import { of } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; @@ -13,7 +14,6 @@ import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.se import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { DialogService } from "@bitwarden/components"; import { PasswordGenerationServiceAbstraction } from "@bitwarden/generator-legacy"; diff --git a/apps/web/src/app/vault/individual-vault/add-edit.component.ts b/apps/web/src/app/vault/individual-vault/add-edit.component.ts index 9826d9f2f5..87bec7667d 100644 --- a/apps/web/src/app/vault/individual-vault/add-edit.component.ts +++ b/apps/web/src/app/vault/individual-vault/add-edit.component.ts @@ -2,6 +2,7 @@ import { DatePipe } from "@angular/common"; import { Component, OnDestroy, OnInit } from "@angular/core"; import { firstValueFrom } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { AddEditComponent as BaseAddEditComponent } from "@bitwarden/angular/vault/components/add-edit.component"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; @@ -20,7 +21,6 @@ import { MessagingService } from "@bitwarden/common/platform/abstractions/messag import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { CipherType } from "@bitwarden/common/vault/enums"; diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts index e787a31f6e..239abbf4b9 100644 --- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts +++ b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-delete-dialog/bulk-delete-dialog.component.ts @@ -1,14 +1,13 @@ import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog"; import { Component, Inject } from "@angular/core"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherBulkDeleteRequest } from "@bitwarden/common/vault/models/request/cipher-bulk-delete.request"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService } from "@bitwarden/components"; export interface BulkDeleteDialogParams { diff --git a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-share-dialog/bulk-share-dialog.component.ts b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-share-dialog/bulk-share-dialog.component.ts index 166f0feba4..edfc617c70 100644 --- a/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-share-dialog/bulk-share-dialog.component.ts +++ b/apps/web/src/app/vault/individual-vault/bulk-action-dialogs/bulk-share-dialog/bulk-share-dialog.component.ts @@ -2,6 +2,7 @@ import { DialogConfig, DialogRef, DIALOG_DATA } from "@angular/cdk/dialog"; import { Component, Inject, OnDestroy, OnInit } from "@angular/core"; import { firstValueFrom, map } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -10,9 +11,7 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service" import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Checkable, isChecked } from "@bitwarden/common/types/checkable"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService } from "@bitwarden/components"; export interface BulkShareDialogParams { diff --git a/apps/web/src/app/vault/individual-vault/collections.component.ts b/apps/web/src/app/vault/individual-vault/collections.component.ts index 0fc5b88d61..f527a74e36 100644 --- a/apps/web/src/app/vault/individual-vault/collections.component.ts +++ b/apps/web/src/app/vault/individual-vault/collections.component.ts @@ -1,6 +1,7 @@ import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog"; import { Component, Inject, OnDestroy } from "@angular/core"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { CollectionsComponent as BaseCollectionsComponent } from "@bitwarden/angular/admin-console/components/collections.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -8,8 +9,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService, ToastService } from "@bitwarden/components"; @Component({ diff --git a/apps/web/src/app/vault/individual-vault/pipes/get-collection-name.pipe.ts b/apps/web/src/app/vault/individual-vault/pipes/get-collection-name.pipe.ts index e7e245a534..b52719304b 100644 --- a/apps/web/src/app/vault/individual-vault/pipes/get-collection-name.pipe.ts +++ b/apps/web/src/app/vault/individual-vault/pipes/get-collection-name.pipe.ts @@ -1,6 +1,6 @@ import { Pipe, PipeTransform } from "@angular/core"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; @Pipe({ name: "collectionNameFromId", diff --git a/apps/web/src/app/vault/individual-vault/share.component.ts b/apps/web/src/app/vault/individual-vault/share.component.ts index e7015fd7c3..e6f55f8846 100644 --- a/apps/web/src/app/vault/individual-vault/share.component.ts +++ b/apps/web/src/app/vault/individual-vault/share.component.ts @@ -1,5 +1,6 @@ import { Component, OnDestroy } from "@angular/core"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { ShareComponent as BaseShareComponent } from "@bitwarden/angular/components/share.component"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -7,8 +8,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; @Component({ selector: "app-vault-share", diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/services/abstractions/vault-filter.service.ts b/apps/web/src/app/vault/individual-vault/vault-filter/services/abstractions/vault-filter.service.ts index b18ee76e9c..aa9d503d25 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/services/abstractions/vault-filter.service.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/services/abstractions/vault-filter.service.ts @@ -1,8 +1,7 @@ import { Observable } from "rxjs"; -import { CollectionAdminView } from "@bitwarden/admin-console/common"; +import { CollectionAdminView, CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { CollectionView } from "@bitwarden/common/src/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/src/vault/models/view/folder.view"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts index 63bf3d5e4c..c6a97a4310 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.spec.ts @@ -7,6 +7,7 @@ import { FakeStateProvider } from "@bitwarden/common/../spec/fake-state-provider import { mock, MockProxy } from "jest-mock-extended"; import { firstValueFrom, ReplaySubject } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; @@ -15,10 +16,8 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { Utils } from "@bitwarden/common/platform/misc/utils"; import { UserId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { COLLAPSED_GROUPINGS } from "@bitwarden/common/vault/services/key-state/collapsed-groupings.state"; diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.ts b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.ts index d8abfb2f79..601c86f230 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/services/vault-filter.service.ts @@ -10,7 +10,11 @@ import { switchMap, } from "rxjs"; -import { CollectionAdminView } from "@bitwarden/admin-console/common"; +import { + CollectionAdminView, + CollectionService, + CollectionView, +} from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { PolicyType } from "@bitwarden/common/admin-console/enums"; @@ -18,11 +22,9 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/orga import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { ActiveUserState, StateProvider } from "@bitwarden/common/platform/state"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; import { COLLAPSED_GROUPINGS } from "@bitwarden/common/vault/services/key-state/collapsed-groupings.state"; diff --git a/apps/web/src/app/vault/individual-vault/vault-filter/shared/models/vault-filter.model.spec.ts b/apps/web/src/app/vault/individual-vault/vault-filter/shared/models/vault-filter.model.spec.ts index 755f30eeee..79d28c75bb 100644 --- a/apps/web/src/app/vault/individual-vault/vault-filter/shared/models/vault-filter.model.spec.ts +++ b/apps/web/src/app/vault/individual-vault/vault-filter/shared/models/vault-filter.model.spec.ts @@ -1,8 +1,8 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { CipherType } from "@bitwarden/common/vault/enums"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { VaultFilter } from "./vault-filter.model"; diff --git a/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.ts b/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.ts index 463a03091e..169dc87550 100644 --- a/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault-header/vault-header.component.ts @@ -9,7 +9,7 @@ import { } from "@angular/core"; import { firstValueFrom } from "rxjs"; -import { Unassigned } from "@bitwarden/admin-console/common"; +import { Unassigned, CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; @@ -17,7 +17,6 @@ import { ConfigService } from "@bitwarden/common/platform/abstractions/config/co import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { BreadcrumbsModule, MenuModule } from "@bitwarden/components"; import { HeaderModule } from "../../../layouts/header/header.module"; diff --git a/apps/web/src/app/vault/individual-vault/vault.component.ts b/apps/web/src/app/vault/individual-vault/vault.component.ts index f404394042..3da86fcb41 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -29,7 +29,13 @@ import { tap, } from "rxjs/operators"; -import { Unassigned } from "@bitwarden/admin-console/common"; +import { + Unassigned, + CollectionService, + CollectionData, + CollectionDetailsResponse, + CollectionView, +} from "@bitwarden/admin-console/common"; import { SearchPipe } from "@bitwarden/angular/pipes/search.pipe"; import { ModalService } from "@bitwarden/angular/services/modal.service"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; @@ -51,16 +57,12 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SyncService } from "@bitwarden/common/platform/sync"; import { CipherId, CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; import { DialogService, Icons, ToastService } from "@bitwarden/components"; import { diff --git a/apps/web/src/app/vault/individual-vault/view.component.spec.ts b/apps/web/src/app/vault/individual-vault/view.component.spec.ts index 046078976b..0dd58b846d 100644 --- a/apps/web/src/app/vault/individual-vault/view.component.spec.ts +++ b/apps/web/src/app/vault/individual-vault/view.component.spec.ts @@ -2,6 +2,7 @@ import { DIALOG_DATA, DialogRef } from "@angular/cdk/dialog"; import { ComponentFixture, TestBed } from "@angular/core/testing"; import { mock } from "jest-mock-extended"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { BillingAccountProfileStateService } from "@bitwarden/common/billing/abstractions/account/billing-account-profile-state.service"; @@ -11,7 +12,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; import { DialogService, ToastService } from "@bitwarden/components"; diff --git a/apps/web/src/app/vault/individual-vault/view.component.ts b/apps/web/src/app/vault/individual-vault/view.component.ts index 4841a18613..99829e8f08 100644 --- a/apps/web/src/app/vault/individual-vault/view.component.ts +++ b/apps/web/src/app/vault/individual-vault/view.component.ts @@ -2,6 +2,7 @@ import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog"; import { CommonModule } from "@angular/common"; import { Component, EventEmitter, Inject, OnInit } from "@angular/core"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; @@ -11,7 +12,6 @@ import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.servi import { ViewPasswordHistoryService } from "@bitwarden/common/vault/abstractions/view-password-history.service"; import { CipherType } from "@bitwarden/common/vault/enums/cipher-type"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { AsyncActionsModule, DialogModule, diff --git a/apps/web/src/app/vault/org-vault/add-edit.component.ts b/apps/web/src/app/vault/org-vault/add-edit.component.ts index 9129ed9cda..9cb5542a7b 100644 --- a/apps/web/src/app/vault/org-vault/add-edit.component.ts +++ b/apps/web/src/app/vault/org-vault/add-edit.component.ts @@ -1,6 +1,7 @@ import { DatePipe } from "@angular/common"; import { Component } from "@angular/core"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; @@ -16,7 +17,6 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { UserId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { CipherData } from "@bitwarden/common/vault/models/data/cipher.data"; diff --git a/apps/web/src/app/vault/org-vault/bulk-collections-dialog/bulk-collections-dialog.component.ts b/apps/web/src/app/vault/org-vault/bulk-collections-dialog/bulk-collections-dialog.component.ts index 2839a6ae60..c8c9b83efc 100644 --- a/apps/web/src/app/vault/org-vault/bulk-collections-dialog/bulk-collections-dialog.component.ts +++ b/apps/web/src/app/vault/org-vault/bulk-collections-dialog/bulk-collections-dialog.component.ts @@ -6,12 +6,12 @@ import { combineLatest, of, Subject, switchMap, takeUntil } from "rxjs"; import { CollectionAdminService, OrganizationUserApiService, + CollectionView, } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService } from "@bitwarden/components"; import { GroupService, GroupView } from "../../../admin-console/organizations/core"; diff --git a/apps/web/src/app/vault/org-vault/collection-badge/collection-name.badge.component.ts b/apps/web/src/app/vault/org-vault/collection-badge/collection-name.badge.component.ts index 4f4e9e269d..1189f06343 100644 --- a/apps/web/src/app/vault/org-vault/collection-badge/collection-name.badge.component.ts +++ b/apps/web/src/app/vault/org-vault/collection-badge/collection-name.badge.component.ts @@ -1,6 +1,6 @@ import { Component, Input } from "@angular/core"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; @Component({ selector: "app-collection-badge", diff --git a/apps/web/src/app/vault/org-vault/collections.component.ts b/apps/web/src/app/vault/org-vault/collections.component.ts index 877e7dfe16..47f5325c75 100644 --- a/apps/web/src/app/vault/org-vault/collections.component.ts +++ b/apps/web/src/app/vault/org-vault/collections.component.ts @@ -1,6 +1,7 @@ import { DIALOG_DATA, DialogConfig, DialogRef } from "@angular/cdk/dialog"; import { Component, Inject } from "@angular/core"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -9,11 +10,9 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherData } from "@bitwarden/common/vault/models/data/cipher.data"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; import { CipherCollectionsRequest } from "@bitwarden/common/vault/models/request/cipher-collections.request"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DialogService, ToastService } from "@bitwarden/components"; import { diff --git a/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.service.ts b/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.service.ts index f9717f19f1..c4ac9d73df 100644 --- a/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.service.ts +++ b/apps/web/src/app/vault/org-vault/vault-filter/vault-filter.service.ts @@ -1,13 +1,12 @@ import { Injectable, OnDestroy } from "@angular/core"; import { map, Observable, ReplaySubject, Subject } from "rxjs"; -import { CollectionAdminView } from "@bitwarden/admin-console/common"; +import { CollectionAdminView, CollectionService } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { StateProvider } from "@bitwarden/common/platform/state"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; diff --git a/apps/web/src/app/vault/org-vault/vault.component.ts b/apps/web/src/app/vault/org-vault/vault.component.ts index 9c8ff3f2ff..3840d5ec6a 100644 --- a/apps/web/src/app/vault/org-vault/vault.component.ts +++ b/apps/web/src/app/vault/org-vault/vault.component.ts @@ -35,6 +35,8 @@ import { CollectionAdminService, CollectionAdminView, Unassigned, + CollectionService, + CollectionView, } from "@bitwarden/admin-console/common"; import { SearchPipe } from "@bitwarden/angular/pipes/search.pipe"; import { ModalService } from "@bitwarden/angular/services/modal.service"; @@ -55,13 +57,11 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SyncService } from "@bitwarden/common/platform/sync"; import { CipherId, CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { TotpService } from "@bitwarden/common/vault/abstractions/totp.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; import { DialogService, Icons, NoItemsModule, ToastService } from "@bitwarden/components"; import { diff --git a/apps/web/src/app/vault/utils/collection-utils.spec.ts b/apps/web/src/app/vault/utils/collection-utils.spec.ts index 916ed8ff32..0354a08c28 100644 --- a/apps/web/src/app/vault/utils/collection-utils.spec.ts +++ b/apps/web/src/app/vault/utils/collection-utils.spec.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { getNestedCollectionTree } from "./collection-utils"; diff --git a/apps/web/src/app/vault/utils/collection-utils.ts b/apps/web/src/app/vault/utils/collection-utils.ts index 2f93e46bed..dacd6547c4 100644 --- a/apps/web/src/app/vault/utils/collection-utils.ts +++ b/apps/web/src/app/vault/utils/collection-utils.ts @@ -1,9 +1,9 @@ -import { CollectionAdminView } from "@bitwarden/admin-console/common"; -import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { + CollectionAdminView, CollectionView, NestingDelimiter, -} from "@bitwarden/common/vault/models/view/collection.view"; +} from "@bitwarden/admin-console/common"; +import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; export function getNestedCollectionTree( diff --git a/libs/admin-console/jest.config.js b/libs/admin-console/jest.config.js index 5d6c94d585..f2a8e6458a 100644 --- a/libs/admin-console/jest.config.js +++ b/libs/admin-console/jest.config.js @@ -10,7 +10,11 @@ module.exports = { displayName: "libs/admin-console tests", preset: "jest-preset-angular", setupFilesAfterEnv: ["/test.setup.ts"], - moduleNameMapper: pathsToModuleNameMapper(compilerOptions?.paths || {}, { - prefix: "/", - }), + moduleNameMapper: pathsToModuleNameMapper( + // lets us use @bitwarden/common/spec in tests + { "@bitwarden/common/spec": ["../common/spec"], ...(compilerOptions?.paths ?? {}) }, + { + prefix: "/", + }, + ), }; diff --git a/libs/admin-console/src/common/collections/abstractions/collection-admin.service.ts b/libs/admin-console/src/common/collections/abstractions/collection-admin.service.ts index e5b0bde7ef..6ade8c8bed 100644 --- a/libs/admin-console/src/common/collections/abstractions/collection-admin.service.ts +++ b/libs/admin-console/src/common/collections/abstractions/collection-admin.service.ts @@ -1,4 +1,4 @@ -import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response"; +import { CollectionDetailsResponse } from "@bitwarden/admin-console/common"; import { CollectionAccessSelectionView, CollectionAdminView } from "../models"; diff --git a/libs/common/src/vault/abstractions/collection.service.ts b/libs/admin-console/src/common/collections/abstractions/collection.service.ts similarity index 76% rename from libs/common/src/vault/abstractions/collection.service.ts rename to libs/admin-console/src/common/collections/abstractions/collection.service.ts index 1f3e95a019..6b590bcdda 100644 --- a/libs/common/src/vault/abstractions/collection.service.ts +++ b/libs/admin-console/src/common/collections/abstractions/collection.service.ts @@ -1,11 +1,10 @@ import { Observable } from "rxjs"; -import { CollectionId, OrganizationId, UserId } from "../../types/guid"; -import { OrgKey } from "../../types/key"; -import { CollectionData } from "../models/data/collection.data"; -import { Collection } from "../models/domain/collection"; -import { TreeNode } from "../models/domain/tree-node"; -import { CollectionView } from "../models/view/collection.view"; +import { CollectionId, OrganizationId, UserId } from "@bitwarden/common/types/guid"; +import { OrgKey } from "@bitwarden/common/types/key"; +import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; + +import { CollectionData, Collection, CollectionView } from "../models"; export abstract class CollectionService { encryptedCollections$: Observable; diff --git a/libs/admin-console/src/common/collections/abstractions/index.ts b/libs/admin-console/src/common/collections/abstractions/index.ts index 4ee5610206..4d1c1910ef 100644 --- a/libs/admin-console/src/common/collections/abstractions/index.ts +++ b/libs/admin-console/src/common/collections/abstractions/index.ts @@ -1 +1,2 @@ export * from "./collection-admin.service"; +export * from "./collection.service"; diff --git a/libs/admin-console/src/common/collections/models/collection-admin.view.ts b/libs/admin-console/src/common/collections/models/collection-admin.view.ts index 208131a3f7..1cf65a2495 100644 --- a/libs/admin-console/src/common/collections/models/collection-admin.view.ts +++ b/libs/admin-console/src/common/collections/models/collection-admin.view.ts @@ -1,8 +1,8 @@ import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { CollectionAccessDetailsResponse } from "@bitwarden/common/src/vault/models/response/collection.response"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; -import { CollectionAccessSelectionView } from "../models"; +import { CollectionAccessSelectionView } from "./collection-access-selection.view"; +import { CollectionAccessDetailsResponse } from "./collection.response"; +import { CollectionView } from "./collection.view"; export const Unassigned = "unassigned"; diff --git a/libs/common/src/vault/models/request/collection-with-id.request.ts b/libs/admin-console/src/common/collections/models/collection-with-id.request.ts similarity index 84% rename from libs/common/src/vault/models/request/collection-with-id.request.ts rename to libs/admin-console/src/common/collections/models/collection-with-id.request.ts index 4ff050b391..d74aeb740a 100644 --- a/libs/common/src/vault/models/request/collection-with-id.request.ts +++ b/libs/admin-console/src/common/collections/models/collection-with-id.request.ts @@ -1,5 +1,4 @@ -import { Collection } from "../domain/collection"; - +import { Collection } from "./collection"; import { CollectionRequest } from "./collection.request"; export class CollectionWithIdRequest extends CollectionRequest { diff --git a/libs/common/src/vault/models/data/collection.data.ts b/libs/admin-console/src/common/collections/models/collection.data.ts similarity index 82% rename from libs/common/src/vault/models/data/collection.data.ts rename to libs/admin-console/src/common/collections/models/collection.data.ts index 6f575a9dd8..4a2b78543a 100644 --- a/libs/common/src/vault/models/data/collection.data.ts +++ b/libs/admin-console/src/common/collections/models/collection.data.ts @@ -1,7 +1,8 @@ import { Jsonify } from "type-fest"; -import { CollectionId, OrganizationId } from "../../../types/guid"; -import { CollectionDetailsResponse } from "../response/collection.response"; +import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; + +import { CollectionDetailsResponse } from "./collection.response"; export class CollectionData { id: CollectionId; diff --git a/libs/common/src/vault/models/request/collection.request.ts b/libs/admin-console/src/common/collections/models/collection.request.ts similarity index 69% rename from libs/common/src/vault/models/request/collection.request.ts rename to libs/admin-console/src/common/collections/models/collection.request.ts index 173bb3c18c..c8b3476e6a 100644 --- a/libs/common/src/vault/models/request/collection.request.ts +++ b/libs/admin-console/src/common/collections/models/collection.request.ts @@ -1,5 +1,6 @@ -import { SelectionReadOnlyRequest } from "../../../admin-console/models/request/selection-read-only.request"; -import { Collection } from "../domain/collection"; +import { SelectionReadOnlyRequest } from "@bitwarden/common/admin-console/models/request/selection-read-only.request"; + +import { Collection } from "./collection"; export class CollectionRequest { name: string; diff --git a/libs/common/src/vault/models/response/collection.response.ts b/libs/admin-console/src/common/collections/models/collection.response.ts similarity index 87% rename from libs/common/src/vault/models/response/collection.response.ts rename to libs/admin-console/src/common/collections/models/collection.response.ts index 19dbe2acf2..e2b8bfd08f 100644 --- a/libs/common/src/vault/models/response/collection.response.ts +++ b/libs/admin-console/src/common/collections/models/collection.response.ts @@ -1,6 +1,6 @@ -import { SelectionReadOnlyResponse } from "../../../admin-console/models/response/selection-read-only.response"; -import { BaseResponse } from "../../../models/response/base.response"; -import { CollectionId, OrganizationId } from "../../../types/guid"; +import { SelectionReadOnlyResponse } from "@bitwarden/common/admin-console/models/response/selection-read-only.response"; +import { BaseResponse } from "@bitwarden/common/models/response/base.response"; +import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; export class CollectionResponse extends BaseResponse { id: CollectionId; diff --git a/libs/common/src/vault/models/domain/collection.spec.ts b/libs/admin-console/src/common/collections/models/collection.spec.ts similarity index 86% rename from libs/common/src/vault/models/domain/collection.spec.ts rename to libs/admin-console/src/common/collections/models/collection.spec.ts index 2b01a3ff03..a21ce57351 100644 --- a/libs/common/src/vault/models/domain/collection.spec.ts +++ b/libs/admin-console/src/common/collections/models/collection.spec.ts @@ -1,9 +1,9 @@ -import { makeSymmetricCryptoKey, mockEnc } from "../../../../spec"; -import { CollectionId, OrganizationId } from "../../../types/guid"; -import { OrgKey } from "../../../types/key"; -import { CollectionData } from "../data/collection.data"; +import { makeSymmetricCryptoKey, mockEnc } from "@bitwarden/common/spec"; +import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; +import { OrgKey } from "@bitwarden/common/types/key"; import { Collection } from "./collection"; +import { CollectionData } from "./collection.data"; describe("Collection", () => { let data: CollectionData; diff --git a/libs/common/src/vault/models/domain/collection.ts b/libs/admin-console/src/common/collections/models/collection.ts similarity index 71% rename from libs/common/src/vault/models/domain/collection.ts rename to libs/admin-console/src/common/collections/models/collection.ts index 6a9e71f110..2fbc035b4d 100644 --- a/libs/common/src/vault/models/domain/collection.ts +++ b/libs/admin-console/src/common/collections/models/collection.ts @@ -1,8 +1,9 @@ -import Domain from "../../../platform/models/domain/domain-base"; -import { EncString } from "../../../platform/models/domain/enc-string"; -import { OrgKey } from "../../../types/key"; -import { CollectionData } from "../data/collection.data"; -import { CollectionView } from "../view/collection.view"; +import Domain from "@bitwarden/common/platform/models/domain/domain-base"; +import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; +import { OrgKey } from "@bitwarden/common/types/key"; + +import { CollectionData } from "./collection.data"; +import { CollectionView } from "./collection.view"; export class Collection extends Domain { id: string; diff --git a/libs/common/src/vault/models/view/collection.view.ts b/libs/admin-console/src/common/collections/models/collection.view.ts similarity index 88% rename from libs/common/src/vault/models/view/collection.view.ts rename to libs/admin-console/src/common/collections/models/collection.view.ts index 873f538ca6..3a00ef57f1 100644 --- a/libs/common/src/vault/models/view/collection.view.ts +++ b/libs/admin-console/src/common/collections/models/collection.view.ts @@ -1,10 +1,11 @@ import { Jsonify } from "type-fest"; -import { Organization } from "../../../admin-console/models/domain/organization"; -import { View } from "../../../models/view/view"; -import { Collection } from "../domain/collection"; -import { ITreeNodeObject } from "../domain/tree-node"; -import { CollectionAccessDetailsResponse } from "../response/collection.response"; +import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; +import { View } from "@bitwarden/common/models/view/view"; +import { ITreeNodeObject } from "@bitwarden/common/vault/models/domain/tree-node"; + +import { Collection } from "./collection"; +import { CollectionAccessDetailsResponse } from "./collection.response"; export const NestingDelimiter = "/"; diff --git a/libs/admin-console/src/common/collections/models/index.ts b/libs/admin-console/src/common/collections/models/index.ts index 4f35728b00..d04ec66330 100644 --- a/libs/admin-console/src/common/collections/models/index.ts +++ b/libs/admin-console/src/common/collections/models/index.ts @@ -1,3 +1,9 @@ export * from "./bulk-collection-access.request"; export * from "./collection-access-selection.view"; export * from "./collection-admin.view"; +export * from "./collection"; +export * from "./collection.data"; +export * from "./collection.view"; +export * from "./collection.request"; +export * from "./collection.response"; +export * from "./collection-with-id.request"; diff --git a/libs/admin-console/src/common/collections/services/default-collection-admin.service.ts b/libs/admin-console/src/common/collections/services/default-collection-admin.service.ts index aa2b5bb91d..3d4fab7a9b 100644 --- a/libs/admin-console/src/common/collections/services/default-collection-admin.service.ts +++ b/libs/admin-console/src/common/collections/services/default-collection-admin.service.ts @@ -3,17 +3,14 @@ import { SelectionReadOnlyRequest } from "@bitwarden/common/admin-console/models import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service"; import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; -import { CollectionRequest } from "@bitwarden/common/vault/models/request/collection.request"; + +import { CollectionAdminService, CollectionService } from "../abstractions"; import { + CollectionData, + CollectionRequest, CollectionAccessDetailsResponse, CollectionDetailsResponse, CollectionResponse, -} from "@bitwarden/common/vault/models/response/collection.response"; - -import { CollectionAdminService } from "../abstractions"; -import { BulkCollectionAccessRequest, CollectionAccessSelectionView, CollectionAdminView, diff --git a/libs/common/src/vault/services/collection.service.spec.ts b/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts similarity index 79% rename from libs/common/src/vault/services/collection.service.spec.ts rename to libs/admin-console/src/common/collections/services/default-collection.service.spec.ts index e18b53dafc..502d554d5f 100644 --- a/libs/common/src/vault/services/collection.service.spec.ts +++ b/libs/admin-console/src/common/collections/services/default-collection.service.spec.ts @@ -1,25 +1,29 @@ import { mock } from "jest-mock-extended"; import { firstValueFrom, of } from "rxjs"; +import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; +import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service"; +import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { Utils } from "@bitwarden/common/platform/misc/utils"; +import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; +import { ContainerService } from "@bitwarden/common/platform/services/container.service"; import { FakeStateProvider, makeEncString, makeSymmetricCryptoKey, mockAccountServiceWith, -} from "../../../spec"; -import { CryptoService } from "../../platform/abstractions/crypto.service"; -import { EncryptService } from "../../platform/abstractions/encrypt.service"; -import { I18nService } from "../../platform/abstractions/i18n.service"; -import { Utils } from "../../platform/misc/utils"; -import { EncString } from "../../platform/models/domain/enc-string"; -import { ContainerService } from "../../platform/services/container.service"; -import { CollectionId, OrganizationId, UserId } from "../../types/guid"; -import { OrgKey } from "../../types/key"; -import { CollectionData } from "../models/data/collection.data"; +} from "@bitwarden/common/spec"; +import { CollectionId, OrganizationId, UserId } from "@bitwarden/common/types/guid"; +import { OrgKey } from "@bitwarden/common/types/key"; -import { CollectionService, ENCRYPTED_COLLECTION_DATA_KEY } from "./collection.service"; +import { CollectionData } from "../models"; -describe("CollectionService", () => { +import { + DefaultCollectionService, + ENCRYPTED_COLLECTION_DATA_KEY, +} from "./default-collection.service"; + +describe("DefaultCollectionService", () => { afterEach(() => { delete (window as any).bitwardenContainerService; }); @@ -49,7 +53,7 @@ describe("CollectionService", () => { }), ); - const collectionService = new CollectionService( + const collectionService = new DefaultCollectionService( cryptoService, mock(), mockI18nService(), @@ -86,7 +90,7 @@ describe("CollectionService", () => { }), ); - const collectionService = new CollectionService( + const collectionService = new DefaultCollectionService( cryptoService, mock(), mockI18nService(), diff --git a/libs/common/src/vault/services/collection.service.ts b/libs/admin-console/src/common/collections/services/default-collection.service.ts similarity index 89% rename from libs/common/src/vault/services/collection.service.ts rename to libs/admin-console/src/common/collections/services/default-collection.service.ts index dfa40105c3..507e21bdb4 100644 --- a/libs/common/src/vault/services/collection.service.ts +++ b/libs/admin-console/src/common/collections/services/default-collection.service.ts @@ -1,11 +1,10 @@ import { combineLatest, firstValueFrom, map, Observable, of, switchMap } from "rxjs"; import { Jsonify } from "type-fest"; +import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service"; - -import { CryptoService } from "../../platform/abstractions/crypto.service"; -import { I18nService } from "../../platform/abstractions/i18n.service"; -import { Utils } from "../../platform/misc/utils"; +import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; +import { Utils } from "@bitwarden/common/platform/misc/utils"; import { ActiveUserState, StateProvider, @@ -13,15 +12,14 @@ import { DeriveDefinition, DerivedState, UserKeyDefinition, -} from "../../platform/state"; -import { CollectionId, OrganizationId, UserId } from "../../types/guid"; -import { OrgKey } from "../../types/key"; -import { CollectionService as CollectionServiceAbstraction } from "../../vault/abstractions/collection.service"; -import { CollectionData } from "../models/data/collection.data"; -import { Collection } from "../models/domain/collection"; -import { TreeNode } from "../models/domain/tree-node"; -import { CollectionView } from "../models/view/collection.view"; -import { ServiceUtils } from "../service-utils"; +} from "@bitwarden/common/platform/state"; +import { CollectionId, OrganizationId, UserId } from "@bitwarden/common/types/guid"; +import { OrgKey } from "@bitwarden/common/types/key"; +import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; +import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; + +import { CollectionService } from "../abstractions"; +import { Collection, CollectionData, CollectionView } from "../models"; export const ENCRYPTED_COLLECTION_DATA_KEY = UserKeyDefinition.record( COLLECTION_DATA, @@ -35,7 +33,7 @@ export const ENCRYPTED_COLLECTION_DATA_KEY = UserKeyDefinition.record, Record], CollectionView[], - { collectionService: CollectionService } + { collectionService: DefaultCollectionService } >(COLLECTION_DATA, "decryptedCollections", { deserializer: (obj) => obj.map((collection) => CollectionView.fromJSON(collection)), derive: async ([collections, orgKeys], { collectionService }) => { @@ -50,7 +48,7 @@ const DECRYPTED_COLLECTION_DATA_KEY = new DeriveDefinition< const NestingDelimiter = "/"; -export class CollectionService implements CollectionServiceAbstraction { +export class DefaultCollectionService implements CollectionService { private encryptedCollectionDataState: ActiveUserState>; encryptedCollections$: Observable; private decryptedCollectionDataState: DerivedState; diff --git a/libs/admin-console/src/common/collections/services/index.ts b/libs/admin-console/src/common/collections/services/index.ts index 1e3ed96c6a..89dcfe078b 100644 --- a/libs/admin-console/src/common/collections/services/index.ts +++ b/libs/admin-console/src/common/collections/services/index.ts @@ -1 +1,2 @@ export * from "./default-collection-admin.service"; +export * from "./default-collection.service"; diff --git a/libs/angular/src/admin-console/components/collections.component.ts b/libs/angular/src/admin-console/components/collections.component.ts index 93410afaae..304ff4411c 100644 --- a/libs/angular/src/admin-console/components/collections.component.ts +++ b/libs/angular/src/admin-console/components/collections.component.ts @@ -1,6 +1,7 @@ import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { firstValueFrom, map } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -8,10 +9,8 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { ToastService } from "@bitwarden/components"; @Directive() diff --git a/libs/angular/src/components/share.component.ts b/libs/angular/src/components/share.component.ts index f3edbf1f46..7f11210f9a 100644 --- a/libs/angular/src/components/share.component.ts +++ b/libs/angular/src/components/share.component.ts @@ -1,6 +1,7 @@ import { Directive, EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core"; import { firstValueFrom, map, Observable, Subject, takeUntil } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -11,9 +12,7 @@ import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/pl import { Utils } from "@bitwarden/common/platform/misc/utils"; import { Checkable, isChecked } from "@bitwarden/common/types/checkable"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; @Directive() export class ShareComponent implements OnInit, OnDestroy { diff --git a/libs/angular/src/services/jslib-services.module.ts b/libs/angular/src/services/jslib-services.module.ts index 41b24a4a54..cc7af0c0b0 100644 --- a/libs/angular/src/services/jslib-services.module.ts +++ b/libs/angular/src/services/jslib-services.module.ts @@ -4,6 +4,8 @@ import { Subject } from "rxjs"; import { OrganizationUserApiService, DefaultOrganizationUserApiService, + CollectionService, + DefaultCollectionService, } from "@bitwarden/admin-console/common"; import { SetPasswordJitService, @@ -232,7 +234,6 @@ import { SendService as SendServiceAbstraction, } from "@bitwarden/common/tools/send/services/send.service.abstraction"; import { CipherService as CipherServiceAbstraction } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService as CollectionServiceAbstraction } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherFileUploadService as CipherFileUploadServiceAbstraction } from "@bitwarden/common/vault/abstractions/file-upload/cipher-file-upload.service"; import { FolderApiServiceAbstraction } from "@bitwarden/common/vault/abstractions/folder/folder-api.service.abstraction"; import { @@ -242,7 +243,6 @@ import { import { TotpService as TotpServiceAbstraction } from "@bitwarden/common/vault/abstractions/totp.service"; import { VaultSettingsService as VaultSettingsServiceAbstraction } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service"; import { CipherService } from "@bitwarden/common/vault/services/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/services/collection.service"; import { CipherFileUploadService } from "@bitwarden/common/vault/services/file-upload/cipher-file-upload.service"; import { FolderApiService } from "@bitwarden/common/vault/services/folder/folder-api.service"; import { FolderService } from "@bitwarden/common/vault/services/folder/folder.service"; @@ -533,8 +533,8 @@ const safeProviders: SafeProvider[] = [ }), safeProvider({ provide: LogService, useFactory: () => new ConsoleLogService(false), deps: [] }), safeProvider({ - provide: CollectionServiceAbstraction, - useClass: CollectionService, + provide: CollectionService, + useClass: DefaultCollectionService, deps: [CryptoServiceAbstraction, EncryptService, I18nServiceAbstraction, StateProvider], }), safeProvider({ @@ -691,7 +691,7 @@ const safeProviders: SafeProvider[] = [ InternalFolderService, CipherServiceAbstraction, CryptoServiceAbstraction, - CollectionServiceAbstraction, + CollectionService, MessagingServiceAbstraction, InternalPolicyService, InternalSendService, @@ -740,7 +740,7 @@ const safeProviders: SafeProvider[] = [ InternalMasterPasswordServiceAbstraction, CipherServiceAbstraction, FolderServiceAbstraction, - CollectionServiceAbstraction, + CollectionService, PlatformUtilsServiceAbstraction, MessagingServiceAbstraction, SearchServiceAbstraction, @@ -795,7 +795,7 @@ const safeProviders: SafeProvider[] = [ FolderServiceAbstraction, ImportApiServiceAbstraction, I18nServiceAbstraction, - CollectionServiceAbstraction, + CollectionService, CryptoServiceAbstraction, EncryptService, PinServiceAbstraction, @@ -826,7 +826,7 @@ const safeProviders: SafeProvider[] = [ CryptoServiceAbstraction, EncryptService, CryptoFunctionServiceAbstraction, - CollectionServiceAbstraction, + CollectionService, KdfConfigServiceAbstraction, AccountServiceAbstraction, ], diff --git a/libs/angular/src/vault/abstractions/deprecated-vault-filter.service.ts b/libs/angular/src/vault/abstractions/deprecated-vault-filter.service.ts index 6672c45138..483f64e87b 100644 --- a/libs/angular/src/vault/abstractions/deprecated-vault-filter.service.ts +++ b/libs/angular/src/vault/abstractions/deprecated-vault-filter.service.ts @@ -1,7 +1,7 @@ import { Observable } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { DynamicTreeNode } from "../vault-filter/models/dynamic-tree-node.model"; diff --git a/libs/angular/src/vault/components/add-edit.component.ts b/libs/angular/src/vault/components/add-edit.component.ts index dc782e6e3a..49129a868b 100644 --- a/libs/angular/src/vault/components/add-edit.component.ts +++ b/libs/angular/src/vault/components/add-edit.component.ts @@ -2,6 +2,7 @@ import { DatePipe } from "@angular/common"; import { Directive, EventEmitter, Input, OnDestroy, OnInit, Output } from "@angular/core"; import { concatMap, firstValueFrom, map, Observable, Subject, takeUntil } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { @@ -24,14 +25,12 @@ import { Utils } from "@bitwarden/common/platform/misc/utils"; import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction"; import { UserId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType, SecureNoteType } from "@bitwarden/common/vault/enums"; import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; import { CardView } from "@bitwarden/common/vault/models/view/card.view"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { IdentityView } from "@bitwarden/common/vault/models/view/identity.view"; import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view"; diff --git a/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts b/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts index 6318cfd2a2..035f2c51cb 100644 --- a/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts +++ b/libs/angular/src/vault/vault-filter/components/collection-filter.component.ts @@ -1,7 +1,7 @@ import { Directive, EventEmitter, Input, Output } from "@angular/core"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { ITreeNodeObject } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { DynamicTreeNode } from "../models/dynamic-tree-node.model"; import { TopLevelTreeNode } from "../models/top-level-tree-node.model"; diff --git a/libs/angular/src/vault/vault-filter/components/vault-filter.component.ts b/libs/angular/src/vault/vault-filter/components/vault-filter.component.ts index 3745924166..c32e556d90 100644 --- a/libs/angular/src/vault/vault-filter/components/vault-filter.component.ts +++ b/libs/angular/src/vault/vault-filter/components/vault-filter.component.ts @@ -1,9 +1,9 @@ import { Directive, EventEmitter, Input, OnInit, Output } from "@angular/core"; import { firstValueFrom, Observable } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { ITreeNodeObject } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { DeprecatedVaultFilterService } from "../../abstractions/deprecated-vault-filter.service"; diff --git a/libs/angular/src/vault/vault-filter/services/vault-filter.service.ts b/libs/angular/src/vault/vault-filter/services/vault-filter.service.ts index 8a6d202477..34310610ca 100644 --- a/libs/angular/src/vault/vault-filter/services/vault-filter.service.ts +++ b/libs/angular/src/vault/vault-filter/services/vault-filter.service.ts @@ -1,6 +1,7 @@ import { Injectable } from "@angular/core"; import { firstValueFrom, from, map, mergeMap, Observable } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { isMember, OrganizationService, @@ -10,10 +11,8 @@ import { PolicyType } from "@bitwarden/common/admin-console/enums"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { ActiveUserState, StateProvider } from "@bitwarden/common/platform/state"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { TreeNode } from "@bitwarden/common/vault/models/domain/tree-node"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { ServiceUtils } from "@bitwarden/common/vault/service-utils"; diff --git a/libs/common/src/abstractions/api.service.ts b/libs/common/src/abstractions/api.service.ts index f1be46f664..9834116c9f 100644 --- a/libs/common/src/abstractions/api.service.ts +++ b/libs/common/src/abstractions/api.service.ts @@ -1,3 +1,10 @@ +import { + CollectionRequest, + CollectionAccessDetailsResponse, + CollectionDetailsResponse, + CollectionResponse, +} from "@bitwarden/admin-console/common"; + import { OrganizationConnectionType } from "../admin-console/enums"; import { OrganizationSponsorshipCreateRequest } from "../admin-console/models/request/organization/organization-sponsorship-create.request"; import { OrganizationSponsorshipRedeemRequest } from "../admin-console/models/request/organization/organization-sponsorship-redeem.request"; @@ -115,15 +122,9 @@ import { CipherCreateRequest } from "../vault/models/request/cipher-create.reque import { CipherPartialRequest } from "../vault/models/request/cipher-partial.request"; import { CipherShareRequest } from "../vault/models/request/cipher-share.request"; import { CipherRequest } from "../vault/models/request/cipher.request"; -import { CollectionRequest } from "../vault/models/request/collection.request"; import { AttachmentUploadDataResponse } from "../vault/models/response/attachment-upload-data.response"; import { AttachmentResponse } from "../vault/models/response/attachment.response"; import { CipherResponse } from "../vault/models/response/cipher.response"; -import { - CollectionAccessDetailsResponse, - CollectionDetailsResponse, - CollectionResponse, -} from "../vault/models/response/collection.response"; import { OptionalCipherResponse } from "../vault/models/response/optional-cipher.response"; /** diff --git a/libs/common/src/admin-console/models/response/organization-export.response.ts b/libs/common/src/admin-console/models/response/organization-export.response.ts index b25b3cbaae..8ead32d782 100644 --- a/libs/common/src/admin-console/models/response/organization-export.response.ts +++ b/libs/common/src/admin-console/models/response/organization-export.response.ts @@ -1,6 +1,7 @@ +import { CollectionResponse } from "@bitwarden/admin-console/common"; + import { BaseResponse } from "../../../models/response/base.response"; import { CipherResponse } from "../../../vault/models/response/cipher.response"; -import { CollectionResponse } from "../../../vault/models/response/collection.response"; export class OrganizationExportResponse extends BaseResponse { collections: CollectionResponse[]; diff --git a/libs/common/src/models/export/collection-with-id.export.ts b/libs/common/src/models/export/collection-with-id.export.ts index be25eaa7ef..4be3fa0121 100644 --- a/libs/common/src/models/export/collection-with-id.export.ts +++ b/libs/common/src/models/export/collection-with-id.export.ts @@ -1,5 +1,4 @@ -import { Collection as CollectionDomain } from "../../vault/models/domain/collection"; -import { CollectionView } from "../../vault/models/view/collection.view"; +import { Collection as CollectionDomain, CollectionView } from "@bitwarden/admin-console/common"; import { CollectionExport } from "./collection.export"; diff --git a/libs/common/src/models/export/collection.export.ts b/libs/common/src/models/export/collection.export.ts index c94d5bc0ca..8bc6d68006 100644 --- a/libs/common/src/models/export/collection.export.ts +++ b/libs/common/src/models/export/collection.export.ts @@ -1,6 +1,6 @@ +import { Collection as CollectionDomain, CollectionView } from "@bitwarden/admin-console/common"; + import { EncString } from "../../platform/models/domain/enc-string"; -import { Collection as CollectionDomain } from "../../vault/models/domain/collection"; -import { CollectionView } from "../../vault/models/view/collection.view"; import { safeGetString } from "./utils"; diff --git a/libs/common/src/models/request/import-organization-ciphers.request.ts b/libs/common/src/models/request/import-organization-ciphers.request.ts index 0689762de3..759b69b21e 100644 --- a/libs/common/src/models/request/import-organization-ciphers.request.ts +++ b/libs/common/src/models/request/import-organization-ciphers.request.ts @@ -1,5 +1,6 @@ +import { CollectionWithIdRequest } from "@bitwarden/admin-console/common"; + import { CipherRequest } from "../../vault/models/request/cipher.request"; -import { CollectionWithIdRequest } from "../../vault/models/request/collection-with-id.request"; import { KvpRequest } from "./kvp.request"; diff --git a/libs/common/src/platform/sync/core-sync.service.ts b/libs/common/src/platform/sync/core-sync.service.ts index e9cfa37d11..13f1525afd 100644 --- a/libs/common/src/platform/sync/core-sync.service.ts +++ b/libs/common/src/platform/sync/core-sync.service.ts @@ -1,5 +1,7 @@ import { firstValueFrom, map, Observable, of, switchMap } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; + import { ApiService } from "../../abstractions/api.service"; import { AccountService } from "../../auth/abstractions/account.service"; import { AuthService } from "../../auth/abstractions/auth.service"; @@ -14,7 +16,6 @@ import { SendApiService } from "../../tools/send/services/send-api.service.abstr import { InternalSendService } from "../../tools/send/services/send.service.abstraction"; import { UserId } from "../../types/guid"; import { CipherService } from "../../vault/abstractions/cipher.service"; -import { CollectionService } from "../../vault/abstractions/collection.service"; import { FolderApiServiceAbstraction } from "../../vault/abstractions/folder/folder-api.service.abstraction"; import { InternalFolderService } from "../../vault/abstractions/folder/folder.service.abstraction"; import { SyncService } from "../../vault/abstractions/sync/sync.service.abstraction"; diff --git a/libs/common/src/platform/sync/default-sync.service.ts b/libs/common/src/platform/sync/default-sync.service.ts index 322687ce6a..66a6c8e350 100644 --- a/libs/common/src/platform/sync/default-sync.service.ts +++ b/libs/common/src/platform/sync/default-sync.service.ts @@ -1,5 +1,11 @@ import { firstValueFrom, map } from "rxjs"; +import { + CollectionService, + CollectionData, + CollectionDetailsResponse, +} from "@bitwarden/admin-console/common"; + import { UserDecryptionOptionsServiceAbstraction } from "../../../../auth/src/common/abstractions"; import { LogoutReason } from "../../../../auth/src/common/types"; import { ApiService } from "../../abstractions/api.service"; @@ -29,14 +35,11 @@ import { SendApiService } from "../../tools/send/services/send-api.service.abstr import { InternalSendService } from "../../tools/send/services/send.service.abstraction"; import { UserId } from "../../types/guid"; import { CipherService } from "../../vault/abstractions/cipher.service"; -import { CollectionService } from "../../vault/abstractions/collection.service"; import { FolderApiServiceAbstraction } from "../../vault/abstractions/folder/folder-api.service.abstraction"; import { InternalFolderService } from "../../vault/abstractions/folder/folder.service.abstraction"; import { CipherData } from "../../vault/models/data/cipher.data"; -import { CollectionData } from "../../vault/models/data/collection.data"; import { FolderData } from "../../vault/models/data/folder.data"; import { CipherResponse } from "../../vault/models/response/cipher.response"; -import { CollectionDetailsResponse } from "../../vault/models/response/collection.response"; import { FolderResponse } from "../../vault/models/response/folder.response"; import { CryptoService } from "../abstractions/crypto.service"; import { LogService } from "../abstractions/log.service"; diff --git a/libs/common/src/platform/sync/sync.response.ts b/libs/common/src/platform/sync/sync.response.ts index 9e7173d3eb..bc94eff67a 100644 --- a/libs/common/src/platform/sync/sync.response.ts +++ b/libs/common/src/platform/sync/sync.response.ts @@ -1,10 +1,11 @@ +import { CollectionDetailsResponse } from "@bitwarden/admin-console/common"; + import { PolicyResponse } from "../../admin-console/models/response/policy.response"; import { BaseResponse } from "../../models/response/base.response"; import { DomainsResponse } from "../../models/response/domains.response"; import { ProfileResponse } from "../../models/response/profile.response"; import { SendResponse } from "../../tools/send/models/response/send.response"; import { CipherResponse } from "../../vault/models/response/cipher.response"; -import { CollectionDetailsResponse } from "../../vault/models/response/collection.response"; import { FolderResponse } from "../../vault/models/response/folder.response"; export class SyncResponse extends BaseResponse { diff --git a/libs/common/src/services/api.service.ts b/libs/common/src/services/api.service.ts index 3d95190fea..5f53131719 100644 --- a/libs/common/src/services/api.service.ts +++ b/libs/common/src/services/api.service.ts @@ -1,5 +1,11 @@ import { firstValueFrom } from "rxjs"; +import { + CollectionRequest, + CollectionAccessDetailsResponse, + CollectionDetailsResponse, + CollectionResponse, +} from "@bitwarden/admin-console/common"; import { LogoutReason } from "@bitwarden/auth/common"; import { ApiService as ApiServiceAbstraction } from "../abstractions/api.service"; @@ -133,15 +139,9 @@ import { CipherCreateRequest } from "../vault/models/request/cipher-create.reque import { CipherPartialRequest } from "../vault/models/request/cipher-partial.request"; import { CipherShareRequest } from "../vault/models/request/cipher-share.request"; import { CipherRequest } from "../vault/models/request/cipher.request"; -import { CollectionRequest } from "../vault/models/request/collection.request"; import { AttachmentUploadDataResponse } from "../vault/models/response/attachment-upload-data.response"; import { AttachmentResponse } from "../vault/models/response/attachment.response"; import { CipherResponse } from "../vault/models/response/cipher.response"; -import { - CollectionAccessDetailsResponse, - CollectionDetailsResponse, - CollectionResponse, -} from "../vault/models/response/collection.response"; import { OptionalCipherResponse } from "../vault/models/response/optional-cipher.response"; /** diff --git a/libs/common/src/services/vault-timeout/vault-timeout.service.spec.ts b/libs/common/src/services/vault-timeout/vault-timeout.service.spec.ts index 942b8ce451..71341a98a6 100644 --- a/libs/common/src/services/vault-timeout/vault-timeout.service.spec.ts +++ b/libs/common/src/services/vault-timeout/vault-timeout.service.spec.ts @@ -1,6 +1,7 @@ import { MockProxy, any, mock } from "jest-mock-extended"; import { BehaviorSubject, from, of } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { LogoutReason } from "@bitwarden/auth/common"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { TaskSchedulerService } from "@bitwarden/common/platform/scheduling"; @@ -21,7 +22,6 @@ import { StateEventRunnerService } from "../../platform/state"; import { UserId } from "../../types/guid"; import { VaultTimeout, VaultTimeoutStringType } from "../../types/vault-timeout.type"; import { CipherService } from "../../vault/abstractions/cipher.service"; -import { CollectionService } from "../../vault/abstractions/collection.service"; import { FolderService } from "../../vault/abstractions/folder/folder.service.abstraction"; import { VaultTimeoutService } from "./vault-timeout.service"; diff --git a/libs/common/src/services/vault-timeout/vault-timeout.service.ts b/libs/common/src/services/vault-timeout/vault-timeout.service.ts index c40e4687b7..07c3cd56f1 100644 --- a/libs/common/src/services/vault-timeout/vault-timeout.service.ts +++ b/libs/common/src/services/vault-timeout/vault-timeout.service.ts @@ -1,5 +1,6 @@ import { combineLatest, concatMap, filter, firstValueFrom, map, timeout } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { LogoutReason } from "@bitwarden/auth/common"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { TaskSchedulerService, ScheduledTaskNames } from "@bitwarden/common/platform/scheduling"; @@ -18,7 +19,6 @@ import { StateService } from "../../platform/abstractions/state.service"; import { StateEventRunnerService } from "../../platform/state"; import { UserId } from "../../types/guid"; import { CipherService } from "../../vault/abstractions/cipher.service"; -import { CollectionService } from "../../vault/abstractions/collection.service"; import { FolderService } from "../../vault/abstractions/folder/folder.service.abstraction"; export class VaultTimeoutService implements VaultTimeoutServiceAbstraction { diff --git a/libs/importer/package.json b/libs/importer/package.json index 9379e9244f..85adcadeee 100644 --- a/libs/importer/package.json +++ b/libs/importer/package.json @@ -19,6 +19,7 @@ }, "dependencies": { "@bitwarden/common": "file:../common", - "@bitwarden/vault-export-core": "file:../tools/export/vault-export/vault-export-core" + "@bitwarden/vault-export-core": "file:../tools/export/vault-export/vault-export-core", + "@bitwarden/admin-console-common": "file:../admin-console/src/common" } } diff --git a/libs/importer/src/components/import.component.ts b/libs/importer/src/components/import.component.ts index 10a3f5a89a..9be0428c86 100644 --- a/libs/importer/src/components/import.component.ts +++ b/libs/importer/src/components/import.component.ts @@ -16,6 +16,7 @@ import * as JSZip from "jszip"; import { concat, Observable, Subject, lastValueFrom, combineLatest, firstValueFrom } from "rxjs"; import { filter, map, takeUntil } from "rxjs/operators"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { safeProvider, SafeProvider } from "@bitwarden/angular/platform/utils/safe-provider"; import { PinServiceAbstraction } from "@bitwarden/auth/common"; @@ -36,10 +37,8 @@ import { LogService } from "@bitwarden/common/platform/abstractions/log.service" import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { AsyncActionsModule, diff --git a/libs/importer/src/importers/base-importer.ts b/libs/importer/src/importers/base-importer.ts index 9cba62c5fa..4e4185676b 100644 --- a/libs/importer/src/importers/base-importer.ts +++ b/libs/importer/src/importers/base-importer.ts @@ -1,12 +1,12 @@ import * as papa from "papaparse"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { normalizeExpiryYearFormat } from "@bitwarden/common/autofill/utils"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { ConsoleLogService } from "@bitwarden/common/platform/services/console-log.service"; import { FieldType, SecureNoteType, CipherType } from "@bitwarden/common/vault/enums"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FieldView } from "@bitwarden/common/vault/models/view/field.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { LoginUriView } from "@bitwarden/common/vault/models/view/login-uri.view"; diff --git a/libs/importer/src/importers/bitwarden/bitwarden-csv-importer.ts b/libs/importer/src/importers/bitwarden/bitwarden-csv-importer.ts index 2c480c18dd..d77f7d7830 100644 --- a/libs/importer/src/importers/bitwarden/bitwarden-csv-importer.ts +++ b/libs/importer/src/importers/bitwarden/bitwarden-csv-importer.ts @@ -1,7 +1,7 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { FieldType, SecureNoteType, CipherType } from "@bitwarden/common/vault/enums"; import { CipherRepromptType } from "@bitwarden/common/vault/enums/cipher-reprompt-type"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FieldView } from "@bitwarden/common/vault/models/view/field.view"; import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; import { SecureNoteView } from "@bitwarden/common/vault/models/view/secure-note.view"; diff --git a/libs/importer/src/importers/bitwarden/bitwarden-json-importer.ts b/libs/importer/src/importers/bitwarden/bitwarden-json-importer.ts index 9adc8a9781..160a55e6f2 100644 --- a/libs/importer/src/importers/bitwarden/bitwarden-json-importer.ts +++ b/libs/importer/src/importers/bitwarden/bitwarden-json-importer.ts @@ -1,5 +1,6 @@ import { firstValueFrom, map } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { PinServiceAbstraction } from "@bitwarden/auth/common"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { @@ -14,7 +15,6 @@ import { EncString } from "@bitwarden/common/platform/models/domain/enc-string"; import { SymmetricCryptoKey } from "@bitwarden/common/platform/models/domain/symmetric-crypto-key"; import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { BitwardenEncryptedIndividualJsonExport, diff --git a/libs/importer/src/importers/padlock-csv-importer.ts b/libs/importer/src/importers/padlock-csv-importer.ts index 1d09fcdaac..39e6339a4d 100644 --- a/libs/importer/src/importers/padlock-csv-importer.ts +++ b/libs/importer/src/importers/padlock-csv-importer.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { ImportResult } from "../models/import-result"; diff --git a/libs/importer/src/importers/passpack-csv-importer.ts b/libs/importer/src/importers/passpack-csv-importer.ts index 43c8b3dba9..a426d6db41 100644 --- a/libs/importer/src/importers/passpack-csv-importer.ts +++ b/libs/importer/src/importers/passpack-csv-importer.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { ImportResult } from "../models/import-result"; diff --git a/libs/importer/src/models/import-result.ts b/libs/importer/src/models/import-result.ts index cc4c487d3d..432bd37f8e 100644 --- a/libs/importer/src/models/import-result.ts +++ b/libs/importer/src/models/import-result.ts @@ -1,5 +1,5 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; export class ImportResult { diff --git a/libs/importer/src/services/import-collection.service.abstraction.ts b/libs/importer/src/services/import-collection.service.abstraction.ts index 68b7e5f192..03ac94ad84 100644 --- a/libs/importer/src/services/import-collection.service.abstraction.ts +++ b/libs/importer/src/services/import-collection.service.abstraction.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; export abstract class ImportCollectionServiceAbstraction { getAllAdminCollections: (organizationId: string) => Promise; diff --git a/libs/importer/src/services/import.service.abstraction.ts b/libs/importer/src/services/import.service.abstraction.ts index dc77e76390..4dfaa9a8ce 100644 --- a/libs/importer/src/services/import.service.abstraction.ts +++ b/libs/importer/src/services/import.service.abstraction.ts @@ -1,4 +1,4 @@ -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { Importer } from "../importers/importer"; diff --git a/libs/importer/src/services/import.service.spec.ts b/libs/importer/src/services/import.service.spec.ts index ef605746e6..c221e15aa7 100644 --- a/libs/importer/src/services/import.service.spec.ts +++ b/libs/importer/src/services/import.service.spec.ts @@ -1,5 +1,6 @@ import { mock, MockProxy } from "jest-mock-extended"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { PinServiceAbstraction } from "@bitwarden/auth/common"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; @@ -7,10 +8,8 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt. import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { BitwardenPasswordProtectedImporter } from "../importers/bitwarden/bitwarden-password-protected-importer"; diff --git a/libs/importer/src/services/import.service.ts b/libs/importer/src/services/import.service.ts index 2295f4f704..1e983aa3d1 100644 --- a/libs/importer/src/services/import.service.ts +++ b/libs/importer/src/services/import.service.ts @@ -1,5 +1,10 @@ import { firstValueFrom, map } from "rxjs"; +import { + CollectionService, + CollectionWithIdRequest, + CollectionView, +} from "@bitwarden/admin-console/common"; import { PinServiceAbstraction } from "@bitwarden/auth/common"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; import { ImportCiphersRequest } from "@bitwarden/common/models/request/import-ciphers.request"; @@ -11,14 +16,11 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt. import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherRequest } from "@bitwarden/common/vault/models/request/cipher.request"; -import { CollectionWithIdRequest } from "@bitwarden/common/vault/models/request/collection-with-id.request"; import { FolderWithIdRequest } from "@bitwarden/common/vault/models/request/folder-with-id.request"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { diff --git a/libs/tools/export/vault-export/vault-export-core/package.json b/libs/tools/export/vault-export/vault-export-core/package.json index 2d6503630b..07289ae223 100644 --- a/libs/tools/export/vault-export/vault-export-core/package.json +++ b/libs/tools/export/vault-export/vault-export-core/package.json @@ -18,6 +18,7 @@ "build:watch": "npm run clean && tsc -watch" }, "dependencies": { - "@bitwarden/common": "file:../../../../common" + "@bitwarden/common": "file:../../../../common", + "@bitwarden/admin-console-common": "file:../../../../admin-console/src/common" } } diff --git a/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts b/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts index 9fc1f20b83..28ffa8e83d 100644 --- a/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts +++ b/libs/tools/export/vault-export/vault-export-core/src/services/org-vault-export.service.ts @@ -1,6 +1,13 @@ import * as papa from "papaparse"; import { firstValueFrom, map } from "rxjs"; +import { + CollectionService, + CollectionData, + Collection, + CollectionDetailsResponse, + CollectionView, +} from "@bitwarden/admin-console/common"; import { PinServiceAbstraction } from "@bitwarden/auth/common"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { AccountService } from "@bitwarden/common/auth/abstractions/account.service"; @@ -12,15 +19,10 @@ import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt. import { Utils } from "@bitwarden/common/platform/misc/utils"; import { OrganizationId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherType } from "@bitwarden/common/vault/enums"; import { CipherData } from "@bitwarden/common/vault/models/data/cipher.data"; -import { CollectionData } from "@bitwarden/common/vault/models/data/collection.data"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; -import { Collection } from "@bitwarden/common/vault/models/domain/collection"; -import { CollectionDetailsResponse } from "@bitwarden/common/vault/models/response/collection.response"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { BitwardenCsvOrgExportType, diff --git a/libs/tools/export/vault-export/vault-export-ui/package.json b/libs/tools/export/vault-export/vault-export-ui/package.json index 3be54c4e19..62df08c527 100644 --- a/libs/tools/export/vault-export/vault-export-ui/package.json +++ b/libs/tools/export/vault-export/vault-export-ui/package.json @@ -21,6 +21,7 @@ "@bitwarden/common": "file:../../../../common", "@bitwarden/angular": "file:../../../../angular", "@bitwarden/auth": "file:../../../../auth", - "@bitwarden/vault-export-core": "file:../vault-export-core" + "@bitwarden/vault-export-core": "file:../vault-export-core", + "@bitwarden/admin-console-common": "file:../../../../admin-console/src/common" } } diff --git a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts index e4f5ec9d32..0c36280442 100644 --- a/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts +++ b/libs/tools/export/vault-export/vault-export-ui/src/components/export.component.ts @@ -12,6 +12,7 @@ import { import { ReactiveFormsModule, UntypedFormBuilder, Validators } from "@angular/forms"; import { combineLatest, map, merge, Observable, startWith, Subject, takeUntil } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { PasswordStrengthV2Component } from "@bitwarden/angular/tools/password-strength/password-strength-v2.component"; import { UserVerificationDialogComponent } from "@bitwarden/auth/angular"; @@ -26,7 +27,6 @@ import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.servic import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { AsyncActionsModule, BitSubmitDirective, diff --git a/libs/vault/src/cipher-form/abstractions/cipher-form-config.service.ts b/libs/vault/src/cipher-form/abstractions/cipher-form-config.service.ts index 28c18b3665..f00aacf963 100644 --- a/libs/vault/src/cipher-form/abstractions/cipher-form-config.service.ts +++ b/libs/vault/src/cipher-form/abstractions/cipher-form-config.service.ts @@ -1,8 +1,8 @@ +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { CipherId, CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherType } from "@bitwarden/common/vault/enums"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; /** diff --git a/libs/vault/src/cipher-form/cipher-form.stories.ts b/libs/vault/src/cipher-form/cipher-form.stories.ts index 96d4289028..618407e3b4 100644 --- a/libs/vault/src/cipher-form/cipher-form.stories.ts +++ b/libs/vault/src/cipher-form/cipher-form.stories.ts @@ -9,6 +9,7 @@ import { } from "@storybook/angular"; import { BehaviorSubject } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { EventCollectionService } from "@bitwarden/common/abstractions/event/event-collection.service"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; @@ -18,7 +19,6 @@ import { UriMatchStrategy } from "@bitwarden/common/models/domain/domain-service import { CipherType } from "@bitwarden/common/vault/enums"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { LoginView } from "@bitwarden/common/vault/models/view/login.view"; import { AsyncActionsModule, ButtonModule, ToastService } from "@bitwarden/components"; diff --git a/libs/vault/src/cipher-form/components/item-details/item-details-section.component.spec.ts b/libs/vault/src/cipher-form/components/item-details/item-details-section.component.spec.ts index d7678aa596..fe1710ccad 100644 --- a/libs/vault/src/cipher-form/components/item-details/item-details-section.component.spec.ts +++ b/libs/vault/src/cipher-form/components/item-details/item-details-section.component.spec.ts @@ -3,11 +3,11 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from "@angular/core/testin import { ReactiveFormsModule } from "@angular/forms"; import { mock, MockProxy } from "jest-mock-extended"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { CipherFormConfig } from "../../abstractions/cipher-form-config.service"; import { CipherFormContainer } from "../../cipher-form-container"; diff --git a/libs/vault/src/cipher-form/components/item-details/item-details-section.component.ts b/libs/vault/src/cipher-form/components/item-details/item-details-section.component.ts index b0716218b5..06ce363a27 100644 --- a/libs/vault/src/cipher-form/components/item-details/item-details-section.component.ts +++ b/libs/vault/src/cipher-form/components/item-details/item-details-section.component.ts @@ -4,12 +4,12 @@ import { takeUntilDestroyed } from "@angular/core/rxjs-interop"; import { FormBuilder, FormControl, ReactiveFormsModule, Validators } from "@angular/forms"; import { concatMap, map } from "rxjs"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CollectionId, OrganizationId } from "@bitwarden/common/types/guid"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { CardComponent, FormFieldModule, diff --git a/libs/vault/src/cipher-form/services/default-cipher-form-config.service.ts b/libs/vault/src/cipher-form/services/default-cipher-form-config.service.ts index 977cee8156..6b607e3048 100644 --- a/libs/vault/src/cipher-form/services/default-cipher-form-config.service.ts +++ b/libs/vault/src/cipher-form/services/default-cipher-form-config.service.ts @@ -1,12 +1,12 @@ import { inject, Injectable } from "@angular/core"; import { combineLatest, filter, firstValueFrom, map, switchMap } from "rxjs"; +import { CollectionService } from "@bitwarden/admin-console/common"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { OrganizationUserStatusType, PolicyType } from "@bitwarden/common/admin-console/enums"; import { CipherId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherType } from "@bitwarden/common/vault/enums"; import { Cipher } from "@bitwarden/common/vault/models/domain/cipher"; diff --git a/libs/vault/src/cipher-view/cipher-view.component.ts b/libs/vault/src/cipher-view/cipher-view.component.ts index c73ad14940..324b2358a8 100644 --- a/libs/vault/src/cipher-view/cipher-view.component.ts +++ b/libs/vault/src/cipher-view/cipher-view.component.ts @@ -2,15 +2,14 @@ import { CommonModule } from "@angular/common"; import { Component, Input, OnChanges, OnDestroy } from "@angular/core"; import { firstValueFrom, Observable, Subject, takeUntil } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { isCardExpired } from "@bitwarden/common/autofill/utils"; import { CollectionId } from "@bitwarden/common/types/guid"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { FolderService } from "@bitwarden/common/vault/abstractions/folder/folder.service.abstraction"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { CalloutModule, SearchModule } from "@bitwarden/components"; diff --git a/libs/vault/src/cipher-view/item-details/item-details-v2.component.ts b/libs/vault/src/cipher-view/item-details/item-details-v2.component.ts index 30e8ad1ecd..48c129bd3b 100644 --- a/libs/vault/src/cipher-view/item-details/item-details-v2.component.ts +++ b/libs/vault/src/cipher-view/item-details/item-details-v2.component.ts @@ -1,10 +1,10 @@ import { CommonModule } from "@angular/common"; import { Component, Input } from "@angular/core"; +import { CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { Organization } from "@bitwarden/common/admin-console/models/domain/organization"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { FolderView } from "@bitwarden/common/vault/models/view/folder.view"; import { CardComponent, diff --git a/libs/vault/src/components/assign-collections.component.ts b/libs/vault/src/components/assign-collections.component.ts index 884a79bf1d..fed1dde28e 100644 --- a/libs/vault/src/components/assign-collections.component.ts +++ b/libs/vault/src/components/assign-collections.component.ts @@ -22,6 +22,7 @@ import { tap, } from "rxjs"; +import { CollectionService, CollectionView } from "@bitwarden/admin-console/common"; import { JslibModule } from "@bitwarden/angular/jslib.module"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; import { OrganizationUserStatusType } from "@bitwarden/common/admin-console/enums"; @@ -30,9 +31,7 @@ import { AccountService } from "@bitwarden/common/auth/abstractions/account.serv import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { CipherId, CollectionId, OrganizationId, UserId } from "@bitwarden/common/types/guid"; import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; -import { CollectionService } from "@bitwarden/common/vault/abstractions/collection.service"; import { CipherView } from "@bitwarden/common/vault/models/view/cipher.view"; -import { CollectionView } from "@bitwarden/common/vault/models/view/collection.view"; import { AsyncActionsModule, BitSubmitDirective, diff --git a/package-lock.json b/package-lock.json index 791976f907..279246061b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -255,6 +255,7 @@ "version": "0.0.0", "license": "GPL-3.0" }, + "libs/admin-console/src/common": {}, "libs/angular": { "name": "@bitwarden/angular", "version": "0.0.0", @@ -289,6 +290,7 @@ "version": "0.0.0", "license": "GPL-3.0", "dependencies": { + "@bitwarden/admin-console-common": "file:../admin-console/src/common", "@bitwarden/common": "file:../common", "@bitwarden/vault-export-core": "file:../tools/export/vault-export/vault-export-core" } @@ -321,6 +323,7 @@ "version": "0.0.0", "license": "GPL-3.0", "dependencies": { + "@bitwarden/admin-console-common": "file:../../../../admin-console/src/common", "@bitwarden/common": "file:../../../../common" } }, @@ -4574,6 +4577,10 @@ "resolved": "libs/admin-console", "link": true }, + "node_modules/@bitwarden/admin-console-common": { + "resolved": "libs/admin-console/src/common", + "link": true + }, "node_modules/@bitwarden/angular": { "resolved": "libs/angular", "link": true