mirror of
https://github.com/empayre/fleet.git
synced 2024-11-06 17:05:18 +00:00
31 lines
1.0 KiB
TypeScript
31 lines
1.0 KiB
TypeScript
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
|
import { IDeviceUserResponse, IHostDevice } from "interfaces/host";
|
|
import sendRequest from "services";
|
|
import endpoints from "utilities/endpoints";
|
|
|
|
export type ILoadHostDetailsExtension = "device_mapping" | "macadmins";
|
|
|
|
export default {
|
|
loadHostDetails: (deviceAuthToken: string): Promise<IDeviceUserResponse> => {
|
|
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);
|
|
},
|
|
};
|