fleet/frontend/services/entities/installers.ts
Roberto Dip 8acf14ab43
adjust installers endpoint to avoid AJAX downloads (#7226)
Related to #7206, this delegates the handling of the download to the browser
2022-08-16 12:54:41 -03:00

27 lines
751 B
TypeScript

/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { IInstallerType } from "interfaces/installer";
import sendRequest from "services";
import ENDPOINTS from "utilities/endpoints";
export interface ICheckInstallerExistenceRequestParams {
enrollSecret: string;
includeDesktop: boolean;
installerType: IInstallerType;
}
export default {
checkInstallerExistence: ({
enrollSecret,
includeDesktop,
installerType,
}: ICheckInstallerExistenceRequestParams): Promise<BlobPart> => {
const path = `${
ENDPOINTS.DOWNLOAD_INSTALLER
}/${installerType}?desktop=${includeDesktop}&enroll_secret=${encodeURIComponent(
enrollSecret
)}`;
return sendRequest("HEAD", path, undefined);
},
};