diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 4c7d621c14..0f13f46c73 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -1,17 +1,21 @@ -import { EnvironmentUrls } from '../models/domain/environmentUrls'; +import { EnvironmentUrls } from '../models/domain'; -import { CipherRequest } from '../models/request/cipherRequest'; -import { FolderRequest } from '../models/request/folderRequest'; -import { PasswordHintRequest } from '../models/request/passwordHintRequest'; -import { RegisterRequest } from '../models/request/registerRequest'; -import { TokenRequest } from '../models/request/tokenRequest'; -import { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest'; +import { + CipherRequest, + FolderRequest, + PasswordHintRequest, + RegisterRequest, + TokenRequest, + TwoFactorEmailRequest, +} from '../models/request'; -import { CipherResponse } from '../models/response/cipherResponse'; -import { FolderResponse } from '../models/response/folderResponse'; -import { IdentityTokenResponse } from '../models/response/identityTokenResponse'; -import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse'; -import { SyncResponse } from '../models/response/syncResponse'; +import { + CipherResponse, + FolderResponse, + IdentityTokenResponse, + IdentityTwoFactorResponse, + SyncResponse, +} from '../models/response'; export abstract class ApiService { urlsSet: boolean; diff --git a/src/abstractions/auth.service.ts b/src/abstractions/auth.service.ts index 08ca102729..0faed28c2d 100644 --- a/src/abstractions/auth.service.ts +++ b/src/abstractions/auth.service.ts @@ -1,6 +1,6 @@ -import { TwoFactorProviderType } from '../enums/twoFactorProviderType'; +import { TwoFactorProviderType } from '../enums'; -import { AuthResult } from '../models/domain/authResult'; +import { AuthResult } from '../models/domain'; export abstract class AuthService { email: string; diff --git a/src/abstractions/cipher.service.ts b/src/abstractions/cipher.service.ts index 330ac71c6c..1df9c72b0f 100644 --- a/src/abstractions/cipher.service.ts +++ b/src/abstractions/cipher.service.ts @@ -1,11 +1,15 @@ -import { CipherData } from '../models/data/cipherData'; +import { CipherData } from '../models/data'; -import { Cipher } from '../models/domain/cipher'; -import { Field } from '../models/domain/field'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; +import { + Cipher, + Field, + SymmetricCryptoKey, +} from '../models/domain'; -import { CipherView } from '../models/view/cipherView'; -import { FieldView } from '../models/view/fieldView'; +import { + CipherView, + FieldView, +} from '../models/view'; export abstract class CipherService { decryptedCipherCache: CipherView[]; diff --git a/src/abstractions/collection.service.ts b/src/abstractions/collection.service.ts index 6c51478555..1bcec5cdaf 100644 --- a/src/abstractions/collection.service.ts +++ b/src/abstractions/collection.service.ts @@ -1,8 +1,8 @@ -import { CollectionData } from '../models/data/collectionData'; +import { CollectionData } from '../models/data'; -import { Collection } from '../models/domain/collection'; +import { Collection } from '../models/domain'; -import { CollectionView } from '../models/view/collectionView'; +import { CollectionView } from '../models/view'; export abstract class CollectionService { decryptedCollectionCache: CollectionView[]; diff --git a/src/abstractions/crypto.service.ts b/src/abstractions/crypto.service.ts index dbf5f0da75..1d5de5e127 100644 --- a/src/abstractions/crypto.service.ts +++ b/src/abstractions/crypto.service.ts @@ -1,7 +1,9 @@ -import { CipherString } from '../models/domain/cipherString'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; +import { + CipherString, + SymmetricCryptoKey, +} from '../models/domain'; -import { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse'; +import { ProfileOrganizationResponse } from '../models/response'; export abstract class CryptoService { setKey: (key: SymmetricCryptoKey) => Promise; diff --git a/src/abstractions/folder.service.ts b/src/abstractions/folder.service.ts index 381bc01317..a6615b2756 100644 --- a/src/abstractions/folder.service.ts +++ b/src/abstractions/folder.service.ts @@ -1,8 +1,8 @@ -import { FolderData } from '../models/data/folderData'; +import { FolderData } from '../models/data'; -import { Folder } from '../models/domain/folder'; +import { Folder } from '../models/domain'; -import { FolderView } from '../models/view/folderView'; +import { FolderView } from '../models/view'; export abstract class FolderService { decryptedFolderCache: FolderView[]; diff --git a/src/abstractions/passwordGeneration.service.ts b/src/abstractions/passwordGeneration.service.ts index a8967db281..36f532403b 100644 --- a/src/abstractions/passwordGeneration.service.ts +++ b/src/abstractions/passwordGeneration.service.ts @@ -1,4 +1,4 @@ -import { PasswordHistory } from '../models/domain/passwordHistory'; +import { PasswordHistory } from '../models/domain'; export abstract class PasswordGenerationService { generatePassword: (options: any) => string; diff --git a/src/abstractions/platformUtils.service.ts b/src/abstractions/platformUtils.service.ts index 3835bd062d..99d2795191 100644 --- a/src/abstractions/platformUtils.service.ts +++ b/src/abstractions/platformUtils.service.ts @@ -1,4 +1,4 @@ -import { DeviceType } from '../enums/deviceType'; +import { DeviceType } from '../enums'; export abstract class PlatformUtilsService { getDevice: () => DeviceType; diff --git a/src/misc/analytics.ts b/src/misc/analytics.ts index 98cfdebc5b..78962c66f6 100644 --- a/src/misc/analytics.ts +++ b/src/misc/analytics.ts @@ -1,6 +1,8 @@ -import { AppIdService } from '../abstractions/appId.service'; -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; -import { StorageService } from '../abstractions/storage.service'; +import { + AppIdService, + PlatformUtilsService, + StorageService, +} from '../abstractions'; import { ConstantsService } from '../services/constants.service'; diff --git a/src/models/data/attachmentData.ts b/src/models/data/attachmentData.ts index 85aa452e1e..792eb07bd1 100644 --- a/src/models/data/attachmentData.ts +++ b/src/models/data/attachmentData.ts @@ -1,4 +1,4 @@ -import { AttachmentResponse } from '../response/attachmentResponse'; +import { AttachmentResponse } from '../response'; export class AttachmentData { id: string; diff --git a/src/models/data/cipherData.ts b/src/models/data/cipherData.ts index 0a4f83c520..40468f0a7a 100644 --- a/src/models/data/cipherData.ts +++ b/src/models/data/cipherData.ts @@ -1,4 +1,4 @@ -import { CipherType } from '../../enums/cipherType'; +import { CipherType } from '../../enums'; import { AttachmentData } from './attachmentData'; import { CardData } from './cardData'; @@ -7,7 +7,7 @@ import { IdentityData } from './identityData'; import { LoginData } from './loginData'; import { SecureNoteData } from './secureNoteData'; -import { CipherResponse } from '../response/cipherResponse'; +import { CipherResponse } from '../response'; export class CipherData { id: string; diff --git a/src/models/data/collectionData.ts b/src/models/data/collectionData.ts index 3b05b9af22..16b44871b3 100644 --- a/src/models/data/collectionData.ts +++ b/src/models/data/collectionData.ts @@ -1,4 +1,4 @@ -import { CollectionResponse } from '../response/collectionResponse'; +import { CollectionResponse } from '../response'; export class CollectionData { id: string; diff --git a/src/models/data/fieldData.ts b/src/models/data/fieldData.ts index cd0fb2c42b..3af1d04285 100644 --- a/src/models/data/fieldData.ts +++ b/src/models/data/fieldData.ts @@ -1,4 +1,4 @@ -import { FieldType } from '../../enums/fieldType'; +import { FieldType } from '../../enums'; export class FieldData { type: FieldType; diff --git a/src/models/data/folderData.ts b/src/models/data/folderData.ts index 509267c9d4..c0a4d0dd2f 100644 --- a/src/models/data/folderData.ts +++ b/src/models/data/folderData.ts @@ -1,4 +1,4 @@ -import { FolderResponse } from '../response/folderResponse'; +import { FolderResponse } from '../response'; export class FolderData { id: string; diff --git a/src/models/data/secureNoteData.ts b/src/models/data/secureNoteData.ts index 4b27125a13..0a3d64da9d 100644 --- a/src/models/data/secureNoteData.ts +++ b/src/models/data/secureNoteData.ts @@ -1,4 +1,4 @@ -import { SecureNoteType } from '../../enums/secureNoteType'; +import { SecureNoteType } from '../../enums'; export class SecureNoteData { type: SecureNoteType; diff --git a/src/models/domain/attachment.ts b/src/models/domain/attachment.ts index 7861066e0e..b2f82863c1 100644 --- a/src/models/domain/attachment.ts +++ b/src/models/domain/attachment.ts @@ -1,9 +1,9 @@ -import { AttachmentData } from '../data/attachmentData'; +import { AttachmentData } from '../data'; import { CipherString } from './cipherString'; import Domain from './domain'; -import { AttachmentView } from '../view/attachmentView'; +import { AttachmentView } from '../view'; export class Attachment extends Domain { id: string; diff --git a/src/models/domain/authResult.ts b/src/models/domain/authResult.ts index cb4bb57c65..e797781bbb 100644 --- a/src/models/domain/authResult.ts +++ b/src/models/domain/authResult.ts @@ -1,4 +1,4 @@ -import { TwoFactorProviderType } from '../../enums/twoFactorProviderType'; +import { TwoFactorProviderType } from '../../enums'; export class AuthResult { twoFactor: boolean = false; diff --git a/src/models/domain/card.ts b/src/models/domain/card.ts index 19a2ad9e50..a41597ecae 100644 --- a/src/models/domain/card.ts +++ b/src/models/domain/card.ts @@ -1,9 +1,9 @@ -import { CardData } from '../data/cardData'; +import { CardData } from '../data'; import { CipherString } from './cipherString'; import Domain from './domain'; -import { CardView } from '../view/cardView'; +import { CardView } from '../view'; export class Card extends Domain { cardholderName: CipherString; diff --git a/src/models/domain/cipher.ts b/src/models/domain/cipher.ts index 7f9c18d1f0..e591c38c59 100644 --- a/src/models/domain/cipher.ts +++ b/src/models/domain/cipher.ts @@ -1,8 +1,8 @@ -import { CipherType } from '../../enums/cipherType'; +import { CipherType } from '../../enums'; -import { CipherData } from '../data/cipherData'; +import { CipherData } from '../data'; -import { CipherView } from '../view/cipherView'; +import { CipherView } from '../view'; import { Attachment } from './attachment'; import { Card } from './card'; diff --git a/src/models/domain/cipherString.ts b/src/models/domain/cipherString.ts index d19d191065..b6f4bedc08 100644 --- a/src/models/domain/cipherString.ts +++ b/src/models/domain/cipherString.ts @@ -1,6 +1,6 @@ -import { EncryptionType } from '../../enums/encryptionType'; +import { EncryptionType } from '../../enums'; -import { CryptoService } from '../../abstractions/crypto.service'; +import { CryptoService } from '../../abstractions'; export class CipherString { encryptedString?: string; diff --git a/src/models/domain/collection.ts b/src/models/domain/collection.ts index 45fd54cd8c..9c3136e189 100644 --- a/src/models/domain/collection.ts +++ b/src/models/domain/collection.ts @@ -1,6 +1,6 @@ -import { CollectionData } from '../data/collectionData'; +import { CollectionData } from '../data'; -import { CollectionView } from '../view/collectionView'; +import { CollectionView } from '../view'; import { CipherString } from './cipherString'; import Domain from './domain'; diff --git a/src/models/domain/domain.ts b/src/models/domain/domain.ts index 7fe644740f..d75bec902e 100644 --- a/src/models/domain/domain.ts +++ b/src/models/domain/domain.ts @@ -1,6 +1,6 @@ -import { CipherString } from '../domain/cipherString'; +import { CipherString } from './cipherString'; -import { View } from '../view/view'; +import { View } from '../view'; export default abstract class Domain { protected buildDomainModel(domain: D, dataObj: any, map: any, diff --git a/src/models/domain/field.ts b/src/models/domain/field.ts index 023fefe5a9..a527edbcac 100644 --- a/src/models/domain/field.ts +++ b/src/models/domain/field.ts @@ -1,11 +1,11 @@ -import { FieldType } from '../../enums/fieldType'; +import { FieldType } from '../../enums'; -import { FieldData } from '../data/fieldData'; +import { FieldData } from '../data'; import { CipherString } from './cipherString'; import Domain from './domain'; -import { FieldView } from '../view/fieldView'; +import { FieldView } from '../view'; export class Field extends Domain { name: CipherString; diff --git a/src/models/domain/folder.ts b/src/models/domain/folder.ts index 77b9fb310d..80c5057533 100644 --- a/src/models/domain/folder.ts +++ b/src/models/domain/folder.ts @@ -1,6 +1,6 @@ -import { FolderData } from '../data/folderData'; +import { FolderData } from '../data'; -import { FolderView } from '../view/folderView'; +import { FolderView } from '../view'; import { CipherString } from './cipherString'; import Domain from './domain'; diff --git a/src/models/domain/identity.ts b/src/models/domain/identity.ts index ade03260ea..7ef205a376 100644 --- a/src/models/domain/identity.ts +++ b/src/models/domain/identity.ts @@ -1,9 +1,9 @@ -import { IdentityData } from '../data/identityData'; +import { IdentityData } from '../data'; import { CipherString } from './cipherString'; import Domain from './domain'; -import { IdentityView } from '../view/identityView'; +import { IdentityView } from '../view'; export class Identity extends Domain { title: CipherString; diff --git a/src/models/domain/login.ts b/src/models/domain/login.ts index 1c98dc7031..743b54ae3a 100644 --- a/src/models/domain/login.ts +++ b/src/models/domain/login.ts @@ -1,6 +1,6 @@ -import { LoginData } from '../data/loginData'; +import { LoginData } from '../data'; -import { LoginView } from '../view/loginView'; +import { LoginView } from '../view'; import { CipherString } from './cipherString'; import Domain from './domain'; diff --git a/src/models/domain/secureNote.ts b/src/models/domain/secureNote.ts index 79724a4193..33640e4794 100644 --- a/src/models/domain/secureNote.ts +++ b/src/models/domain/secureNote.ts @@ -1,10 +1,10 @@ -import { SecureNoteType } from '../../enums/secureNoteType'; +import { SecureNoteType } from '../../enums'; -import { SecureNoteData } from '../data/secureNoteData'; +import { SecureNoteData } from '../data'; import Domain from './domain'; -import { SecureNoteView } from '../view/secureNoteView'; +import { SecureNoteView } from '../view'; export class SecureNote extends Domain { type: SecureNoteType; diff --git a/src/models/domain/symmetricCryptoKey.ts b/src/models/domain/symmetricCryptoKey.ts index 4e3a5d6c2d..4b12f98b07 100644 --- a/src/models/domain/symmetricCryptoKey.ts +++ b/src/models/domain/symmetricCryptoKey.ts @@ -1,6 +1,6 @@ import * as forge from 'node-forge'; -import { EncryptionType } from '../../enums/encryptionType'; +import { EncryptionType } from '../../enums'; import { SymmetricCryptoKeyBuffers } from './symmetricCryptoKeyBuffers'; diff --git a/src/models/request/cipherRequest.ts b/src/models/request/cipherRequest.ts index 232883f323..ff2a79d972 100644 --- a/src/models/request/cipherRequest.ts +++ b/src/models/request/cipherRequest.ts @@ -1,4 +1,4 @@ -import { CipherType } from '../../enums/cipherType'; +import { CipherType } from '../../enums'; export class CipherRequest { type: CipherType; diff --git a/src/models/request/deviceRequest.ts b/src/models/request/deviceRequest.ts index 2aaa42cbe0..4b29b44383 100644 --- a/src/models/request/deviceRequest.ts +++ b/src/models/request/deviceRequest.ts @@ -1,6 +1,6 @@ -import { DeviceType } from '../../enums/deviceType'; +import { DeviceType } from '../../enums'; -import { PlatformUtilsService } from '../../abstractions/platformUtils.service'; +import { PlatformUtilsService } from '../../abstractions'; export class DeviceRequest { type: DeviceType; diff --git a/src/models/request/folderRequest.ts b/src/models/request/folderRequest.ts index 54ec76cac5..63d53819b1 100644 --- a/src/models/request/folderRequest.ts +++ b/src/models/request/folderRequest.ts @@ -1,4 +1,4 @@ -import { Folder } from '../domain/folder'; +import { Folder } from '../domain'; export class FolderRequest { name: string; diff --git a/src/models/response/deviceResponse.ts b/src/models/response/deviceResponse.ts index 23d0135b76..9fe3d37ece 100644 --- a/src/models/response/deviceResponse.ts +++ b/src/models/response/deviceResponse.ts @@ -1,4 +1,4 @@ -import { DeviceType } from '../../enums/deviceType'; +import { DeviceType } from '../../enums'; export class DeviceResponse { id: string; diff --git a/src/models/response/identityTwoFactorResponse.ts b/src/models/response/identityTwoFactorResponse.ts index 2adeeaa053..b01b83fb58 100644 --- a/src/models/response/identityTwoFactorResponse.ts +++ b/src/models/response/identityTwoFactorResponse.ts @@ -1,4 +1,4 @@ -import { TwoFactorProviderType } from '../../enums/twoFactorProviderType'; +import { TwoFactorProviderType } from '../../enums'; export class IdentityTwoFactorResponse { twoFactorProviders: TwoFactorProviderType[]; diff --git a/src/models/view/attachmentView.ts b/src/models/view/attachmentView.ts index 49ea57326d..3fc9c39ff9 100644 --- a/src/models/view/attachmentView.ts +++ b/src/models/view/attachmentView.ts @@ -1,6 +1,6 @@ import { View } from './view'; -import { Attachment } from '../domain/attachment'; +import { Attachment } from '../domain'; export class AttachmentView implements View { id: string; diff --git a/src/models/view/cardView.ts b/src/models/view/cardView.ts index 26e3308e31..7149395630 100644 --- a/src/models/view/cardView.ts +++ b/src/models/view/cardView.ts @@ -1,6 +1,6 @@ import { View } from './view'; -import { Card } from '../domain/card'; +import { Card } from '../domain'; export class CardView implements View { cardholderName: string; diff --git a/src/models/view/cipherView.ts b/src/models/view/cipherView.ts index b3f232bcbc..aeb7e43cd7 100644 --- a/src/models/view/cipherView.ts +++ b/src/models/view/cipherView.ts @@ -1,6 +1,6 @@ -import { CipherType } from '../../enums/cipherType'; +import { CipherType } from '../../enums'; -import { Cipher } from '../domain/cipher'; +import { Cipher } from '../domain'; import { AttachmentView } from './attachmentView'; import { CardView } from './cardView'; diff --git a/src/models/view/collectionView.ts b/src/models/view/collectionView.ts index ab184a2c35..6cdc8a1791 100644 --- a/src/models/view/collectionView.ts +++ b/src/models/view/collectionView.ts @@ -1,6 +1,6 @@ import { View } from './view'; -import { Collection } from '../domain/collection'; +import { Collection } from '../domain'; export class CollectionView implements View { id: string; diff --git a/src/models/view/fieldView.ts b/src/models/view/fieldView.ts index b3f68a584f..8e67ff6dc8 100644 --- a/src/models/view/fieldView.ts +++ b/src/models/view/fieldView.ts @@ -1,8 +1,8 @@ -import { FieldType } from '../../enums/fieldType'; +import { FieldType } from '../../enums'; import { View } from './view'; -import { Field } from '../domain/field'; +import { Field } from '../domain'; export class FieldView implements View { name: string; diff --git a/src/models/view/folderView.ts b/src/models/view/folderView.ts index ebe8ea157a..8f2cfe3e2c 100644 --- a/src/models/view/folderView.ts +++ b/src/models/view/folderView.ts @@ -1,6 +1,6 @@ import { View } from './view'; -import { Folder } from '../domain/folder'; +import { Folder } from '../domain'; export class FolderView implements View { id: string = null; diff --git a/src/models/view/identityView.ts b/src/models/view/identityView.ts index 4ae5fa0cf9..6843e1e3ac 100644 --- a/src/models/view/identityView.ts +++ b/src/models/view/identityView.ts @@ -1,6 +1,6 @@ import { View } from './view'; -import { Identity } from '../domain/identity'; +import { Identity } from '../domain'; export class IdentityView implements View { title: string = null; diff --git a/src/models/view/index.ts b/src/models/view/index.ts index 0e07c256be..eb1b943c82 100644 --- a/src/models/view/index.ts +++ b/src/models/view/index.ts @@ -1,7 +1,9 @@ export { AttachmentView } from './attachmentView'; export { CardView } from './cardView'; export { CipherView } from './cipherView'; +export { CollectionView } from './collectionView'; export { FieldView } from './fieldView'; +export { FolderView } from './folderView'; export { IdentityView } from './identityView'; export { LoginView } from './loginView'; export { SecureNoteView } from './secureNoteView'; diff --git a/src/models/view/loginView.ts b/src/models/view/loginView.ts index c3554c9c38..6c97772b76 100644 --- a/src/models/view/loginView.ts +++ b/src/models/view/loginView.ts @@ -1,8 +1,8 @@ import { View } from './view'; -import { Login } from '../domain/login'; +import { Login } from '../domain'; -import { PlatformUtilsService } from '../../abstractions/platformUtils.service'; +import { PlatformUtilsService } from '../../abstractions'; export class LoginView implements View { username: string; diff --git a/src/models/view/secureNoteView.ts b/src/models/view/secureNoteView.ts index 1047c41086..d6c2867dfa 100644 --- a/src/models/view/secureNoteView.ts +++ b/src/models/view/secureNoteView.ts @@ -1,8 +1,8 @@ -import { SecureNoteType } from '../../enums/secureNoteType'; +import { SecureNoteType } from '../../enums'; import { View } from './view'; -import { SecureNote } from '../domain/secureNote'; +import { SecureNote } from '../domain'; export class SecureNoteView implements View { type: SecureNoteType; diff --git a/src/services/api.service.ts b/src/services/api.service.ts index 1e452af755..395b411794 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -1,24 +1,30 @@ import { ConstantsService } from './constants.service'; -import { ApiService as ApiServiceAbstraction } from '../abstractions/api.service'; -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; -import { TokenService } from '../abstractions/token.service'; +import { + ApiService as ApiServiceAbstraction, + PlatformUtilsService, + TokenService, +} from '../abstractions'; -import { EnvironmentUrls } from '../models/domain/environmentUrls'; +import { EnvironmentUrls } from '../models/domain'; -import { CipherRequest } from '../models/request/cipherRequest'; -import { FolderRequest } from '../models/request/folderRequest'; -import { PasswordHintRequest } from '../models/request/passwordHintRequest'; -import { RegisterRequest } from '../models/request/registerRequest'; -import { TokenRequest } from '../models/request/tokenRequest'; -import { TwoFactorEmailRequest } from '../models/request/twoFactorEmailRequest'; +import { + CipherRequest, + FolderRequest, + PasswordHintRequest, + RegisterRequest, + TokenRequest, + TwoFactorEmailRequest, +} from '../models/request'; -import { CipherResponse } from '../models/response/cipherResponse'; -import { ErrorResponse } from '../models/response/errorResponse'; -import { FolderResponse } from '../models/response/folderResponse'; -import { IdentityTokenResponse } from '../models/response/identityTokenResponse'; -import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse'; -import { SyncResponse } from '../models/response/syncResponse'; +import { + CipherResponse, + ErrorResponse, + FolderResponse, + IdentityTokenResponse, + IdentityTwoFactorResponse, + SyncResponse, +} from '../models/response'; export class ApiService implements ApiServiceAbstraction { urlsSet: boolean = false; diff --git a/src/services/appId.service.ts b/src/services/appId.service.ts index 430a375571..50778bf8ea 100644 --- a/src/services/appId.service.ts +++ b/src/services/appId.service.ts @@ -1,7 +1,9 @@ import { UtilsService } from './utils.service'; -import { AppIdService as AppIdServiceInterface } from '../abstractions/appId.service'; -import { StorageService } from '../abstractions/storage.service'; +import { + AppIdService as AppIdServiceInterface, + StorageService, +} from '../abstractions'; export class AppIdService implements AppIdServiceInterface { constructor(private storageService: StorageService) { diff --git a/src/services/auth.service.ts b/src/services/auth.service.ts index a360dc1c1d..101a53e4f6 100644 --- a/src/services/auth.service.ts +++ b/src/services/auth.service.ts @@ -1,24 +1,32 @@ -import { TwoFactorProviderType } from '../enums/twoFactorProviderType'; +import { TwoFactorProviderType } from '../enums'; -import { AuthResult } from '../models/domain/authResult'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; +import { + AuthResult, + SymmetricCryptoKey, +} from '../models/domain'; -import { DeviceRequest } from '../models/request/deviceRequest'; -import { TokenRequest } from '../models/request/tokenRequest'; +import { + DeviceRequest, + TokenRequest, +} from '../models/request'; -import { IdentityTokenResponse } from '../models/response/identityTokenResponse'; -import { IdentityTwoFactorResponse } from '../models/response/identityTwoFactorResponse'; +import { + IdentityTokenResponse, + IdentityTwoFactorResponse, +} from '../models/response'; import { ConstantsService } from '../services/constants.service'; -import { ApiService } from '../abstractions/api.service'; -import { AppIdService } from '../abstractions/appId.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { I18nService } from '../abstractions/i18n.service'; -import { MessagingService } from '../abstractions/messaging.service'; -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; -import { TokenService } from '../abstractions/token.service'; -import { UserService } from '../abstractions/user.service'; +import { + ApiService, + AppIdService, + CryptoService, + I18nService, + MessagingService, + PlatformUtilsService, + TokenService, + UserService, +} from '../abstractions'; export const TwoFactorProviders = { [TwoFactorProviderType.Authenticator]: { diff --git a/src/services/cipher.service.ts b/src/services/cipher.service.ts index fb8e532d62..9818eab438 100644 --- a/src/services/cipher.service.ts +++ b/src/services/cipher.service.ts @@ -1,38 +1,47 @@ -import { CipherType } from '../enums/cipherType'; +import { CipherType } from '../enums'; -import { CipherData } from '../models/data/cipherData'; +import { CipherData } from '../models/data'; + +import { + Card, + Cipher, + CipherString, + Field, + Identity, + Login, + SecureNote, + SymmetricCryptoKey, +} from '../models/domain'; -import { Card } from '../models/domain/card'; -import { Cipher } from '../models/domain/cipher'; -import { CipherString } from '../models/domain/cipherString'; import Domain from '../models/domain/domain'; -import { Field } from '../models/domain/field'; -import { Identity } from '../models/domain/identity'; -import { Login } from '../models/domain/login'; -import { SecureNote } from '../models/domain/secureNote'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; -import { CipherRequest } from '../models/request/cipherRequest'; +import { CipherRequest } from '../models/request'; -import { CipherResponse } from '../models/response/cipherResponse'; -import { ErrorResponse } from '../models/response/errorResponse'; +import { + CipherResponse, + ErrorResponse, +} from '../models/response'; -import { CardView } from '../models/view/cardView'; -import { CipherView } from '../models/view/cipherView'; -import { FieldView } from '../models/view/fieldView'; -import { IdentityView } from '../models/view/identityView'; -import { LoginView } from '../models/view/loginView'; -import { View } from '../models/view/view'; +import { + CardView, + CipherView, + FieldView, + IdentityView, + LoginView, + View, +} from '../models/view'; import { ConstantsService } from './constants.service'; -import { ApiService } from '../abstractions/api.service'; -import { CipherService as CipherServiceAbstraction } from '../abstractions/cipher.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { I18nService } from '../abstractions/i18n.service'; -import { SettingsService } from '../abstractions/settings.service'; -import { StorageService } from '../abstractions/storage.service'; -import { UserService } from '../abstractions/user.service'; +import { + ApiService, + CipherService as CipherServiceAbstraction, + CryptoService, + I18nService, + SettingsService, + StorageService, + UserService, +} from '../abstractions'; const Keys = { ciphersPrefix: 'ciphers_', diff --git a/src/services/collection.service.ts b/src/services/collection.service.ts index 3e7c60c089..58b54be274 100644 --- a/src/services/collection.service.ts +++ b/src/services/collection.service.ts @@ -1,14 +1,16 @@ -import { CollectionData } from '../models/data/collectionData'; +import { CollectionData } from '../models/data'; import { Collection } from '../models/domain'; -import { CollectionView } from '../models/view/collectionView'; +import { CollectionView } from '../models/view'; -import { CollectionService as CollectionServiceAbstraction } from '../abstractions/collection.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { I18nService } from '../abstractions/i18n.service'; -import { StorageService } from '../abstractions/storage.service'; -import { UserService } from '../abstractions/user.service'; +import { + CollectionService as CollectionServiceAbstraction, + CryptoService, + I18nService, + StorageService, + UserService, +} from '../abstractions'; const Keys = { collectionsPrefix: 'collections_', diff --git a/src/services/constants.service.ts b/src/services/constants.service.ts index e0c695432c..0210d9faed 100644 --- a/src/services/constants.service.ts +++ b/src/services/constants.service.ts @@ -1,4 +1,4 @@ -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; +import { PlatformUtilsService } from '../abstractions'; export class ConstantsService { static readonly environmentUrlsKey: string = 'environmentUrls'; diff --git a/src/services/container.service.ts b/src/services/container.service.ts index fa9a6628ce..3659eacdfa 100644 --- a/src/services/container.service.ts +++ b/src/services/container.service.ts @@ -1,5 +1,7 @@ -import { CryptoService } from '../abstractions/crypto.service'; -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; +import { + CryptoService, + PlatformUtilsService, +} from '../abstractions'; export class ContainerService { constructor(private cryptoService: CryptoService, diff --git a/src/services/crypto.service.ts b/src/services/crypto.service.ts index e6ad642574..a25f1786fe 100644 --- a/src/services/crypto.service.ts +++ b/src/services/crypto.service.ts @@ -1,14 +1,19 @@ import * as forge from 'node-forge'; -import { EncryptionType } from '../enums/encryptionType'; +import { EncryptionType } from '../enums'; -import { CipherString } from '../models/domain/cipherString'; -import { EncryptedObject } from '../models/domain/encryptedObject'; -import { SymmetricCryptoKey } from '../models/domain/symmetricCryptoKey'; -import { ProfileOrganizationResponse } from '../models/response/profileOrganizationResponse'; +import { + CipherString, + EncryptedObject, + SymmetricCryptoKey, +} from '../models/domain'; -import { CryptoService as CryptoServiceAbstraction } from '../abstractions/crypto.service'; -import { StorageService as StorageServiceInterface } from '../abstractions/storage.service'; +import { ProfileOrganizationResponse } from '../models/response'; + +import { + CryptoService as CryptoServiceAbstraction, + StorageService as StorageServiceAbstraction, +} from '../abstractions'; import { ConstantsService } from './constants.service'; import { UtilsService } from './utils.service'; @@ -41,8 +46,8 @@ export class CryptoService implements CryptoServiceAbstraction { private privateKey: ArrayBuffer; private orgKeys: Map; - constructor(private storageService: StorageServiceInterface, - private secureStorageService: StorageServiceInterface) { + constructor(private storageService: StorageServiceAbstraction, + private secureStorageService: StorageServiceAbstraction) { } async setKey(key: SymmetricCryptoKey): Promise { diff --git a/src/services/environment.service.ts b/src/services/environment.service.ts index e1544489f1..d9bab748a0 100644 --- a/src/services/environment.service.ts +++ b/src/services/environment.service.ts @@ -1,10 +1,12 @@ -import { EnvironmentUrls } from '../models/domain/environmentUrls'; +import { EnvironmentUrls } from '../models/domain'; import { ConstantsService } from './constants.service'; -import { ApiService } from '../abstractions/api.service'; -import { EnvironmentService as EnvironmentServiceAbstraction } from '../abstractions/environment.service'; -import { StorageService } from '../abstractions/storage.service'; +import { + ApiService, + EnvironmentService as EnvironmentServiceAbstraction, + StorageService, +} from '../abstractions'; export class EnvironmentService implements EnvironmentServiceAbstraction { baseUrl: string; diff --git a/src/services/folder.service.ts b/src/services/folder.service.ts index 81c03a15f5..a8f1769874 100644 --- a/src/services/folder.service.ts +++ b/src/services/folder.service.ts @@ -1,19 +1,21 @@ -import { FolderData } from '../models/data/folderData'; +import { FolderData } from '../models/data'; -import { Folder } from '../models/domain/folder'; +import { Folder } from '../models/domain'; -import { FolderRequest } from '../models/request/folderRequest'; +import { FolderRequest } from '../models/request'; -import { FolderResponse } from '../models/response/folderResponse'; +import { FolderResponse } from '../models/response'; -import { FolderView } from '../models/view/folderView'; +import { FolderView } from '../models/view'; -import { ApiService } from '../abstractions/api.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { FolderService as FolderServiceAbstraction } from '../abstractions/folder.service'; -import { I18nService } from '../abstractions/i18n.service'; -import { StorageService } from '../abstractions/storage.service'; -import { UserService } from '../abstractions/user.service'; +import { + ApiService, + CryptoService, + FolderService as FolderServiceAbstraction, + I18nService, + StorageService, + UserService, +} from '../abstractions'; const Keys = { foldersPrefix: 'folders_', diff --git a/src/services/lock.service.ts b/src/services/lock.service.ts index ba54fec1bf..db24c60219 100644 --- a/src/services/lock.service.ts +++ b/src/services/lock.service.ts @@ -1,13 +1,15 @@ import { ConstantsService } from './constants.service'; -import { CipherService } from '../abstractions/cipher.service'; -import { CollectionService } from '../abstractions/collection.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { FolderService } from '../abstractions/folder.service'; -import { LockService as LockServiceAbstraction } from '../abstractions/lock.service'; -import { MessagingService } from '../abstractions/messaging.service'; -import { PlatformUtilsService } from '../abstractions/platformUtils.service'; -import { StorageService } from '../abstractions/storage.service'; +import { + CipherService, + CollectionService, + CryptoService, + FolderService, + LockService as LockServiceAbstraction, + MessagingService, + PlatformUtilsService, + StorageService, +} from '../abstractions'; export class LockService implements LockServiceAbstraction { constructor(private cipherService: CipherService, private folderService: FolderService, diff --git a/src/services/passwordGeneration.service.ts b/src/services/passwordGeneration.service.ts index 09b728c050..40cc3705c7 100644 --- a/src/services/passwordGeneration.service.ts +++ b/src/services/passwordGeneration.service.ts @@ -1,13 +1,15 @@ -import { CipherString } from '../models/domain/cipherString'; -import { PasswordHistory } from '../models/domain/passwordHistory'; +import { + CipherString, + PasswordHistory, +} from '../models/domain'; import { UtilsService } from './utils.service'; -import { CryptoService } from '../abstractions/crypto.service'; import { + CryptoService, PasswordGenerationService as PasswordGenerationServiceAbstraction, -} from '../abstractions/passwordGeneration.service'; -import { StorageService } from '../abstractions/storage.service'; + StorageService, +} from '../abstractions'; const DefaultOptions = { length: 14, diff --git a/src/services/settings.service.ts b/src/services/settings.service.ts index 506bdf01a0..cd9ee2e66e 100644 --- a/src/services/settings.service.ts +++ b/src/services/settings.service.ts @@ -1,6 +1,8 @@ -import { SettingsService as SettingsServiceAbstraction } from '../abstractions/settings.service'; -import { StorageService } from '../abstractions/storage.service'; -import { UserService } from '../abstractions/user.service'; +import { + SettingsService as SettingsServiceAbstraction, + StorageService, + UserService, +} from '../abstractions'; const Keys = { settingsPrefix: 'settings_', diff --git a/src/services/state.service.ts b/src/services/state.service.ts index 03a09e30fc..d8b845c010 100644 --- a/src/services/state.service.ts +++ b/src/services/state.service.ts @@ -1,4 +1,4 @@ -import { StateService as StateServiceAbstraction } from '../abstractions/state.service'; +import { StateService as StateServiceAbstraction } from '../abstractions'; export class StateService implements StateServiceAbstraction { private state: any = {}; diff --git a/src/services/sync.service.ts b/src/services/sync.service.ts index 2a001e01a8..fdcd16f493 100644 --- a/src/services/sync.service.ts +++ b/src/services/sync.service.ts @@ -1,23 +1,29 @@ -import { ApiService } from '../abstractions/api.service'; -import { CipherService } from '../abstractions/cipher.service'; -import { CollectionService } from '../abstractions/collection.service'; -import { CryptoService } from '../abstractions/crypto.service'; -import { FolderService } from '../abstractions/folder.service'; -import { MessagingService } from '../abstractions/messaging.service'; -import { SettingsService } from '../abstractions/settings.service'; -import { StorageService } from '../abstractions/storage.service'; -import { SyncService as SyncServiceAbstraction } from '../abstractions/sync.service'; -import { UserService } from '../abstractions/user.service'; +import { + ApiService, + CipherService, + CollectionService, + CryptoService, + FolderService, + MessagingService, + SettingsService, + StorageService, + SyncService as SyncServiceAbstraction, + UserService, +} from '../abstractions'; -import { CipherData } from '../models/data/cipherData'; -import { CollectionData } from '../models/data/collectionData'; -import { FolderData } from '../models/data/folderData'; +import { + CipherData, + CollectionData, + FolderData, +} from '../models/data'; -import { CipherResponse } from '../models/response/cipherResponse'; -import { CollectionResponse } from '../models/response/collectionResponse'; -import { DomainsResponse } from '../models/response/domainsResponse'; -import { FolderResponse } from '../models/response/folderResponse'; -import { ProfileResponse } from '../models/response/profileResponse'; +import { + CipherResponse, + CollectionResponse, + DomainsResponse, + FolderResponse, + ProfileResponse, +} from '../models/response'; const Keys = { lastSyncPrefix: 'lastSync_', diff --git a/src/services/token.service.ts b/src/services/token.service.ts index 94dbfa10fd..694c2bf78c 100644 --- a/src/services/token.service.ts +++ b/src/services/token.service.ts @@ -1,8 +1,10 @@ import { ConstantsService } from './constants.service'; import { UtilsService } from './utils.service'; -import { StorageService } from '../abstractions/storage.service'; -import { TokenService as TokenServiceAbstraction } from '../abstractions/token.service'; +import { + StorageService, + TokenService as TokenServiceAbstraction, +} from '../abstractions'; const Keys = { accessToken: 'accessToken', diff --git a/src/services/totp.service.ts b/src/services/totp.service.ts index e52c11e48c..1bc57b4be8 100644 --- a/src/services/totp.service.ts +++ b/src/services/totp.service.ts @@ -1,7 +1,9 @@ import { ConstantsService } from './constants.service'; -import { StorageService } from '../abstractions/storage.service'; -import { TotpService as TotpServiceAbstraction } from '../abstractions/totp.service'; +import { + StorageService, + TotpService as TotpServiceAbstraction, +} from '../abstractions'; const b32Chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567'; diff --git a/src/services/user.service.ts b/src/services/user.service.ts index 1949cadb48..5fefef16ce 100644 --- a/src/services/user.service.ts +++ b/src/services/user.service.ts @@ -1,6 +1,8 @@ -import { StorageService } from '../abstractions/storage.service'; -import { TokenService } from '../abstractions/token.service'; -import { UserService as UserServiceAbsrtaction } from '../abstractions/user.service'; +import { + StorageService, + TokenService, + UserService as UserServiceAbsrtaction, +} from '../abstractions'; const Keys = { userId: 'userId', diff --git a/src/services/utils.service.ts b/src/services/utils.service.ts index 359a743a91..7a58df6a5a 100644 --- a/src/services/utils.service.ts +++ b/src/services/utils.service.ts @@ -1,4 +1,4 @@ -import { UtilsService as UtilsServiceAbstraction } from '../abstractions/utils.service'; +import { UtilsService as UtilsServiceAbstraction } from '../abstractions'; export class UtilsService implements UtilsServiceAbstraction { static copyToClipboard(text: string, doc?: Document): void {