generaltranslation 7.9.1 → 8.0.0
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/CHANGELOG.md +14 -0
- package/dist/errors/ApiError.d.ts +7 -0
- package/dist/errors.cjs.min.cjs +2 -0
- package/dist/errors.cjs.min.cjs.map +1 -0
- package/dist/errors.d.ts +9 -0
- package/dist/errors.esm.min.mjs +2 -0
- package/dist/errors.esm.min.mjs.map +1 -0
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +200 -269
- package/dist/index.esm.min.mjs +3 -3
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/translate/api.d.ts +1 -0
- package/dist/translate/checkJobStatus.d.ts +8 -0
- package/dist/translate/createBranch.d.ts +10 -0
- package/dist/translate/queryBranchData.d.ts +3 -0
- package/dist/translate/queryFileData.d.ts +42 -0
- package/dist/translate/submitUserEditDiffs.d.ts +3 -3
- package/dist/translate/utils/batch.d.ts +52 -0
- package/dist/types-dir/api/branch.d.ts +10 -0
- package/dist/types-dir/api/checkFileTranslations.d.ts +1 -4
- package/dist/types-dir/api/downloadFileBatch.d.ts +16 -7
- package/dist/types-dir/api/enqueueFiles.d.ts +13 -22
- package/dist/types-dir/api/file.d.ts +29 -7
- package/dist/types-dir/api/uploadFiles.d.ts +5 -10
- package/dist/types.d.ts +135 -39
- package/package.json +12 -1
- package/dist/translate/checkFileTranslations.d.ts +0 -1
- package/dist/translate/checkSetupStatus.d.ts +0 -8
- package/dist/translate/checkTranslationStatus.d.ts +0 -1
- package/dist/translate/downloadFile.d.ts +0 -1
- package/dist/translate/enqueueEntries.d.ts +0 -1
- package/dist/translate/fetchTranslations.d.ts +0 -1
- package/dist/translate/shouldSetupProject.d.ts +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const API_VERSION = "2025-11-03.v1";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export type FileDataQuery = {
|
|
2
|
+
sourceFiles?: {
|
|
3
|
+
fileId: string;
|
|
4
|
+
versionId: string;
|
|
5
|
+
branchId: string;
|
|
6
|
+
}[];
|
|
7
|
+
translatedFiles?: {
|
|
8
|
+
fileId: string;
|
|
9
|
+
versionId: string;
|
|
10
|
+
branchId: string;
|
|
11
|
+
locale: string;
|
|
12
|
+
}[];
|
|
13
|
+
};
|
|
14
|
+
export type FileDataResult = {
|
|
15
|
+
sourceFiles?: {
|
|
16
|
+
branchId: string;
|
|
17
|
+
fileId: string;
|
|
18
|
+
versionId: string;
|
|
19
|
+
fileName: string;
|
|
20
|
+
fileFormat: string;
|
|
21
|
+
dataFormat: string | null;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
approvalRequiredAt: string | null;
|
|
25
|
+
publishedAt: string | null;
|
|
26
|
+
locales: string[];
|
|
27
|
+
sourceLocale: string;
|
|
28
|
+
}[];
|
|
29
|
+
translatedFiles?: {
|
|
30
|
+
branchId: string;
|
|
31
|
+
fileId: string;
|
|
32
|
+
versionId: string;
|
|
33
|
+
fileFormat: string;
|
|
34
|
+
dataFormat: string | null;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
updatedAt: string;
|
|
37
|
+
approvedAt: string | null;
|
|
38
|
+
publishedAt: string | null;
|
|
39
|
+
completedAt: string | null;
|
|
40
|
+
locale: string;
|
|
41
|
+
}[];
|
|
42
|
+
};
|
|
@@ -2,11 +2,11 @@ export type SubmitUserEditDiff = {
|
|
|
2
2
|
fileName: string;
|
|
3
3
|
locale: string;
|
|
4
4
|
diff: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
branchId: string;
|
|
6
|
+
versionId: string;
|
|
7
|
+
fileId: string;
|
|
7
8
|
localContent?: string;
|
|
8
9
|
};
|
|
9
10
|
export type SubmitUserEditDiffsPayload = {
|
|
10
|
-
projectId?: string;
|
|
11
11
|
diffs: SubmitUserEditDiff[];
|
|
12
12
|
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Splits an array into batches of a specified size.
|
|
3
|
+
* @param items - The array to split into batches
|
|
4
|
+
* @param batchSize - The maximum size of each batch
|
|
5
|
+
* @returns An array of batches
|
|
6
|
+
*/
|
|
7
|
+
export declare function createBatches<T>(items: T[], batchSize: number): T[][];
|
|
8
|
+
/**
|
|
9
|
+
* Result of processing batches
|
|
10
|
+
*/
|
|
11
|
+
export interface BatchList<T> {
|
|
12
|
+
/** The items successfully processed across all batches */
|
|
13
|
+
data: T[];
|
|
14
|
+
/** The total number of items processed */
|
|
15
|
+
count: number;
|
|
16
|
+
/** The number of batches processed */
|
|
17
|
+
batchCount: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options for batch processing
|
|
21
|
+
*/
|
|
22
|
+
export interface BatchProcessOptions {
|
|
23
|
+
/** Maximum number of items per batch (default: 100) */
|
|
24
|
+
batchSize?: number;
|
|
25
|
+
/** Whether to process batches in parallel (default: true) */
|
|
26
|
+
parallel?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Processes items in batches using a provided processor function.
|
|
30
|
+
*
|
|
31
|
+
* @param items - The items to process
|
|
32
|
+
* @param processor - Async function that processes a single batch and returns items
|
|
33
|
+
* @param options - Optional configuration for batch processing
|
|
34
|
+
* @returns Promise that resolves to a BatchList containing all processed items
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```typescript
|
|
38
|
+
* const result = await processBatches(
|
|
39
|
+
* files,
|
|
40
|
+
* async (batch) => {
|
|
41
|
+
* const response = await uploadFiles(batch);
|
|
42
|
+
* return response.uploadedFiles;
|
|
43
|
+
* },
|
|
44
|
+
* { batchSize: 100 }
|
|
45
|
+
* );
|
|
46
|
+
*
|
|
47
|
+
* console.log(result.data); // All items
|
|
48
|
+
* console.log(result.count); // Total count
|
|
49
|
+
* console.log(result.batchCount); // Number of batches processed
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function processBatches<TInput, TOutput>(items: TInput[], processor: (batch: TInput[]) => Promise<TOutput[]>, options?: BatchProcessOptions): Promise<BatchList<TOutput>>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { CompletedFileTranslationData } from './file';
|
|
2
1
|
export type FileTranslationQuery = {
|
|
3
2
|
versionId: string;
|
|
4
3
|
fileName?: string;
|
|
@@ -8,11 +7,9 @@ export type FileTranslationQuery = {
|
|
|
8
7
|
export type CheckFileTranslationsOptions = {
|
|
9
8
|
timeout?: number;
|
|
10
9
|
};
|
|
11
|
-
export type CheckFileTranslationsResult = {
|
|
12
|
-
translations: CompletedFileTranslationData[];
|
|
13
|
-
};
|
|
14
10
|
export type FileQuery = {
|
|
15
11
|
fileId: string;
|
|
12
|
+
branchId?: string;
|
|
16
13
|
versionId?: string;
|
|
17
14
|
};
|
|
18
15
|
export type FileQueryResult = {
|
|
@@ -1,24 +1,33 @@
|
|
|
1
1
|
import { FileFormat } from './file';
|
|
2
|
+
export type DownloadFileBatchRequest = {
|
|
3
|
+
fileId: string;
|
|
4
|
+
branchId?: string;
|
|
5
|
+
versionId?: string;
|
|
6
|
+
locale?: string;
|
|
7
|
+
}[];
|
|
2
8
|
export type DownloadFileBatchOptions = {
|
|
3
9
|
timeout?: number;
|
|
4
10
|
};
|
|
5
11
|
export type BatchDownloadResult = {
|
|
6
|
-
|
|
7
|
-
fileName
|
|
12
|
+
fileId: string;
|
|
13
|
+
fileName: string;
|
|
8
14
|
success: boolean;
|
|
9
15
|
content?: string;
|
|
10
16
|
contentType?: string;
|
|
11
17
|
error?: string;
|
|
12
18
|
};
|
|
13
|
-
type
|
|
19
|
+
export type DownloadedFile = {
|
|
14
20
|
id: string;
|
|
15
|
-
|
|
21
|
+
branchId: string;
|
|
22
|
+
fileId: string;
|
|
23
|
+
versionId: string;
|
|
24
|
+
locale?: string;
|
|
25
|
+
fileName?: string;
|
|
16
26
|
data: string;
|
|
17
|
-
metadata: any
|
|
27
|
+
metadata: Record<string, any>;
|
|
18
28
|
fileFormat: FileFormat;
|
|
19
29
|
};
|
|
20
30
|
export type DownloadFileBatchResult = {
|
|
21
|
-
files:
|
|
31
|
+
files: DownloadedFile[];
|
|
22
32
|
count: number;
|
|
23
33
|
};
|
|
24
|
-
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { CompletedFileTranslationData, FileFormat } from './file';
|
|
1
|
+
import { JsxChildren } from '../jsx/content';
|
|
3
2
|
export type Updates = ({
|
|
4
3
|
metadata: Record<string, any>;
|
|
5
4
|
} & ({
|
|
@@ -12,21 +11,6 @@ export type Updates = ({
|
|
|
12
11
|
dataFormat: 'I18NEXT';
|
|
13
12
|
source: string;
|
|
14
13
|
}))[];
|
|
15
|
-
/**
|
|
16
|
-
* File object structure for enqueueing files
|
|
17
|
-
* @param content - Content of the file
|
|
18
|
-
* @param fileName - Unique identifier for the file (such as the file path + file name)
|
|
19
|
-
* @param fileFormat - The format of the file (JSON, MDX, MD, etc.)
|
|
20
|
-
* @param formatMetadata - Optional metadata for the file, specific to the format of the file
|
|
21
|
-
* @param dataFormat - Optional format of the data within the file
|
|
22
|
-
*/
|
|
23
|
-
export type FileToTranslate = {
|
|
24
|
-
content: string;
|
|
25
|
-
fileName: string;
|
|
26
|
-
fileFormat: FileFormat;
|
|
27
|
-
formatMetadata?: Record<string, any>;
|
|
28
|
-
dataFormat?: DataFormat;
|
|
29
|
-
};
|
|
30
14
|
/**
|
|
31
15
|
* Options for enqueueing files
|
|
32
16
|
* @param publish - Whether to publish the files
|
|
@@ -52,11 +36,18 @@ export type EnqueueFilesOptions = {
|
|
|
52
36
|
};
|
|
53
37
|
export type RequiredEnqueueFilesOptions = EnqueueFilesOptions & Required<Pick<EnqueueFilesOptions, 'sourceLocale'>>;
|
|
54
38
|
export type EnqueueFilesResult = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
39
|
+
jobData: {
|
|
40
|
+
[jobId: string]: {
|
|
41
|
+
sourceFileId: string;
|
|
42
|
+
fileId: string;
|
|
43
|
+
versionId: string;
|
|
44
|
+
branchId: string;
|
|
45
|
+
targetLocale: string;
|
|
46
|
+
projectId: string;
|
|
47
|
+
force: boolean;
|
|
48
|
+
modelProvider?: string;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
60
51
|
locales: string[];
|
|
61
52
|
message: string;
|
|
62
53
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { DataFormat } from 'src/types';
|
|
1
2
|
import { Entry } from './entry';
|
|
2
3
|
export type FileFormat = 'GTJSON' | 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML';
|
|
3
4
|
export type FileMetadata = {
|
|
@@ -11,13 +12,34 @@ export type File = {
|
|
|
11
12
|
source: Entry[] | string;
|
|
12
13
|
fileMetadata: FileMetadata;
|
|
13
14
|
};
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* File object structure for uploading files
|
|
17
|
+
* @param content - Content of the file
|
|
18
|
+
* @param fileName - Unique identifier for the file (such as the file path + file name)
|
|
19
|
+
* @param fileFormat - The format of the file (JSON, MDX, MD, etc.)
|
|
20
|
+
* @param formatMetadata - Optional metadata for the file, specific to the format of the file
|
|
21
|
+
* @param dataFormat - Optional format of the data within the file
|
|
22
|
+
*/
|
|
23
|
+
export type FileToUpload = {
|
|
24
|
+
content: string;
|
|
25
|
+
formatMetadata?: Record<string, any>;
|
|
26
|
+
incomingBranchId?: string;
|
|
27
|
+
checkedOutBranchId?: string;
|
|
28
|
+
} & Omit<FileReference, 'branchId'> & {
|
|
29
|
+
branchId?: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* File object structure for referencing files
|
|
33
|
+
* @param fileId - The ID of the file
|
|
34
|
+
* @param versionId - The ID of the version of the file
|
|
35
|
+
* @param branchId - The ID of the branch of the file
|
|
36
|
+
* @param locale - The locale of the file ()
|
|
37
|
+
*/
|
|
38
|
+
export type FileReference = {
|
|
17
39
|
fileId: string;
|
|
18
|
-
fileName: string;
|
|
19
40
|
versionId: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
41
|
+
branchId: string;
|
|
42
|
+
fileName: string;
|
|
43
|
+
fileFormat: FileFormat;
|
|
44
|
+
dataFormat?: DataFormat;
|
|
23
45
|
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { DataFormat } from '../jsx/content';
|
|
2
|
-
import { FileFormat } from './file';
|
|
2
|
+
import { FileFormat, FileReference } from './file';
|
|
3
3
|
export type FileUpload = {
|
|
4
|
+
branchId?: string;
|
|
5
|
+
incomingBranchId?: string;
|
|
6
|
+
checkedOutBranchId?: string;
|
|
4
7
|
content: string;
|
|
5
8
|
fileName: string;
|
|
6
9
|
fileFormat: FileFormat;
|
|
@@ -9,14 +12,6 @@ export type FileUpload = {
|
|
|
9
12
|
versionId?: string;
|
|
10
13
|
fileId?: string;
|
|
11
14
|
};
|
|
12
|
-
export type FileUploadRef = {
|
|
13
|
-
fileId: string;
|
|
14
|
-
versionId: string;
|
|
15
|
-
fileName: string;
|
|
16
|
-
fileFormat: FileFormat;
|
|
17
|
-
dataFormat?: DataFormat;
|
|
18
|
-
locale?: string;
|
|
19
|
-
};
|
|
20
15
|
export type UploadData = {
|
|
21
16
|
data: {
|
|
22
17
|
source: FileUpload;
|
|
@@ -31,7 +26,7 @@ export type UploadFilesOptions = {
|
|
|
31
26
|
timeout?: number;
|
|
32
27
|
};
|
|
33
28
|
export type UploadFilesResponse = {
|
|
34
|
-
uploadedFiles:
|
|
29
|
+
uploadedFiles: FileReference[];
|
|
35
30
|
count: number;
|
|
36
31
|
message: string;
|
|
37
32
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { DataFormat as DataFormat$1 } from 'src/types';
|
|
2
|
+
|
|
1
3
|
type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
|
|
2
4
|
|
|
3
5
|
type LocaleProperties = {
|
|
@@ -129,18 +131,6 @@ type TranslationStatusResult = {
|
|
|
129
131
|
localesWaitingForApproval: any[];
|
|
130
132
|
};
|
|
131
133
|
|
|
132
|
-
type FileFormat = 'GTJSON' | 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML';
|
|
133
|
-
type CompletedFileTranslationData = {
|
|
134
|
-
locale: string;
|
|
135
|
-
metadata: any;
|
|
136
|
-
fileId: string;
|
|
137
|
-
fileName: string;
|
|
138
|
-
versionId: string;
|
|
139
|
-
id: string;
|
|
140
|
-
isReady: boolean;
|
|
141
|
-
downloadUrl: string;
|
|
142
|
-
};
|
|
143
|
-
|
|
144
134
|
type FileTranslationQuery = {
|
|
145
135
|
versionId: string;
|
|
146
136
|
fileName?: string;
|
|
@@ -150,22 +140,56 @@ type FileTranslationQuery = {
|
|
|
150
140
|
type CheckFileTranslationsOptions = {
|
|
151
141
|
timeout?: number;
|
|
152
142
|
};
|
|
153
|
-
|
|
154
|
-
|
|
143
|
+
|
|
144
|
+
type FileFormat = 'GTJSON' | 'JSON' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML';
|
|
145
|
+
/**
|
|
146
|
+
* File object structure for uploading files
|
|
147
|
+
* @param content - Content of the file
|
|
148
|
+
* @param fileName - Unique identifier for the file (such as the file path + file name)
|
|
149
|
+
* @param fileFormat - The format of the file (JSON, MDX, MD, etc.)
|
|
150
|
+
* @param formatMetadata - Optional metadata for the file, specific to the format of the file
|
|
151
|
+
* @param dataFormat - Optional format of the data within the file
|
|
152
|
+
*/
|
|
153
|
+
type FileToUpload = {
|
|
154
|
+
content: string;
|
|
155
|
+
formatMetadata?: Record<string, any>;
|
|
156
|
+
incomingBranchId?: string;
|
|
157
|
+
checkedOutBranchId?: string;
|
|
158
|
+
} & Omit<FileReference, 'branchId'> & {
|
|
159
|
+
branchId?: string;
|
|
160
|
+
};
|
|
161
|
+
/**
|
|
162
|
+
* File object structure for referencing files
|
|
163
|
+
* @param fileId - The ID of the file
|
|
164
|
+
* @param versionId - The ID of the version of the file
|
|
165
|
+
* @param branchId - The ID of the branch of the file
|
|
166
|
+
* @param locale - The locale of the file ()
|
|
167
|
+
*/
|
|
168
|
+
type FileReference = {
|
|
169
|
+
fileId: string;
|
|
170
|
+
versionId: string;
|
|
171
|
+
branchId: string;
|
|
172
|
+
fileName: string;
|
|
173
|
+
fileFormat: FileFormat;
|
|
174
|
+
dataFormat?: DataFormat$1;
|
|
155
175
|
};
|
|
156
176
|
|
|
157
177
|
type DownloadFileBatchOptions = {
|
|
158
178
|
timeout?: number;
|
|
159
179
|
};
|
|
160
|
-
type
|
|
180
|
+
type DownloadedFile = {
|
|
161
181
|
id: string;
|
|
162
|
-
|
|
182
|
+
branchId: string;
|
|
183
|
+
fileId: string;
|
|
184
|
+
versionId: string;
|
|
185
|
+
locale?: string;
|
|
186
|
+
fileName?: string;
|
|
163
187
|
data: string;
|
|
164
|
-
metadata: any
|
|
188
|
+
metadata: Record<string, any>;
|
|
165
189
|
fileFormat: FileFormat;
|
|
166
190
|
};
|
|
167
191
|
type DownloadFileBatchResult = {
|
|
168
|
-
files:
|
|
192
|
+
files: DownloadedFile[];
|
|
169
193
|
count: number;
|
|
170
194
|
};
|
|
171
195
|
|
|
@@ -193,21 +217,6 @@ type Updates = ({
|
|
|
193
217
|
dataFormat: 'I18NEXT';
|
|
194
218
|
source: string;
|
|
195
219
|
}))[];
|
|
196
|
-
/**
|
|
197
|
-
* File object structure for enqueueing files
|
|
198
|
-
* @param content - Content of the file
|
|
199
|
-
* @param fileName - Unique identifier for the file (such as the file path + file name)
|
|
200
|
-
* @param fileFormat - The format of the file (JSON, MDX, MD, etc.)
|
|
201
|
-
* @param formatMetadata - Optional metadata for the file, specific to the format of the file
|
|
202
|
-
* @param dataFormat - Optional format of the data within the file
|
|
203
|
-
*/
|
|
204
|
-
type FileToTranslate = {
|
|
205
|
-
content: string;
|
|
206
|
-
fileName: string;
|
|
207
|
-
fileFormat: FileFormat;
|
|
208
|
-
formatMetadata?: Record<string, any>;
|
|
209
|
-
dataFormat?: DataFormat;
|
|
210
|
-
};
|
|
211
220
|
/**
|
|
212
221
|
* Options for enqueueing files
|
|
213
222
|
* @param publish - Whether to publish the files
|
|
@@ -232,11 +241,18 @@ type EnqueueFilesOptions = {
|
|
|
232
241
|
force?: boolean;
|
|
233
242
|
};
|
|
234
243
|
type EnqueueFilesResult = {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
244
|
+
jobData: {
|
|
245
|
+
[jobId: string]: {
|
|
246
|
+
sourceFileId: string;
|
|
247
|
+
fileId: string;
|
|
248
|
+
versionId: string;
|
|
249
|
+
branchId: string;
|
|
250
|
+
targetLocale: string;
|
|
251
|
+
projectId: string;
|
|
252
|
+
force: boolean;
|
|
253
|
+
modelProvider?: string;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
240
256
|
locales: string[];
|
|
241
257
|
message: string;
|
|
242
258
|
};
|
|
@@ -304,6 +320,86 @@ type TranslationResult = RequestSuccess | TranslationError;
|
|
|
304
320
|
*/
|
|
305
321
|
type TranslateManyResult = Array<TranslationResult>;
|
|
306
322
|
|
|
323
|
+
type BranchDataResult = {
|
|
324
|
+
branches: {
|
|
325
|
+
id: string;
|
|
326
|
+
name: string;
|
|
327
|
+
}[];
|
|
328
|
+
defaultBranch: {
|
|
329
|
+
id: string;
|
|
330
|
+
name: string;
|
|
331
|
+
} | null;
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
type BranchQuery = {
|
|
335
|
+
branchNames: string[];
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
type FileDataQuery = {
|
|
339
|
+
sourceFiles?: {
|
|
340
|
+
fileId: string;
|
|
341
|
+
versionId: string;
|
|
342
|
+
branchId: string;
|
|
343
|
+
}[];
|
|
344
|
+
translatedFiles?: {
|
|
345
|
+
fileId: string;
|
|
346
|
+
versionId: string;
|
|
347
|
+
branchId: string;
|
|
348
|
+
locale: string;
|
|
349
|
+
}[];
|
|
350
|
+
};
|
|
351
|
+
type FileDataResult = {
|
|
352
|
+
sourceFiles?: {
|
|
353
|
+
branchId: string;
|
|
354
|
+
fileId: string;
|
|
355
|
+
versionId: string;
|
|
356
|
+
fileName: string;
|
|
357
|
+
fileFormat: string;
|
|
358
|
+
dataFormat: string | null;
|
|
359
|
+
createdAt: string;
|
|
360
|
+
updatedAt: string;
|
|
361
|
+
approvalRequiredAt: string | null;
|
|
362
|
+
publishedAt: string | null;
|
|
363
|
+
locales: string[];
|
|
364
|
+
sourceLocale: string;
|
|
365
|
+
}[];
|
|
366
|
+
translatedFiles?: {
|
|
367
|
+
branchId: string;
|
|
368
|
+
fileId: string;
|
|
369
|
+
versionId: string;
|
|
370
|
+
fileFormat: string;
|
|
371
|
+
dataFormat: string | null;
|
|
372
|
+
createdAt: string;
|
|
373
|
+
updatedAt: string;
|
|
374
|
+
approvedAt: string | null;
|
|
375
|
+
publishedAt: string | null;
|
|
376
|
+
completedAt: string | null;
|
|
377
|
+
locale: string;
|
|
378
|
+
}[];
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
type JobStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'unknown';
|
|
382
|
+
type CheckJobStatusResult = {
|
|
383
|
+
jobId: string;
|
|
384
|
+
status: JobStatus;
|
|
385
|
+
error?: {
|
|
386
|
+
message: string;
|
|
387
|
+
};
|
|
388
|
+
}[];
|
|
389
|
+
|
|
390
|
+
type SubmitUserEditDiff = {
|
|
391
|
+
fileName: string;
|
|
392
|
+
locale: string;
|
|
393
|
+
diff: string;
|
|
394
|
+
branchId: string;
|
|
395
|
+
versionId: string;
|
|
396
|
+
fileId: string;
|
|
397
|
+
localContent?: string;
|
|
398
|
+
};
|
|
399
|
+
type SubmitUserEditDiffsPayload = {
|
|
400
|
+
diffs: SubmitUserEditDiff[];
|
|
401
|
+
};
|
|
402
|
+
|
|
307
403
|
/**
|
|
308
404
|
* Transformations are made from a prefix and a suffix.
|
|
309
405
|
*/
|
|
@@ -406,4 +502,4 @@ type TranslationRequestConfig = {
|
|
|
406
502
|
};
|
|
407
503
|
|
|
408
504
|
export { HTML_CONTENT_PROPS };
|
|
409
|
-
export type {
|
|
505
|
+
export type { BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, Entry, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FormatVariables, GTProp, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, Request, RetrievedTranslations, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generaltranslation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"description": "A language toolkit for AI developers",
|
|
5
5
|
"main": "dist/index.cjs.min.cjs",
|
|
6
6
|
"module": "dist/index.esm.min.mjs",
|
|
@@ -69,6 +69,11 @@
|
|
|
69
69
|
"types": "./dist/types.d.ts",
|
|
70
70
|
"require": "./dist/types.cjs.min.cjs",
|
|
71
71
|
"import": "./dist/types.esm.min.mjs"
|
|
72
|
+
},
|
|
73
|
+
"./errors": {
|
|
74
|
+
"types": "./dist/errors.d.ts",
|
|
75
|
+
"require": "./dist/errors.cjs.min.cjs",
|
|
76
|
+
"import": "./dist/errors.esm.min.mjs"
|
|
72
77
|
}
|
|
73
78
|
},
|
|
74
79
|
"typesVersions": {
|
|
@@ -81,6 +86,9 @@
|
|
|
81
86
|
],
|
|
82
87
|
"types": [
|
|
83
88
|
"./dist/types.d.ts"
|
|
89
|
+
],
|
|
90
|
+
"errors": [
|
|
91
|
+
"./dist/errors.d.ts"
|
|
84
92
|
]
|
|
85
93
|
}
|
|
86
94
|
},
|
|
@@ -95,6 +103,9 @@
|
|
|
95
103
|
],
|
|
96
104
|
"generaltranslation/types": [
|
|
97
105
|
"/dist/types"
|
|
106
|
+
],
|
|
107
|
+
"generaltranslation/errors": [
|
|
108
|
+
"/dist/errors"
|
|
98
109
|
]
|
|
99
110
|
}
|
|
100
111
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|