@enplug/scripts 1.11.4-dev1 → 1.11.4-dev2
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.
|
@@ -138,12 +138,12 @@ async function findCrowdinAppDirectoryId(credentials, crowdinPath) {
|
|
|
138
138
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=${appName}`;
|
|
139
139
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
140
140
|
const directories = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
141
|
-
return directories.data.find(d => d.data.name === appName)
|
|
141
|
+
return directories.data.find(d => d.data.name === appName).id;
|
|
142
142
|
} else if(path.startsWith('dashboard')) {
|
|
143
143
|
const url = `${CROWDIN_PROJECT_URL}/directories?filter=dashboard`;
|
|
144
144
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
145
145
|
const directories = axios.get(url, { headers: { Authorization: AuthStr } });
|
|
146
|
-
return directories.data.find(d => d.data.name === 'dashboard' && d.data.title === 'Dashboard' && d.data.path === '/dashboard')
|
|
146
|
+
return directories.data.find(d => d.data.name === 'dashboard' && d.data.title === 'Dashboard' && d.data.path === '/dashboard').id;
|
|
147
147
|
}
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -151,14 +151,14 @@ async function findCrowdinAppSubFolderId(credentials, directoryId, subfolderName
|
|
|
151
151
|
const url = `${CROWDIN_PROJECT_URL}/directories?directoryId=${directoryId}`;
|
|
152
152
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
153
153
|
const directories = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
154
|
-
return directories.data.find(d => d.data.name === subfolderName)
|
|
154
|
+
return directories.data.find(d => d.data.name === subfolderName).id;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
157
|
async function getFileIdIfExists(credentials, directoryId, fileName) {
|
|
158
158
|
const url = `${CROWDIN_PROJECT_URL}/files?directoryId=${directoryId}`;
|
|
159
159
|
const AuthStr = 'Bearer '.concat(credentials.token);
|
|
160
160
|
const files = await axios.get(url, { headers: { Authorization: AuthStr } });
|
|
161
|
-
return files.data.find(d => d.data.name === fileName)
|
|
161
|
+
return files.data.find(d => d.data.name === fileName).id;
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
async function uploadFileToCrowdinStorage(credentials, crowdinPath, localPath) {
|