diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index 6059f3a4a5..8e0cf66498 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -12,26 +12,27 @@ import { FolderResponse } from '../models/response/folderResponse'; import { IdentityTokenResponse } from '../models/response/identityTokenResponse'; import { SyncResponse } from '../models/response/syncResponse'; -export interface ApiService { +export abstract class ApiService { urlsSet: boolean; baseUrl: string; identityBaseUrl: string; deviceType: string; logoutCallback: Function; - setUrls(urls: EnvironmentUrls): void; - postIdentityToken(request: TokenRequest): Promise; - refreshIdentityToken(): Promise; - postTwoFactorEmail(request: TwoFactorEmailRequest): Promise; - getAccountRevisionDate(): Promise; - postPasswordHint(request: PasswordHintRequest): Promise; - postRegister(request: RegisterRequest): Promise; - postFolder(request: FolderRequest): Promise; - putFolder(id: string, request: FolderRequest): Promise; - deleteFolder(id: string): Promise; - postCipher(request: CipherRequest): Promise; - putCipher(id: string, request: CipherRequest): Promise; - deleteCipher(id: string): Promise; - postCipherAttachment(id: string, data: FormData): Promise; - deleteCipherAttachment(id: string, attachmentId: string): Promise; - getSync(): Promise; + + setUrls: (urls: EnvironmentUrls) => void; + postIdentityToken: (request: TokenRequest) => Promise; + refreshIdentityToken: () => Promise; + postTwoFactorEmail: (request: TwoFactorEmailRequest) => Promise; + getAccountRevisionDate: () => Promise; + postPasswordHint: (request: PasswordHintRequest) => Promise; + postRegister: (request: RegisterRequest) => Promise; + postFolder: (request: FolderRequest) => Promise; + putFolder: (id: string, request: FolderRequest) => Promise; + deleteFolder: (id: string) => Promise; + postCipher: (request: CipherRequest) => Promise; + putCipher: (id: string, request: CipherRequest) => Promise; + deleteCipher: (id: string) => Promise; + postCipherAttachment: (id: string, data: FormData) => Promise; + deleteCipherAttachment: (id: string, attachmentId: string) => Promise; + getSync: () => Promise; } diff --git a/src/services/api.service.ts b/src/services/api.service.ts index e9838ed095..5fd95daac4 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -1,6 +1,6 @@ import { ConstantsService } from './constants.service'; -import { ApiService as ApiServiceInterface } from '../abstractions/api.service'; +import { ApiService as ApiServiceAbstraction } from '../abstractions/api.service'; import { PlatformUtilsService } from '../abstractions/platformUtils.service'; import { TokenService } from '../abstractions/token.service'; @@ -19,7 +19,7 @@ import { FolderResponse } from '../models/response/folderResponse'; import { IdentityTokenResponse } from '../models/response/identityTokenResponse'; import { SyncResponse } from '../models/response/syncResponse'; -export class ApiService implements ApiServiceInterface { +export class ApiService implements ApiServiceAbstraction { urlsSet: boolean = false; baseUrl: string; identityBaseUrl: string;