From 6916d68f3728c095df635dd7a0de32152b345808 Mon Sep 17 00:00:00 2001 From: Vincent Salucci Date: Fri, 3 Apr 2020 09:47:45 -0500 Subject: [PATCH] Update jslib 31a2574 -> 28e3fff, update vault timeout service deps --- jslib | 2 +- package.json | 2 +- src/bw.ts | 8 ++++---- src/commands/lock.command.ts | 6 +++--- src/program.ts | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/jslib b/jslib index 31a257407b..28e3fff739 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 31a257407be7f8f47624b0d021363aaf2cfda2d7 +Subproject commit 28e3fff739e64c2dd80d3d98717e2921895d16df diff --git a/package.json b/package.json index 6eae9dfa06..5c1d12dccd 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "scripts": { "sub:init": "git submodule update --init --recursive", "sub:update": "git submodule update --remote", - "sub:pull": "git submodule foreach git pull", + "sub:pull": "git submodule foreach git pull origin master", "clean": "rimraf dist/**/*", "symlink:win": "rmdir /S /Q ./jslib && cmd /c mklink /J .\\jslib ..\\jslib", "symlink:mac": "npm run symlink:lin", diff --git a/src/bw.ts b/src/bw.ts index 2d2a9161dd..b3340481e3 100644 --- a/src/bw.ts +++ b/src/bw.ts @@ -20,7 +20,6 @@ import { EnvironmentService } from 'jslib/services/environment.service'; import { ExportService } from 'jslib/services/export.service'; import { FolderService } from 'jslib/services/folder.service'; import { ImportService } from 'jslib/services/import.service'; -import { LockService } from 'jslib/services/lock.service'; import { LowdbStorageService } from 'jslib/services/lowdbStorage.service'; import { NodeApiService } from 'jslib/services/nodeApi.service'; import { NodeCryptoFunctionService } from 'jslib/services/nodeCryptoFunction.service'; @@ -33,6 +32,7 @@ import { SyncService } from 'jslib/services/sync.service'; import { TokenService } from 'jslib/services/token.service'; import { TotpService } from 'jslib/services/totp.service'; import { UserService } from 'jslib/services/user.service'; +import { VaultTimeoutService } from 'jslib/services/vaultTimeout.service'; import { Program } from './program'; @@ -59,7 +59,7 @@ export class Main { cipherService: CipherService; folderService: FolderService; collectionService: CollectionService; - lockService: LockService; + vaultTimeoutService: VaultTimeoutService; syncService: SyncService; passwordGenerationService: PasswordGenerationService; totpService: TotpService; @@ -116,9 +116,9 @@ export class Main { this.i18nService); this.searchService = new SearchService(this.cipherService, this.platformUtilsService); this.policyService = new PolicyService(this.userService, this.storageService); - this.lockService = new LockService(this.cipherService, this.folderService, this.collectionService, + this.vaultTimeoutService = new VaultTimeoutService(this.cipherService, this.folderService, this.collectionService, this.cryptoService, this.platformUtilsService, this.storageService, this.messagingService, - this.searchService, this.userService, null); + this.searchService, this.userService, null, null); this.syncService = new SyncService(this.userService, this.apiService, this.settingsService, this.folderService, this.cipherService, this.cryptoService, this.collectionService, this.storageService, this.messagingService, this.policyService, diff --git a/src/commands/lock.command.ts b/src/commands/lock.command.ts index dbb2ac6e76..4722c48a6b 100644 --- a/src/commands/lock.command.ts +++ b/src/commands/lock.command.ts @@ -1,15 +1,15 @@ import * as program from 'commander'; -import { LockService } from 'jslib/abstractions/lock.service'; +import { VaultTimeoutService } from 'jslib/abstractions/vaultTimeout.service'; import { Response } from 'jslib/cli/models/response'; import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; export class LockCommand { - constructor(private lockService: LockService) { } + constructor(private vaultTimeoutService: VaultTimeoutService) { } async run(cmd: program.Command) { - await this.lockService.lock(); + await this.vaultTimeoutService.lock(); process.env.BW_SESSION = null; const res = new MessageResponse('Your vault is locked.', null); return Response.success(res); diff --git a/src/program.ts b/src/program.ts index 9f870809e3..7f81cbb4e1 100644 --- a/src/program.ts +++ b/src/program.ts @@ -163,7 +163,7 @@ export class Program extends BaseProgram { }) .action(async (cmd) => { await this.exitIfNotAuthed(); - const command = new LockCommand(this.main.lockService); + const command = new LockCommand(this.main.vaultTimeoutService); const response = await command.run(cmd); this.processResponse(response); }); @@ -186,7 +186,7 @@ export class Program extends BaseProgram { writeLn('', true); }) .option('--check', 'Check lock status.', async () => { - const locked = await this.main.lockService.isLocked(); + const locked = await this.main.vaultTimeoutService.isLocked(); if (!locked) { const res = new MessageResponse('Vault is unlocked!', null); this.processResponse(Response.success(res), true);