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