* @param {Record } filesMapping * @param {Record } storageMapping * @returns {Promise }
(filesMapping, storageMapping)
| 252 | * @returns {Promise<void>} |
| 253 | */ |
| 254 | async function updateFiles(filesMapping, storageMapping) { |
| 255 | let count = 0; |
| 256 | for (const [fullPath, fileId] of Object.entries(filesMapping)) { |
| 257 | log.info(`Updating '${toCrowdinPath(fullPath)}' (${++count} of ${Object.keys(filesMapping).length})`); |
| 258 | await performApiRequest(`/files/${fileId}`, { |
| 259 | method: 'PUT', |
| 260 | payload: { |
| 261 | storageId: storageMapping[fullPath], |
| 262 | }, |
| 263 | }); |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | /** |
| 268 | * @returns {Promise<void>} |
no test coverage detected