1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-30 15:13:52 +00:00
Files
directory-connector/src/commands/clearCache.command.ts

22 lines
761 B
TypeScript

import * as program from "commander";
import { I18nService } from "@/jslib/common/src/abstractions/i18n.service";
import { Response } from "@/jslib/node/src/cli/models/response";
import { MessageResponse } from "@/jslib/node/src/cli/models/response/messageResponse";
import { StateService } from "../abstractions/state.service";
export class ClearCacheCommand {
constructor(private i18nService: I18nService, private stateService: StateService) {}
async run(cmd: program.OptionValues): Promise<Response> {
try {
await this.stateService.clearSyncSettings(true);
const res = new MessageResponse(this.i18nService.t("syncCacheCleared"), null);
return Response.success(res);
} catch (e) {
return Response.error(e);
}
}
}