From ac7d80980dfcaeb1f34758dae933378eb605a3d1 Mon Sep 17 00:00:00 2001 From: Jonathan Prusik Date: Fri, 15 Mar 2024 10:11:16 -0400 Subject: [PATCH] remove unused services (#8334) --- apps/browser/src/background/main.background.ts | 2 -- apps/browser/src/background/nativeMessaging.background.ts | 2 -- apps/browser/src/popup/settings/excluded-domains.component.ts | 2 -- apps/browser/src/popup/settings/options.component.ts | 2 -- apps/browser/src/popup/settings/settings.component.ts | 2 -- .../components/fido2/fido2-use-browser-link.component.ts | 2 -- apps/desktop/src/app/services/services.module.ts | 1 - apps/desktop/src/services/native-message-handler.service.ts | 2 -- apps/desktop/src/services/native-messaging.service.ts | 2 -- .../organizations/reporting/reports-home.component.ts | 2 -- apps/web/src/app/auth/login/login.component.ts | 2 -- apps/web/src/app/auth/settings/change-password.component.ts | 2 -- apps/web/src/app/settings/preferences.component.ts | 2 -- apps/web/src/app/settings/settings.component.ts | 2 -- apps/web/src/app/vault/individual-vault/vault.component.ts | 2 -- .../src/vault/services/fido2/fido2-client.service.spec.ts | 4 ---- libs/common/src/vault/services/fido2/fido2-client.service.ts | 2 -- 17 files changed, 35 deletions(-) diff --git a/apps/browser/src/background/main.background.ts b/apps/browser/src/background/main.background.ts index e0dd4e5791..34a5f9e1fd 100644 --- a/apps/browser/src/background/main.background.ts +++ b/apps/browser/src/background/main.background.ts @@ -791,7 +791,6 @@ export default class MainBackground { this.fido2AuthenticatorService, this.configService, this.authService, - this.stateService, this.vaultSettingsService, this.domainSettingsService, this.logService, @@ -839,7 +838,6 @@ export default class MainBackground { this.cryptoService, this.cryptoFunctionService, this.runtimeBackground, - this.i18nService, this.messagingService, this.appIdService, this.platformUtilsService, diff --git a/apps/browser/src/background/nativeMessaging.background.ts b/apps/browser/src/background/nativeMessaging.background.ts index 620f9735c8..240fb1dede 100644 --- a/apps/browser/src/background/nativeMessaging.background.ts +++ b/apps/browser/src/background/nativeMessaging.background.ts @@ -5,7 +5,6 @@ import { AuthenticationStatus } from "@bitwarden/common/auth/enums/authenticatio import { AppIdService } from "@bitwarden/common/platform/abstractions/app-id.service"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; @@ -75,7 +74,6 @@ export class NativeMessagingBackground { private cryptoService: CryptoService, private cryptoFunctionService: CryptoFunctionService, private runtimeBackground: RuntimeBackground, - private i18nService: I18nService, private messagingService: MessagingService, private appIdService: AppIdService, private platformUtilsService: PlatformUtilsService, diff --git a/apps/browser/src/popup/settings/excluded-domains.component.ts b/apps/browser/src/popup/settings/excluded-domains.component.ts index 6fa28d10ab..1741fbaa65 100644 --- a/apps/browser/src/popup/settings/excluded-domains.component.ts +++ b/apps/browser/src/popup/settings/excluded-domains.component.ts @@ -6,7 +6,6 @@ import { DomainSettingsService } from "@bitwarden/common/autofill/services/domai import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { BrowserApi } from "../../platform/browser/browser-api"; @@ -31,7 +30,6 @@ export class ExcludedDomainsComponent implements OnInit, OnDestroy { accountSwitcherEnabled = false; constructor( - private stateService: StateService, private domainSettingsService: DomainSettingsService, private i18nService: I18nService, private router: Router, diff --git a/apps/browser/src/popup/settings/options.component.ts b/apps/browser/src/popup/settings/options.component.ts index a4260b688f..2142693e2a 100644 --- a/apps/browser/src/popup/settings/options.component.ts +++ b/apps/browser/src/popup/settings/options.component.ts @@ -13,7 +13,6 @@ import { } from "@bitwarden/common/models/domain/domain-service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { ThemeType } from "@bitwarden/common/platform/enums"; import { ThemeStateService } from "@bitwarden/common/platform/theming/theme-state.service"; import { VaultSettingsService } from "@bitwarden/common/vault/abstractions/vault-settings/vault-settings.service"; @@ -51,7 +50,6 @@ export class OptionsComponent implements OnInit { constructor( private messagingService: MessagingService, - private stateService: StateService, private userNotificationSettingsService: UserNotificationSettingsServiceAbstraction, private autofillSettingsService: AutofillSettingsServiceAbstraction, private domainSettingsService: DomainSettingsService, diff --git a/apps/browser/src/popup/settings/settings.component.ts b/apps/browser/src/popup/settings/settings.component.ts index 2fcd258885..05f633d424 100644 --- a/apps/browser/src/popup/settings/settings.component.ts +++ b/apps/browser/src/popup/settings/settings.component.ts @@ -16,7 +16,6 @@ import { takeUntil, } from "rxjs"; -import { ModalService } from "@bitwarden/angular/services/modal.service"; import { FingerprintDialogComponent } from "@bitwarden/auth/angular"; import { VaultTimeoutSettingsService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout-settings.service"; import { VaultTimeoutService } from "@bitwarden/common/abstractions/vault-timeout/vault-timeout.service"; @@ -98,7 +97,6 @@ export class SettingsComponent implements OnInit { private environmentService: EnvironmentService, private cryptoService: CryptoService, private stateService: StateService, - private modalService: ModalService, private userVerificationService: UserVerificationService, private dialogService: DialogService, private changeDetectorRef: ChangeDetectorRef, diff --git a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts index 9ea0914d87..7dd0c50003 100644 --- a/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts +++ b/apps/browser/src/vault/popup/components/fido2/fido2-use-browser-link.component.ts @@ -6,7 +6,6 @@ import { firstValueFrom } from "rxjs"; import { DomainSettingsService } from "@bitwarden/common/autofill/services/domain-settings.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { BrowserFido2UserInterfaceSession } from "../../../fido2/browser-fido2-user-interface.service"; @@ -52,7 +51,6 @@ export class Fido2UseBrowserLinkComponent { protected fido2PopoutSessionData$ = fido2PopoutSessionData$(); constructor( - private stateService: StateService, private domainSettingsService: DomainSettingsService, private platformUtilsService: PlatformUtilsService, private i18nService: I18nService, diff --git a/apps/desktop/src/app/services/services.module.ts b/apps/desktop/src/app/services/services.module.ts index 38a44401ee..2b103b8d71 100644 --- a/apps/desktop/src/app/services/services.module.ts +++ b/apps/desktop/src/app/services/services.module.ts @@ -170,7 +170,6 @@ const RELOAD_CALLBACK = new InjectionToken<() => any>("RELOAD_CALLBACK"); CryptoServiceAbstraction, CryptoFunctionServiceAbstraction, MessagingServiceAbstraction, - I18nServiceAbstraction, EncryptedMessageHandlerService, DialogService, ], diff --git a/apps/desktop/src/services/native-message-handler.service.ts b/apps/desktop/src/services/native-message-handler.service.ts index 7d916af0ac..c90271d25c 100644 --- a/apps/desktop/src/services/native-message-handler.service.ts +++ b/apps/desktop/src/services/native-message-handler.service.ts @@ -4,7 +4,6 @@ import { firstValueFrom } from "rxjs"; import { NativeMessagingVersion } from "@bitwarden/common/enums"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { EncryptedString, EncString } from "@bitwarden/common/platform/models/domain/enc-string"; @@ -33,7 +32,6 @@ export class NativeMessageHandlerService { private cryptoService: CryptoService, private cryptoFunctionService: CryptoFunctionService, private messagingService: MessagingService, - private i18nService: I18nService, private encryptedMessageHandlerService: EncryptedMessageHandlerService, private dialogService: DialogService, ) {} diff --git a/apps/desktop/src/services/native-messaging.service.ts b/apps/desktop/src/services/native-messaging.service.ts index 453b100815..148e4f1e89 100644 --- a/apps/desktop/src/services/native-messaging.service.ts +++ b/apps/desktop/src/services/native-messaging.service.ts @@ -3,7 +3,6 @@ import { firstValueFrom } from "rxjs"; import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/crypto-function.service"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; -import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; @@ -35,7 +34,6 @@ export class NativeMessagingService { private cryptoService: CryptoService, private platformUtilService: PlatformUtilsService, private logService: LogService, - private i18nService: I18nService, private messagingService: MessagingService, private stateService: StateService, private biometricStateService: BiometricStateService, diff --git a/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts b/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts index 51f34481d3..4e4bea2e0c 100644 --- a/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts +++ b/apps/web/src/app/admin-console/organizations/reporting/reports-home.component.ts @@ -3,7 +3,6 @@ import { ActivatedRoute, NavigationEnd, Router } from "@angular/router"; import { filter, map, Observable, startWith } from "rxjs"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { ReportVariant, reports, ReportType, ReportEntry } from "../../../tools/reports"; @@ -17,7 +16,6 @@ export class ReportsHomeComponent implements OnInit { constructor( private route: ActivatedRoute, - private stateService: StateService, private organizationService: OrganizationService, private router: Router, ) {} diff --git a/apps/web/src/app/auth/login/login.component.ts b/apps/web/src/app/auth/login/login.component.ts index 4440575cd6..9075c3ab28 100644 --- a/apps/web/src/app/auth/login/login.component.ts +++ b/apps/web/src/app/auth/login/login.component.ts @@ -24,7 +24,6 @@ import { CryptoFunctionService } from "@bitwarden/common/platform/abstractions/c import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; -import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; import { PasswordGenerationServiceAbstraction } from "@bitwarden/common/tools/generator/password"; import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength"; @@ -60,7 +59,6 @@ export class LoginComponent extends BaseLoginComponent implements OnInit { logService: LogService, ngZone: NgZone, protected stateService: StateService, - private messagingService: MessagingService, private routerService: RouterService, formBuilder: FormBuilder, formValidationErrorService: FormValidationErrorsService, diff --git a/apps/web/src/app/auth/settings/change-password.component.ts b/apps/web/src/app/auth/settings/change-password.component.ts index c747bbc4f7..6d16893170 100644 --- a/apps/web/src/app/auth/settings/change-password.component.ts +++ b/apps/web/src/app/auth/settings/change-password.component.ts @@ -7,7 +7,6 @@ import { AuditService } from "@bitwarden/common/abstractions/audit.service"; import { PolicyService } from "@bitwarden/common/admin-console/abstractions/policy/policy.service.abstraction"; import { UserVerificationService } from "@bitwarden/common/auth/abstractions/user-verification/user-verification.service.abstraction"; import { PasswordRequest } from "@bitwarden/common/auth/models/request/password.request"; -import { ConfigServiceAbstraction } from "@bitwarden/common/platform/abstractions/config/config.service.abstraction"; import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; @@ -48,7 +47,6 @@ export class ChangePasswordComponent extends BaseChangePasswordComponent { private router: Router, dialogService: DialogService, private userVerificationService: UserVerificationService, - private configService: ConfigServiceAbstraction, private keyRotationService: UserKeyRotationService, ) { super( diff --git a/apps/web/src/app/settings/preferences.component.ts b/apps/web/src/app/settings/preferences.component.ts index fd759cd036..aa2bc22bea 100644 --- a/apps/web/src/app/settings/preferences.component.ts +++ b/apps/web/src/app/settings/preferences.component.ts @@ -10,7 +10,6 @@ import { VaultTimeoutAction } from "@bitwarden/common/enums/vault-timeout-action import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; -import { StateService } from "@bitwarden/common/platform/abstractions/state.service"; import { ThemeType } from "@bitwarden/common/platform/enums"; import { Utils } from "@bitwarden/common/platform/misc/utils"; import { ThemeStateService } from "@bitwarden/common/platform/theming/theme-state.service"; @@ -48,7 +47,6 @@ export class PreferencesComponent implements OnInit { constructor( private formBuilder: FormBuilder, private policyService: PolicyService, - private stateService: StateService, private i18nService: I18nService, private vaultTimeoutSettingsService: VaultTimeoutSettingsService, private platformUtilsService: PlatformUtilsService, diff --git a/apps/web/src/app/settings/settings.component.ts b/apps/web/src/app/settings/settings.component.ts index c2fd1c77fa..918973b86c 100644 --- a/apps/web/src/app/settings/settings.component.ts +++ b/apps/web/src/app/settings/settings.component.ts @@ -2,7 +2,6 @@ import { Component, NgZone, OnDestroy, OnInit } from "@angular/core"; import { ApiService } from "@bitwarden/common/abstractions/api.service"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; -import { TokenService } from "@bitwarden/common/auth/abstractions/token.service"; import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service"; @@ -21,7 +20,6 @@ export class SettingsComponent implements OnInit, OnDestroy { hideSubscription: boolean; constructor( - private tokenService: TokenService, private broadcasterService: BroadcasterService, private ngZone: NgZone, private platformUtilsService: PlatformUtilsService, 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 7894677b69..a501c7a494 100644 --- a/apps/web/src/app/vault/individual-vault/vault.component.ts +++ b/apps/web/src/app/vault/individual-vault/vault.component.ts @@ -41,7 +41,6 @@ import { EventType } from "@bitwarden/common/enums"; import { FeatureFlag } from "@bitwarden/common/enums/feature-flag.enum"; import { BroadcasterService } from "@bitwarden/common/platform/abstractions/broadcaster.service"; import { ConfigServiceAbstraction } from "@bitwarden/common/platform/abstractions/config/config.service.abstraction"; -import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service"; import { I18nService } from "@bitwarden/common/platform/abstractions/i18n.service"; import { LogService } from "@bitwarden/common/platform/abstractions/log.service"; import { MessagingService } from "@bitwarden/common/platform/abstractions/messaging.service"; @@ -163,7 +162,6 @@ export class VaultComponent implements OnInit, OnDestroy { private modalService: ModalService, private dialogService: DialogService, private tokenService: TokenService, - private cryptoService: CryptoService, private messagingService: MessagingService, private platformUtilsService: PlatformUtilsService, private broadcasterService: BroadcasterService, diff --git a/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts b/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts index dd90c53cb1..2f76c5043a 100644 --- a/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts +++ b/libs/common/src/vault/services/fido2/fido2-client.service.spec.ts @@ -5,7 +5,6 @@ import { AuthService } from "../../../auth/abstractions/auth.service"; import { AuthenticationStatus } from "../../../auth/enums/authentication-status"; import { DomainSettingsService } from "../../../autofill/services/domain-settings.service"; import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction"; -import { StateService } from "../../../platform/abstractions/state.service"; import { Utils } from "../../../platform/misc/utils"; import { Fido2AuthenticatorError, @@ -33,7 +32,6 @@ describe("FidoAuthenticatorService", () => { let authenticator!: MockProxy; let configService!: MockProxy; let authService!: MockProxy; - let stateService!: MockProxy; let vaultSettingsService: MockProxy; let domainSettingsService: MockProxy; let client!: Fido2ClientService; @@ -43,7 +41,6 @@ describe("FidoAuthenticatorService", () => { authenticator = mock(); configService = mock(); authService = mock(); - stateService = mock(); vaultSettingsService = mock(); domainSettingsService = mock(); @@ -51,7 +48,6 @@ describe("FidoAuthenticatorService", () => { authenticator, configService, authService, - stateService, vaultSettingsService, domainSettingsService, ); diff --git a/libs/common/src/vault/services/fido2/fido2-client.service.ts b/libs/common/src/vault/services/fido2/fido2-client.service.ts index 257700453e..c725b22637 100644 --- a/libs/common/src/vault/services/fido2/fido2-client.service.ts +++ b/libs/common/src/vault/services/fido2/fido2-client.service.ts @@ -6,7 +6,6 @@ import { AuthenticationStatus } from "../../../auth/enums/authentication-status" import { DomainSettingsService } from "../../../autofill/services/domain-settings.service"; import { ConfigServiceAbstraction } from "../../../platform/abstractions/config/config.service.abstraction"; import { LogService } from "../../../platform/abstractions/log.service"; -import { StateService } from "../../../platform/abstractions/state.service"; import { Utils } from "../../../platform/misc/utils"; import { Fido2AuthenticatorError, @@ -43,7 +42,6 @@ export class Fido2ClientService implements Fido2ClientServiceAbstraction { private authenticator: Fido2AuthenticatorService, private configService: ConfigServiceAbstraction, private authService: AuthService, - private stateService: StateService, private vaultSettingsService: VaultSettingsService, private domainSettingsService: DomainSettingsService, private logService?: LogService,