(fileLocation: string)
| 114 | } |
| 115 | |
| 116 | async function thisGetFileFromS3(fileLocation: string) { |
| 117 | return new Promise(async (res, rej) => { |
| 118 | try { |
| 119 | const target = tmpdir() + '/' + v4(); |
| 120 | fs.mkdirSync(target, { recursive: true }); |
| 121 | const response = await axios({ |
| 122 | url: encodeURI(fileLocation), |
| 123 | method: 'get', |
| 124 | responseType: 'stream', |
| 125 | }); |
| 126 | response.data.pipe(fs.createWriteStream(target + '/file.zip')); |
| 127 | response.data.on('end', () => { |
| 128 | res(target + '/file.zip'); |
| 129 | }); |
| 130 | } catch (error) { |
| 131 | rej(error); |
| 132 | } |
| 133 | }); |
| 134 | } |
| 135 | |
| 136 | async function thisExtractIntoTemp(file: any) { |
| 137 | const target = tmpdir() + '/' + v4(); |
nothing calls this directly
no outgoing calls
no test coverage detected