mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-26 12:25:20 +01:00
PM-1049 - Add getDevices call to retrieve all user devices to API service
This commit is contained in:
parent
59a8dee993
commit
9d140a8aad
@ -70,6 +70,7 @@ import { UpdateTwoFactorYubioOtpRequest } from "../auth/models/request/update-tw
|
||||
import { ApiKeyResponse } from "../auth/models/response/api-key.response";
|
||||
import { AuthRequestResponse } from "../auth/models/response/auth-request.response";
|
||||
import { DeviceVerificationResponse } from "../auth/models/response/device-verification.response";
|
||||
import { DeviceResponse } from "../auth/models/response/device.response";
|
||||
import {
|
||||
EmergencyAccessGranteeDetailsResponse,
|
||||
EmergencyAccessGrantorDetailsResponse,
|
||||
@ -363,6 +364,8 @@ export abstract class ApiService {
|
||||
) => Promise<DeviceVerificationResponse>;
|
||||
getKnownDevice: (email: string, deviceIdentifier: string) => Promise<boolean>;
|
||||
|
||||
getDevices: () => Promise<ListResponse<DeviceResponse>>;
|
||||
|
||||
getEmergencyAccessTrusted: () => Promise<ListResponse<EmergencyAccessGranteeDetailsResponse>>;
|
||||
getEmergencyAccessGranted: () => Promise<ListResponse<EmergencyAccessGrantorDetailsResponse>>;
|
||||
getEmergencyAccess: (id: string) => Promise<EmergencyAccessGranteeDetailsResponse>;
|
||||
|
@ -77,6 +77,7 @@ import { UpdateTwoFactorYubioOtpRequest } from "../auth/models/request/update-tw
|
||||
import { ApiKeyResponse } from "../auth/models/response/api-key.response";
|
||||
import { AuthRequestResponse } from "../auth/models/response/auth-request.response";
|
||||
import { DeviceVerificationResponse } from "../auth/models/response/device-verification.response";
|
||||
import { DeviceResponse } from "../auth/models/response/device.response";
|
||||
import {
|
||||
EmergencyAccessGranteeDetailsResponse,
|
||||
EmergencyAccessGrantorDetailsResponse,
|
||||
@ -1118,6 +1119,12 @@ export class ApiService implements ApiServiceAbstraction {
|
||||
return r as boolean;
|
||||
}
|
||||
|
||||
// TODO: move this method to new devices-api.service once it's merged to master
|
||||
async getDevices(): Promise<ListResponse<DeviceResponse>> {
|
||||
const r = await this.send("GET", "/devices", null, true, true, null);
|
||||
return new ListResponse(r, DeviceResponse);
|
||||
}
|
||||
|
||||
// Emergency Access APIs
|
||||
|
||||
async getEmergencyAccessTrusted(): Promise<ListResponse<EmergencyAccessGranteeDetailsResponse>> {
|
||||
|
Loading…
Reference in New Issue
Block a user