generaltranslation 8.2.6 → 8.2.8

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.
Files changed (162) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/dist/ApiError-4zIP-twr.cjs +24 -0
  3. package/dist/ApiError-4zIP-twr.cjs.map +1 -0
  4. package/dist/ApiError-Bv7vlzyQ.mjs +19 -0
  5. package/dist/ApiError-Bv7vlzyQ.mjs.map +1 -0
  6. package/dist/errors.cjs +3 -0
  7. package/dist/errors.d.cts +11 -0
  8. package/dist/errors.d.mts +11 -0
  9. package/dist/errors.mjs +2 -0
  10. package/dist/id-CPbVYREY.mjs +74 -0
  11. package/dist/id-CPbVYREY.mjs.map +1 -0
  12. package/dist/id-VXBgyXu2.cjs +89 -0
  13. package/dist/id-VXBgyXu2.cjs.map +1 -0
  14. package/dist/id.cjs +5 -0
  15. package/dist/{id/hashSource.d.ts → id.d.cts} +20 -5
  16. package/dist/id.d.mts +40 -0
  17. package/dist/id.mjs +2 -0
  18. package/dist/index.cjs +3491 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/index.d.cts +1219 -0
  21. package/dist/index.d.mts +1219 -0
  22. package/dist/index.mjs +3441 -0
  23. package/dist/index.mjs.map +1 -0
  24. package/dist/internal-B3QbyI_5.mjs +820 -0
  25. package/dist/internal-B3QbyI_5.mjs.map +1 -0
  26. package/dist/internal-DIHQF9gs.cjs +1070 -0
  27. package/dist/internal-DIHQF9gs.cjs.map +1 -0
  28. package/dist/internal.cjs +45 -0
  29. package/dist/{internal.d.ts → internal.d.cts} +82 -113
  30. package/dist/internal.d.mts +263 -0
  31. package/dist/internal.mjs +3 -0
  32. package/dist/sha2-DKowBr6H.cjs +747 -0
  33. package/dist/sha2-DKowBr6H.cjs.map +1 -0
  34. package/dist/stableStringify-DgDlE_pD.mjs +53 -0
  35. package/dist/stableStringify-DgDlE_pD.mjs.map +1 -0
  36. package/dist/types-BJdoI1d1.d.cts +741 -0
  37. package/dist/types-DazaDJbs.d.mts +741 -0
  38. package/dist/types.cjs +17 -0
  39. package/dist/types.cjs.map +1 -0
  40. package/dist/types.d.cts +2 -0
  41. package/dist/types.d.mts +2 -0
  42. package/dist/types.mjs +16 -0
  43. package/dist/types.mjs.map +1 -0
  44. package/package.json +52 -32
  45. package/dist/backwards-compatability/dataConversion.d.ts +0 -23
  46. package/dist/backwards-compatability/oldHashJsxChildren.d.ts +0 -23
  47. package/dist/backwards-compatability/oldTypes.d.ts +0 -21
  48. package/dist/backwards-compatability/typeChecking.d.ts +0 -21
  49. package/dist/cache/IntlCache.d.ts +0 -26
  50. package/dist/cache/types.d.ts +0 -32
  51. package/dist/derive/condenseVars.d.ts +0 -7
  52. package/dist/derive/declareVar.d.ts +0 -26
  53. package/dist/derive/decodeVars.d.ts +0 -9
  54. package/dist/derive/derive.d.ts +0 -38
  55. package/dist/derive/extractVars.d.ts +0 -9
  56. package/dist/derive/index.d.ts +0 -7
  57. package/dist/derive/indexVars.d.ts +0 -6
  58. package/dist/derive/utils/constants.d.ts +0 -2
  59. package/dist/derive/utils/regex.d.ts +0 -2
  60. package/dist/derive/utils/sanitizeVar.d.ts +0 -12
  61. package/dist/derive/utils/traverseHelpers.d.ts +0 -4
  62. package/dist/derive/utils/traverseIcu.d.ts +0 -20
  63. package/dist/derive/utils/types.d.ts +0 -23
  64. package/dist/errors/ApiError.d.ts +0 -7
  65. package/dist/errors/formattingErrors.d.ts +0 -1
  66. package/dist/errors.cjs.min.cjs +0 -2
  67. package/dist/errors.cjs.min.cjs.map +0 -1
  68. package/dist/errors.d.ts +0 -9
  69. package/dist/errors.esm.min.mjs +0 -2
  70. package/dist/errors.esm.min.mjs.map +0 -1
  71. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +0 -59
  72. package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +0 -4
  73. package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +0 -48
  74. package/dist/formatting/format.d.ts +0 -1
  75. package/dist/id/hashTemplate.d.ts +0 -4
  76. package/dist/id/types.d.ts +0 -7
  77. package/dist/id.cjs.min.cjs +0 -2
  78. package/dist/id.cjs.min.cjs.map +0 -1
  79. package/dist/id.d.ts +0 -86
  80. package/dist/id.esm.min.mjs +0 -2
  81. package/dist/id.esm.min.mjs.map +0 -1
  82. package/dist/index.cjs.min.cjs +0 -2
  83. package/dist/index.cjs.min.cjs.map +0 -1
  84. package/dist/index.d.ts +0 -1627
  85. package/dist/index.esm.min.mjs +0 -2
  86. package/dist/index.esm.min.mjs.map +0 -1
  87. package/dist/internal.cjs.min.cjs +0 -2
  88. package/dist/internal.cjs.min.cjs.map +0 -1
  89. package/dist/internal.esm.min.mjs +0 -2
  90. package/dist/internal.esm.min.mjs.map +0 -1
  91. package/dist/locales/customLocaleMapping.d.ts +0 -11
  92. package/dist/locales/determineLocale.d.ts +0 -1
  93. package/dist/locales/getLocaleDirection.d.ts +0 -1
  94. package/dist/locales/getLocaleEmoji.d.ts +0 -2
  95. package/dist/locales/getLocaleName.d.ts +0 -1
  96. package/dist/locales/getLocaleProperties.d.ts +0 -32
  97. package/dist/locales/getPluralForm.d.ts +0 -9
  98. package/dist/locales/getRegionProperties.d.ts +0 -7
  99. package/dist/locales/isSameDialect.d.ts +0 -1
  100. package/dist/locales/isSameLanguage.d.ts +0 -1
  101. package/dist/locales/isSupersetLocale.d.ts +0 -1
  102. package/dist/locales/isValidLocale.d.ts +0 -1
  103. package/dist/locales/requiresTranslation.d.ts +0 -1
  104. package/dist/locales/resolveAliasLocale.d.ts +0 -8
  105. package/dist/locales/resolveCanonicalLocale.d.ts +0 -8
  106. package/dist/logging/errors.d.ts +0 -10
  107. package/dist/logging/logger.d.ts +0 -117
  108. package/dist/logging/warnings.d.ts +0 -2
  109. package/dist/projects/getProjectData.d.ts +0 -1
  110. package/dist/settings/plurals.d.ts +0 -3
  111. package/dist/settings/settings.d.ts +0 -2
  112. package/dist/settings/settingsUrls.d.ts +0 -3
  113. package/dist/translate/api.d.ts +0 -1
  114. package/dist/translate/awaitJobs.d.ts +0 -19
  115. package/dist/translate/checkJobStatus.d.ts +0 -8
  116. package/dist/translate/createBranch.d.ts +0 -10
  117. package/dist/translate/createTag.d.ts +0 -19
  118. package/dist/translate/downloadFileBatch.d.ts +0 -1
  119. package/dist/translate/enqueueFiles.d.ts +0 -8
  120. package/dist/translate/getOrphanedFiles.d.ts +0 -8
  121. package/dist/translate/processFileMoves.d.ts +0 -25
  122. package/dist/translate/publishFiles.d.ts +0 -17
  123. package/dist/translate/queryBranchData.d.ts +0 -3
  124. package/dist/translate/queryFileData.d.ts +0 -42
  125. package/dist/translate/querySourceFile.d.ts +0 -1
  126. package/dist/translate/setupProject.d.ts +0 -11
  127. package/dist/translate/submitUserEditDiffs.d.ts +0 -12
  128. package/dist/translate/translateMany.d.ts +0 -1
  129. package/dist/translate/uploadSourceFiles.d.ts +0 -1
  130. package/dist/translate/uploadTranslations.d.ts +0 -1
  131. package/dist/translate/utils/apiRequest.d.ts +0 -1
  132. package/dist/translate/utils/batch.d.ts +0 -52
  133. package/dist/translate/utils/fetchWithTimeout.d.ts +0 -1
  134. package/dist/translate/utils/generateRequestHeaders.d.ts +0 -2
  135. package/dist/translate/utils/handleFetchError.d.ts +0 -1
  136. package/dist/translate/utils/validateResponse.d.ts +0 -1
  137. package/dist/types-dir/api/branch.d.ts +0 -10
  138. package/dist/types-dir/api/checkFileTranslations.d.ts +0 -37
  139. package/dist/types-dir/api/downloadFile.d.ts +0 -3
  140. package/dist/types-dir/api/downloadFileBatch.d.ts +0 -34
  141. package/dist/types-dir/api/enqueueEntries.d.ts +0 -21
  142. package/dist/types-dir/api/enqueueFiles.d.ts +0 -56
  143. package/dist/types-dir/api/entry.d.ts +0 -36
  144. package/dist/types-dir/api/fetchTranslations.d.ts +0 -11
  145. package/dist/types-dir/api/file.d.ts +0 -54
  146. package/dist/types-dir/api/project.d.ts +0 -7
  147. package/dist/types-dir/api/translate.d.ts +0 -34
  148. package/dist/types-dir/api/translateMany.d.ts +0 -5
  149. package/dist/types-dir/api/translationStatus.d.ts +0 -9
  150. package/dist/types-dir/api/uploadFiles.d.ts +0 -43
  151. package/dist/types-dir/jsx/content.d.ts +0 -61
  152. package/dist/types-dir/jsx/variables.d.ts +0 -9
  153. package/dist/types-dir/transformations.d.ts +0 -8
  154. package/dist/types.cjs.min.cjs +0 -2
  155. package/dist/types.cjs.min.cjs.map +0 -1
  156. package/dist/types.d.ts +0 -652
  157. package/dist/types.esm.min.mjs +0 -2
  158. package/dist/types.esm.min.mjs.map +0 -1
  159. package/dist/utils/base64.d.ts +0 -2
  160. package/dist/utils/isVariable.d.ts +0 -2
  161. package/dist/utils/minify.d.ts +0 -2
  162. package/dist/utils/stableStringify.d.ts +0 -1
@@ -0,0 +1,741 @@
1
+ //#region src/locales/customLocaleMapping.d.ts
2
+ type CustomMapping = Record<string, string | Partial<LocaleProperties>>;
3
+ //#endregion
4
+ //#region src/locales/getLocaleProperties.d.ts
5
+ type LocaleProperties = {
6
+ code: string;
7
+ name: string;
8
+ nativeName: string;
9
+ languageCode: string;
10
+ languageName: string;
11
+ nativeLanguageName: string;
12
+ nameWithRegionCode: string;
13
+ nativeNameWithRegionCode: string;
14
+ regionCode: string;
15
+ regionName: string;
16
+ nativeRegionName: string;
17
+ scriptCode: string;
18
+ scriptName: string;
19
+ nativeScriptName: string;
20
+ maximizedCode: string;
21
+ maximizedName: string;
22
+ nativeMaximizedName: string;
23
+ minimizedCode: string;
24
+ minimizedName: string;
25
+ nativeMinimizedName: string;
26
+ emoji: string;
27
+ };
28
+ //#endregion
29
+ //#region src/types-dir/jsx/variables.d.ts
30
+ type VariableType = 'v' | 'n' | 'd' | 'c' | 'rt';
31
+ /**
32
+ * Variables are used to store the variable name and type.
33
+ */
34
+ type Variable = {
35
+ k: string;
36
+ i?: number;
37
+ v?: VariableType;
38
+ };
39
+ //#endregion
40
+ //#region src/types-dir/jsx/content.d.ts
41
+ /**
42
+ * Map of data-_gt properties to their corresponding React props
43
+ */
44
+ declare const HTML_CONTENT_PROPS: {
45
+ readonly pl: "placeholder";
46
+ readonly ti: "title";
47
+ readonly alt: "alt";
48
+ readonly arl: "aria-label";
49
+ readonly arb: "aria-labelledby";
50
+ readonly ard: "aria-describedby";
51
+ };
52
+ type HtmlContentPropKeysRecord = Partial<Record<keyof typeof HTML_CONTENT_PROPS, string>>;
53
+ type HtmlContentPropValuesRecord = Partial<Record<(typeof HTML_CONTENT_PROPS)[keyof typeof HTML_CONTENT_PROPS], string>>;
54
+ /**
55
+ * GTProp is an internal property used to contain data for translating and rendering elements.
56
+ * note, transformations are only read on the server side if they are 'plural' or 'branch'
57
+ */
58
+ type GTProp = {
59
+ b?: Record<string, JsxChildren>;
60
+ t?: 'p' | 'b';
61
+ } & HtmlContentPropKeysRecord;
62
+ type JsxElement = {
63
+ t?: string;
64
+ i?: number;
65
+ d?: GTProp;
66
+ c?: JsxChildren;
67
+ };
68
+ type JsxChild = string | JsxElement | Variable;
69
+ /**
70
+ * The format of the string content
71
+ */
72
+ type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
73
+ /**
74
+ * The format of the content
75
+ */
76
+ type DataFormat = 'JSX' | StringFormat;
77
+ /**
78
+ * String format content
79
+ */
80
+ type StringContent = IcuMessage | StringMessage | I18nextMessage;
81
+ /**
82
+ * A content type representing JSX, ICU, and I18next messages
83
+ */
84
+ type Content = JsxChildren | StringContent;
85
+ /**
86
+ * A content type representing JSX elements
87
+ */
88
+ type JsxChildren = JsxChild | JsxChild[];
89
+ /**
90
+ * A content type representing ICU messages
91
+ */
92
+ type IcuMessage = string;
93
+ /**
94
+ * A content type representing I18next messages
95
+ */
96
+ type I18nextMessage = string;
97
+ /**
98
+ * A content type representing plain strings
99
+ */
100
+ type StringMessage = string;
101
+ //#endregion
102
+ //#region src/types-dir/api/entry.d.ts
103
+ /**
104
+ * ActionType is the type of action to perform on the request.
105
+ *
106
+ * @param fast - The fast action type (mini model).
107
+ */
108
+ type ActionType = 'fast';
109
+ /**
110
+ * EntryMetadata is the metadata for a GTRequest.
111
+ *
112
+ * @param context - The context of the request.
113
+ * @param id - The id of the request.
114
+ * @param maxChars - The maxChars of the request.
115
+ * @param hash - The hash of the request.
116
+ */
117
+ type EntryMetadata = {
118
+ id?: string;
119
+ hash?: string;
120
+ context?: string;
121
+ maxChars?: number;
122
+ dataFormat?: DataFormat;
123
+ actionType?: ActionType;
124
+ };
125
+ type TranslateOptions = {
126
+ targetLocale: string;
127
+ sourceLocale?: string;
128
+ modelProvider?: string;
129
+ };
130
+ /**
131
+ * TranslateManyEntry is the input type for translateMany.
132
+ * Can be a plain string or an object with source and entry metadata fields.
133
+ */
134
+ type TranslateManyEntry = string | {
135
+ source: Content;
136
+ metadata?: EntryMetadata;
137
+ };
138
+ //#endregion
139
+ //#region src/id/types.d.ts
140
+ type HashMetadata = {
141
+ context?: string;
142
+ id?: string;
143
+ maxChars?: number;
144
+ dataFormat?: DataFormat;
145
+ };
146
+ //#endregion
147
+ //#region src/types-dir/api/translationStatus.d.ts
148
+ type TranslationStatusResult = {
149
+ count: number;
150
+ availableLocales: string[];
151
+ locales: string[];
152
+ localesWaitingForApproval: any[];
153
+ };
154
+ //#endregion
155
+ //#region src/types-dir/api/checkFileTranslations.d.ts
156
+ type FileTranslationQuery = {
157
+ versionId: string;
158
+ fileName?: string;
159
+ fileId?: string;
160
+ locale: string;
161
+ };
162
+ type CheckFileTranslationsOptions = {
163
+ timeout?: number;
164
+ };
165
+ type FileQuery = {
166
+ fileId: string;
167
+ branchId?: string;
168
+ versionId?: string;
169
+ };
170
+ type FileQueryResult = {
171
+ sourceFile: {
172
+ id: string;
173
+ fileId: string;
174
+ versionId: string;
175
+ sourceLocale: string;
176
+ fileName: string;
177
+ fileFormat: string;
178
+ dataFormat: string | null;
179
+ createdAt: string;
180
+ updatedAt: string;
181
+ approvalRequiredAt: string | null;
182
+ locales: string[];
183
+ };
184
+ translations: {
185
+ locale: string;
186
+ completedAt: string | null;
187
+ approvedAt: string | null;
188
+ publishedAt: string | null;
189
+ createdAt: string | null;
190
+ updatedAt: string | null;
191
+ }[];
192
+ };
193
+ //#endregion
194
+ //#region src/types-dir/api/enqueueFiles.d.ts
195
+ type Updates = ({
196
+ metadata: Record<string, any> & {
197
+ staticId?: string;
198
+ };
199
+ } & ({
200
+ dataFormat: 'JSX';
201
+ source: JsxChildren;
202
+ } | {
203
+ dataFormat: 'ICU';
204
+ source: string;
205
+ } | {
206
+ dataFormat: 'I18NEXT';
207
+ source: string;
208
+ } | {
209
+ dataFormat: 'STRING';
210
+ source: string;
211
+ }))[];
212
+ /**
213
+ * Options for enqueueing files
214
+ * @param requireApproval - Whether to require approval for the files
215
+ * @param description - Optional description for the project
216
+ * @param sourceLocale - The project's source locale
217
+ * @param targetLocales - The locales to translate the files to
218
+ * @param version - Optional custom version ID to specify
219
+ * @param timeout - Optional timeout for the request
220
+ * @param modelProvider - Optional model provider to use
221
+ */
222
+ type EnqueueFilesOptions = {
223
+ requireApproval?: boolean;
224
+ description?: string;
225
+ sourceLocale?: string;
226
+ targetLocales: string[];
227
+ version?: string;
228
+ _versionId?: string;
229
+ timeout?: number;
230
+ modelProvider?: string;
231
+ force?: boolean;
232
+ };
233
+ type EnqueueFilesResult = {
234
+ jobData: {
235
+ [jobId: string]: {
236
+ sourceFileId: string;
237
+ fileId: string;
238
+ versionId: string;
239
+ branchId: string;
240
+ targetLocale: string;
241
+ projectId: string;
242
+ force: boolean;
243
+ modelProvider?: string;
244
+ };
245
+ };
246
+ locales: string[];
247
+ message: string;
248
+ };
249
+ //#endregion
250
+ //#region src/types-dir/api/file.d.ts
251
+ type FileFormat = 'GTJSON' | 'JSON' | 'PO' | 'POT' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML' | 'TXT' | 'TWILIO_CONTENT_JSON';
252
+ /**
253
+ * Metadata for files or entries
254
+ */
255
+ type FormatMetadata = Record<string, any> | Updates[number]['metadata'];
256
+ /**
257
+ * File object structure for uploading files
258
+ * @see {@link FileReferenceOptionalBranchId}
259
+ * @property {string} content - Content of the file
260
+ * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
261
+ * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file
262
+ * @property {string} [incomingBranchId] - The ID of the incoming branch of the file
263
+ * @property {string} [checkedOutBranchId] - The ID of the checked out branch of the file
264
+ */
265
+ type FileToUpload = Omit<FileReference, 'branchId'> & {
266
+ content: string;
267
+ locale: string;
268
+ transformFormat?: FileFormat;
269
+ formatMetadata?: FormatMetadata;
270
+ branchId?: string;
271
+ incomingBranchId?: string;
272
+ checkedOutBranchId?: string;
273
+ };
274
+ /**
275
+ * File object structure for referencing files
276
+ * @property {string} fileId - The ID of the file
277
+ * @property {string} versionId - The ID of the version of the file
278
+ * @property {string} branchId - The ID of the branch of the file
279
+ * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
280
+ * @property {string} fileName - The name of the file
281
+ * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.)
282
+ * @property {DataFormat} [dataFormat] - Optional format of the data within the file
283
+ */
284
+ type FileReference = {
285
+ fileId: string;
286
+ versionId: string;
287
+ branchId: string;
288
+ fileName: string;
289
+ fileFormat: FileFormat;
290
+ transformFormat?: FileFormat;
291
+ dataFormat?: DataFormat;
292
+ };
293
+ /**
294
+ * File reference object structure for referencing files
295
+ * @see {@link FileReference}
296
+ * @property {string} [branchId] - The ID of the branch of the file
297
+ */
298
+ type FileReferenceIds = Omit<FileReference, 'branchId' | 'fileName' | 'fileFormat' | 'dataFormat'> & {
299
+ branchId?: string;
300
+ fileName?: string;
301
+ fileFormat?: FileFormat;
302
+ transformFormat?: FileFormat;
303
+ dataFormat?: DataFormat;
304
+ };
305
+ //#endregion
306
+ //#region src/types-dir/api/downloadFileBatch.d.ts
307
+ type DownloadFileBatchRequest = {
308
+ fileId: string;
309
+ branchId?: string;
310
+ versionId?: string;
311
+ locale?: string;
312
+ useLatestAvailableVersion?: boolean;
313
+ }[];
314
+ type DownloadFileBatchOptions = {
315
+ timeout?: number;
316
+ };
317
+ type DownloadedFile = {
318
+ id: string;
319
+ branchId: string;
320
+ fileId: string;
321
+ versionId: string;
322
+ locale?: string;
323
+ fileName?: string;
324
+ data: string;
325
+ metadata: Record<string, any>;
326
+ fileFormat: FileFormat;
327
+ };
328
+ type DownloadFileBatchResult = {
329
+ files: DownloadedFile[];
330
+ count: number;
331
+ };
332
+ //#endregion
333
+ //#region src/types-dir/api/fetchTranslations.d.ts
334
+ type FetchTranslationsOptions = {
335
+ timeout?: number;
336
+ };
337
+ type RetrievedTranslation = {
338
+ locale: string;
339
+ translation: any;
340
+ };
341
+ type RetrievedTranslations = RetrievedTranslation[];
342
+ type FetchTranslationsResult = {
343
+ translations: RetrievedTranslations;
344
+ };
345
+ //#endregion
346
+ //#region src/translate/createTag.d.ts
347
+ type CreateTagFileReference = {
348
+ fileId: string;
349
+ versionId: string;
350
+ branchId: string;
351
+ };
352
+ type CreateTagOptions = {
353
+ tagId: string;
354
+ files: CreateTagFileReference[];
355
+ message?: string;
356
+ };
357
+ type CreateTagResult = {
358
+ tag: {
359
+ id: string;
360
+ tagId: string;
361
+ message: string | null;
362
+ createdAt: string;
363
+ updatedAt: string;
364
+ };
365
+ };
366
+ //#endregion
367
+ //#region src/types-dir/api/uploadFiles.d.ts
368
+ /**
369
+ * Metadata stored alongside GTJSON file entries.
370
+ * Keys correspond to the entry id/hash in the GTJSON body.
371
+ */
372
+ type GTJsonFormatMetadata = Record<string, {
373
+ context?: string;
374
+ id?: string;
375
+ domain?: string;
376
+ maxChars?: number;
377
+ dataFormat?: 'JSX' | 'ICU' | 'I18NEXT';
378
+ requestVersion?: number;
379
+ approved_at?: string | null;
380
+ approved_by?: string | null;
381
+ hash?: string;
382
+ staticId?: string;
383
+ filePaths?: string[];
384
+ }>;
385
+ type FileUpload = {
386
+ branchId?: string;
387
+ incomingBranchId?: string;
388
+ checkedOutBranchId?: string;
389
+ content: string;
390
+ fileName: string;
391
+ fileFormat: FileFormat;
392
+ transformFormat?: FileFormat;
393
+ dataFormat?: DataFormat;
394
+ locale: string;
395
+ formatMetadata?: GTJsonFormatMetadata;
396
+ versionId?: string;
397
+ fileId?: string;
398
+ };
399
+ type UploadFilesOptions = {
400
+ sourceLocale: string;
401
+ modelProvider?: string;
402
+ timeout?: number;
403
+ };
404
+ type UploadFilesResponse = {
405
+ uploadedFiles: FileReference[];
406
+ count: number;
407
+ message: string;
408
+ };
409
+ //#endregion
410
+ //#region src/types-dir/api/enqueueEntries.d.ts
411
+ type EnqueueEntriesOptions = {
412
+ timeout?: number;
413
+ sourceLocale?: string;
414
+ targetLocales?: string[];
415
+ dataFormat?: DataFormat;
416
+ version?: string;
417
+ description?: string;
418
+ requireApproval?: boolean;
419
+ modelProvider?: string;
420
+ };
421
+ type EnqueueEntriesResult = {
422
+ versionId: string;
423
+ locales: string[];
424
+ message: string;
425
+ projectSettings: {
426
+ cdnEnabled: boolean;
427
+ requireApproval: boolean;
428
+ };
429
+ };
430
+ //#endregion
431
+ //#region src/translate/publishFiles.d.ts
432
+ type PublishFileEntry = {
433
+ fileId: string;
434
+ versionId: string;
435
+ branchId?: string;
436
+ publish: boolean;
437
+ fileName?: string;
438
+ };
439
+ type PublishFilesResult = {
440
+ results: {
441
+ fileId: string;
442
+ versionId: string;
443
+ locale?: string;
444
+ branchId: string;
445
+ success: boolean;
446
+ error?: string;
447
+ }[];
448
+ };
449
+ //#endregion
450
+ //#region src/types-dir/api/downloadFile.d.ts
451
+ type DownloadFileOptions = {
452
+ timeout?: number;
453
+ };
454
+ //#endregion
455
+ //#region src/types-dir/api/translate.d.ts
456
+ /**
457
+ * TranslationResultReference is used to store the reference for a translation result.
458
+ */
459
+ type TranslationResultReference = {
460
+ id?: string;
461
+ hash: string;
462
+ };
463
+ /**
464
+ * TypedResult is a union type that represents the different types of translations that can be returned.
465
+ */
466
+ type TypedResult = {
467
+ translation: JsxChildren;
468
+ dataFormat: 'JSX';
469
+ } | {
470
+ translation: I18nextMessage | IcuMessage | StringMessage;
471
+ dataFormat: 'ICU' | 'I18NEXT' | 'STRING';
472
+ };
473
+ /**
474
+ * RequestError is a type that represents an error that occurred during a translation request.
475
+ */
476
+ type TranslationError = {
477
+ success: false;
478
+ error: string;
479
+ code: number;
480
+ };
481
+ /**
482
+ * RequestSuccess is a type that represents a successful translation request.
483
+ */
484
+ type RequestSuccess = TypedResult & {
485
+ success: true;
486
+ locale: string;
487
+ };
488
+ type TranslationResult = RequestSuccess | TranslationError;
489
+ //#endregion
490
+ //#region src/types-dir/api/translateMany.d.ts
491
+ /**
492
+ * BatchTranslationResult is the result of a batch translation request.
493
+ */
494
+ type TranslateManyResult = TranslationResult[];
495
+ //#endregion
496
+ //#region src/types-dir/api/branch.d.ts
497
+ type BranchDataResult = {
498
+ branches: {
499
+ id: string;
500
+ name: string;
501
+ }[];
502
+ defaultBranch: {
503
+ id: string;
504
+ name: string;
505
+ } | null;
506
+ };
507
+ //#endregion
508
+ //#region src/translate/queryBranchData.d.ts
509
+ type BranchQuery = {
510
+ branchNames: string[];
511
+ };
512
+ //#endregion
513
+ //#region src/translate/queryFileData.d.ts
514
+ type FileDataQuery = {
515
+ sourceFiles?: {
516
+ fileId: string;
517
+ versionId: string;
518
+ branchId: string;
519
+ }[];
520
+ translatedFiles?: {
521
+ fileId: string;
522
+ versionId: string;
523
+ branchId: string;
524
+ locale: string;
525
+ }[];
526
+ };
527
+ type FileDataResult = {
528
+ sourceFiles?: {
529
+ branchId: string;
530
+ fileId: string;
531
+ versionId: string;
532
+ fileName: string;
533
+ fileFormat: string;
534
+ dataFormat: string | null;
535
+ createdAt: string;
536
+ updatedAt: string;
537
+ approvalRequiredAt: string | null;
538
+ publishedAt: string | null;
539
+ locales: string[];
540
+ sourceLocale: string;
541
+ }[];
542
+ translatedFiles?: {
543
+ branchId: string;
544
+ fileId: string;
545
+ versionId: string;
546
+ fileFormat: string;
547
+ dataFormat: string | null;
548
+ createdAt: string;
549
+ updatedAt: string;
550
+ approvedAt: string | null;
551
+ publishedAt: string | null;
552
+ completedAt: string | null;
553
+ locale: string;
554
+ }[];
555
+ };
556
+ //#endregion
557
+ //#region src/translate/getOrphanedFiles.d.ts
558
+ type OrphanedFile = {
559
+ fileId: string;
560
+ versionId: string;
561
+ fileName: string;
562
+ };
563
+ type GetOrphanedFilesResult = {
564
+ orphanedFiles: OrphanedFile[];
565
+ };
566
+ //#endregion
567
+ //#region src/translate/processFileMoves.d.ts
568
+ type MoveMapping = {
569
+ oldFileId: string;
570
+ newFileId: string;
571
+ newFileName: string;
572
+ };
573
+ type MoveResult = {
574
+ oldFileId: string;
575
+ newFileId: string;
576
+ success: boolean;
577
+ newSourceFileId?: string;
578
+ clonedTranslationsCount?: number;
579
+ error?: string;
580
+ };
581
+ type ProcessMovesResponse = {
582
+ results: MoveResult[];
583
+ summary: {
584
+ total: number;
585
+ succeeded: number;
586
+ failed: number;
587
+ };
588
+ };
589
+ type ProcessMovesOptions = {
590
+ timeout?: number;
591
+ branchId?: string;
592
+ };
593
+ //#endregion
594
+ //#region src/translate/checkJobStatus.d.ts
595
+ type JobStatus = 'queued' | 'processing' | 'completed' | 'failed' | 'unknown';
596
+ type CheckJobStatusResult = {
597
+ jobId: string;
598
+ status: JobStatus;
599
+ error?: {
600
+ message: string;
601
+ };
602
+ }[];
603
+ //#endregion
604
+ //#region src/translate/awaitJobs.d.ts
605
+ type AwaitJobsOptions = {
606
+ /** Polling interval in seconds. Defaults to 5. */pollingIntervalSeconds?: number; /** Timeout in seconds. Defaults to 600 (10 minutes). If reached, resolves with whatever status is current. */
607
+ timeoutSeconds?: number;
608
+ };
609
+ type JobResult = {
610
+ jobId: string;
611
+ status: JobStatus;
612
+ error?: {
613
+ message: string;
614
+ };
615
+ };
616
+ type AwaitJobsResult = {
617
+ /** Whether all jobs completed (none still in progress). */complete: boolean;
618
+ jobs: JobResult[];
619
+ };
620
+ //#endregion
621
+ //#region src/translate/submitUserEditDiffs.d.ts
622
+ type SubmitUserEditDiff = {
623
+ fileName: string;
624
+ locale: string;
625
+ diff: string;
626
+ branchId: string;
627
+ versionId: string;
628
+ fileId: string;
629
+ localContent: string;
630
+ };
631
+ type SubmitUserEditDiffsPayload = {
632
+ diffs: SubmitUserEditDiff[];
633
+ };
634
+ //#endregion
635
+ //#region src/types-dir/transformations.d.ts
636
+ /**
637
+ * Transformations are made from a prefix and a suffix.
638
+ */
639
+ type Transformation = BaseTransformation | `${BaseTransformation}-${InjectionType}`;
640
+ type BaseTransformation = 'translate-client' | 'translate-server' | 'translate-runtime' | 'variable-variable' | 'variable-currency' | 'variable-datetime' | 'variable-number' | 'variable-relative-time' | 'plural' | 'branch' | 'derive';
641
+ type TransformationPrefix = 'translate' | 'variable' | 'plural' | 'branch' | 'fragment' | 'derive';
642
+ type VariableTransformationSuffix = 'variable' | 'number' | 'datetime' | 'currency' | 'relative-time';
643
+ type InjectionType = 'automatic' | 'manual';
644
+ //#endregion
645
+ //#region src/types.d.ts
646
+ /**
647
+ * @deprecated Use {@link Content} instead.
648
+ */
649
+ type _Content = string | Array<string | Variable>;
650
+ type Metadata = {
651
+ maxChars?: number;
652
+ context?: string;
653
+ id?: string;
654
+ sourceLocale?: string;
655
+ actionType?: 'standard' | 'fast' | string;
656
+ filePaths?: string[];
657
+ [key: string]: any;
658
+ };
659
+ type FormatVariables = Record<string, string | number | boolean | null | undefined | Date>;
660
+ /**
661
+ * @deprecated This type is deprecated and will be removed in a future version.
662
+ */
663
+ type Update = {
664
+ type: 'content';
665
+ data: {
666
+ source: _Content;
667
+ metadata: Metadata;
668
+ };
669
+ } | {
670
+ type: 'jsx';
671
+ data: {
672
+ source: JsxChildren;
673
+ metadata: Metadata;
674
+ };
675
+ };
676
+ /**
677
+ * @deprecated This type is deprecated and will be removed in a future version.
678
+ */
679
+ type Request = {
680
+ type: 'content';
681
+ data: {
682
+ source: _Content;
683
+ targetLocale: string;
684
+ metadata: Metadata;
685
+ };
686
+ } | {
687
+ type: 'jsx';
688
+ data: {
689
+ source: JsxChildren;
690
+ targetLocale: string;
691
+ metadata: Metadata;
692
+ };
693
+ };
694
+ /**
695
+ * @deprecated Use {@link TranslationResult} instead.
696
+ */
697
+ type ContentTranslationResult = {
698
+ translation: _Content;
699
+ locale: string;
700
+ reference?: {
701
+ id: string;
702
+ key: string;
703
+ };
704
+ };
705
+ /**
706
+ * @deprecated Use {@link TranslationResult} instead.
707
+ */
708
+ type IcuTranslationResult = {
709
+ translation: string;
710
+ locale: string;
711
+ reference?: {
712
+ id: string;
713
+ key: string;
714
+ };
715
+ };
716
+ /**
717
+ * @deprecated Use {@link TranslationResult} instead.
718
+ */
719
+ type JsxTranslationResult = {
720
+ translation: JsxChildren;
721
+ locale: string;
722
+ reference?: {
723
+ id: string;
724
+ key: string;
725
+ };
726
+ };
727
+ /**
728
+ * TranslationRequestConfig is used to configure the translation request.
729
+ *
730
+ * @param projectId - The project id of the translation request.
731
+ * @param baseUrl - The base url of the translation request.
732
+ * @param apiKey - The api key of the translation request.
733
+ */
734
+ type TranslationRequestConfig = {
735
+ projectId: string;
736
+ baseUrl?: string;
737
+ apiKey?: string;
738
+ };
739
+ //#endregion
740
+ export { FileReference as $, BranchDataResult as A, VariableType as At, FileUpload as B, ProcessMovesOptions as C, JsxChild as Ct, FileDataQuery as D, StringFormat as Dt, OrphanedFile as E, StringContent as Et, DownloadFileOptions as F, FetchTranslationsOptions as G, UploadFilesResponse as H, PublishFileEntry as I, DownloadFileBatchOptions as J, FetchTranslationsResult as K, PublishFilesResult as L, TranslationError as M, CustomMapping as Mt, TranslationResult as N, FileDataResult as O, StringMessage as Ot, TranslationResultReference as P, FileFormat as Q, EnqueueEntriesOptions as R, MoveResult as S, IcuMessage as St, GetOrphanedFilesResult as T, JsxElement as Tt, CreateTagOptions as U, UploadFilesOptions as V, CreateTagResult as W, DownloadFileBatchResult as X, DownloadFileBatchRequest as Y, DownloadedFile as Z, AwaitJobsResult as _, GTProp as _t, Metadata as a, CheckFileTranslationsOptions as at, JobStatus as b, HtmlContentPropValuesRecord as bt, Update as c, FileTranslationQuery as ct, Transformation as d, ActionType as dt, FileReferenceIds as et, TransformationPrefix as f, EntryMetadata as ft, AwaitJobsOptions as g, DataFormat as gt, SubmitUserEditDiffsPayload as h, Content as ht, JsxTranslationResult as i, Updates as it, TranslateManyResult as j, LocaleProperties as jt, BranchQuery as k, Variable as kt, _Content as l, TranslationStatusResult as lt, SubmitUserEditDiff as m, TranslateOptions as mt, FormatVariables as n, EnqueueFilesOptions as nt, Request as o, FileQuery as ot, VariableTransformationSuffix as p, TranslateManyEntry as pt, RetrievedTranslations as q, IcuTranslationResult as r, EnqueueFilesResult as rt, TranslationRequestConfig as s, FileQueryResult as st, ContentTranslationResult as t, FileToUpload as tt, InjectionType as u, HashMetadata as ut, JobResult as v, HTML_CONTENT_PROPS as vt, ProcessMovesResponse as w, JsxChildren as wt, MoveMapping as x, I18nextMessage as xt, CheckJobStatusResult as y, HtmlContentPropKeysRecord as yt, EnqueueEntriesResult as z };
741
+ //# sourceMappingURL=types-DazaDJbs.d.mts.map