generaltranslation 7.5.0 → 7.6.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/CHANGELOG.md +12 -0
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +81 -28
- package/dist/index.esm.min.mjs +3 -3
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/translate/checkSetupStatus.d.ts +8 -0
- package/dist/translate/enqueueFiles.d.ts +9 -1
- package/dist/translate/setupProject.d.ts +4 -0
- package/dist/translate/shouldSetupProject.d.ts +3 -0
- package/dist/translate/uploadTranslations.d.ts +1 -0
- package/dist/types-dir/uploadFiles.d.ts +13 -0
- package/package.json +1 -1
- /package/dist/translate/{uploadFiles.d.ts → uploadSourceFiles.d.ts} +0 -0
package/dist/index.d.ts
CHANGED
@@ -1,10 +1,14 @@
|
|
1
|
-
import { CustomMapping, FormatVariables, I18nextMessage, IcuMessage, TranslateManyResult, TranslationError, TranslationResult, Updates, EnqueueEntriesOptions, EnqueueEntriesResult,
|
1
|
+
import { CustomMapping, FormatVariables, I18nextMessage, IcuMessage, TranslateManyResult, TranslationError, TranslationResult, Updates, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesResult, CheckFileTranslationsOptions, CheckFileTranslationsResult, DownloadFileBatchOptions, DownloadFileBatchResult, FetchTranslationsOptions, FetchTranslationsResult, DownloadFileOptions, EntryMetadata, Entry } from './types';
|
2
2
|
import { LocaleProperties } from './locales/getLocaleProperties';
|
3
3
|
import { JsxChildren } from './internal';
|
4
|
+
import { SetupProjectResult } from './translate/setupProject';
|
5
|
+
import { CheckSetupStatusResult } from './translate/checkSetupStatus';
|
6
|
+
import { ShouldSetupProjectResult } from './translate/shouldSetupProject';
|
7
|
+
import { EnqueueOptions } from './translate/enqueueFiles';
|
4
8
|
import { FileTranslationQuery } from './types-dir/checkFileTranslations';
|
5
9
|
import { CheckTranslationStatusOptions, TranslationStatusResult } from './types-dir/translationStatus';
|
6
10
|
import { CustomRegionMapping } from './locales/getRegionProperties';
|
7
|
-
import { FileUpload, UploadFilesOptions } from './types-dir/uploadFiles';
|
11
|
+
import { FileUpload, FileUploadRef, UploadFilesOptions, UploadFilesResponse } from './types-dir/uploadFiles';
|
8
12
|
/**
|
9
13
|
* Type representing the constructor parameters for the GT class.
|
10
14
|
* @typedef {Object} GTConstructorParams
|
@@ -115,34 +119,53 @@ export declare class GT {
|
|
115
119
|
*/
|
116
120
|
enqueueEntries(updates: Updates, options?: EnqueueEntriesOptions): Promise<EnqueueEntriesResult>;
|
117
121
|
/**
|
118
|
-
* Enqueues
|
122
|
+
* Enqueues project setup job using the specified file references
|
119
123
|
*
|
120
|
-
*
|
121
|
-
*
|
122
|
-
*
|
124
|
+
* This method creates setup jobs that will process source file references
|
125
|
+
* and generate a project setup. The files parameter contains references (IDs) to source
|
126
|
+
* files that have already been uploaded via uploadSourceFiles. The setup jobs are queued
|
127
|
+
* for processing and will generate a project setup based on the source files.
|
123
128
|
*
|
124
|
-
* @
|
125
|
-
*
|
126
|
-
*
|
127
|
-
|
128
|
-
|
129
|
-
|
129
|
+
* @param {FileUploadRef[]} files - Array of file references containing IDs of previously uploaded source files
|
130
|
+
* @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request
|
131
|
+
* @returns {Promise<SetupProjectResult>} Object containing the jobId and status
|
132
|
+
*/
|
133
|
+
setupProject(files: FileUploadRef[], timeoutMs?: number): Promise<SetupProjectResult>;
|
134
|
+
/**
|
135
|
+
* Checks the current status of a project setup job by its unique identifier.
|
130
136
|
*
|
131
|
-
*
|
132
|
-
*
|
133
|
-
*
|
134
|
-
*
|
135
|
-
*
|
136
|
-
*
|
137
|
-
*
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
*
|
142
|
-
*
|
143
|
-
*
|
137
|
+
* This method polls the API to determine whether a setup job is still running,
|
138
|
+
* has completed successfully, or has failed. Setup jobs are created when
|
139
|
+
* uploading source files to initialize project translation workflows.
|
140
|
+
*
|
141
|
+
* @param {string} jobId - The unique identifier of the setup job to check
|
142
|
+
* @param {number} [timeoutMs] - Optional timeout in milliseconds for the API request
|
143
|
+
* @returns {Promise<CheckSetupStatusResult>} Object containing the job status
|
144
|
+
*/
|
145
|
+
checkSetupStatus(jobId: string, timeoutMs?: number): Promise<CheckSetupStatusResult>;
|
146
|
+
/**
|
147
|
+
* Checks if a prpject requires setup.
|
148
|
+
*
|
149
|
+
* This method queries API to check if a project has been set up and returns
|
150
|
+
* true if setup is missing
|
151
|
+
*
|
152
|
+
* @returns {Promise<ShouldSetupProjectResult>} Object containing shouldSetupProject
|
153
|
+
*/
|
154
|
+
shouldSetupProject(): Promise<ShouldSetupProjectResult>;
|
155
|
+
/**
|
156
|
+
* Enqueues translation jobs for previously uploaded source files.
|
157
|
+
*
|
158
|
+
* This method creates translation jobs that will process existing source files
|
159
|
+
* and generate translations in the specified target languages. The files parameter
|
160
|
+
* contains references (IDs) to source files that have already been uploaded via
|
161
|
+
* uploadSourceFiles. The translation jobs are queued for processing and will
|
162
|
+
* generate translated content based on the source files and target locales provided.
|
163
|
+
*
|
164
|
+
* @param {FileUploadRef[]} files - Array of file references containing IDs of previously uploaded source files
|
165
|
+
* @param {EnqueueOptions} options - Configuration options including source locale, target locales, and job settings
|
166
|
+
* @returns {Promise<EnqueueFilesResult>} Result containing job IDs, queue status, and processing information
|
144
167
|
*/
|
145
|
-
enqueueFiles(files:
|
168
|
+
enqueueFiles(files: FileUploadRef[], options: EnqueueOptions): Promise<EnqueueFilesResult>;
|
146
169
|
/**
|
147
170
|
* Checks the translation status of files.
|
148
171
|
*
|
@@ -174,6 +197,7 @@ export declare class GT {
|
|
174
197
|
* @returns {Promise<TranslationStatusResult>} The translation status of the version.
|
175
198
|
*
|
176
199
|
* @example
|
200
|
+
* @deprecated Use the {@link checkFileTranslations} method instead. Will be removed in v7.0.0.
|
177
201
|
* const gt = new GT({
|
178
202
|
* sourceLocale: 'en-US',
|
179
203
|
* targetLocale: 'es-ES',
|
@@ -319,10 +343,39 @@ export declare class GT {
|
|
319
343
|
translateMany(sources: Entry[], globalMetadata?: {
|
320
344
|
targetLocale: string;
|
321
345
|
} & EntryMetadata): Promise<TranslateManyResult>;
|
322
|
-
|
346
|
+
/**
|
347
|
+
* Uploads source files to the translation service without any translation content.
|
348
|
+
*
|
349
|
+
* This method creates or replaces source file entries in your project. Each uploaded
|
350
|
+
* file becomes a source that can later be translated into target languages. The files
|
351
|
+
* are processed and stored as base entries that serve as the foundation for generating
|
352
|
+
* translations through the translation workflow.
|
353
|
+
*
|
354
|
+
* @param {Array<{source: FileUpload}>} files - Array of objects containing source file data to upload
|
355
|
+
* @param {UploadFilesOptions} options - Configuration options including source locale and other upload settings
|
356
|
+
* @returns {Promise<UploadFilesResponse>} Upload result containing file IDs, version information, and upload status
|
357
|
+
*/
|
358
|
+
uploadSourceFiles(files: {
|
359
|
+
source: FileUpload;
|
360
|
+
}[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
|
361
|
+
/**
|
362
|
+
* Uploads translation files that correspond to previously uploaded source files.
|
363
|
+
*
|
364
|
+
* This method allows you to provide translated content for existing source files in your project.
|
365
|
+
* Each translation must reference an existing source file and include the translated content
|
366
|
+
* along with the target locale information. This is used when you have pre-existing translations
|
367
|
+
* that you want to upload directly rather than generating them through the translation service.
|
368
|
+
*
|
369
|
+
* @param {Array<{source: FileUpload, translations: FileUpload[]}>} files - Array of file objects where:
|
370
|
+
* - `source`: Reference to the existing source file (contains IDs but no content)
|
371
|
+
* - `translations`: Array of translated files, each containing content, locale, and reference IDs
|
372
|
+
* @param {UploadFilesOptions} options - Configuration options including source locale and upload settings
|
373
|
+
* @returns {Promise<UploadFilesResponse>} Upload result containing translation IDs, status, and processing information
|
374
|
+
*/
|
375
|
+
uploadTranslations(files: {
|
323
376
|
source: FileUpload;
|
324
377
|
translations: FileUpload[];
|
325
|
-
}[], options: UploadFilesOptions): Promise<
|
378
|
+
}[], options: UploadFilesOptions): Promise<UploadFilesResponse>;
|
326
379
|
/**
|
327
380
|
* Formats a message according to the specified locales and options.
|
328
381
|
*
|