@lokalise/polyglot-sdk 21.0.1 → 22.0.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.
- package/dist/index.d.ts +10 -10
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/sdk/PolyglotClient.js.map +1 -1
- package/dist/sdk/schemas/common/asyncRequestSchemas.d.ts +4 -14
- package/dist/sdk/schemas/common/asyncRequestSchemas.js +1 -2
- package/dist/sdk/schemas/common/asyncRequestSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/commonSchemas.d.ts +19 -68
- package/dist/sdk/schemas/common/commonSchemas.js +6 -9
- package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/errorSchemas.d.ts +6 -51
- package/dist/sdk/schemas/common/errorSchemas.js +1 -1
- package/dist/sdk/schemas/common/errorSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/translationContextSchemas.d.ts +142 -438
- package/dist/sdk/schemas/common/translationContextSchemas.js +1 -1
- package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/commonSchemas.d.ts +38 -264
- package/dist/sdk/schemas/lqa/commonSchemas.js +1 -1
- package/dist/sdk/schemas/lqa/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.d.ts +87 -817
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js +4 -4
- package/dist/sdk/schemas/lqa/lqaAsyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.d.ts +76 -685
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js +2 -2
- package/dist/sdk/schemas/lqa/lqaSyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/generateVariants.d.ts +67 -524
- package/dist/sdk/schemas/translation/generateVariants.js +16 -6
- package/dist/sdk/schemas/translation/generateVariants.js.map +1 -1
- package/dist/sdk/schemas/translation/rewriteTextSchemas.d.ts +233 -1512
- package/dist/sdk/schemas/translation/rewriteTextSchemas.js +22 -4
- package/dist/sdk/schemas/translation/rewriteTextSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/sharedSchemas.d.ts +70 -451
- package/dist/sdk/schemas/translation/sharedSchemas.js +5 -12
- package/dist/sdk/schemas/translation/sharedSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateAsyncSchemas.d.ts +117 -2123
- package/dist/sdk/schemas/translation/translateAsyncSchemas.js +15 -6
- package/dist/sdk/schemas/translation/translateAsyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateSyncSchemas.d.ts +111 -1683
- package/dist/sdk/schemas/translation/translateSyncSchemas.js +16 -6
- package/dist/sdk/schemas/translation/translateSyncSchemas.js.map +1 -1
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.d.ts +87 -1079
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js +4 -4
- package/dist/sdk/schemas/translation/translateTextSegmentSchemas.js.map +1 -1
- package/package.json +10 -13
|
@@ -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,33 @@ 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<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
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<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
|
|
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.
|
|
44
|
+
export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodPipe<z.ZodObject<{
|
|
56
45
|
id: z.ZodString;
|
|
57
46
|
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
58
|
-
sourceValue: z.
|
|
59
|
-
translatedValue: z.
|
|
60
|
-
},
|
|
61
|
-
sourceValue: string;
|
|
62
|
-
translatedValue: string;
|
|
63
|
-
}, {
|
|
64
|
-
sourceValue: string;
|
|
65
|
-
translatedValue: string;
|
|
66
|
-
}>>;
|
|
47
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
48
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
67
50
|
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
-
sourceValue: z.
|
|
69
|
-
translatedValue: z.
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}, {
|
|
74
|
-
sourceValue: string;
|
|
75
|
-
translatedValue: string;
|
|
76
|
-
}>, "many">>;
|
|
77
|
-
value: z.ZodEffects<z.ZodString, string, string>;
|
|
78
|
-
}, "strip", z.ZodTypeAny, {
|
|
79
|
-
value: string;
|
|
51
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
52
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
53
|
+
}, z.core.$strip>>>;
|
|
54
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
55
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
80
56
|
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;
|
|
91
|
-
id: string;
|
|
92
|
-
tmMatch?: {
|
|
93
|
-
sourceValue: string;
|
|
94
|
-
translatedValue: string;
|
|
95
|
-
} | undefined;
|
|
96
|
-
translationExamples?: {
|
|
97
|
-
sourceValue: string;
|
|
98
|
-
translatedValue: string;
|
|
99
|
-
}[] | undefined;
|
|
100
|
-
}>, {
|
|
101
57
|
value: string;
|
|
102
|
-
id: string;
|
|
103
58
|
tmMatch?: {
|
|
104
59
|
sourceValue: string;
|
|
105
60
|
translatedValue: string;
|
|
@@ -109,8 +64,8 @@ export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
109
64
|
translatedValue: string;
|
|
110
65
|
}[] | undefined;
|
|
111
66
|
}, {
|
|
112
|
-
value: string;
|
|
113
67
|
id: string;
|
|
68
|
+
value: string;
|
|
114
69
|
tmMatch?: {
|
|
115
70
|
sourceValue: string;
|
|
116
71
|
translatedValue: string;
|
|
@@ -119,65 +74,27 @@ export declare const TRANSLATE_SEGMENT_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
119
74
|
sourceValue: string;
|
|
120
75
|
translatedValue: string;
|
|
121
76
|
}[] | undefined;
|
|
122
|
-
}
|
|
77
|
+
}>>;
|
|
123
78
|
export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
124
79
|
id: z.ZodString;
|
|
125
80
|
context: z.ZodOptional<z.ZodObject<{
|
|
126
|
-
description: z.
|
|
127
|
-
},
|
|
128
|
-
description: string;
|
|
129
|
-
}, {
|
|
130
|
-
description: string;
|
|
131
|
-
}>>;
|
|
81
|
+
description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
82
|
+
}, z.core.$strip>>;
|
|
132
83
|
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
133
|
-
segments: z.
|
|
84
|
+
segments: z.ZodArray<z.ZodPipe<z.ZodObject<{
|
|
134
85
|
id: z.ZodString;
|
|
135
86
|
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
136
|
-
sourceValue: z.
|
|
137
|
-
translatedValue: z.
|
|
138
|
-
},
|
|
139
|
-
sourceValue: string;
|
|
140
|
-
translatedValue: string;
|
|
141
|
-
}, {
|
|
142
|
-
sourceValue: string;
|
|
143
|
-
translatedValue: string;
|
|
144
|
-
}>>;
|
|
87
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
88
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
89
|
+
}, z.core.$strip>>;
|
|
145
90
|
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
146
|
-
sourceValue: z.
|
|
147
|
-
translatedValue: z.
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, {
|
|
152
|
-
sourceValue: string;
|
|
153
|
-
translatedValue: string;
|
|
154
|
-
}>, "many">>;
|
|
155
|
-
value: z.ZodEffects<z.ZodString, string, string>;
|
|
156
|
-
}, "strip", z.ZodTypeAny, {
|
|
157
|
-
value: string;
|
|
91
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
92
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
93
|
+
}, z.core.$strip>>>;
|
|
94
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
95
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
158
96
|
id: string;
|
|
159
|
-
tmMatch?: {
|
|
160
|
-
sourceValue: string;
|
|
161
|
-
translatedValue: string;
|
|
162
|
-
} | undefined;
|
|
163
|
-
translationExamples?: {
|
|
164
|
-
sourceValue: string;
|
|
165
|
-
translatedValue: string;
|
|
166
|
-
}[] | undefined;
|
|
167
|
-
}, {
|
|
168
|
-
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
97
|
value: string;
|
|
180
|
-
id: string;
|
|
181
98
|
tmMatch?: {
|
|
182
99
|
sourceValue: string;
|
|
183
100
|
translatedValue: string;
|
|
@@ -187,41 +104,8 @@ export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
|
187
104
|
translatedValue: string;
|
|
188
105
|
}[] | undefined;
|
|
189
106
|
}, {
|
|
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
107
|
id: string;
|
|
214
|
-
tmMatch?: {
|
|
215
|
-
sourceValue: string;
|
|
216
|
-
translatedValue: string;
|
|
217
|
-
} | undefined;
|
|
218
|
-
translationExamples?: {
|
|
219
|
-
sourceValue: string;
|
|
220
|
-
translatedValue: string;
|
|
221
|
-
}[] | undefined;
|
|
222
|
-
}[]], [{
|
|
223
108
|
value: string;
|
|
224
|
-
id: string;
|
|
225
109
|
tmMatch?: {
|
|
226
110
|
sourceValue: string;
|
|
227
111
|
translatedValue: string;
|
|
@@ -230,77 +114,8 @@ export declare const TRANSLATE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
|
230
114
|
sourceValue: string;
|
|
231
115
|
translatedValue: string;
|
|
232
116
|
}[] | undefined;
|
|
233
|
-
}
|
|
234
|
-
|
|
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
|
-
id: string;
|
|
278
|
-
tmMatch?: {
|
|
279
|
-
sourceValue: string;
|
|
280
|
-
translatedValue: string;
|
|
281
|
-
} | undefined;
|
|
282
|
-
translationExamples?: {
|
|
283
|
-
sourceValue: string;
|
|
284
|
-
translatedValue: string;
|
|
285
|
-
}[] | undefined;
|
|
286
|
-
}, ...{
|
|
287
|
-
value: string;
|
|
288
|
-
id: string;
|
|
289
|
-
tmMatch?: {
|
|
290
|
-
sourceValue: string;
|
|
291
|
-
translatedValue: string;
|
|
292
|
-
} | undefined;
|
|
293
|
-
translationExamples?: {
|
|
294
|
-
sourceValue: string;
|
|
295
|
-
translatedValue: string;
|
|
296
|
-
}[] | undefined;
|
|
297
|
-
}[]];
|
|
298
|
-
id: string;
|
|
299
|
-
context?: {
|
|
300
|
-
description: string;
|
|
301
|
-
} | undefined;
|
|
302
|
-
characterLimit?: number | undefined;
|
|
303
|
-
}>;
|
|
117
|
+
}>>>;
|
|
118
|
+
}, z.core.$strip>;
|
|
304
119
|
export type TranslateSegment = z.infer<typeof TRANSLATE_SEGMENT_SCHEMA>;
|
|
305
120
|
export type TranslateContentUnit = z.infer<typeof TRANSLATE_CONTENT_UNIT_SCHEMA>;
|
|
306
121
|
/**
|
|
@@ -308,73 +123,19 @@ export type TranslateContentUnit = z.infer<typeof TRANSLATE_CONTENT_UNIT_SCHEMA>
|
|
|
308
123
|
*/
|
|
309
124
|
export declare const REWRITE_SEGMENT_SCHEMA: z.ZodObject<{
|
|
310
125
|
id: z.ZodString;
|
|
311
|
-
value: z.
|
|
312
|
-
},
|
|
313
|
-
value: string;
|
|
314
|
-
id: string;
|
|
315
|
-
}, {
|
|
316
|
-
value: string;
|
|
317
|
-
id: string;
|
|
318
|
-
}>;
|
|
126
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
319
128
|
export declare const REWRITE_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
320
129
|
id: z.ZodString;
|
|
321
130
|
context: z.ZodOptional<z.ZodObject<{
|
|
322
|
-
description: z.
|
|
323
|
-
},
|
|
324
|
-
description: string;
|
|
325
|
-
}, {
|
|
326
|
-
description: string;
|
|
327
|
-
}>>;
|
|
131
|
+
description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
328
133
|
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
329
|
-
segments: z.
|
|
134
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
330
135
|
id: z.ZodString;
|
|
331
|
-
value: z.
|
|
332
|
-
},
|
|
333
|
-
|
|
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
|
-
}>;
|
|
136
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
}, z.core.$strip>;
|
|
378
139
|
export type RewriteSegment = z.infer<typeof REWRITE_SEGMENT_SCHEMA>;
|
|
379
140
|
export type RewriteContentUnit = z.infer<typeof REWRITE_CONTENT_UNIT_SCHEMA>;
|
|
380
141
|
/**
|
|
@@ -392,36 +153,24 @@ export declare const TranslateModeEnum: {
|
|
|
392
153
|
};
|
|
393
154
|
export type TranslateModeEnum = ObjectValues<typeof TranslateModeEnum>;
|
|
394
155
|
export declare const HISTORY_REQUEST_SCHEMA: z.ZodObject<{
|
|
395
|
-
values: z.
|
|
396
|
-
mode: z.
|
|
156
|
+
values: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
|
|
157
|
+
mode: z.ZodPipe<z.ZodString, z.ZodEnum<{
|
|
397
158
|
readonly REPHRASE: "rephrase";
|
|
398
159
|
readonly SHORTEN: "shorten";
|
|
399
160
|
}>>;
|
|
400
|
-
},
|
|
401
|
-
values: string[];
|
|
402
|
-
mode: "rephrase" | "shorten";
|
|
403
|
-
}, {
|
|
404
|
-
values: [string, ...string[]];
|
|
405
|
-
mode: string;
|
|
406
|
-
}>;
|
|
161
|
+
}, z.core.$strip>;
|
|
407
162
|
export type History = z.infer<typeof HISTORY_REQUEST_SCHEMA>;
|
|
408
163
|
/**
|
|
409
164
|
* This is an updated version for history entry object, which will eventually replace HISTORY_REQUEST_SCHEMA
|
|
410
165
|
*/
|
|
411
166
|
export declare const HISTORY_ENTRY_SCHEMA: z.ZodObject<{
|
|
412
|
-
mode: z.
|
|
167
|
+
mode: z.ZodEnum<{
|
|
413
168
|
readonly REPHRASE: "rephrase";
|
|
414
169
|
readonly SHORTEN: "shorten";
|
|
415
170
|
readonly TRANSLATE: "translate";
|
|
416
171
|
}>;
|
|
417
|
-
value: z.
|
|
418
|
-
},
|
|
419
|
-
value: string;
|
|
420
|
-
mode: "rephrase" | "shorten" | "translate";
|
|
421
|
-
}, {
|
|
422
|
-
value: string;
|
|
423
|
-
mode: "rephrase" | "shorten" | "translate";
|
|
424
|
-
}>;
|
|
172
|
+
value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
173
|
+
}, z.core.$strip>;
|
|
425
174
|
export type HistoryEntry = z.infer<typeof HISTORY_ENTRY_SCHEMA>;
|
|
426
175
|
/**
|
|
427
176
|
* Streaming events
|
|
@@ -432,7 +181,7 @@ export declare const TRANSLATION_EVENT_SCHEMA: z.ZodObject<{
|
|
|
432
181
|
id: z.ZodString;
|
|
433
182
|
content: z.ZodString;
|
|
434
183
|
isComplete: z.ZodBoolean;
|
|
435
|
-
integration: z.
|
|
184
|
+
integration: z.ZodEnum<{
|
|
436
185
|
readonly FAKE: "Fake";
|
|
437
186
|
readonly FINETUNED_OPENAI: "FT-OpenAI";
|
|
438
187
|
readonly CLAUDE: "Claude";
|
|
@@ -444,93 +193,28 @@ export declare const TRANSLATION_EVENT_SCHEMA: z.ZodObject<{
|
|
|
444
193
|
}>;
|
|
445
194
|
polyglotRefId: z.ZodOptional<z.ZodString>;
|
|
446
195
|
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
447
|
-
kind: z.ZodEnum<
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
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
|
-
}>;
|
|
196
|
+
kind: z.ZodEnum<{
|
|
197
|
+
EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
|
|
198
|
+
EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
|
|
199
|
+
}>;
|
|
200
|
+
}, z.core.$strip>>>;
|
|
201
|
+
}, z.core.$strip>;
|
|
202
|
+
}, z.core.$strip>;
|
|
497
203
|
export declare const ERROR_EVENT_SCHEMA: z.ZodObject<{
|
|
498
204
|
event: z.ZodLiteral<"error">;
|
|
499
205
|
data: z.ZodObject<{
|
|
500
206
|
message: z.ZodString;
|
|
501
207
|
errorCode: z.ZodString;
|
|
502
208
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
503
|
-
},
|
|
504
|
-
|
|
505
|
-
|
|
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<{
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
}, z.core.$strip>;
|
|
211
|
+
export declare const STREAMING_EVENT_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
528
212
|
event: z.ZodLiteral<"translation">;
|
|
529
213
|
data: z.ZodObject<{
|
|
530
214
|
id: z.ZodString;
|
|
531
215
|
content: z.ZodString;
|
|
532
216
|
isComplete: z.ZodBoolean;
|
|
533
|
-
integration: z.
|
|
217
|
+
integration: z.ZodEnum<{
|
|
534
218
|
readonly FAKE: "Fake";
|
|
535
219
|
readonly FINETUNED_OPENAI: "FT-OpenAI";
|
|
536
220
|
readonly CLAUDE: "Claude";
|
|
@@ -542,84 +226,19 @@ export declare const STREAMING_EVENT_SCHEMA: z.ZodDiscriminatedUnion<"event", [z
|
|
|
542
226
|
}>;
|
|
543
227
|
polyglotRefId: z.ZodOptional<z.ZodString>;
|
|
544
228
|
warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
545
|
-
kind: z.ZodEnum<
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
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<{
|
|
229
|
+
kind: z.ZodEnum<{
|
|
230
|
+
EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
|
|
231
|
+
EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
|
|
232
|
+
}>;
|
|
233
|
+
}, z.core.$strip>>>;
|
|
234
|
+
}, z.core.$strip>;
|
|
235
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
595
236
|
event: z.ZodLiteral<"error">;
|
|
596
237
|
data: z.ZodObject<{
|
|
597
238
|
message: z.ZodString;
|
|
598
239
|
errorCode: z.ZodString;
|
|
599
240
|
details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
600
|
-
},
|
|
601
|
-
|
|
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
|
-
}>]>;
|
|
241
|
+
}, z.core.$strip>;
|
|
242
|
+
}, z.core.$strip>]>;
|
|
624
243
|
export type TranslationEvent = z.infer<typeof TRANSLATION_EVENT_SCHEMA>;
|
|
625
244
|
export type StreamingEvent = TranslationEvent;
|