abstract api service
This commit is contained in:
parent
4694793785
commit
5845291aaf
|
@ -12,26 +12,27 @@ import { FolderResponse } from '../models/response/folderResponse';
|
||||||
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
||||||
import { SyncResponse } from '../models/response/syncResponse';
|
import { SyncResponse } from '../models/response/syncResponse';
|
||||||
|
|
||||||
export interface ApiService {
|
export abstract class ApiService {
|
||||||
urlsSet: boolean;
|
urlsSet: boolean;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
identityBaseUrl: string;
|
identityBaseUrl: string;
|
||||||
deviceType: string;
|
deviceType: string;
|
||||||
logoutCallback: Function;
|
logoutCallback: Function;
|
||||||
setUrls(urls: EnvironmentUrls): void;
|
|
||||||
postIdentityToken(request: TokenRequest): Promise<IdentityTokenResponse | any>;
|
setUrls: (urls: EnvironmentUrls) => void;
|
||||||
refreshIdentityToken(): Promise<any>;
|
postIdentityToken: (request: TokenRequest) => Promise<IdentityTokenResponse | any>;
|
||||||
postTwoFactorEmail(request: TwoFactorEmailRequest): Promise<any>;
|
refreshIdentityToken: () => Promise<any>;
|
||||||
getAccountRevisionDate(): Promise<number>;
|
postTwoFactorEmail: (request: TwoFactorEmailRequest) => Promise<any>;
|
||||||
postPasswordHint(request: PasswordHintRequest): Promise<any>;
|
getAccountRevisionDate: () => Promise<number>;
|
||||||
postRegister(request: RegisterRequest): Promise<any>;
|
postPasswordHint: (request: PasswordHintRequest) => Promise<any>;
|
||||||
postFolder(request: FolderRequest): Promise<FolderResponse>;
|
postRegister: (request: RegisterRequest) => Promise<any>;
|
||||||
putFolder(id: string, request: FolderRequest): Promise<FolderResponse>;
|
postFolder: (request: FolderRequest) => Promise<FolderResponse>;
|
||||||
deleteFolder(id: string): Promise<any>;
|
putFolder: (id: string, request: FolderRequest) => Promise<FolderResponse>;
|
||||||
postCipher(request: CipherRequest): Promise<CipherResponse>;
|
deleteFolder: (id: string) => Promise<any>;
|
||||||
putCipher(id: string, request: CipherRequest): Promise<CipherResponse>;
|
postCipher: (request: CipherRequest) => Promise<CipherResponse>;
|
||||||
deleteCipher(id: string): Promise<any>;
|
putCipher: (id: string, request: CipherRequest) => Promise<CipherResponse>;
|
||||||
postCipherAttachment(id: string, data: FormData): Promise<CipherResponse>;
|
deleteCipher: (id: string) => Promise<any>;
|
||||||
deleteCipherAttachment(id: string, attachmentId: string): Promise<any>;
|
postCipherAttachment: (id: string, data: FormData) => Promise<CipherResponse>;
|
||||||
getSync(): Promise<SyncResponse>;
|
deleteCipherAttachment: (id: string, attachmentId: string) => Promise<any>;
|
||||||
|
getSync: () => Promise<SyncResponse>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { ConstantsService } from './constants.service';
|
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 { PlatformUtilsService } from '../abstractions/platformUtils.service';
|
||||||
import { TokenService } from '../abstractions/token.service';
|
import { TokenService } from '../abstractions/token.service';
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ import { FolderResponse } from '../models/response/folderResponse';
|
||||||
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
import { IdentityTokenResponse } from '../models/response/identityTokenResponse';
|
||||||
import { SyncResponse } from '../models/response/syncResponse';
|
import { SyncResponse } from '../models/response/syncResponse';
|
||||||
|
|
||||||
export class ApiService implements ApiServiceInterface {
|
export class ApiService implements ApiServiceAbstraction {
|
||||||
urlsSet: boolean = false;
|
urlsSet: boolean = false;
|
||||||
baseUrl: string;
|
baseUrl: string;
|
||||||
identityBaseUrl: string;
|
identityBaseUrl: string;
|
||||||
|
|
Loading…
Reference in New Issue