1
0
mirror of https://github.com/bitwarden/directory-connector synced 2025-12-05 23:53:21 +00:00
Files
directory-connector/src/commands/clearCache.command.ts
Oscar Hinton 6097bca063 Add jslib as a "real" dependency (#127)
* Split jslib

* Change hook to preinstall

* Install gyp (ci)

* Fix rebuild command

* Review comments

* Add tsconfig-paths-plugin to webpack.cli.

* Bump jslib

* Install old version of prebuild-install to bypass bug in pkg
2021-06-09 21:46:38 +02:00

23 lines
827 B
TypeScript

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