@enplug/scripts 1.11.4-dev14 → 1.11.4-dev16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -112,9 +112,9 @@ function generateFormData(crowdinPath, localPath) {
112
112
  const formData = new FormData();
113
113
 
114
114
  // formData.append('update_option', 'update_without_changes'); // Previous translations should remain valid
115
- formData.append('json', '');
115
+ // formData.append('json', '');
116
116
  formData.append(`files[${crowdinPath}]`, fs.createReadStream(localPath));
117
- formData.append(`export_patterns[${crowdinPath}]`, '%locale%.json');
117
+ // formData.append(`export_patterns[${crowdinPath}]`, '%locale%.json');
118
118
  return formData;
119
119
  }
120
120
 
@@ -162,7 +162,6 @@ async function getFileIdIfExists(credentials, directoryId, fileName) {
162
162
  const AuthStr = 'Bearer '.concat(credentials.token);
163
163
  const resp = await axios.get(url, { headers: { Authorization: AuthStr } });
164
164
  const file = resp.data.data.find(d => d.data.name === fileName);
165
- console.log('file found', file);
166
165
  return file.data.id;
167
166
  }
168
167
 
@@ -211,6 +210,8 @@ async function uploadFileToCrowdinStorage(credentials, crowdinPath, localPath) {
211
210
  }
212
211
 
213
212
  function updateCrowdinFile(credentials, storageId, fileId) {
213
+ console.log('storageId', storageId);
214
+ console.log('fileId', fileId);
214
215
  const url = `${CROWDIN_PROJECT_URL}/files/${fileId}`;
215
216
  const AuthStr = 'Bearer '.concat(credentials.token);
216
217
  const body = {
@@ -68,7 +68,7 @@ async function syncTranslations(s3Client, bucket) {
68
68
  const folderId = await findCrowdinAppSubFolderId(credentials, appDirectoryId, subfolderName);
69
69
  const fileId = await getFileIdIfExists(credentials, folderId, path.split('/')[3]);
70
70
  const storageId = await uploadFileToCrowdinStorage(credentials, config.crowdinPath, config.localPath);
71
- if(fileId) {
71
+ if(fileId && storageId) {
72
72
  const response = await updateCrowdinFile(credentials, storageId.data.data.id, fileId);
73
73
  console.log('response', response.data);
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enplug/scripts",
3
- "version": "1.11.4-dev14",
3
+ "version": "1.11.4-dev16",
4
4
  "description": "Enplug scripts",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1",