2018-05-16 16:25:25 +02:00
|
|
|
import * as program from 'commander';
|
|
|
|
|
|
|
|
import { LockService } from 'jslib/abstractions/lock.service';
|
|
|
|
|
2019-03-16 03:34:59 +01:00
|
|
|
import { Response } from 'jslib/cli/models/response';
|
|
|
|
import { MessageResponse } from 'jslib/cli/models/response/messageResponse';
|
2018-05-16 16:25:25 +02:00
|
|
|
|
|
|
|
export class LockCommand {
|
|
|
|
constructor(private lockService: LockService) { }
|
|
|
|
|
|
|
|
async run(cmd: program.Command) {
|
|
|
|
await this.lockService.lock();
|
|
|
|
process.env.BW_SESSION = null;
|
|
|
|
const res = new MessageResponse('Your vault is locked.', null);
|
|
|
|
return Response.success(res);
|
|
|
|
}
|
|
|
|
}
|