gtx-cli 2.0.0 → 2.0.1-alpha.1
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.
package/dist/api/sendFiles.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Settings } from '../types/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { FileFormat, DataFormat } from '../types/data.js';
|
|
3
3
|
/**
|
|
4
4
|
* File object structure
|
|
5
5
|
* @param content - The content of the file
|
|
@@ -10,7 +10,7 @@ import { FileExtension, DataFormat } from '../types/data.js';
|
|
|
10
10
|
export interface FileToTranslate {
|
|
11
11
|
content: string;
|
|
12
12
|
fileName: string;
|
|
13
|
-
|
|
13
|
+
fileFormat: FileFormat;
|
|
14
14
|
dataFormat: DataFormat;
|
|
15
15
|
}
|
|
16
16
|
type ApiOptions = Settings & {
|
package/dist/api/sendFiles.js
CHANGED
|
@@ -19,8 +19,8 @@ export async function sendFiles(files, options) {
|
|
|
19
19
|
// Add each file to the form data
|
|
20
20
|
files.forEach((file, index) => {
|
|
21
21
|
formData.append(`file${index}`, new Blob([file.content]), file.fileName);
|
|
22
|
-
formData.append(`
|
|
23
|
-
formData.append(`
|
|
22
|
+
formData.append(`fileFormat${index}`, file.fileFormat);
|
|
23
|
+
formData.append(`fileDataFormat${index}`, file.dataFormat);
|
|
24
24
|
formData.append(`fileName${index}`, file.fileName);
|
|
25
25
|
});
|
|
26
26
|
// Add number of files
|
|
@@ -38,7 +38,7 @@ export async function translateFiles(filePaths, placeholderPaths, transformPaths
|
|
|
38
38
|
return {
|
|
39
39
|
content,
|
|
40
40
|
fileName: relativePath,
|
|
41
|
-
|
|
41
|
+
fileFormat: 'JSON',
|
|
42
42
|
dataFormat,
|
|
43
43
|
};
|
|
44
44
|
});
|
|
@@ -55,7 +55,7 @@ export async function translateFiles(filePaths, placeholderPaths, transformPaths
|
|
|
55
55
|
return {
|
|
56
56
|
content: sanitizedContent,
|
|
57
57
|
fileName: relativePath,
|
|
58
|
-
|
|
58
|
+
fileFormat: fileType.toUpperCase(),
|
|
59
59
|
dataFormat,
|
|
60
60
|
};
|
|
61
61
|
});
|
package/dist/types/data.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type FlattenedJSONDictionary = {
|
|
|
18
18
|
[key: string]: string;
|
|
19
19
|
};
|
|
20
20
|
export type DataFormat = 'JSX' | 'ICU' | 'I18NEXT';
|
|
21
|
-
export type
|
|
21
|
+
export type FileFormat = 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS';
|
|
22
22
|
export type JsxChildren = string | string[] | any;
|
|
23
23
|
export type Translations = {
|
|
24
24
|
[key: string]: JsxChildren;
|