///
import type { IncomingMessage } from "http";
import type { Headers, Options } from "got";
import type { GatsbyCache } from "gatsby";
export type IFetchRemoteFileOptions = {
url: string;
auth?: {
htaccess_pass?: string;
htaccess_user?: string;
};
httpHeaders?: Headers;
ext?: string;
name?: string;
cacheKey?: string;
excludeDigest?: boolean;
} & ({
directory: string;
cache?: never;
} | {
directory?: never;
cache: GatsbyCache;
});
/**
* requestRemoteNode
* --
* Download the requested file
*
* @param {String} url
* @param {Headers} headers
* @param {String} tmpFilename
* @param {Object} httpOptions
* @param {number} attempt
* @return {Promise