mirror of
https://github.com/bitwarden/browser
synced 2025-12-10 05:13:29 +00:00
Merge pull request #177 from bitwarden/jslib-update-fix-lowdb-storage-constructor
Add log service and pass to lowdb storage
This commit is contained in:
2
jslib
2
jslib
Submodule jslib updated: d84d6da7f7...4cd20f0fa8
@@ -2,12 +2,15 @@ import * as fs from 'fs';
|
|||||||
import * as jsdom from 'jsdom';
|
import * as jsdom from 'jsdom';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
|
|
||||||
|
import { LogLevelType } from 'jslib/enums/logLevelType';
|
||||||
|
|
||||||
import { AuthService } from 'jslib/services/auth.service';
|
import { AuthService } from 'jslib/services/auth.service';
|
||||||
|
|
||||||
import { I18nService } from './services/i18n.service';
|
import { I18nService } from './services/i18n.service';
|
||||||
import { NodeEnvSecureStorageService } from './services/nodeEnvSecureStorage.service';
|
import { NodeEnvSecureStorageService } from './services/nodeEnvSecureStorage.service';
|
||||||
|
|
||||||
import { CliPlatformUtilsService } from 'jslib/cli/services/cliPlatformUtils.service';
|
import { CliPlatformUtilsService } from 'jslib/cli/services/cliPlatformUtils.service';
|
||||||
|
import { ConsoleLogService } from 'jslib/cli/services/consoleLog.service';
|
||||||
|
|
||||||
import { AppIdService } from 'jslib/services/appId.service';
|
import { AppIdService } from 'jslib/services/appId.service';
|
||||||
import { AuditService } from 'jslib/services/audit.service';
|
import { AuditService } from 'jslib/services/audit.service';
|
||||||
@@ -72,6 +75,7 @@ export class Main {
|
|||||||
authService: AuthService;
|
authService: AuthService;
|
||||||
policyService: PolicyService;
|
policyService: PolicyService;
|
||||||
program: Program;
|
program: Program;
|
||||||
|
logService: ConsoleLogService;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
let p = null;
|
let p = null;
|
||||||
@@ -92,8 +96,10 @@ export class Main {
|
|||||||
|
|
||||||
this.i18nService = new I18nService('en', './locales');
|
this.i18nService = new I18nService('en', './locales');
|
||||||
this.platformUtilsService = new CliPlatformUtilsService('cli', packageJson);
|
this.platformUtilsService = new CliPlatformUtilsService('cli', packageJson);
|
||||||
|
this.logService = new ConsoleLogService(this.platformUtilsService.isDev(),
|
||||||
|
(level) => process.env.BITWARDENCLI_DEBUG !== 'true' && level <= LogLevelType.Info);
|
||||||
this.cryptoFunctionService = new NodeCryptoFunctionService();
|
this.cryptoFunctionService = new NodeCryptoFunctionService();
|
||||||
this.storageService = new LowdbStorageService(null, p, true);
|
this.storageService = new LowdbStorageService(this.logService, null, p, true);
|
||||||
this.secureStorageService = new NodeEnvSecureStorageService(this.storageService, () => this.cryptoService);
|
this.secureStorageService = new NodeEnvSecureStorageService(this.storageService, () => this.cryptoService);
|
||||||
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService,
|
this.cryptoService = new CryptoService(this.storageService, this.secureStorageService,
|
||||||
this.cryptoFunctionService);
|
this.cryptoFunctionService);
|
||||||
|
|||||||
Reference in New Issue
Block a user