@lokalise/polyglot-sdk 21.0.2 → 22.1.0

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 (47) hide show
  1. package/dist/index.d.ts +11 -10
  2. package/dist/index.js +9 -8
  3. package/dist/index.js.map +1 -1
  4. package/dist/sdk/PolyglotClient.js.map +1 -1
  5. package/dist/sdk/schemas/common/asyncRequestSchemas.d.ts +4 -14
  6. package/dist/sdk/schemas/common/asyncRequestSchemas.js +1 -2
  7. package/dist/sdk/schemas/common/asyncRequestSchemas.js.map +1 -1
  8. package/dist/sdk/schemas/common/commonSchemas.d.ts +19 -68
  9. package/dist/sdk/schemas/common/commonSchemas.js +6 -9
  10. package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
  11. package/dist/sdk/schemas/common/errorSchemas.d.ts +6 -51
  12. package/dist/sdk/schemas/common/errorSchemas.js +1 -1
  13. package/dist/sdk/schemas/common/errorSchemas.js.map +1 -1
  14. package/dist/sdk/schemas/common/pluralFormSchemas.d.ts +28 -0
  15. package/dist/sdk/schemas/common/pluralFormSchemas.js +48 -0
  16. package/dist/sdk/schemas/common/pluralFormSchemas.js.map +1 -0
  17. package/dist/sdk/schemas/common/translationContextSchemas.d.ts +142 -438
  18. package/dist/sdk/schemas/common/translationContextSchemas.js +4 -3
  19. package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -1
  20. package/dist/sdk/schemas/lqa/commonSchemas.d.ts +62 -264
  21. package/dist/sdk/schemas/lqa/commonSchemas.js +12 -3
  22. package/dist/sdk/schemas/lqa/commonSchemas.js.map +1 -1
  23. package/dist/sdk/schemas/lqa/lqaAsyncSchemas.d.ts +133 -817
  24. package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js +7 -4
  25. package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js.map +1 -1
  26. package/dist/sdk/schemas/lqa/lqaSyncSchemas.d.ts +106 -685
  27. package/dist/sdk/schemas/lqa/lqaSyncSchemas.js +5 -2
  28. package/dist/sdk/schemas/lqa/lqaSyncSchemas.js.map +1 -1
  29. package/dist/sdk/schemas/translation/generateVariants.d.ts +67 -524
  30. package/dist/sdk/schemas/translation/generateVariants.js +16 -6
  31. package/dist/sdk/schemas/translation/generateVariants.js.map +1 -1
  32. package/dist/sdk/schemas/translation/rewriteTextSchemas.d.ts +245 -1512
  33. package/dist/sdk/schemas/translation/rewriteTextSchemas.js +22 -4
  34. package/dist/sdk/schemas/translation/rewriteTextSchemas.js.map +1 -1
  35. package/dist/sdk/schemas/translation/sharedSchemas.d.ts +114 -451
  36. package/dist/sdk/schemas/translation/sharedSchemas.js +27 -25
  37. package/dist/sdk/schemas/translation/sharedSchemas.js.map +1 -1
  38. package/dist/sdk/schemas/translation/translateAsyncSchemas.d.ts +179 -2123
  39. package/dist/sdk/schemas/translation/translateAsyncSchemas.js +18 -6
  40. package/dist/sdk/schemas/translation/translateAsyncSchemas.js.map +1 -1
  41. package/dist/sdk/schemas/translation/translateSyncSchemas.d.ts +142 -1680
  42. package/dist/sdk/schemas/translation/translateSyncSchemas.js +19 -6
  43. package/dist/sdk/schemas/translation/translateSyncSchemas.js.map +1 -1
  44. package/dist/sdk/schemas/translation/translateTextSegmentSchemas.d.ts +87 -1079
  45. package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js +4 -4
  46. package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js.map +1 -1
  47. package/package.json +9 -11
@@ -1,4 +1,4 @@
1
- import z from 'zod';
1
+ import z from 'zod/v4';
2
2
  import type { ObjectValues } from '../../types/common.ts';
3
3
  import { IntegrationEngineEnum } from '../common/commonSchemas.ts';
4
4
  export type ContentUnitLike = {
@@ -14,15 +14,6 @@ export declare const refineHistoryIsPresent: readonly [(data: {
14
14
  history?: HistoryEntry[];
15
15
  mode: TranslateModeEnum;
16
16
  }) => boolean | undefined, "History must be present for \"rephrase\" and \"shorten\" modes, and must contain at least one \"translate\" entry"];
17
- export declare const refineSingleSegmentSizeLimit: readonly [(data: {
18
- value?: string;
19
- sourceValue?: string;
20
- integration?: IntegrationEngineEnum;
21
- }) => boolean, (data: {
22
- integration?: IntegrationEngineEnum;
23
- }) => {
24
- message: string;
25
- }];
26
17
  export declare const refineRequestSizeLimit: readonly [(data: {
27
18
  contentUnits: ContentUnitLike[];
28
19
  integration?: IntegrationEngineEnum;
@@ -37,69 +28,42 @@ export declare const refineUniqueIds: readonly [(data: {
37
28
  export declare const TRANSLATION_QUALITY_WARNING_KINDS: readonly ["EDITED_NON_TRANSLATABLE_CONTENT", "EDITED_ICU_PLURALS"];
38
29
  export type TranslationQualityWarningKind = (typeof TRANSLATION_QUALITY_WARNING_KINDS)[number];
39
30
  export declare const SEGMENT_TRANSLATION_WARNING_SCHEMA: z.ZodObject<{
40
- kind: z.ZodEnum<["EDITED_NON_TRANSLATABLE_CONTENT", "EDITED_ICU_PLURALS"]>;
41
- }, "strip", z.ZodTypeAny, {
42
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
43
- }, {
44
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
45
- }>;
31
+ kind: z.ZodEnum<{
32
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
33
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
34
+ }>;
35
+ }, z.core.$strip>;
46
36
  export type SegmentTranslationWarning = z.infer<typeof SEGMENT_TRANSLATION_WARNING_SCHEMA>;
47
37
  export declare const SEGMENT_WARNINGS_SCHEMA: z.ZodArray<z.ZodObject<{
48
- kind: z.ZodEnum<["EDITED_NON_TRANSLATABLE_CONTENT", "EDITED_ICU_PLURALS"]>;
49
- }, "strip", z.ZodTypeAny, {
50
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
51
- }, {
52
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
53
- }>, "many">;
38
+ kind: z.ZodEnum<{
39
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
40
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
41
+ }>;
42
+ }, z.core.$strip>>;
54
43
  export declare const CONTENT_UNIT_DESCRIPTION_MAX_LENGTH = 32768;
55
- export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
44
+ export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodPipe<z.ZodObject<{
56
45
  id: z.ZodString;
57
- tmMatch: z.ZodOptional<z.ZodObject<{
58
- sourceValue: z.ZodEffects<z.ZodString, string, string>;
59
- translatedValue: z.ZodEffects<z.ZodString, string, string>;
60
- }, "strip", z.ZodTypeAny, {
61
- sourceValue: string;
62
- translatedValue: string;
63
- }, {
64
- sourceValue: string;
65
- translatedValue: string;
46
+ pluralForm: z.ZodOptional<z.ZodEnum<{
47
+ readonly ZERO: "zero";
48
+ readonly ONE: "one";
49
+ readonly TWO: "two";
50
+ readonly FEW: "few";
51
+ readonly MANY: "many";
52
+ readonly OTHER: "other";
66
53
  }>>;
54
+ tmMatch: z.ZodOptional<z.ZodObject<{
55
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
56
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
57
+ }, z.core.$strip>>;
67
58
  translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
68
- sourceValue: z.ZodEffects<z.ZodString, string, string>;
69
- translatedValue: z.ZodEffects<z.ZodString, string, string>;
70
- }, "strip", z.ZodTypeAny, {
71
- sourceValue: string;
72
- translatedValue: string;
73
- }, {
74
- sourceValue: string;
75
- translatedValue: string;
76
- }>, "many">>;
77
- value: z.ZodEffects<z.ZodString, string, string>;
78
- }, "strip", z.ZodTypeAny, {
79
- value: string;
80
- id: string;
81
- tmMatch?: {
82
- sourceValue: string;
83
- translatedValue: string;
84
- } | undefined;
85
- translationExamples?: {
86
- sourceValue: string;
87
- translatedValue: string;
88
- }[] | undefined;
89
- }, {
90
- value: string;
59
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
60
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
61
+ }, z.core.$strip>>>;
62
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
63
+ }, z.core.$strip>, z.ZodTransform<{
91
64
  id: string;
92
- tmMatch?: {
93
- sourceValue: string;
94
- translatedValue: string;
95
- } | undefined;
96
- translationExamples?: {
97
- sourceValue: string;
98
- translatedValue: string;
99
- }[] | undefined;
100
- }>, {
101
65
  value: string;
102
- id: string;
66
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
103
67
  tmMatch?: {
104
68
  sourceValue: string;
105
69
  translatedValue: string;
@@ -109,8 +73,9 @@ export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
109
73
  translatedValue: string;
110
74
  }[] | undefined;
111
75
  }, {
112
- value: string;
113
76
  id: string;
77
+ value: string;
78
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
114
79
  tmMatch?: {
115
80
  sourceValue: string;
116
81
  translatedValue: string;
@@ -119,65 +84,40 @@ export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
119
84
  sourceValue: string;
120
85
  translatedValue: string;
121
86
  }[] | undefined;
122
- }>;
87
+ }>>;
123
88
  export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
124
89
  id: z.ZodString;
125
- context: z.ZodOptional<z.ZodObject<{
126
- description: z.ZodEffects<z.ZodString, string, string>;
127
- }, "strip", z.ZodTypeAny, {
128
- description: string;
129
- }, {
130
- description: string;
90
+ type: z.ZodDefault<z.ZodEnum<{
91
+ readonly SEGMENTED: "segmented";
92
+ readonly PLURAL: "plural";
131
93
  }>>;
94
+ context: z.ZodOptional<z.ZodObject<{
95
+ description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
96
+ }, z.core.$strip>>;
132
97
  characterLimit: z.ZodOptional<z.ZodNumber>;
133
- segments: z.ZodEffects<z.ZodArray<z.ZodEffects<z.ZodObject<{
98
+ segments: z.ZodArray<z.ZodPipe<z.ZodObject<{
134
99
  id: z.ZodString;
135
- tmMatch: z.ZodOptional<z.ZodObject<{
136
- sourceValue: z.ZodEffects<z.ZodString, string, string>;
137
- translatedValue: z.ZodEffects<z.ZodString, string, string>;
138
- }, "strip", z.ZodTypeAny, {
139
- sourceValue: string;
140
- translatedValue: string;
141
- }, {
142
- sourceValue: string;
143
- translatedValue: string;
100
+ pluralForm: z.ZodOptional<z.ZodEnum<{
101
+ readonly ZERO: "zero";
102
+ readonly ONE: "one";
103
+ readonly TWO: "two";
104
+ readonly FEW: "few";
105
+ readonly MANY: "many";
106
+ readonly OTHER: "other";
144
107
  }>>;
108
+ tmMatch: z.ZodOptional<z.ZodObject<{
109
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
110
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
111
+ }, z.core.$strip>>;
145
112
  translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
146
- sourceValue: z.ZodEffects<z.ZodString, string, string>;
147
- translatedValue: z.ZodEffects<z.ZodString, string, string>;
148
- }, "strip", z.ZodTypeAny, {
149
- sourceValue: string;
150
- translatedValue: string;
151
- }, {
152
- sourceValue: string;
153
- translatedValue: string;
154
- }>, "many">>;
155
- value: z.ZodEffects<z.ZodString, string, string>;
156
- }, "strip", z.ZodTypeAny, {
157
- value: string;
113
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
114
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
115
+ }, z.core.$strip>>>;
116
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
117
+ }, z.core.$strip>, z.ZodTransform<{
158
118
  id: string;
159
- tmMatch?: {
160
- sourceValue: string;
161
- translatedValue: string;
162
- } | undefined;
163
- translationExamples?: {
164
- sourceValue: string;
165
- translatedValue: string;
166
- }[] | undefined;
167
- }, {
168
119
  value: string;
169
- id: string;
170
- tmMatch?: {
171
- sourceValue: string;
172
- translatedValue: string;
173
- } | undefined;
174
- translationExamples?: {
175
- sourceValue: string;
176
- translatedValue: string;
177
- }[] | undefined;
178
- }>, {
179
- value: string;
180
- id: string;
120
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
181
121
  tmMatch?: {
182
122
  sourceValue: string;
183
123
  translatedValue: string;
@@ -187,105 +127,9 @@ export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
187
127
  translatedValue: string;
188
128
  }[] | undefined;
189
129
  }, {
190
- value: string;
191
- id: string;
192
- tmMatch?: {
193
- sourceValue: string;
194
- translatedValue: string;
195
- } | undefined;
196
- translationExamples?: {
197
- sourceValue: string;
198
- translatedValue: string;
199
- }[] | undefined;
200
- }>, "atleastone">, [{
201
- value: string;
202
- id: string;
203
- tmMatch?: {
204
- sourceValue: string;
205
- translatedValue: string;
206
- } | undefined;
207
- translationExamples?: {
208
- sourceValue: string;
209
- translatedValue: string;
210
- }[] | undefined;
211
- }, ...{
212
- value: string;
213
- id: string;
214
- tmMatch?: {
215
- sourceValue: string;
216
- translatedValue: string;
217
- } | undefined;
218
- translationExamples?: {
219
- sourceValue: string;
220
- translatedValue: string;
221
- }[] | undefined;
222
- }[]], [{
223
- value: string;
224
- id: string;
225
- tmMatch?: {
226
- sourceValue: string;
227
- translatedValue: string;
228
- } | undefined;
229
- translationExamples?: {
230
- sourceValue: string;
231
- translatedValue: string;
232
- }[] | undefined;
233
- }, ...{
234
- value: string;
235
- id: string;
236
- tmMatch?: {
237
- sourceValue: string;
238
- translatedValue: string;
239
- } | undefined;
240
- translationExamples?: {
241
- sourceValue: string;
242
- translatedValue: string;
243
- }[] | undefined;
244
- }[]]>;
245
- }, "strip", z.ZodTypeAny, {
246
- segments: [{
247
- value: string;
248
- id: string;
249
- tmMatch?: {
250
- sourceValue: string;
251
- translatedValue: string;
252
- } | undefined;
253
- translationExamples?: {
254
- sourceValue: string;
255
- translatedValue: string;
256
- }[] | undefined;
257
- }, ...{
258
- value: string;
259
- id: string;
260
- tmMatch?: {
261
- sourceValue: string;
262
- translatedValue: string;
263
- } | undefined;
264
- translationExamples?: {
265
- sourceValue: string;
266
- translatedValue: string;
267
- }[] | undefined;
268
- }[]];
269
- id: string;
270
- context?: {
271
- description: string;
272
- } | undefined;
273
- characterLimit?: number | undefined;
274
- }, {
275
- segments: [{
276
- value: string;
277
130
  id: string;
278
- tmMatch?: {
279
- sourceValue: string;
280
- translatedValue: string;
281
- } | undefined;
282
- translationExamples?: {
283
- sourceValue: string;
284
- translatedValue: string;
285
- }[] | undefined;
286
- }, ...{
287
131
  value: string;
288
- id: string;
132
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
289
133
  tmMatch?: {
290
134
  sourceValue: string;
291
135
  translatedValue: string;
@@ -294,13 +138,8 @@ export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
294
138
  sourceValue: string;
295
139
  translatedValue: string;
296
140
  }[] | undefined;
297
- }[]];
298
- id: string;
299
- context?: {
300
- description: string;
301
- } | undefined;
302
- characterLimit?: number | undefined;
303
- }>;
141
+ }>>>;
142
+ }, z.core.$strip>;
304
143
  export type TranslateSegment = z.infer<typeof TRANSLATE_SEGMENT_SCHEMA>;
305
144
  export type TranslateContentUnit = z.infer<typeof TRANSLATE_CONTENT_UNIT_SCHEMA>;
306
145
  /**
@@ -308,73 +147,39 @@ export type TranslateContentUnit = z.infer<typeof TRANSLATE_CONTENT_UNIT_SCHEMA>
308
147
  */
309
148
  export declare const REWRITE_SEGMENT_SCHEMA: z.ZodObject<{
310
149
  id: z.ZodString;
311
- value: z.ZodEffects<z.ZodString, string, string>;
312
- }, "strip", z.ZodTypeAny, {
313
- value: string;
314
- id: string;
315
- }, {
316
- value: string;
317
- id: string;
318
- }>;
150
+ pluralForm: z.ZodOptional<z.ZodEnum<{
151
+ readonly ZERO: "zero";
152
+ readonly ONE: "one";
153
+ readonly TWO: "two";
154
+ readonly FEW: "few";
155
+ readonly MANY: "many";
156
+ readonly OTHER: "other";
157
+ }>>;
158
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
159
+ }, z.core.$strip>;
319
160
  export declare const REWRITE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
320
161
  id: z.ZodString;
321
- context: z.ZodOptional<z.ZodObject<{
322
- description: z.ZodEffects<z.ZodString, string, string>;
323
- }, "strip", z.ZodTypeAny, {
324
- description: string;
325
- }, {
326
- description: string;
162
+ type: z.ZodDefault<z.ZodEnum<{
163
+ readonly SEGMENTED: "segmented";
164
+ readonly PLURAL: "plural";
327
165
  }>>;
166
+ context: z.ZodOptional<z.ZodObject<{
167
+ description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
168
+ }, z.core.$strip>>;
328
169
  characterLimit: z.ZodOptional<z.ZodNumber>;
329
- segments: z.ZodEffects<z.ZodArray<z.ZodObject<{
170
+ segments: z.ZodArray<z.ZodObject<{
330
171
  id: z.ZodString;
331
- value: z.ZodEffects<z.ZodString, string, string>;
332
- }, "strip", z.ZodTypeAny, {
333
- value: string;
334
- id: string;
335
- }, {
336
- value: string;
337
- id: string;
338
- }>, "atleastone">, [{
339
- value: string;
340
- id: string;
341
- }, ...{
342
- value: string;
343
- id: string;
344
- }[]], [{
345
- value: string;
346
- id: string;
347
- }, ...{
348
- value: string;
349
- id: string;
350
- }[]]>;
351
- }, "strip", z.ZodTypeAny, {
352
- segments: [{
353
- value: string;
354
- id: string;
355
- }, ...{
356
- value: string;
357
- id: string;
358
- }[]];
359
- id: string;
360
- context?: {
361
- description: string;
362
- } | undefined;
363
- characterLimit?: number | undefined;
364
- }, {
365
- segments: [{
366
- value: string;
367
- id: string;
368
- }, ...{
369
- value: string;
370
- id: string;
371
- }[]];
372
- id: string;
373
- context?: {
374
- description: string;
375
- } | undefined;
376
- characterLimit?: number | undefined;
377
- }>;
172
+ pluralForm: z.ZodOptional<z.ZodEnum<{
173
+ readonly ZERO: "zero";
174
+ readonly ONE: "one";
175
+ readonly TWO: "two";
176
+ readonly FEW: "few";
177
+ readonly MANY: "many";
178
+ readonly OTHER: "other";
179
+ }>>;
180
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
181
+ }, z.core.$strip>>;
182
+ }, z.core.$strip>;
378
183
  export type RewriteSegment = z.infer<typeof REWRITE_SEGMENT_SCHEMA>;
379
184
  export type RewriteContentUnit = z.infer<typeof REWRITE_CONTENT_UNIT_SCHEMA>;
380
185
  /**
@@ -392,36 +197,24 @@ export declare const TranslateModeEnum: {
392
197
  };
393
198
  export type TranslateModeEnum = ObjectValues<typeof TranslateModeEnum>;
394
199
  export declare const HISTORY_REQUEST_SCHEMA: z.ZodObject<{
395
- values: z.ZodEffects<z.ZodArray<z.ZodString, "atleastone">, string[], [string, ...string[]]>;
396
- mode: z.ZodPipeline<z.ZodString, z.ZodNativeEnum<{
200
+ values: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
201
+ mode: z.ZodPipe<z.ZodString, z.ZodEnum<{
397
202
  readonly REPHRASE: "rephrase";
398
203
  readonly SHORTEN: "shorten";
399
204
  }>>;
400
- }, "strip", z.ZodTypeAny, {
401
- values: string[];
402
- mode: "rephrase" | "shorten";
403
- }, {
404
- values: [string, ...string[]];
405
- mode: string;
406
- }>;
205
+ }, z.core.$strip>;
407
206
  export type History = z.infer<typeof HISTORY_REQUEST_SCHEMA>;
408
207
  /**
409
208
  * This is an updated version for history entry object, which will eventually replace HISTORY_REQUEST_SCHEMA
410
209
  */
411
210
  export declare const HISTORY_ENTRY_SCHEMA: z.ZodObject<{
412
- mode: z.ZodNativeEnum<{
211
+ mode: z.ZodEnum<{
413
212
  readonly REPHRASE: "rephrase";
414
213
  readonly SHORTEN: "shorten";
415
214
  readonly TRANSLATE: "translate";
416
215
  }>;
417
- value: z.ZodEffects<z.ZodString, string, string>;
418
- }, "strip", z.ZodTypeAny, {
419
- value: string;
420
- mode: "rephrase" | "shorten" | "translate";
421
- }, {
422
- value: string;
423
- mode: "rephrase" | "shorten" | "translate";
424
- }>;
216
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
217
+ }, z.core.$strip>;
425
218
  export type HistoryEntry = z.infer<typeof HISTORY_ENTRY_SCHEMA>;
426
219
  /**
427
220
  * Streaming events
@@ -432,7 +225,7 @@ export declare const TRANSLATION_EVENT_SCHEMA: z.ZodObject<{
432
225
  id: z.ZodString;
433
226
  content: z.ZodString;
434
227
  isComplete: z.ZodBoolean;
435
- integration: z.ZodNativeEnum<{
228
+ integration: z.ZodEnum<{
436
229
  readonly FAKE: "Fake";
437
230
  readonly FINETUNED_OPENAI: "FT-OpenAI";
438
231
  readonly CLAUDE: "Claude";
@@ -444,93 +237,28 @@ export declare const TRANSLATION_EVENT_SCHEMA: z.ZodObject<{
444
237
  }>;
445
238
  polyglotRefId: z.ZodOptional<z.ZodString>;
446
239
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
447
- kind: z.ZodEnum<["EDITED_NON_TRANSLATABLE_CONTENT", "EDITED_ICU_PLURALS"]>;
448
- }, "strip", z.ZodTypeAny, {
449
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
450
- }, {
451
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
452
- }>, "many">>;
453
- }, "strip", z.ZodTypeAny, {
454
- id: string;
455
- content: string;
456
- isComplete: boolean;
457
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
458
- polyglotRefId?: string | undefined;
459
- warnings?: {
460
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
461
- }[] | undefined;
462
- }, {
463
- id: string;
464
- content: string;
465
- isComplete: boolean;
466
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
467
- polyglotRefId?: string | undefined;
468
- warnings?: {
469
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
470
- }[] | undefined;
471
- }>;
472
- }, "strip", z.ZodTypeAny, {
473
- event: "translation";
474
- data: {
475
- id: string;
476
- content: string;
477
- isComplete: boolean;
478
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
479
- polyglotRefId?: string | undefined;
480
- warnings?: {
481
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
482
- }[] | undefined;
483
- };
484
- }, {
485
- event: "translation";
486
- data: {
487
- id: string;
488
- content: string;
489
- isComplete: boolean;
490
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
491
- polyglotRefId?: string | undefined;
492
- warnings?: {
493
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
494
- }[] | undefined;
495
- };
496
- }>;
240
+ kind: z.ZodEnum<{
241
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
242
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
243
+ }>;
244
+ }, z.core.$strip>>>;
245
+ }, z.core.$strip>;
246
+ }, z.core.$strip>;
497
247
  export declare const ERROR_EVENT_SCHEMA: z.ZodObject<{
498
248
  event: z.ZodLiteral<"error">;
499
249
  data: z.ZodObject<{
500
250
  message: z.ZodString;
501
251
  errorCode: z.ZodString;
502
252
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
503
- }, "strip", z.ZodTypeAny, {
504
- message: string;
505
- errorCode: string;
506
- details?: Record<string, unknown> | undefined;
507
- }, {
508
- message: string;
509
- errorCode: string;
510
- details?: Record<string, unknown> | undefined;
511
- }>;
512
- }, "strip", z.ZodTypeAny, {
513
- event: "error";
514
- data: {
515
- message: string;
516
- errorCode: string;
517
- details?: Record<string, unknown> | undefined;
518
- };
519
- }, {
520
- event: "error";
521
- data: {
522
- message: string;
523
- errorCode: string;
524
- details?: Record<string, unknown> | undefined;
525
- };
526
- }>;
527
- export declare const STREAMING_EVENT_SCHEMA: z.ZodDiscriminatedUnion<"event", [z.ZodObject<{
253
+ }, z.core.$strip>;
254
+ }, z.core.$strip>;
255
+ export declare const STREAMING_EVENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
528
256
  event: z.ZodLiteral<"translation">;
529
257
  data: z.ZodObject<{
530
258
  id: z.ZodString;
531
259
  content: z.ZodString;
532
260
  isComplete: z.ZodBoolean;
533
- integration: z.ZodNativeEnum<{
261
+ integration: z.ZodEnum<{
534
262
  readonly FAKE: "Fake";
535
263
  readonly FINETUNED_OPENAI: "FT-OpenAI";
536
264
  readonly CLAUDE: "Claude";
@@ -542,84 +270,19 @@ export declare const STREAMING_EVENT_SCHEMA: z.ZodDiscriminatedUnion<"event", [z
542
270
  }>;
543
271
  polyglotRefId: z.ZodOptional<z.ZodString>;
544
272
  warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
545
- kind: z.ZodEnum<["EDITED_NON_TRANSLATABLE_CONTENT", "EDITED_ICU_PLURALS"]>;
546
- }, "strip", z.ZodTypeAny, {
547
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
548
- }, {
549
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
550
- }>, "many">>;
551
- }, "strip", z.ZodTypeAny, {
552
- id: string;
553
- content: string;
554
- isComplete: boolean;
555
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
556
- polyglotRefId?: string | undefined;
557
- warnings?: {
558
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
559
- }[] | undefined;
560
- }, {
561
- id: string;
562
- content: string;
563
- isComplete: boolean;
564
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
565
- polyglotRefId?: string | undefined;
566
- warnings?: {
567
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
568
- }[] | undefined;
569
- }>;
570
- }, "strip", z.ZodTypeAny, {
571
- event: "translation";
572
- data: {
573
- id: string;
574
- content: string;
575
- isComplete: boolean;
576
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
577
- polyglotRefId?: string | undefined;
578
- warnings?: {
579
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
580
- }[] | undefined;
581
- };
582
- }, {
583
- event: "translation";
584
- data: {
585
- id: string;
586
- content: string;
587
- isComplete: boolean;
588
- integration: "FT-OpenAI" | "Claude" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | "Fake";
589
- polyglotRefId?: string | undefined;
590
- warnings?: {
591
- kind: "EDITED_NON_TRANSLATABLE_CONTENT" | "EDITED_ICU_PLURALS";
592
- }[] | undefined;
593
- };
594
- }>, z.ZodObject<{
273
+ kind: z.ZodEnum<{
274
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
275
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
276
+ }>;
277
+ }, z.core.$strip>>>;
278
+ }, z.core.$strip>;
279
+ }, z.core.$strip>, z.ZodObject<{
595
280
  event: z.ZodLiteral<"error">;
596
281
  data: z.ZodObject<{
597
282
  message: z.ZodString;
598
283
  errorCode: z.ZodString;
599
284
  details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
600
- }, "strip", z.ZodTypeAny, {
601
- message: string;
602
- errorCode: string;
603
- details?: Record<string, unknown> | undefined;
604
- }, {
605
- message: string;
606
- errorCode: string;
607
- details?: Record<string, unknown> | undefined;
608
- }>;
609
- }, "strip", z.ZodTypeAny, {
610
- event: "error";
611
- data: {
612
- message: string;
613
- errorCode: string;
614
- details?: Record<string, unknown> | undefined;
615
- };
616
- }, {
617
- event: "error";
618
- data: {
619
- message: string;
620
- errorCode: string;
621
- details?: Record<string, unknown> | undefined;
622
- };
623
- }>]>;
285
+ }, z.core.$strip>;
286
+ }, z.core.$strip>]>;
624
287
  export type TranslationEvent = z.infer<typeof TRANSLATION_EVENT_SCHEMA>;
625
288
  export type StreamingEvent = TranslationEvent;