2022-03-21 13:38:59 +00:00
|
|
|
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
2023-05-23 18:01:04 +00:00
|
|
|
import { IDeviceUserResponse, IHostDevice } from "interfaces/host";
|
2022-03-21 13:38:59 +00:00
|
|
|
import sendRequest from "services";
|
2022-04-22 16:45:35 +00:00
|
|
|
import endpoints from "utilities/endpoints";
|
2022-03-21 13:38:59 +00:00
|
|
|
|
|
|
|
export type ILoadHostDetailsExtension = "device_mapping" | "macadmins";
|
|
|
|
|
|
|
|
export default {
|
2023-05-23 18:01:04 +00:00
|
|
|
loadHostDetails: (deviceAuthToken: string): Promise<IDeviceUserResponse> => {
|
2022-03-21 13:38:59 +00:00
|
|
|
const { DEVICE_USER_DETAILS } = endpoints;
|
|
|
|
const path = `${DEVICE_USER_DETAILS}/${deviceAuthToken}`;
|
|
|
|
|
|
|
|
return sendRequest("GET", path);
|
|
|
|
},
|
|
|
|
loadHostDetailsExtension: (
|
|
|
|
deviceAuthToken: string,
|
|
|
|
extension: ILoadHostDetailsExtension
|
|
|
|
) => {
|
|
|
|
const { DEVICE_USER_DETAILS } = endpoints;
|
|
|
|
const path = `${DEVICE_USER_DETAILS}/${deviceAuthToken}/${extension}`;
|
|
|
|
|
|
|
|
return sendRequest("GET", path);
|
|
|
|
},
|
|
|
|
refetch: (deviceAuthToken: string) => {
|
|
|
|
const { DEVICE_USER_DETAILS } = endpoints;
|
|
|
|
const path = `${DEVICE_USER_DETAILS}/${deviceAuthToken}/refetch`;
|
|
|
|
|
|
|
|
return sendRequest("POST", path);
|
|
|
|
},
|
|
|
|
};
|