generaltranslation 8.1.19 → 8.1.21
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/README.md +2 -3
- package/dist/index.cjs.min.cjs +3 -3
- package/dist/index.cjs.min.cjs.map +1 -1
- package/dist/index.d.ts +38 -4
- package/dist/index.esm.min.mjs +3 -3
- package/dist/index.esm.min.mjs.map +1 -1
- package/dist/translate/awaitJobs.d.ts +19 -0
- package/dist/translate/enqueueFiles.d.ts +1 -1
- package/dist/translate/publishFiles.d.ts +2 -0
- package/dist/types-dir/api/downloadFileBatch.d.ts +1 -0
- package/dist/types-dir/api/file.d.ts +6 -2
- package/dist/types.d.ts +24 -10
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { JobStatus } from './checkJobStatus';
|
|
2
|
+
export type AwaitJobsOptions = {
|
|
3
|
+
/** Polling interval in seconds. Defaults to 5. */
|
|
4
|
+
pollingIntervalSeconds?: number;
|
|
5
|
+
/** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */
|
|
6
|
+
timeoutSeconds?: number;
|
|
7
|
+
};
|
|
8
|
+
export type JobResult = {
|
|
9
|
+
jobId: string;
|
|
10
|
+
status: JobStatus;
|
|
11
|
+
error?: {
|
|
12
|
+
message: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type AwaitJobsResult = {
|
|
16
|
+
/** Whether all jobs completed (none still in progress). */
|
|
17
|
+
complete: boolean;
|
|
18
|
+
jobs: JobResult[];
|
|
19
|
+
};
|
|
@@ -14,10 +14,11 @@ type FormatMetadata = Record<string, any> | Updates[number]['metadata'];
|
|
|
14
14
|
* @property {string} [incomingBranchId] - The ID of the incoming branch of the file
|
|
15
15
|
* @property {string} [checkedOutBranchId] - The ID of the checked out branch of the file
|
|
16
16
|
*/
|
|
17
|
-
export type FileToUpload =
|
|
17
|
+
export type FileToUpload = Omit<FileReference, 'branchId'> & {
|
|
18
18
|
content: string;
|
|
19
19
|
locale: string;
|
|
20
20
|
formatMetadata?: FormatMetadata;
|
|
21
|
+
branchId?: string;
|
|
21
22
|
incomingBranchId?: string;
|
|
22
23
|
checkedOutBranchId?: string;
|
|
23
24
|
};
|
|
@@ -44,7 +45,10 @@ export type FileReference = {
|
|
|
44
45
|
* @see {@link FileReference}
|
|
45
46
|
* @property {string} [branchId] - The ID of the branch of the file
|
|
46
47
|
*/
|
|
47
|
-
export type
|
|
48
|
+
export type FileReferenceIds = Omit<FileReference, 'branchId' | 'fileName' | 'fileFormat' | 'dataFormat'> & {
|
|
48
49
|
branchId?: string;
|
|
50
|
+
fileName?: string;
|
|
51
|
+
fileFormat?: FileFormat;
|
|
52
|
+
dataFormat?: DataFormat;
|
|
49
53
|
};
|
|
50
54
|
export {};
|
package/dist/types.d.ts
CHANGED
|
@@ -208,10 +208,11 @@ type FormatMetadata = Record<string, any> | Updates[number]['metadata'];
|
|
|
208
208
|
* @property {string} [incomingBranchId] - The ID of the incoming branch of the file
|
|
209
209
|
* @property {string} [checkedOutBranchId] - The ID of the checked out branch of the file
|
|
210
210
|
*/
|
|
211
|
-
type FileToUpload =
|
|
211
|
+
type FileToUpload = Omit<FileReference, 'branchId'> & {
|
|
212
212
|
content: string;
|
|
213
213
|
locale: string;
|
|
214
214
|
formatMetadata?: FormatMetadata;
|
|
215
|
+
branchId?: string;
|
|
215
216
|
incomingBranchId?: string;
|
|
216
217
|
checkedOutBranchId?: string;
|
|
217
218
|
};
|
|
@@ -233,14 +234,6 @@ type FileReference = {
|
|
|
233
234
|
fileFormat: FileFormat;
|
|
234
235
|
dataFormat?: DataFormat;
|
|
235
236
|
};
|
|
236
|
-
/**
|
|
237
|
-
* File reference object structure for referencing files
|
|
238
|
-
* @see {@link FileReference}
|
|
239
|
-
* @property {string} [branchId] - The ID of the branch of the file
|
|
240
|
-
*/
|
|
241
|
-
type FileReferenceOptionalBranchId = Omit<FileReference, 'branchId'> & {
|
|
242
|
-
branchId?: string;
|
|
243
|
-
};
|
|
244
237
|
|
|
245
238
|
type DownloadFileBatchOptions = {
|
|
246
239
|
timeout?: number;
|
|
@@ -335,6 +328,8 @@ type PublishFilesResult = {
|
|
|
335
328
|
results: {
|
|
336
329
|
fileId: string;
|
|
337
330
|
versionId: string;
|
|
331
|
+
locale?: string;
|
|
332
|
+
branchId: string;
|
|
338
333
|
success: boolean;
|
|
339
334
|
error?: string;
|
|
340
335
|
}[];
|
|
@@ -485,6 +480,25 @@ type CheckJobStatusResult = {
|
|
|
485
480
|
};
|
|
486
481
|
}[];
|
|
487
482
|
|
|
483
|
+
type AwaitJobsOptions = {
|
|
484
|
+
/** Polling interval in seconds. Defaults to 5. */
|
|
485
|
+
pollingIntervalSeconds?: number;
|
|
486
|
+
/** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */
|
|
487
|
+
timeoutSeconds?: number;
|
|
488
|
+
};
|
|
489
|
+
type JobResult = {
|
|
490
|
+
jobId: string;
|
|
491
|
+
status: JobStatus;
|
|
492
|
+
error?: {
|
|
493
|
+
message: string;
|
|
494
|
+
};
|
|
495
|
+
};
|
|
496
|
+
type AwaitJobsResult = {
|
|
497
|
+
/** Whether all jobs completed (none still in progress). */
|
|
498
|
+
complete: boolean;
|
|
499
|
+
jobs: JobResult[];
|
|
500
|
+
};
|
|
501
|
+
|
|
488
502
|
type SubmitUserEditDiff = {
|
|
489
503
|
fileName: string;
|
|
490
504
|
locale: string;
|
|
@@ -602,4 +616,4 @@ type TranslationRequestConfig = {
|
|
|
602
616
|
};
|
|
603
617
|
|
|
604
618
|
export { HTML_CONTENT_PROPS };
|
|
605
|
-
export type { BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, Request, RetrievedTranslations, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
|
|
619
|
+
export type { AwaitJobsOptions, AwaitJobsResult, BranchDataResult, BranchQuery, CheckFileTranslationsOptions, CheckJobStatusResult, Content, ContentTranslationResult, CustomMapping, DataFormat, DownloadFileBatchOptions, DownloadFileBatchResult, DownloadFileOptions, DownloadedFile, EnqueueEntriesOptions, EnqueueEntriesResult, EnqueueFilesOptions, EnqueueFilesResult, ActionType as EntryActionType, EntryMetadata, FetchTranslationsOptions, FetchTranslationsResult, FileDataQuery, FileDataResult, FileFormat, FileReference, FileToUpload, FileTranslationQuery, FileUpload, FormatVariables, GTProp, GetOrphanedFilesResult, HashMetadata, HtmlContentPropKeysRecord, HtmlContentPropValuesRecord, I18nextMessage, IcuMessage, IcuTranslationResult, JobResult, JobStatus, JsxChild, JsxChildren, JsxElement, JsxTranslationResult, LocaleProperties, Metadata, MoveMapping, MoveResult, OrphanedFile, ProcessMovesOptions, ProcessMovesResponse, PublishFileEntry, PublishFilesResult, Request, RetrievedTranslations, SubmitUserEditDiff, SubmitUserEditDiffsPayload, Transformation, TransformationPrefix, TranslateManyEntry, TranslateManyResult, TranslationError, TranslationRequestConfig, TranslationResult, TranslationResultReference, TranslationStatusResult, Update, Updates, Variable, VariableTransformationSuffix, VariableType, _Content };
|