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.
@@ -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
+ };
@@ -1,5 +1,5 @@
1
1
  export type EnqueueOptions = {
2
- sourceLocale: string;
2
+ sourceLocale?: string;
3
3
  targetLocales: string[];
4
4
  requireApproval?: boolean;
5
5
  modelProvider?: string;
@@ -9,6 +9,8 @@ export type PublishFilesResult = {
9
9
  results: {
10
10
  fileId: string;
11
11
  versionId: string;
12
+ locale?: string;
13
+ branchId: string;
12
14
  success: boolean;
13
15
  error?: string;
14
16
  }[];
@@ -4,6 +4,7 @@ export type DownloadFileBatchRequest = {
4
4
  branchId?: string;
5
5
  versionId?: string;
6
6
  locale?: string;
7
+ useLatestAvailableVersion?: boolean;
7
8
  }[];
8
9
  export type DownloadFileBatchOptions = {
9
10
  timeout?: number;
@@ -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 = FileReferenceOptionalBranchId & {
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 FileReferenceOptionalBranchId = Omit<FileReference, 'branchId'> & {
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 = FileReferenceOptionalBranchId & {
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generaltranslation",
3
- "version": "8.1.19",
3
+ "version": "8.1.21",
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",