tests/bulk_data.test.js
/**
     * Starts an export and waits for it. Then downloads the file at the given
     * index. NOTE: this method assumes that the index exists and will throw
     * otherwise.
     * @param {Number} index The index of the file in the status list
     */
Starts an export and waits for it. Then downloads the file at the given
index. NOTE: this method assumes that the index exists and will throw
otherwise.
@param {Number} index The index of the file in the status list
Starts an export and waits for it . Then downloads the file at the given index . NOTE : this method assumes that the index exists and will throw otherwise . @param { Number } index The index of the file in the status list
async downloadFileAt(index, accessToken = null, fileError = null) {
        if (!this.statusResponse || !this.statusResponse.body) {
            throw new Error("Trying to download from export that has not been completed");
        }
        let fileUrl;
        try {
            fileUrl = this.statusResponse.body.output[index].url;
        } catch (e) {
            throw new Error(`No file was found at "output[${index}]" in the status response.`);
        }
        return await this.downloadFile(fileUrl, accessToken, fileError);
    }
async downloadFileAt ( index , accessToken = null , fileError = null ) { if ( ! this . statusResponse || ! this . statusResponse . body ) { throw new Error ( "Trying to download from export that has not been completed" ) ; } let fileUrl ; try { fileUrl = this . statusResponse . body . output [ index ] . url ; } catch ( e ) { throw new Error ( ` ${ index } ` ) ; } return await this . downloadFile ( fileUrl , accessToken , fileError ) ; }
Starts an export and waits for it.
Starts an export and waits for it .