diff --git a/src/abstractions/api.service.ts b/src/abstractions/api.service.ts index befcbe8aae..aaaae3e4da 100644 --- a/src/abstractions/api.service.ts +++ b/src/abstractions/api.service.ts @@ -38,6 +38,7 @@ import { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoR import { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest'; import { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest'; import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest'; +import { VerifyEmailRequest } from '../models/request/verifyEmailRequest'; import { BillingResponse } from '../models/response/billingResponse'; import { CipherResponse } from '../models/response/cipherResponse'; @@ -100,6 +101,8 @@ export abstract class ApiService { postAccountPayment: (request: PaymentRequest) => Promise; postAccountLicense: (data: FormData) => Promise; postAccountKeys: (request: KeysRequest) => Promise; + postAccountVerifyEmail: () => Promise; + postAccountVerifyEmailToken: (request: VerifyEmailRequest) => Promise; postFolder: (request: FolderRequest) => Promise; putFolder: (id: string, request: FolderRequest) => Promise; diff --git a/src/models/request/verifyEmailRequest.ts b/src/models/request/verifyEmailRequest.ts new file mode 100644 index 0000000000..7609fd06a7 --- /dev/null +++ b/src/models/request/verifyEmailRequest.ts @@ -0,0 +1,9 @@ +export class VerifyEmailRequest { + userId: string; + token: string; + + constructor(userId: string, token: string) { + this.userId = userId; + this.token = token; + } +} diff --git a/src/services/api.service.ts b/src/services/api.service.ts index cfdfe68b37..ba502cb50a 100644 --- a/src/services/api.service.ts +++ b/src/services/api.service.ts @@ -44,6 +44,7 @@ import { UpdateTwoFactorDuoRequest } from '../models/request/updateTwoFactorDuoR import { UpdateTwoFactorEmailRequest } from '../models/request/updateTwoFactorEmailRequest'; import { UpdateTwoFactorU2fRequest } from '../models/request/updateTwoFactorU2fRequest'; import { UpdateTwoFactorYubioOtpRequest } from '../models/request/updateTwoFactorYubioOtpRequest'; +import { VerifyEmailRequest } from '../models/request/verifyEmailRequest'; import { BillingResponse } from '../models/response/billingResponse'; import { CipherResponse } from '../models/response/cipherResponse'; @@ -249,6 +250,14 @@ export class ApiService implements ApiServiceAbstraction { return this.send('POST', '/accounts/keys', request, true, false); } + postAccountVerifyEmail(): Promise { + return this.send('POST', '/accounts/verify-email', null, true, false); + } + + postAccountVerifyEmailToken(request: VerifyEmailRequest): Promise { + return this.send('POST', '/accounts/verify-email-token', request, false, false); + } + // Folder APIs async postFolder(request: FolderRequest): Promise {