diff --git a/apps/cli/src/tools/import.command.ts b/apps/cli/src/tools/import.command.ts index 3ee4ddae986..0080197aa74 100644 --- a/apps/cli/src/tools/import.command.ts +++ b/apps/cli/src/tools/import.command.ts @@ -2,6 +2,7 @@ import * as program from "commander"; import * as inquirer from "inquirer"; import { OrganizationService } from "@bitwarden/common/admin-console/abstractions/organization/organization.service.abstraction"; +import { SyncService } from "@bitwarden/common/vault/abstractions/sync/sync.service.abstraction"; import { ImportServiceAbstraction, ImportType } from "@bitwarden/importer"; import { Response } from "../models/response"; @@ -11,7 +12,8 @@ import { CliUtils } from "../utils"; export class ImportCommand { constructor( private importService: ImportServiceAbstraction, - private organizationService: OrganizationService + private organizationService: OrganizationService, + private syncService: SyncService ) {} async run( @@ -76,6 +78,7 @@ export class ImportCommand { const response = await this.importService.import(importer, contents, organizationId); if (response.success) { + this.syncService.fullSync(true); return Response.success(new MessageResponse("Imported " + filepath, null)); } } catch (err) { diff --git a/apps/cli/src/vault.program.ts b/apps/cli/src/vault.program.ts index 767893d5eee..85f413a9feb 100644 --- a/apps/cli/src/vault.program.ts +++ b/apps/cli/src/vault.program.ts @@ -442,7 +442,11 @@ export class VaultProgram extends Program { }) .action(async (format, filepath, options) => { await this.exitIfLocked(); - const command = new ImportCommand(this.main.importService, this.main.organizationService); + const command = new ImportCommand( + this.main.importService, + this.main.organizationService, + this.main.syncService + ); const response = await command.run(format, filepath, options); this.processResponse(response); });