@tolgee/cli 2.1.4 → 2.1.6
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.
@@ -1,11 +1,18 @@
|
|
1
1
|
import FormData from 'form-data';
|
2
|
+
import { pathToPossix } from '../utils/pathToPossix.js';
|
2
3
|
export const createImportClient = ({ apiClient }) => {
|
3
4
|
return {
|
4
5
|
async import(data) {
|
5
6
|
const body = new FormData();
|
6
7
|
for (const file of data.files) {
|
7
|
-
|
8
|
+
// converting paths to possix style, so it's correctly matched on the server
|
9
|
+
body.append('files', file.data, { filepath: pathToPossix(file.name) });
|
8
10
|
}
|
11
|
+
data.params.fileMappings = data.params.fileMappings.map((i) => ({
|
12
|
+
...i,
|
13
|
+
// converting paths to possix style, so it's correctly matched on the server
|
14
|
+
fileName: pathToPossix(i.fileName),
|
15
|
+
}));
|
9
16
|
body.append('params', JSON.stringify(data.params));
|
10
17
|
return apiClient.POST('/v2/projects/{projectId}/single-step-import', {
|
11
18
|
params: { path: { projectId: apiClient.getProjectId() } },
|