* @param {string} name Should be properly url-encoded * @param {string} fullPath * @param {string} contentType Should be one of https://www.iana.org/assignments/media-types/media-types.xhtml * @returns {Promise >}
(name, fullPath, contentType)
| 121 | * @returns {Promise<Record<string, any>>} |
| 122 | */ |
| 123 | async function addStorage(name, fullPath, contentType) { |
| 124 | const {data: storageData} = await performApiRequest('/storages', { |
| 125 | method: 'POST', |
| 126 | headers: { |
| 127 | 'Crowdin-API-FileName': name, |
| 128 | 'Content-Type': contentType, |
| 129 | }, |
| 130 | payload: fs.createReadStream(fullPath), |
| 131 | isProjectSpecific: false, |
| 132 | }); |
| 133 | return storageData; |
| 134 | } |
| 135 | |
| 136 | /** |
| 137 | * @param {string[]} matchedFiles |
no test coverage detected