generaltranslation 8.2.11 → 8.2.13

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 (264) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{IntlCache-k2qfrDqB.cjs → IntlCache-CAW8tKhd.cjs} +12 -12
  3. package/dist/IntlCache-CAW8tKhd.cjs.map +1 -0
  4. package/dist/{IntlCache-Ccg_cQPR.mjs → IntlCache-WZk0rKvj.mjs} +12 -12
  5. package/dist/IntlCache-WZk0rKvj.mjs.map +1 -0
  6. package/dist/LocaleConfig.d.ts +59 -0
  7. package/dist/LocaleConfig.js +225 -0
  8. package/dist/backwards-compatability/dataConversion.d.ts +23 -0
  9. package/dist/backwards-compatability/dataConversion.js +207 -0
  10. package/dist/backwards-compatability/oldHashJsxChildren.d.ts +23 -0
  11. package/dist/backwards-compatability/oldHashJsxChildren.js +79 -0
  12. package/dist/backwards-compatability/oldTypes.d.ts +21 -0
  13. package/dist/backwards-compatability/oldTypes.js +1 -0
  14. package/dist/backwards-compatability/typeChecking.d.ts +21 -0
  15. package/dist/backwards-compatability/typeChecking.js +61 -0
  16. package/dist/{base64-CUcEPEC5.cjs → base64-2fu94Klt.cjs} +3 -3
  17. package/dist/base64-2fu94Klt.cjs.map +1 -0
  18. package/dist/{base64-C1sogiix.mjs → base64-DH0STixb.mjs} +3 -3
  19. package/dist/base64-DH0STixb.mjs.map +1 -0
  20. package/dist/cache/IntlCache.d.ts +26 -0
  21. package/dist/cache/IntlCache.js +84 -0
  22. package/dist/cache/types.d.ts +32 -0
  23. package/dist/cache/types.js +1 -0
  24. package/dist/{core-3SOQ5ND6.cjs → core-7RP541eY.cjs} +18 -20
  25. package/dist/core-7RP541eY.cjs.map +1 -0
  26. package/dist/{core-6rY3oy32.d.cts → core-I9pWGafA.d.mts} +8 -8
  27. package/dist/{core-BYVWty_t.d.mts → core-TLJoDpJP.d.cts} +8 -8
  28. package/dist/{core-Bx0m6GOp.mjs → core-isLphYAZ.mjs} +18 -20
  29. package/dist/core-isLphYAZ.mjs.map +1 -0
  30. package/dist/core.cjs +1 -1
  31. package/dist/core.d.cts +1 -1
  32. package/dist/core.d.mts +1 -1
  33. package/dist/core.d.ts +128 -0
  34. package/dist/core.js +137 -0
  35. package/dist/core.mjs +1 -1
  36. package/dist/derive/condenseVars.d.ts +7 -0
  37. package/dist/derive/condenseVars.js +30 -0
  38. package/dist/derive/declareVar.d.ts +26 -0
  39. package/dist/derive/declareVar.js +38 -0
  40. package/dist/derive/decodeVars.d.ts +9 -0
  41. package/dist/derive/decodeVars.js +52 -0
  42. package/dist/derive/derive.d.ts +53 -0
  43. package/dist/derive/derive.js +55 -0
  44. package/dist/derive/extractVars.d.ts +9 -0
  45. package/dist/derive/extractVars.js +34 -0
  46. package/dist/derive/index.d.ts +7 -0
  47. package/dist/derive/index.js +7 -0
  48. package/dist/derive/indexVars.d.ts +6 -0
  49. package/dist/derive/indexVars.js +52 -0
  50. package/dist/derive/utils/constants.d.ts +2 -0
  51. package/dist/derive/utils/constants.js +2 -0
  52. package/dist/derive/utils/regex.d.ts +2 -0
  53. package/dist/derive/utils/regex.js +4 -0
  54. package/dist/derive/utils/sanitizeVar.d.ts +12 -0
  55. package/dist/derive/utils/sanitizeVar.js +38 -0
  56. package/dist/derive/utils/traverseHelpers.d.ts +4 -0
  57. package/dist/derive/utils/traverseHelpers.js +22 -0
  58. package/dist/derive/utils/traverseIcu.d.ts +20 -0
  59. package/dist/derive/utils/traverseIcu.js +49 -0
  60. package/dist/derive/utils/types.d.ts +23 -0
  61. package/dist/derive/utils/types.js +1 -0
  62. package/dist/errors/ApiError.d.ts +7 -0
  63. package/dist/errors/ApiError.js +33 -0
  64. package/dist/errors/formattingErrors.d.ts +1 -0
  65. package/dist/errors/formattingErrors.js +3 -0
  66. package/dist/errors.d.ts +1 -0
  67. package/dist/errors.js +1 -0
  68. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.d.ts +59 -0
  69. package/dist/formatting/custom-formats/CutoffFormat/CutoffFormat.js +147 -0
  70. package/dist/formatting/custom-formats/CutoffFormat/constants.d.ts +4 -0
  71. package/dist/formatting/custom-formats/CutoffFormat/constants.js +30 -0
  72. package/dist/formatting/custom-formats/CutoffFormat/types.d.ts +48 -0
  73. package/dist/formatting/custom-formats/CutoffFormat/types.js +2 -0
  74. package/dist/formatting/format.d.ts +1 -0
  75. package/dist/formatting/format.js +257 -0
  76. package/dist/id/hashSource.d.ts +25 -0
  77. package/dist/id/hashSource.js +98 -0
  78. package/dist/id/hashTemplate.d.ts +4 -0
  79. package/dist/id/hashTemplate.js +6 -0
  80. package/dist/id/types.d.ts +7 -0
  81. package/dist/id/types.js +1 -0
  82. package/dist/{id-COlX5v3V.cjs → id-CyiXsQrY.cjs} +9 -9
  83. package/dist/id-CyiXsQrY.cjs.map +1 -0
  84. package/dist/{id-BmOyfaug.mjs → id-DbD7K-HL.mjs} +9 -9
  85. package/dist/id-DbD7K-HL.mjs.map +1 -0
  86. package/dist/id.cjs +1 -1
  87. package/dist/id.d.cts +9 -9
  88. package/dist/id.d.mts +9 -9
  89. package/dist/id.d.ts +3 -0
  90. package/dist/id.js +3 -0
  91. package/dist/id.mjs +1 -1
  92. package/dist/index.cjs +140 -140
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.d.cts +88 -88
  95. package/dist/index.d.mts +88 -88
  96. package/dist/index.d.ts +1019 -0
  97. package/dist/index.js +1664 -0
  98. package/dist/index.mjs +140 -140
  99. package/dist/index.mjs.map +1 -1
  100. package/dist/internal.cjs +41 -26
  101. package/dist/internal.cjs.map +1 -1
  102. package/dist/internal.d.cts +38 -23
  103. package/dist/internal.d.mts +38 -23
  104. package/dist/internal.d.ts +19 -0
  105. package/dist/internal.js +17 -0
  106. package/dist/internal.mjs +41 -26
  107. package/dist/internal.mjs.map +1 -1
  108. package/dist/locales/customLocaleMapping.d.ts +11 -0
  109. package/dist/locales/customLocaleMapping.js +23 -0
  110. package/dist/locales/determineLocale.d.ts +1 -0
  111. package/dist/locales/determineLocale.js +72 -0
  112. package/dist/locales/getLocaleDirection.d.ts +1 -0
  113. package/dist/locales/getLocaleDirection.js +89 -0
  114. package/dist/locales/getLocaleEmoji.d.ts +2 -0
  115. package/dist/locales/getLocaleEmoji.js +319 -0
  116. package/dist/locales/getLocaleName.d.ts +1 -0
  117. package/dist/locales/getLocaleName.js +45 -0
  118. package/dist/locales/getLocaleProperties.d.ts +32 -0
  119. package/dist/locales/getLocaleProperties.js +220 -0
  120. package/dist/locales/getPluralForm.d.ts +9 -0
  121. package/dist/locales/getPluralForm.js +63 -0
  122. package/dist/locales/getRegionProperties.d.ts +7 -0
  123. package/dist/locales/getRegionProperties.js +61 -0
  124. package/dist/locales/isSameDialect.d.ts +1 -0
  125. package/dist/locales/isSameDialect.js +41 -0
  126. package/dist/locales/isSameLanguage.d.ts +1 -0
  127. package/dist/locales/isSameLanguage.js +20 -0
  128. package/dist/locales/isSupersetLocale.d.ts +1 -0
  129. package/dist/locales/isSupersetLocale.js +22 -0
  130. package/dist/locales/isValidLocale.d.ts +1 -0
  131. package/dist/locales/isValidLocale.js +75 -0
  132. package/dist/locales/requiresTranslation.d.ts +1 -0
  133. package/dist/locales/requiresTranslation.js +32 -0
  134. package/dist/locales/resolveAliasLocale.d.ts +8 -0
  135. package/dist/locales/resolveAliasLocale.js +21 -0
  136. package/dist/locales/resolveCanonicalLocale.d.ts +8 -0
  137. package/dist/locales/resolveCanonicalLocale.js +13 -0
  138. package/dist/logging/errors.d.ts +10 -0
  139. package/dist/logging/errors.js +29 -0
  140. package/dist/logging/logger.d.ts +121 -0
  141. package/dist/logging/logger.js +259 -0
  142. package/dist/logging/warnings.d.ts +2 -0
  143. package/dist/logging/warnings.js +2 -0
  144. package/dist/projects/getProjectData.d.ts +1 -0
  145. package/dist/projects/getProjectData.js +87 -0
  146. package/dist/settings/plurals.d.ts +3 -0
  147. package/dist/settings/plurals.js +14 -0
  148. package/dist/settings/settings.d.ts +2 -0
  149. package/dist/settings/settings.js +2 -0
  150. package/dist/settings/settingsUrls.d.ts +3 -0
  151. package/dist/settings/settingsUrls.js +3 -0
  152. package/dist/translate/api.d.ts +1 -0
  153. package/dist/translate/api.js +1 -0
  154. package/dist/translate/awaitJobs.d.ts +19 -0
  155. package/dist/translate/awaitJobs.js +112 -0
  156. package/dist/translate/checkJobStatus.d.ts +8 -0
  157. package/dist/translate/checkJobStatus.js +55 -0
  158. package/dist/translate/createBranch.d.ts +10 -0
  159. package/dist/translate/createBranch.js +53 -0
  160. package/dist/translate/createTag.d.ts +19 -0
  161. package/dist/translate/createTag.js +67 -0
  162. package/dist/translate/downloadFileBatch.d.ts +1 -0
  163. package/dist/translate/downloadFileBatch.js +77 -0
  164. package/dist/translate/enqueueFiles.d.ts +8 -0
  165. package/dist/translate/enqueueFiles.js +96 -0
  166. package/dist/translate/getOrphanedFiles.d.ts +8 -0
  167. package/dist/translate/getOrphanedFiles.js +97 -0
  168. package/dist/translate/processFileMoves.d.ts +25 -0
  169. package/dist/translate/processFileMoves.js +90 -0
  170. package/dist/translate/publishFiles.d.ts +17 -0
  171. package/dist/translate/publishFiles.js +56 -0
  172. package/dist/translate/queryBranchData.d.ts +3 -0
  173. package/dist/translate/queryBranchData.js +53 -0
  174. package/dist/translate/queryFileData.d.ts +42 -0
  175. package/dist/translate/queryFileData.js +71 -0
  176. package/dist/translate/querySourceFile.d.ts +1 -0
  177. package/dist/translate/querySourceFile.js +67 -0
  178. package/dist/translate/setupProject.d.ts +11 -0
  179. package/dist/translate/setupProject.js +63 -0
  180. package/dist/translate/submitUserEditDiffs.d.ts +12 -0
  181. package/dist/translate/submitUserEditDiffs.js +68 -0
  182. package/dist/translate/translateMany.d.ts +1 -0
  183. package/dist/translate/translateMany.js +103 -0
  184. package/dist/translate/uploadSourceFiles.d.ts +1 -0
  185. package/dist/translate/uploadSourceFiles.js +87 -0
  186. package/dist/translate/uploadTranslations.d.ts +1 -0
  187. package/dist/translate/uploadTranslations.js +101 -0
  188. package/dist/translate/utils/apiRequest.d.ts +1 -0
  189. package/dist/translate/utils/apiRequest.js +130 -0
  190. package/dist/translate/utils/batch.d.ts +52 -0
  191. package/dist/translate/utils/batch.js +126 -0
  192. package/dist/translate/utils/fetchWithTimeout.d.ts +1 -0
  193. package/dist/translate/utils/fetchWithTimeout.js +93 -0
  194. package/dist/translate/utils/generateRequestHeaders.d.ts +2 -0
  195. package/dist/translate/utils/generateRequestHeaders.js +26 -0
  196. package/dist/translate/utils/handleFetchError.d.ts +1 -0
  197. package/dist/translate/utils/handleFetchError.js +12 -0
  198. package/dist/translate/utils/validateFileFormatTransform.d.ts +16 -0
  199. package/dist/translate/utils/validateFileFormatTransform.js +29 -0
  200. package/dist/translate/utils/validateResponse.d.ts +1 -0
  201. package/dist/translate/utils/validateResponse.js +72 -0
  202. package/dist/{types-Cy8q2XZX.d.mts → types-AHtYZIP-.d.mts} +63 -40
  203. package/dist/{types-NKhpChvT.d.cts → types-Bf8_Apq_.d.cts} +63 -40
  204. package/dist/types-dir/api/branch.d.ts +10 -0
  205. package/dist/types-dir/api/branch.js +1 -0
  206. package/dist/types-dir/api/checkFileTranslations.d.ts +37 -0
  207. package/dist/types-dir/api/checkFileTranslations.js +1 -0
  208. package/dist/types-dir/api/downloadFile.d.ts +3 -0
  209. package/dist/types-dir/api/downloadFile.js +1 -0
  210. package/dist/types-dir/api/downloadFileBatch.d.ts +35 -0
  211. package/dist/types-dir/api/downloadFileBatch.js +1 -0
  212. package/dist/types-dir/api/enqueueEntries.d.ts +21 -0
  213. package/dist/types-dir/api/enqueueEntries.js +1 -0
  214. package/dist/types-dir/api/enqueueFiles.d.ts +70 -0
  215. package/dist/types-dir/api/enqueueFiles.js +1 -0
  216. package/dist/types-dir/api/entry.d.ts +39 -0
  217. package/dist/types-dir/api/entry.js +1 -0
  218. package/dist/types-dir/api/fetchTranslations.d.ts +12 -0
  219. package/dist/types-dir/api/fetchTranslations.js +1 -0
  220. package/dist/types-dir/api/file.d.ts +57 -0
  221. package/dist/types-dir/api/file.js +1 -0
  222. package/dist/types-dir/api/json.d.ts +5 -0
  223. package/dist/types-dir/api/json.js +1 -0
  224. package/dist/types-dir/api/project.d.ts +7 -0
  225. package/dist/types-dir/api/project.js +1 -0
  226. package/dist/types-dir/api/translate.d.ts +34 -0
  227. package/dist/types-dir/api/translate.js +1 -0
  228. package/dist/types-dir/api/translateMany.d.ts +5 -0
  229. package/dist/types-dir/api/translateMany.js +1 -0
  230. package/dist/types-dir/api/translationStatus.d.ts +9 -0
  231. package/dist/types-dir/api/translationStatus.js +1 -0
  232. package/dist/types-dir/api/uploadFiles.d.ts +44 -0
  233. package/dist/types-dir/api/uploadFiles.js +1 -0
  234. package/dist/types-dir/jsx/content.d.ts +61 -0
  235. package/dist/types-dir/jsx/content.js +11 -0
  236. package/dist/types-dir/jsx/variables.d.ts +9 -0
  237. package/dist/types-dir/jsx/variables.js +1 -0
  238. package/dist/types-dir/transformations.d.ts +8 -0
  239. package/dist/types-dir/transformations.js +1 -0
  240. package/dist/types.cjs.map +1 -1
  241. package/dist/types.d.cts +2 -2
  242. package/dist/types.d.mts +2 -2
  243. package/dist/types.d.ts +129 -0
  244. package/dist/types.js +2 -0
  245. package/dist/types.mjs.map +1 -1
  246. package/dist/utils/base64.d.ts +2 -0
  247. package/dist/utils/base64.js +28 -0
  248. package/dist/utils/isSupportedFileFormatTransform.d.ts +8 -0
  249. package/dist/utils/isSupportedFileFormatTransform.js +26 -0
  250. package/dist/utils/isVariable.d.ts +2 -0
  251. package/dist/utils/isVariable.js +22 -0
  252. package/dist/utils/minify.d.ts +2 -0
  253. package/dist/utils/minify.js +10 -0
  254. package/dist/utils/stableStringify.d.ts +1 -0
  255. package/dist/utils/stableStringify.js +40 -0
  256. package/package.json +5 -6
  257. package/dist/IntlCache-Ccg_cQPR.mjs.map +0 -1
  258. package/dist/IntlCache-k2qfrDqB.cjs.map +0 -1
  259. package/dist/base64-C1sogiix.mjs.map +0 -1
  260. package/dist/base64-CUcEPEC5.cjs.map +0 -1
  261. package/dist/core-3SOQ5ND6.cjs.map +0 -1
  262. package/dist/core-Bx0m6GOp.mjs.map +0 -1
  263. package/dist/id-BmOyfaug.mjs.map +0 -1
  264. package/dist/id-COlX5v3V.cjs.map +0 -1
@@ -71,31 +71,31 @@ type JsxChild = string | JsxElement | Variable;
71
71
  */
72
72
  type StringFormat = 'ICU' | 'I18NEXT' | 'STRING';
73
73
  /**
74
- * The format of the content
74
+ * The format of the content.
75
75
  */
76
76
  type DataFormat = 'JSX' | StringFormat;
77
77
  /**
78
- * String format content
78
+ * String format content.
79
79
  */
80
80
  type StringContent = IcuMessage | StringMessage | I18nextMessage;
81
81
  /**
82
- * A content type representing JSX, ICU, and I18next messages
82
+ * A content type representing JSX, ICU, and I18next messages.
83
83
  */
84
84
  type Content = JsxChildren | StringContent;
85
85
  /**
86
- * A content type representing JSX elements
86
+ * A content type representing JSX elements.
87
87
  */
88
88
  type JsxChildren = JsxChild | JsxChild[];
89
89
  /**
90
- * A content type representing ICU messages
90
+ * A content type representing ICU messages.
91
91
  */
92
92
  type IcuMessage = string;
93
93
  /**
94
- * A content type representing I18next messages
94
+ * A content type representing I18next messages.
95
95
  */
96
96
  type I18nextMessage = string;
97
97
  /**
98
- * A content type representing plain strings
98
+ * A content type representing plain strings.
99
99
  */
100
100
  type StringMessage = string;
101
101
  //#endregion
@@ -110,7 +110,7 @@ type ActionType = 'fast';
110
110
  * EntryMetadata is the metadata for a GTRequest.
111
111
  *
112
112
  * @param context - The context of the request.
113
- * @param id - The id of the request.
113
+ * @param id - The ID of the request.
114
114
  * @param maxChars - The maxChars of the request.
115
115
  * @param hash - The hash of the request.
116
116
  */
@@ -152,7 +152,14 @@ type TranslationStatusResult = {
152
152
  count: number;
153
153
  availableLocales: string[];
154
154
  locales: string[];
155
- localesWaitingForApproval: any[];
155
+ localesWaitingForApproval: string[];
156
+ };
157
+ //#endregion
158
+ //#region src/types-dir/api/json.d.ts
159
+ type JsonPrimitive = string | number | boolean | null;
160
+ type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
161
+ type JsonObject = {
162
+ [key: string]: JsonValue;
156
163
  };
157
164
  //#endregion
158
165
  //#region src/types-dir/api/checkFileTranslations.d.ts
@@ -195,10 +202,23 @@ type FileQueryResult = {
195
202
  };
196
203
  //#endregion
197
204
  //#region src/types-dir/api/enqueueFiles.d.ts
205
+ type UpdateMetadata = {
206
+ id?: string;
207
+ hash?: string;
208
+ context?: string;
209
+ maxChars?: number;
210
+ dataFormat?: DataFormat;
211
+ actionType?: 'standard' | 'fast' | string;
212
+ staticId?: string;
213
+ format?: string;
214
+ filePaths?: string[];
215
+ sourceCode?: unknown;
216
+ contextDeriveExpr?: unknown;
217
+ _contextDeriveExpr?: unknown;
218
+ [key: string]: unknown;
219
+ };
198
220
  type Updates = ({
199
- metadata: Record<string, any> & {
200
- staticId?: string;
201
- };
221
+ metadata: UpdateMetadata;
202
222
  } & ({
203
223
  dataFormat: 'JSX';
204
224
  source: JsxChildren;
@@ -214,13 +234,13 @@ type Updates = ({
214
234
  }))[];
215
235
  /**
216
236
  * Options for enqueueing files
217
- * @param requireApproval - Whether to require approval for the files
218
- * @param description - Optional description for the project
219
- * @param sourceLocale - The project's source locale
220
- * @param targetLocales - The locales to translate the files to
221
- * @param version - Optional custom version ID to specify
222
- * @param timeout - Optional timeout for the request
223
- * @param modelProvider - Optional model provider to use
237
+ * @param requireApproval - Whether to require approval for the files.
238
+ * @param description - Optional description for the project.
239
+ * @param sourceLocale - The project's source locale.
240
+ * @param targetLocales - The locales to translate the files to.
241
+ * @param version - Optional custom version ID to specify.
242
+ * @param timeout - Optional timeout for the request.
243
+ * @param modelProvider - Optional model provider to use.
224
244
  */
225
245
  type EnqueueFilesOptions = {
226
246
  requireApproval?: boolean;
@@ -253,17 +273,17 @@ type EnqueueFilesResult = {
253
273
  //#region src/types-dir/api/file.d.ts
254
274
  type FileFormat = 'GTJSON' | 'JSON' | 'PO' | 'POT' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML' | 'TXT' | 'TWILIO_CONTENT_JSON';
255
275
  /**
256
- * Metadata for files or entries
276
+ * Metadata for files or entries.
257
277
  */
258
- type FormatMetadata = Record<string, any> | Updates[number]['metadata'];
278
+ type FormatMetadata = JsonObject | Updates[number]['metadata'];
259
279
  /**
260
- * File object structure for uploading files
280
+ * File object structure for uploading files.
261
281
  * @see {@link FileReferenceOptionalBranchId}
262
- * @property {string} content - Content of the file
282
+ * @property {string} content - Content of the file.
263
283
  * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
264
284
  * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file
265
- * @property {string} [incomingBranchId] - The ID of the incoming branch of the file
266
- * @property {string} [checkedOutBranchId] - The ID of the checked out branch of the file
285
+ * @property {string} [incomingBranchId] - The ID of the incoming branch of the file.
286
+ * @property {string} [checkedOutBranchId] - The ID of the checked-out branch of the file.
267
287
  */
268
288
  type FileToUpload = Omit<FileReference, 'branchId'> & {
269
289
  content: string;
@@ -275,14 +295,14 @@ type FileToUpload = Omit<FileReference, 'branchId'> & {
275
295
  checkedOutBranchId?: string;
276
296
  };
277
297
  /**
278
- * File object structure for referencing files
279
- * @property {string} fileId - The ID of the file
298
+ * File object structure for referencing files.
299
+ * @property {string} fileId - The ID of the file.
280
300
  * @property {string} versionId - The ID of the version of the file
281
301
  * @property {string} branchId - The ID of the branch of the file
282
302
  * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
283
- * @property {string} fileName - The name of the file
284
- * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.)
285
- * @property {DataFormat} [dataFormat] - Optional format of the data within the file
303
+ * @property {string} fileName - The name of the file.
304
+ * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.).
305
+ * @property {DataFormat} [dataFormat] - Optional format of the data within the file.
286
306
  */
287
307
  type FileReference = {
288
308
  fileId: string;
@@ -294,7 +314,7 @@ type FileReference = {
294
314
  dataFormat?: DataFormat;
295
315
  };
296
316
  /**
297
- * File reference object structure for referencing files
317
+ * File reference object structure for referencing files.
298
318
  * @see {@link FileReference}
299
319
  * @property {string} [branchId] - The ID of the branch of the file
300
320
  */
@@ -325,7 +345,7 @@ type DownloadedFile = {
325
345
  locale?: string;
326
346
  fileName?: string;
327
347
  data: string;
328
- metadata: Record<string, any>;
348
+ metadata: JsonObject;
329
349
  fileFormat: FileFormat;
330
350
  };
331
351
  type DownloadFileBatchResult = {
@@ -339,7 +359,7 @@ type FetchTranslationsOptions = {
339
359
  };
340
360
  type RetrievedTranslation = {
341
361
  locale: string;
342
- translation: any;
362
+ translation: Content;
343
363
  };
344
364
  type RetrievedTranslations = RetrievedTranslation[];
345
365
  type FetchTranslationsResult = {
@@ -395,7 +415,7 @@ type FileUpload = {
395
415
  transformFormat?: FileFormat;
396
416
  dataFormat?: DataFormat;
397
417
  locale: string;
398
- formatMetadata?: GTJsonFormatMetadata;
418
+ formatMetadata?: GTJsonFormatMetadata | FormatMetadata;
399
419
  versionId?: string;
400
420
  fileId?: string;
401
421
  };
@@ -654,10 +674,13 @@ type Metadata = {
654
674
  maxChars?: number;
655
675
  context?: string;
656
676
  id?: string;
677
+ hash?: string;
678
+ format?: string;
679
+ dataFormat?: DataFormat;
657
680
  sourceLocale?: string;
658
681
  actionType?: 'standard' | 'fast' | string;
659
682
  filePaths?: string[];
660
- [key: string]: any;
683
+ [key: string]: unknown;
661
684
  };
662
685
  type FormatVariables = Record<string, string | number | boolean | null | undefined | Date>;
663
686
  /**
@@ -730,9 +753,9 @@ type JsxTranslationResult = {
730
753
  /**
731
754
  * TranslationRequestConfig is used to configure the translation request.
732
755
  *
733
- * @param projectId - The project id of the translation request.
734
- * @param baseUrl - The base url of the translation request.
735
- * @param apiKey - The api key of the translation request.
756
+ * @param projectId - The project ID of the translation request.
757
+ * @param baseUrl - The base URL of the translation request.
758
+ * @param apiKey - The API key of the translation request.
736
759
  */
737
760
  type TranslationRequestConfig = {
738
761
  projectId: string;
@@ -740,5 +763,5 @@ type TranslationRequestConfig = {
740
763
  apiKey?: string;
741
764
  };
742
765
  //#endregion
743
- export { FileReference as $, BranchDataResult as A, Variable as At, FileUpload as B, ProcessMovesOptions as C, IcuMessage as Ct, FileDataQuery as D, StringContent as Dt, OrphanedFile as E, JsxElement 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, LocaleProperties as Mt, TranslationResult as N, CustomMapping as Nt, FileDataResult as O, StringFormat as Ot, TranslationResultReference as P, FileFormat as Q, EnqueueEntriesOptions as R, MoveResult as S, I18nextMessage as St, GetOrphanedFilesResult as T, JsxChildren as Tt, CreateTagOptions as U, UploadFilesOptions as V, CreateTagResult as W, DownloadFileBatchResult as X, DownloadFileBatchRequest as Y, DownloadedFile as Z, AwaitJobsResult as _, DataFormat as _t, Metadata as a, CheckFileTranslationsOptions as at, JobStatus as b, HtmlContentPropKeysRecord 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, Content as gt, SubmitUserEditDiffsPayload as h, TranslateOptions as ht, JsxTranslationResult as i, Updates as it, TranslateManyResult as j, VariableType as jt, BranchQuery as k, StringMessage as kt, _Content as l, TranslationStatusResult as lt, SubmitUserEditDiff as m, TranslateManyEntry as mt, FormatVariables as n, EnqueueFilesOptions as nt, Request as o, FileQuery as ot, VariableTransformationSuffix as p, RuntimeTranslateManyOptions 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, GTProp as vt, ProcessMovesResponse as w, JsxChild as wt, MoveMapping as x, HtmlContentPropValuesRecord as xt, CheckJobStatusResult as y, HTML_CONTENT_PROPS as yt, EnqueueEntriesResult as z };
744
- //# sourceMappingURL=types-NKhpChvT.d.cts.map
766
+ export { FileReference as $, BranchDataResult as A, StringContent as At, FileUpload as B, ProcessMovesOptions as C, HtmlContentPropKeysRecord as Ct, FileDataQuery as D, JsxChild as Dt, OrphanedFile as E, IcuMessage as Et, DownloadFileOptions as F, LocaleProperties as Ft, FetchTranslationsOptions as G, UploadFilesResponse as H, PublishFileEntry as I, CustomMapping as It, DownloadFileBatchOptions as J, FetchTranslationsResult as K, PublishFilesResult as L, TranslationError as M, StringMessage as Mt, TranslationResult as N, Variable as Nt, FileDataResult as O, JsxChildren as Ot, TranslationResultReference as P, VariableType as Pt, FileFormat as Q, EnqueueEntriesOptions as R, MoveResult as S, HTML_CONTENT_PROPS as St, GetOrphanedFilesResult as T, I18nextMessage as Tt, CreateTagOptions as U, UploadFilesOptions as V, CreateTagResult as W, DownloadFileBatchResult as X, DownloadFileBatchRequest as Y, DownloadedFile as Z, AwaitJobsResult as _, TranslateManyEntry as _t, Metadata as a, CheckFileTranslationsOptions as at, JobStatus as b, DataFormat as bt, Update as c, FileTranslationQuery as ct, Transformation as d, JsonValue as dt, FileReferenceIds as et, TransformationPrefix as f, TranslationStatusResult as ft, AwaitJobsOptions as g, RuntimeTranslateManyOptions as gt, SubmitUserEditDiffsPayload as h, EntryMetadata as ht, JsxTranslationResult as i, Updates as it, TranslateManyResult as j, StringFormat as jt, BranchQuery as k, JsxElement as kt, _Content as l, JsonObject as lt, SubmitUserEditDiff as m, ActionType as mt, FormatVariables as n, EnqueueFilesOptions as nt, Request as o, FileQuery as ot, VariableTransformationSuffix as p, HashMetadata 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, JsonPrimitive as ut, JobResult as v, TranslateOptions as vt, ProcessMovesResponse as w, HtmlContentPropValuesRecord as wt, MoveMapping as x, GTProp as xt, CheckJobStatusResult as y, Content as yt, EnqueueEntriesResult as z };
767
+ //# sourceMappingURL=types-Bf8_Apq_.d.cts.map
@@ -0,0 +1,10 @@
1
+ export type BranchDataResult = {
2
+ branches: {
3
+ id: string;
4
+ name: string;
5
+ }[];
6
+ defaultBranch: {
7
+ id: string;
8
+ name: string;
9
+ } | null;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,37 @@
1
+ export type FileTranslationQuery = {
2
+ versionId: string;
3
+ fileName?: string;
4
+ fileId?: string;
5
+ locale: string;
6
+ };
7
+ export type CheckFileTranslationsOptions = {
8
+ timeout?: number;
9
+ };
10
+ export type FileQuery = {
11
+ fileId: string;
12
+ branchId?: string;
13
+ versionId?: string;
14
+ };
15
+ export type FileQueryResult = {
16
+ sourceFile: {
17
+ id: string;
18
+ fileId: string;
19
+ versionId: string;
20
+ sourceLocale: string;
21
+ fileName: string;
22
+ fileFormat: string;
23
+ dataFormat: string | null;
24
+ createdAt: string;
25
+ updatedAt: string;
26
+ approvalRequiredAt: string | null;
27
+ locales: string[];
28
+ };
29
+ translations: {
30
+ locale: string;
31
+ completedAt: string | null;
32
+ approvedAt: string | null;
33
+ publishedAt: string | null;
34
+ createdAt: string | null;
35
+ updatedAt: string | null;
36
+ }[];
37
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type DownloadFileOptions = {
2
+ timeout?: number;
3
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,35 @@
1
+ import { FileFormat } from './file';
2
+ import type { JsonObject } from './json';
3
+ export type DownloadFileBatchRequest = {
4
+ fileId: string;
5
+ branchId?: string;
6
+ versionId?: string;
7
+ locale?: string;
8
+ useLatestAvailableVersion?: boolean;
9
+ }[];
10
+ export type DownloadFileBatchOptions = {
11
+ timeout?: number;
12
+ };
13
+ export type BatchDownloadResult = {
14
+ fileId: string;
15
+ fileName: string;
16
+ success: boolean;
17
+ content?: string;
18
+ contentType?: string;
19
+ error?: string;
20
+ };
21
+ export type DownloadedFile = {
22
+ id: string;
23
+ branchId: string;
24
+ fileId: string;
25
+ versionId: string;
26
+ locale?: string;
27
+ fileName?: string;
28
+ data: string;
29
+ metadata: JsonObject;
30
+ fileFormat: FileFormat;
31
+ };
32
+ export type DownloadFileBatchResult = {
33
+ files: DownloadedFile[];
34
+ count: number;
35
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,21 @@
1
+ import { DataFormat } from '../jsx/content';
2
+ export type { Updates } from './enqueueFiles';
3
+ export type EnqueueEntriesOptions = {
4
+ timeout?: number;
5
+ sourceLocale?: string;
6
+ targetLocales?: string[];
7
+ dataFormat?: DataFormat;
8
+ version?: string;
9
+ description?: string;
10
+ requireApproval?: boolean;
11
+ modelProvider?: string;
12
+ };
13
+ export type EnqueueEntriesResult = {
14
+ versionId: string;
15
+ locales: string[];
16
+ message: string;
17
+ projectSettings: {
18
+ cdnEnabled: boolean;
19
+ requireApproval: boolean;
20
+ };
21
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,70 @@
1
+ import { DataFormat, JsxChildren } from '../jsx/content';
2
+ type UpdateMetadata = {
3
+ id?: string;
4
+ hash?: string;
5
+ context?: string;
6
+ maxChars?: number;
7
+ dataFormat?: DataFormat;
8
+ actionType?: 'standard' | 'fast' | string;
9
+ staticId?: string;
10
+ format?: string;
11
+ filePaths?: string[];
12
+ sourceCode?: unknown;
13
+ contextDeriveExpr?: unknown;
14
+ _contextDeriveExpr?: unknown;
15
+ [key: string]: unknown;
16
+ };
17
+ export type Updates = ({
18
+ metadata: UpdateMetadata;
19
+ } & ({
20
+ dataFormat: 'JSX';
21
+ source: JsxChildren;
22
+ } | {
23
+ dataFormat: 'ICU';
24
+ source: string;
25
+ } | {
26
+ dataFormat: 'I18NEXT';
27
+ source: string;
28
+ } | {
29
+ dataFormat: 'STRING';
30
+ source: string;
31
+ }))[];
32
+ /**
33
+ * Options for enqueueing files
34
+ * @param requireApproval - Whether to require approval for the files.
35
+ * @param description - Optional description for the project.
36
+ * @param sourceLocale - The project's source locale.
37
+ * @param targetLocales - The locales to translate the files to.
38
+ * @param version - Optional custom version ID to specify.
39
+ * @param timeout - Optional timeout for the request.
40
+ * @param modelProvider - Optional model provider to use.
41
+ */
42
+ export type EnqueueFilesOptions = {
43
+ requireApproval?: boolean;
44
+ description?: string;
45
+ sourceLocale?: string;
46
+ targetLocales: string[];
47
+ version?: string;
48
+ _versionId?: string;
49
+ timeout?: number;
50
+ modelProvider?: string;
51
+ force?: boolean;
52
+ };
53
+ export type RequiredEnqueueFilesOptions = EnqueueFilesOptions & Required<Pick<EnqueueFilesOptions, 'sourceLocale'>>;
54
+ export type EnqueueFilesResult = {
55
+ jobData: {
56
+ [jobId: string]: {
57
+ sourceFileId: string;
58
+ fileId: string;
59
+ versionId: string;
60
+ branchId: string;
61
+ targetLocale: string;
62
+ projectId: string;
63
+ force: boolean;
64
+ modelProvider?: string;
65
+ };
66
+ };
67
+ locales: string[];
68
+ message: string;
69
+ };
70
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,39 @@
1
+ import { Content, DataFormat } from '../../types';
2
+ /**
3
+ * ActionType is the type of action to perform on the request.
4
+ *
5
+ * @param fast - The fast action type (mini model).
6
+ */
7
+ export type ActionType = 'fast';
8
+ /**
9
+ * EntryMetadata is the metadata for a GTRequest.
10
+ *
11
+ * @param context - The context of the request.
12
+ * @param id - The ID of the request.
13
+ * @param maxChars - The maxChars of the request.
14
+ * @param hash - The hash of the request.
15
+ */
16
+ export type EntryMetadata = {
17
+ id?: string;
18
+ hash?: string;
19
+ context?: string;
20
+ maxChars?: number;
21
+ dataFormat?: DataFormat;
22
+ actionType?: ActionType;
23
+ };
24
+ export type RuntimeTranslateManyOptions = {
25
+ sourceLocale?: string;
26
+ modelProvider?: string;
27
+ [key: string]: unknown;
28
+ };
29
+ export type TranslateOptions = RuntimeTranslateManyOptions & {
30
+ targetLocale: string;
31
+ };
32
+ /**
33
+ * TranslateManyEntry is the input type for translateMany.
34
+ * Can be a plain string or an object with source and entry metadata fields.
35
+ */
36
+ export type TranslateManyEntry = string | {
37
+ source: Content;
38
+ metadata?: EntryMetadata;
39
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { Content } from '../jsx/content';
2
+ export type FetchTranslationsOptions = {
3
+ timeout?: number;
4
+ };
5
+ export type RetrievedTranslation = {
6
+ locale: string;
7
+ translation: Content;
8
+ };
9
+ export type RetrievedTranslations = RetrievedTranslation[];
10
+ export type FetchTranslationsResult = {
11
+ translations: RetrievedTranslations;
12
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,57 @@
1
+ import { DataFormat } from '../jsx/content';
2
+ import { Updates } from './enqueueFiles';
3
+ import type { JsonObject } from './json';
4
+ export type FileFormat = 'GTJSON' | 'JSON' | 'PO' | 'POT' | 'YAML' | 'MDX' | 'MD' | 'TS' | 'JS' | 'HTML' | 'TXT' | 'TWILIO_CONTENT_JSON';
5
+ /**
6
+ * Metadata for files or entries.
7
+ */
8
+ export type FormatMetadata = JsonObject | Updates[number]['metadata'];
9
+ /**
10
+ * File object structure for uploading files.
11
+ * @see {@link FileReferenceOptionalBranchId}
12
+ * @property {string} content - Content of the file.
13
+ * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
14
+ * @property {FormatMetadata} [formatMetadata] - Optional metadata for the file, specific to the format of the file
15
+ * @property {string} [incomingBranchId] - The ID of the incoming branch of the file.
16
+ * @property {string} [checkedOutBranchId] - The ID of the checked-out branch of the file.
17
+ */
18
+ export type FileToUpload = Omit<FileReference, 'branchId'> & {
19
+ content: string;
20
+ locale: string;
21
+ transformFormat?: FileFormat;
22
+ formatMetadata?: FormatMetadata;
23
+ branchId?: string;
24
+ incomingBranchId?: string;
25
+ checkedOutBranchId?: string;
26
+ };
27
+ /**
28
+ * File object structure for referencing files.
29
+ * @property {string} fileId - The ID of the file.
30
+ * @property {string} versionId - The ID of the version of the file
31
+ * @property {string} branchId - The ID of the branch of the file
32
+ * @property {string} locale - The locale of the file (e.g. 'en', 'de', 'es', etc.)
33
+ * @property {string} fileName - The name of the file.
34
+ * @property {FileFormat} fileFormat - The format of the file (JSON, MDX, MD, etc.).
35
+ * @property {DataFormat} [dataFormat] - Optional format of the data within the file.
36
+ */
37
+ export type FileReference = {
38
+ fileId: string;
39
+ versionId: string;
40
+ branchId: string;
41
+ fileName: string;
42
+ fileFormat: FileFormat;
43
+ transformFormat?: FileFormat;
44
+ dataFormat?: DataFormat;
45
+ };
46
+ /**
47
+ * File reference object structure for referencing files.
48
+ * @see {@link FileReference}
49
+ * @property {string} [branchId] - The ID of the branch of the file
50
+ */
51
+ export type FileReferenceIds = Omit<FileReference, 'branchId' | 'fileName' | 'fileFormat' | 'dataFormat'> & {
52
+ branchId?: string;
53
+ fileName?: string;
54
+ fileFormat?: FileFormat;
55
+ transformFormat?: FileFormat;
56
+ dataFormat?: DataFormat;
57
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export type JsonPrimitive = string | number | boolean | null;
2
+ export type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;
3
+ export type JsonObject = {
4
+ [key: string]: JsonValue;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export type ProjectData = {
2
+ id: string;
3
+ name: string;
4
+ orgId: string;
5
+ defaultLocale: string;
6
+ currentLocales: string[];
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,34 @@
1
+ import { I18nextMessage, IcuMessage, JsxChildren, StringMessage } from '../jsx/content';
2
+ /**
3
+ * TranslationResultReference is used to store the reference for a translation result.
4
+ */
5
+ export type TranslationResultReference = {
6
+ id?: string;
7
+ hash: string;
8
+ };
9
+ /**
10
+ * TypedResult is a union type that represents the different types of translations that can be returned.
11
+ */
12
+ export type TypedResult = {
13
+ translation: JsxChildren;
14
+ dataFormat: 'JSX';
15
+ } | {
16
+ translation: I18nextMessage | IcuMessage | StringMessage;
17
+ dataFormat: 'ICU' | 'I18NEXT' | 'STRING';
18
+ };
19
+ /**
20
+ * RequestError is a type that represents an error that occurred during a translation request.
21
+ */
22
+ export type TranslationError = {
23
+ success: false;
24
+ error: string;
25
+ code: number;
26
+ };
27
+ /**
28
+ * RequestSuccess is a type that represents a successful translation request.
29
+ */
30
+ export type RequestSuccess = TypedResult & {
31
+ success: true;
32
+ locale: string;
33
+ };
34
+ export type TranslationResult = RequestSuccess | TranslationError;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { TranslationResult } from './translate';
2
+ /**
3
+ * BatchTranslationResult is the result of a batch translation request.
4
+ */
5
+ export type TranslateManyResult = TranslationResult[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ export type TranslationStatusResult = {
2
+ count: number;
3
+ availableLocales: string[];
4
+ locales: string[];
5
+ localesWaitingForApproval: string[];
6
+ };
7
+ export type CheckTranslationStatusOptions = {
8
+ timeout?: number;
9
+ };
@@ -0,0 +1 @@
1
+ export {};