diff --git a/jslib b/jslib index 49e06e77c4..13a160fb79 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 49e06e77c4913867fc468f7d9e0b2b1529c1d181 +Subproject commit 13a160fb795a69bad1edbb3fc5fd5c7c15396e03 diff --git a/src/bw.ts b/src/bw.ts index cd301fb632..c01f41a647 100644 --- a/src/bw.ts +++ b/src/bw.ts @@ -5,8 +5,8 @@ import { AuthService } from 'jslib/services/auth.service'; import { I18nService } from './services/i18n.service'; import { NodeEnvSecureStorageService } from './services/nodeEnvSecureStorage.service'; -import { NodePlatformUtilsService } from './services/nodePlatformUtils.service'; -import { NoopMessagingService } from './services/noopMessaging.service'; + +import { CliPlatformUtilsService } from 'jslib/cli/services/cliPlatformUtils.service'; import { AppIdService } from 'jslib/services/appId.service'; import { AuditService } from 'jslib/services/audit.service'; @@ -23,6 +23,7 @@ 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'; +import { NoopMessagingService } from 'jslib/services/noopMessaging.service'; import { PasswordGenerationService } from 'jslib/services/passwordGeneration.service'; import { SearchService } from 'jslib/services/search.service'; import { SettingsService } from 'jslib/services/settings.service'; @@ -36,12 +37,15 @@ import { Program } from './program'; // Polyfills (global as any).DOMParser = new jsdom.JSDOM().window.DOMParser; +// tslint:disable-next-line +const packageJson = require('../package.json'); + export class Main { messagingService: NoopMessagingService; storageService: LowdbStorageService; secureStorageService: NodeEnvSecureStorageService; i18nService: I18nService; - platformUtilsService: NodePlatformUtilsService; + platformUtilsService: CliPlatformUtilsService; constantsService: ConstantsService; cryptoService: CryptoService; tokenService: TokenService; @@ -81,7 +85,7 @@ export class Main { } this.i18nService = new I18nService('en', './locales'); - this.platformUtilsService = new NodePlatformUtilsService(); + this.platformUtilsService = new CliPlatformUtilsService('cli', packageJson); this.cryptoFunctionService = new NodeCryptoFunctionService(); this.storageService = new LowdbStorageService(null, p, true); this.secureStorageService = new NodeEnvSecureStorageService(this.storageService, () => this.cryptoService); diff --git a/src/commands/config.command.ts b/src/commands/config.command.ts index 02585f99ab..28ca591658 100644 --- a/src/commands/config.command.ts +++ b/src/commands/config.command.ts @@ -2,8 +2,8 @@ import * as program from 'commander'; import { EnvironmentService } from 'jslib/abstractions/environment.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; export class ConfigCommand { constructor(private environmentService: EnvironmentService) { } diff --git a/src/commands/create.command.ts b/src/commands/create.command.ts index e7bbbeab57..8f2ee8667a 100644 --- a/src/commands/create.command.ts +++ b/src/commands/create.command.ts @@ -10,7 +10,8 @@ import { UserService } from 'jslib/abstractions/user.service'; import { Cipher } from 'jslib/models/export/cipher'; import { Folder } from 'jslib/models/export/folder'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; + import { CipherResponse } from '../models/response/cipherResponse'; import { FolderResponse } from '../models/response/folderResponse'; diff --git a/src/commands/delete.command.ts b/src/commands/delete.command.ts index 73f2e31868..3e891c67fe 100644 --- a/src/commands/delete.command.ts +++ b/src/commands/delete.command.ts @@ -4,7 +4,7 @@ import { CipherService } from 'jslib/abstractions/cipher.service'; import { FolderService } from 'jslib/abstractions/folder.service'; import { UserService } from 'jslib/abstractions/user.service'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; export class DeleteCommand { constructor(private cipherService: CipherService, private folderService: FolderService, diff --git a/src/commands/edit.command.ts b/src/commands/edit.command.ts index 1330ccf99c..571e0af0a3 100644 --- a/src/commands/edit.command.ts +++ b/src/commands/edit.command.ts @@ -6,7 +6,8 @@ import { FolderService } from 'jslib/services/folder.service'; import { Cipher } from 'jslib/models/export/cipher'; import { Folder } from 'jslib/models/export/folder'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; + import { CipherResponse } from '../models/response/cipherResponse'; import { FolderResponse } from '../models/response/folderResponse'; diff --git a/src/commands/encode.command.ts b/src/commands/encode.command.ts index 3e310ca031..bf70cd8e36 100644 --- a/src/commands/encode.command.ts +++ b/src/commands/encode.command.ts @@ -1,7 +1,7 @@ import * as program from 'commander'; -import { Response } from '../models/response'; -import { StringResponse } from '../models/response/stringResponse'; +import { Response } from 'jslib/cli/models/response'; +import { StringResponse } from 'jslib/cli/models/response/stringResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/export.command.ts b/src/commands/export.command.ts index 37a02a6f9a..950cd43b6f 100644 --- a/src/commands/export.command.ts +++ b/src/commands/export.command.ts @@ -4,8 +4,8 @@ import * as inquirer from 'inquirer'; import { CryptoService } from 'jslib/abstractions/crypto.service'; import { ExportService } from 'jslib/abstractions/export.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/generate.command.ts b/src/commands/generate.command.ts index cda624130c..18dc64866a 100644 --- a/src/commands/generate.command.ts +++ b/src/commands/generate.command.ts @@ -2,8 +2,8 @@ import * as program from 'commander'; import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service'; -import { Response } from '../models/response'; -import { StringResponse } from '../models/response/stringResponse'; +import { Response } from 'jslib/cli/models/response'; +import { StringResponse } from 'jslib/cli/models/response/stringResponse'; export class GenerateCommand { constructor(private passwordGenerationService: PasswordGenerationService) { } diff --git a/src/commands/get.command.ts b/src/commands/get.command.ts index c34b955324..1c5f587d08 100644 --- a/src/commands/get.command.ts +++ b/src/commands/get.command.ts @@ -29,13 +29,14 @@ import { CipherView } from 'jslib/models/view/cipherView'; import { CollectionView } from 'jslib/models/view/collectionView'; import { FolderView } from 'jslib/models/view/folderView'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; +import { StringResponse } from 'jslib/cli/models/response/stringResponse'; + import { CipherResponse } from '../models/response/cipherResponse'; import { CollectionResponse } from '../models/response/collectionResponse'; import { FolderResponse } from '../models/response/folderResponse'; -import { MessageResponse } from '../models/response/messageResponse'; import { OrganizationResponse } from '../models/response/organizationResponse'; -import { StringResponse } from '../models/response/stringResponse'; import { TemplateResponse } from '../models/response/templateResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/import.command.ts b/src/commands/import.command.ts index f1d5818cd9..137cfc8218 100644 --- a/src/commands/import.command.ts +++ b/src/commands/import.command.ts @@ -1,8 +1,8 @@ import * as program from 'commander'; import { ImportService } from 'jslib/abstractions/import.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/list.command.ts b/src/commands/list.command.ts index f44b659b31..0bb417f0f7 100644 --- a/src/commands/list.command.ts +++ b/src/commands/list.command.ts @@ -8,11 +8,12 @@ import { FolderService } from 'jslib/abstractions/folder.service'; import { SearchService } from 'jslib/abstractions/search.service'; import { UserService } from 'jslib/abstractions/user.service'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; +import { ListResponse } from 'jslib/cli/models/response/listResponse'; + import { CipherResponse } from '../models/response/cipherResponse'; import { CollectionResponse } from '../models/response/collectionResponse'; import { FolderResponse } from '../models/response/folderResponse'; -import { ListResponse } from '../models/response/listResponse'; import { OrganizationResponse } from '../models/response/organizationResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/lock.command.ts b/src/commands/lock.command.ts index 259d591c86..dbb2ac6e76 100644 --- a/src/commands/lock.command.ts +++ b/src/commands/lock.command.ts @@ -2,8 +2,8 @@ import * as program from 'commander'; import { LockService } from 'jslib/abstractions/lock.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; export class LockCommand { constructor(private lockService: LockService) { } diff --git a/src/commands/login.command.ts b/src/commands/login.command.ts index 8732bd08bb..1a9f00e65d 100644 --- a/src/commands/login.command.ts +++ b/src/commands/login.command.ts @@ -11,8 +11,8 @@ import { AuthService } from 'jslib/abstractions/auth.service'; import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service'; import { SyncService } from 'jslib/abstractions/sync.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; import { Utils } from 'jslib/misc/utils'; diff --git a/src/commands/logout.command.ts b/src/commands/logout.command.ts index 97ea00c1b4..1d3e7e7ae7 100644 --- a/src/commands/logout.command.ts +++ b/src/commands/logout.command.ts @@ -2,8 +2,8 @@ import * as program from 'commander'; import { AuthService } from 'jslib/abstractions/auth.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; export class LogoutCommand { constructor(private authService: AuthService, private logoutCallback: () => Promise) { } diff --git a/src/commands/share.command.ts b/src/commands/share.command.ts index 2a5bc87952..d1ad07c521 100644 --- a/src/commands/share.command.ts +++ b/src/commands/share.command.ts @@ -2,7 +2,8 @@ import * as program from 'commander'; import { CipherService } from 'jslib/abstractions/cipher.service'; -import { Response } from '../models/response'; +import { Response } from 'jslib/cli/models/response'; + import { CipherResponse } from '../models/response/cipherResponse'; import { CliUtils } from '../utils'; diff --git a/src/commands/sync.command.ts b/src/commands/sync.command.ts index a3ba3f23f6..d7c198715e 100644 --- a/src/commands/sync.command.ts +++ b/src/commands/sync.command.ts @@ -2,9 +2,9 @@ import * as program from 'commander'; import { SyncService } from 'jslib/abstractions/sync.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; -import { StringResponse } from '../models/response/stringResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; +import { StringResponse } from 'jslib/cli/models/response/stringResponse'; export class SyncCommand { constructor(private syncService: SyncService) { } diff --git a/src/commands/unlock.command.ts b/src/commands/unlock.command.ts index 2453cdd577..f38a333422 100644 --- a/src/commands/unlock.command.ts +++ b/src/commands/unlock.command.ts @@ -5,8 +5,8 @@ import { CryptoService } from 'jslib/abstractions/crypto.service'; import { CryptoFunctionService } from 'jslib/abstractions/cryptoFunction.service'; import { UserService } from 'jslib/abstractions/user.service'; -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; +import { Response } from 'jslib/cli/models/response'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; import { Utils } from 'jslib/misc/utils'; diff --git a/src/commands/update.command.ts b/src/commands/update.command.ts deleted file mode 100644 index 7d14e0eb16..0000000000 --- a/src/commands/update.command.ts +++ /dev/null @@ -1,81 +0,0 @@ -import * as program from 'commander'; -import * as fetch from 'node-fetch'; - -import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; - -import { Response } from '../models/response'; -import { MessageResponse } from '../models/response/messageResponse'; - -export class UpdateCommand { - inPkg: boolean = false; - - constructor(private platformUtilsService: PlatformUtilsService) { - this.inPkg = !!(process as any).pkg; - } - - async run(cmd: program.Command): Promise { - const currentVersion = this.platformUtilsService.getApplicationVersion(); - - const response = await fetch.default('https://api.github.com/repos/bitwarden/cli/releases/latest'); - if (response.status === 200) { - const responseJson = await response.json(); - const res = new MessageResponse(null, null); - - const tagName: string = responseJson.tag_name; - if (tagName === ('v' + currentVersion)) { - res.title = 'No update available.'; - res.noColor = true; - return Response.success(res); - } - - let downloadUrl: string = null; - if (responseJson.assets != null) { - for (const a of responseJson.assets) { - const download: string = a.browser_download_url; - if (download == null) { - continue; - } - - if (download.indexOf('.zip') === -1) { - continue; - } - - if (process.platform === 'win32' && download.indexOf('bw-windows') > -1) { - downloadUrl = download; - break; - } else if (process.platform === 'darwin' && download.indexOf('bw-macos') > -1) { - downloadUrl = download; - break; - } else if (process.platform === 'linux' && download.indexOf('bw-linux') > -1) { - downloadUrl = download; - break; - } - } - } - - res.title = 'A new version is available: ' + tagName; - if (downloadUrl == null) { - downloadUrl = 'https://github.com/bitwarden/cli/releases'; - } else { - res.raw = downloadUrl; - } - res.message = ''; - if (responseJson.body != null && responseJson.body !== '') { - res.message = responseJson.body + '\n\n'; - } - - res.message += 'You can download this update at ' + downloadUrl; - - if (this.inPkg) { - res.message += '\n\nIf you installed this CLI through a package manager ' + - 'you should probably update using its update command instead.'; - } else { - res.message += '\n\nIf you installed this CLI through NPM ' + - 'you should update using `npm install -g @bitwarden/cli`'; - } - return Response.success(res); - } else { - return Response.error('Error contacting update API: ' + response.status); - } - } -} diff --git a/src/models/response.ts b/src/models/response.ts deleted file mode 100644 index d361c3a2b6..0000000000 --- a/src/models/response.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { BaseResponse } from './response/baseResponse'; - -export class Response { - static error(error: any): Response { - const res = new Response(); - res.success = false; - if (typeof (error) === 'string') { - res.message = error; - } else { - res.message = error.message != null ? error.message : error.toString(); - } - return res; - } - - static notFound(): Response { - return Response.error('Not found.'); - } - - static badRequest(message: string): Response { - return Response.error(message); - } - - static multipleResults(ids: string[]): Response { - let msg = 'More than one result was found. Try getting a specific object by `id` instead. ' + - 'The following objects were found:'; - ids.forEach((id) => { - msg += '\n' + id; - }); - return Response.error(msg); - } - - static success(data?: BaseResponse): Response { - const res = new Response(); - res.success = true; - res.data = data; - return res; - } - - success: boolean; - message: string; - errorCode: number; - data: BaseResponse; -} diff --git a/src/models/response/baseResponse.ts b/src/models/response/baseResponse.ts deleted file mode 100644 index 9d8beca059..0000000000 --- a/src/models/response/baseResponse.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface BaseResponse { - object: string; -} diff --git a/src/models/response/cipherResponse.ts b/src/models/response/cipherResponse.ts index afdd64fb97..8dfd314528 100644 --- a/src/models/response/cipherResponse.ts +++ b/src/models/response/cipherResponse.ts @@ -1,8 +1,9 @@ import { CipherWithIds } from 'jslib/models/export/cipherWithIds'; import { CipherView } from 'jslib/models/view/cipherView'; +import { BaseResponse } from 'jslib/cli/models/response/baseResponse'; + import { AttachmentResponse } from './attachmentResponse'; -import { BaseResponse } from './baseResponse'; import { LoginResponse } from './loginResponse'; import { PasswordHistoryResponse } from './passwordHistoryResponse'; diff --git a/src/models/response/collectionResponse.ts b/src/models/response/collectionResponse.ts index 293d474722..6d8bd09ef3 100644 --- a/src/models/response/collectionResponse.ts +++ b/src/models/response/collectionResponse.ts @@ -1,7 +1,7 @@ import { CollectionWithId } from 'jslib/models/export/collectionWithId'; import { CollectionView } from 'jslib/models/view/collectionView'; -import { BaseResponse } from './baseResponse'; +import { BaseResponse } from 'jslib/cli/models/response/baseResponse'; export class CollectionResponse extends CollectionWithId implements BaseResponse { object: string; diff --git a/src/models/response/folderResponse.ts b/src/models/response/folderResponse.ts index a543278691..7ea0b6680e 100644 --- a/src/models/response/folderResponse.ts +++ b/src/models/response/folderResponse.ts @@ -1,7 +1,7 @@ import { FolderWithId } from 'jslib/models/export/folderWithId'; import { FolderView } from 'jslib/models/view/folderView'; -import { BaseResponse } from './baseResponse'; +import { BaseResponse } from 'jslib/cli/models/response/baseResponse'; export class FolderResponse extends FolderWithId implements BaseResponse { object: string; diff --git a/src/models/response/listResponse.ts b/src/models/response/listResponse.ts deleted file mode 100644 index 7995bd4fe8..0000000000 --- a/src/models/response/listResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseResponse } from './baseResponse'; - -export class ListResponse implements BaseResponse { - object: string; - data: BaseResponse[]; - - constructor(data: BaseResponse[]) { - this.object = 'list'; - this.data = data; - } -} diff --git a/src/models/response/messageResponse.ts b/src/models/response/messageResponse.ts deleted file mode 100644 index 448e3db795..0000000000 --- a/src/models/response/messageResponse.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { BaseResponse } from './baseResponse'; - -export class MessageResponse implements BaseResponse { - object: string; - title: string; - message: string; - raw: string; - noColor = false; - - constructor(title: string, message: string) { - this.object = 'message'; - this.title = title; - this.message = message; - } -} diff --git a/src/models/response/organizationResponse.ts b/src/models/response/organizationResponse.ts index b8d367b776..f2727adac9 100644 --- a/src/models/response/organizationResponse.ts +++ b/src/models/response/organizationResponse.ts @@ -1,4 +1,4 @@ -import { BaseResponse } from './baseResponse'; +import { BaseResponse } from 'jslib/cli/models/response/baseResponse'; import { Organization } from 'jslib/models/domain/organization'; diff --git a/src/models/response/stringResponse.ts b/src/models/response/stringResponse.ts deleted file mode 100644 index b9a0f04412..0000000000 --- a/src/models/response/stringResponse.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { BaseResponse } from './baseResponse'; - -export class StringResponse implements BaseResponse { - object: string; - data: string; - - constructor(data: string) { - this.object = 'string'; - this.data = data; - } -} diff --git a/src/models/response/templateResponse.ts b/src/models/response/templateResponse.ts index 1876f0a04a..2987686dc2 100644 --- a/src/models/response/templateResponse.ts +++ b/src/models/response/templateResponse.ts @@ -1,4 +1,4 @@ -import { BaseResponse } from './baseResponse'; +import { BaseResponse } from 'jslib/cli/models/response/baseResponse'; export class TemplateResponse implements BaseResponse { object: string; diff --git a/src/program.ts b/src/program.ts index 97b0f64e71..e8f2a67685 100644 --- a/src/program.ts +++ b/src/program.ts @@ -19,12 +19,14 @@ import { LogoutCommand } from './commands/logout.command'; import { ShareCommand } from './commands/share.command'; import { SyncCommand } from './commands/sync.command'; import { UnlockCommand } from './commands/unlock.command'; -import { UpdateCommand } from './commands/update.command'; -import { Response } from './models/response'; -import { ListResponse } from './models/response/listResponse'; -import { MessageResponse } from './models/response/messageResponse'; -import { StringResponse } from './models/response/stringResponse'; +import { UpdateCommand } from 'jslib/cli/commands/update.command'; + +import { Response } from 'jslib/cli/models/response'; +import { ListResponse } from 'jslib/cli/models/response/listResponse'; +import { MessageResponse } from 'jslib/cli/models/response/messageResponse'; +import { StringResponse } from 'jslib/cli/models/response/stringResponse'; + import { TemplateResponse } from './models/response/templateResponse'; import { CliUtils } from './utils'; @@ -553,7 +555,7 @@ export class Program { writeLn('', true); }) .action(async (cmd) => { - const command = new UpdateCommand(this.main.platformUtilsService); + const command = new UpdateCommand(this.main.platformUtilsService, 'cli', 'bw'); const response = await command.run(cmd); this.processResponse(response); }); diff --git a/src/services/nodePlatformUtils.service.ts b/src/services/nodePlatformUtils.service.ts deleted file mode 100644 index 034a4ebd91..0000000000 --- a/src/services/nodePlatformUtils.service.ts +++ /dev/null @@ -1,135 +0,0 @@ - -import { DeviceType } from 'jslib/enums/deviceType'; - -import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service'; - -// tslint:disable-next-line -const pjson = require('../../package.json'); - -export class NodePlatformUtilsService implements PlatformUtilsService { - identityClientId: string; - - private deviceCache: DeviceType = null; - - constructor() { - this.identityClientId = 'cli'; - } - - getDevice(): DeviceType { - if (!this.deviceCache) { - switch (process.platform) { - case 'win32': - this.deviceCache = DeviceType.WindowsDesktop; - break; - case 'darwin': - this.deviceCache = DeviceType.MacOsDesktop; - break; - case 'linux': - default: - this.deviceCache = DeviceType.LinuxDesktop; - break; - } - } - - return this.deviceCache; - } - - getDeviceString(): string { - const device = DeviceType[this.getDevice()].toLowerCase(); - return device.replace('desktop', ''); - } - - isFirefox() { - return false; - } - - isChrome() { - return false; - } - - isEdge() { - return false; - } - - isOpera() { - return false; - } - - isVivaldi() { - return false; - } - - isSafari() { - return false; - } - - isIE() { - return false; - } - - isMacAppStore() { - return false; - } - - analyticsId() { - return null as string; - } - - isViewOpen() { - return false; - } - - lockTimeout(): number { - return null; - } - - launchUri(uri: string, options?: any): void { - throw new Error('Not implemented.'); - } - - saveFile(win: Window, blobData: any, blobOptions: any, fileName: string): void { - throw new Error('Not implemented.'); - } - - getApplicationVersion(): string { - return pjson.version; - } - - supportsU2f(win: Window) { - return false; - } - - supportsDuo(): boolean { - return false; - } - - showToast(type: 'error' | 'success' | 'warning' | 'info', title: string, text: string | string[], - options?: any): void { - throw new Error('Not implemented.'); - } - - showDialog(text: string, title?: string, confirmText?: string, cancelText?: string, type?: string): - Promise { - throw new Error('Not implemented.'); - } - - eventTrack(action: string, label?: string, options?: any) { - throw new Error('Not implemented.'); - } - - isDev(): boolean { - return process.env.BWCLI_ENV === 'development'; - } - - isSelfHost(): boolean { - return false; - } - - copyToClipboard(text: string, options?: any): void { - throw new Error('Not implemented.'); - } - - readFromClipboard(options?: any): Promise { - throw new Error('Not implemented.'); - } -} diff --git a/src/services/noopMessaging.service.ts b/src/services/noopMessaging.service.ts deleted file mode 100644 index d6a824edb0..0000000000 --- a/src/services/noopMessaging.service.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { MessagingService } from 'jslib/abstractions/messaging.service'; - -export class NoopMessagingService implements MessagingService { - send(subscriber: string, arg: any = {}) { - // Do nothing... - } -}