@lokalise/polyglot-sdk 24.1.0 → 24.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,920 @@
1
+ import z from 'zod/v4';
2
+ export declare const translateAsyncContract: {
3
+ readonly method: "post";
4
+ readonly pathResolver: () => string;
5
+ readonly requestBodySchema: z.ZodObject<{
6
+ originCorrelationId: z.ZodString;
7
+ ownerId: z.ZodString;
8
+ callbackUrl: z.ZodURL;
9
+ callbackToken: z.ZodString;
10
+ sourceLocale: z.ZodString;
11
+ targetLocale: z.ZodString;
12
+ integration: z.ZodOptional<z.ZodEnum<{
13
+ readonly CLAUDE: "Claude";
14
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
15
+ readonly GPT: "GPT";
16
+ readonly GEMINI: "Gemini";
17
+ readonly DEEPL: "DeepL";
18
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
19
+ }>>;
20
+ forceIntegration: z.ZodOptional<z.ZodBoolean>;
21
+ pickIntegrationByScore: z.ZodDefault<z.ZodBoolean>;
22
+ includeScore: z.ZodDefault<z.ZodBoolean>;
23
+ context: z.ZodOptional<z.ZodObject<{
24
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
25
+ styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
26
+ text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ targetAudience: z.ZodOptional<z.ZodEnum<{
29
+ general: "general";
30
+ technical: "technical";
31
+ "non-technical": "non-technical";
32
+ }>>;
33
+ toneOfVoice: z.ZodOptional<z.ZodEnum<{
34
+ friendly: "friendly";
35
+ empowering: "empowering";
36
+ informative: "informative";
37
+ supportive: "supportive";
38
+ elegant: "elegant";
39
+ }>>;
40
+ levelOfFormality: z.ZodOptional<z.ZodEnum<{
41
+ informal: "informal";
42
+ formal: "formal";
43
+ neutral: "neutral";
44
+ }>>;
45
+ generalRule: z.ZodOptional<z.ZodEnum<{
46
+ "active-voice": "active-voice";
47
+ "passive-voice": "passive-voice";
48
+ }>>;
49
+ }, z.core.$strip>]>>;
50
+ glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
51
+ term: z.ZodString;
52
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
53
+ translatable: z.ZodDefault<z.ZodBoolean>;
54
+ forbidden: z.ZodDefault<z.ZodBoolean>;
55
+ caseSensitive: z.ZodDefault<z.ZodBoolean>;
56
+ translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
57
+ locale: z.ZodString;
58
+ translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
59
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
60
+ }, z.core.$strip>>>;
61
+ }, z.core.$strip>>>;
62
+ targetPluralForms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
63
+ readonly ZERO: "zero";
64
+ readonly ONE: "one";
65
+ readonly TWO: "two";
66
+ readonly FEW: "few";
67
+ readonly MANY: "many";
68
+ readonly OTHER: "other";
69
+ }>>>;
70
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
71
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
72
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
73
+ }, z.core.$strip>>>;
74
+ }, z.core.$strip>>;
75
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
76
+ options: z.ZodDefault<z.ZodObject<{
77
+ optimize: z.ZodDefault<z.ZodEnum<{
78
+ readonly COST: "cost";
79
+ readonly QUALITY: "quality";
80
+ }>>;
81
+ }, z.core.$strip>>;
82
+ contentUnits: z.ZodArray<z.ZodObject<{
83
+ id: z.ZodString;
84
+ type: z.ZodDefault<z.ZodEnum<{
85
+ readonly SEGMENTED: "segmented";
86
+ readonly PLURAL: "plural";
87
+ }>>;
88
+ context: z.ZodOptional<z.ZodObject<{
89
+ description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
90
+ }, z.core.$strip>>;
91
+ characterLimit: z.ZodOptional<z.ZodNumber>;
92
+ segments: z.ZodArray<z.ZodPipe<z.ZodObject<{
93
+ id: z.ZodString;
94
+ pluralForm: z.ZodOptional<z.ZodEnum<{
95
+ readonly ZERO: "zero";
96
+ readonly ONE: "one";
97
+ readonly TWO: "two";
98
+ readonly FEW: "few";
99
+ readonly MANY: "many";
100
+ readonly OTHER: "other";
101
+ }>>;
102
+ tmMatch: z.ZodOptional<z.ZodObject<{
103
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
104
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
105
+ }, z.core.$strip>>;
106
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
107
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
108
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
109
+ }, z.core.$strip>>>;
110
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
111
+ imageUrl: z.ZodOptional<z.ZodURL>;
112
+ glossaryReferences: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
113
+ }, z.core.$strip>, z.ZodTransform<{
114
+ id: string;
115
+ value: string;
116
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
117
+ tmMatch?: {
118
+ sourceValue: string;
119
+ translatedValue: string;
120
+ } | undefined;
121
+ translationExamples?: {
122
+ sourceValue: string;
123
+ translatedValue: string;
124
+ }[] | undefined;
125
+ imageUrl?: string | undefined;
126
+ glossaryReferences?: number[] | undefined;
127
+ }, {
128
+ id: string;
129
+ value: string;
130
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
131
+ tmMatch?: {
132
+ sourceValue: string;
133
+ translatedValue: string;
134
+ } | undefined;
135
+ translationExamples?: {
136
+ sourceValue: string;
137
+ translatedValue: string;
138
+ }[] | undefined;
139
+ imageUrl?: string | undefined;
140
+ glossaryReferences?: number[] | undefined;
141
+ }>>>;
142
+ }, z.core.$strip>>;
143
+ }, z.core.$strip>;
144
+ readonly requestHeaderSchema: z.ZodObject<{
145
+ 'x-fake-processing': z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
146
+ }, z.core.$strip>;
147
+ readonly summary: "Translate (async) v3";
148
+ readonly description: "Schedules a translation from source language to target language. Result is delivered via sending a POST request to a given `callbackUrl`.";
149
+ readonly tags: readonly ["Translation APIs"];
150
+ readonly responsesByStatusCode: {
151
+ readonly 202: z.ZodObject<{
152
+ requestId: z.ZodUUID;
153
+ expectedAt: z.ZodISODateTime;
154
+ }, z.core.$strip>;
155
+ readonly 400: z.ZodObject<{
156
+ message: z.ZodString;
157
+ errorCode: z.ZodString;
158
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
159
+ }, z.core.$strip>;
160
+ readonly 503: z.ZodObject<{
161
+ message: z.ZodString;
162
+ errorCode: z.ZodString;
163
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
164
+ }, z.core.$strip>;
165
+ };
166
+ };
167
+ export declare const translateSyncContract: {
168
+ readonly method: "post";
169
+ readonly pathResolver: () => string;
170
+ readonly requestBodySchema: z.ZodPipe<z.ZodObject<{
171
+ tenantId: z.ZodOptional<z.ZodString>;
172
+ ownerId: z.ZodOptional<z.ZodString>;
173
+ sourceLocale: z.ZodString;
174
+ targetLocale: z.ZodString;
175
+ integration: z.ZodOptional<z.ZodEnum<{
176
+ readonly CLAUDE: "Claude";
177
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
178
+ readonly GPT: "GPT";
179
+ readonly GEMINI: "Gemini";
180
+ readonly DEEPL: "DeepL";
181
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
182
+ }>>;
183
+ forceIntegration: z.ZodOptional<z.ZodBoolean>;
184
+ context: z.ZodOptional<z.ZodObject<{
185
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
186
+ styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
187
+ text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
188
+ }, z.core.$strip>, z.ZodObject<{
189
+ targetAudience: z.ZodOptional<z.ZodEnum<{
190
+ general: "general";
191
+ technical: "technical";
192
+ "non-technical": "non-technical";
193
+ }>>;
194
+ toneOfVoice: z.ZodOptional<z.ZodEnum<{
195
+ friendly: "friendly";
196
+ empowering: "empowering";
197
+ informative: "informative";
198
+ supportive: "supportive";
199
+ elegant: "elegant";
200
+ }>>;
201
+ levelOfFormality: z.ZodOptional<z.ZodEnum<{
202
+ informal: "informal";
203
+ formal: "formal";
204
+ neutral: "neutral";
205
+ }>>;
206
+ generalRule: z.ZodOptional<z.ZodEnum<{
207
+ "active-voice": "active-voice";
208
+ "passive-voice": "passive-voice";
209
+ }>>;
210
+ }, z.core.$strip>]>>;
211
+ glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
212
+ term: z.ZodString;
213
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
214
+ translatable: z.ZodDefault<z.ZodBoolean>;
215
+ forbidden: z.ZodDefault<z.ZodBoolean>;
216
+ caseSensitive: z.ZodDefault<z.ZodBoolean>;
217
+ translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ locale: z.ZodString;
219
+ translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
220
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
221
+ }, z.core.$strip>>>;
222
+ }, z.core.$strip>>>;
223
+ targetPluralForms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
224
+ readonly ZERO: "zero";
225
+ readonly ONE: "one";
226
+ readonly TWO: "two";
227
+ readonly FEW: "few";
228
+ readonly MANY: "many";
229
+ readonly OTHER: "other";
230
+ }>>>;
231
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
232
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
233
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
234
+ }, z.core.$strip>>>;
235
+ }, z.core.$strip>>;
236
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
237
+ options: z.ZodDefault<z.ZodObject<{
238
+ optimize: z.ZodDefault<z.ZodEnum<{
239
+ readonly COST: "cost";
240
+ readonly QUALITY: "quality";
241
+ }>>;
242
+ }, z.core.$strip>>;
243
+ contentUnits: z.ZodArray<z.ZodObject<{
244
+ id: z.ZodString;
245
+ type: z.ZodDefault<z.ZodEnum<{
246
+ readonly SEGMENTED: "segmented";
247
+ readonly PLURAL: "plural";
248
+ }>>;
249
+ context: z.ZodOptional<z.ZodObject<{
250
+ description: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
251
+ }, z.core.$strip>>;
252
+ characterLimit: z.ZodOptional<z.ZodNumber>;
253
+ segments: z.ZodArray<z.ZodPipe<z.ZodObject<{
254
+ id: z.ZodString;
255
+ pluralForm: z.ZodOptional<z.ZodEnum<{
256
+ readonly ZERO: "zero";
257
+ readonly ONE: "one";
258
+ readonly TWO: "two";
259
+ readonly FEW: "few";
260
+ readonly MANY: "many";
261
+ readonly OTHER: "other";
262
+ }>>;
263
+ tmMatch: z.ZodOptional<z.ZodObject<{
264
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
265
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
266
+ }, z.core.$strip>>;
267
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
268
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
269
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
270
+ }, z.core.$strip>>>;
271
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
272
+ imageUrl: z.ZodOptional<z.ZodURL>;
273
+ glossaryReferences: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
274
+ }, z.core.$strip>, z.ZodTransform<{
275
+ id: string;
276
+ value: string;
277
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
278
+ tmMatch?: {
279
+ sourceValue: string;
280
+ translatedValue: string;
281
+ } | undefined;
282
+ translationExamples?: {
283
+ sourceValue: string;
284
+ translatedValue: string;
285
+ }[] | undefined;
286
+ imageUrl?: string | undefined;
287
+ glossaryReferences?: number[] | undefined;
288
+ }, {
289
+ id: string;
290
+ value: string;
291
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
292
+ tmMatch?: {
293
+ sourceValue: string;
294
+ translatedValue: string;
295
+ } | undefined;
296
+ translationExamples?: {
297
+ sourceValue: string;
298
+ translatedValue: string;
299
+ }[] | undefined;
300
+ imageUrl?: string | undefined;
301
+ glossaryReferences?: number[] | undefined;
302
+ }>>>;
303
+ }, z.core.$strip>>;
304
+ }, z.core.$strip>, z.ZodTransform<{
305
+ sourceLocale: string;
306
+ targetLocale: string;
307
+ options: {
308
+ optimize: "cost" | "quality";
309
+ };
310
+ contentUnits: {
311
+ id: string;
312
+ type: "segmented" | "plural";
313
+ segments: {
314
+ id: string;
315
+ value: string;
316
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
317
+ tmMatch?: {
318
+ sourceValue: string;
319
+ translatedValue: string;
320
+ } | undefined;
321
+ translationExamples?: {
322
+ sourceValue: string;
323
+ translatedValue: string;
324
+ }[] | undefined;
325
+ imageUrl?: string | undefined;
326
+ glossaryReferences?: number[] | undefined;
327
+ }[];
328
+ context?: {
329
+ description: string;
330
+ } | undefined;
331
+ characterLimit?: number | undefined;
332
+ }[];
333
+ tenantId?: string | undefined;
334
+ ownerId?: string | undefined;
335
+ integration?: "Claude" | "Claude-Bedrock" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | undefined;
336
+ forceIntegration?: boolean | undefined;
337
+ context?: {
338
+ description?: string | undefined;
339
+ styleGuide?: {
340
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
341
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
342
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
343
+ generalRule?: "active-voice" | "passive-voice" | undefined;
344
+ } | {
345
+ text: string;
346
+ } | undefined;
347
+ glossary?: {
348
+ term: string;
349
+ translatable: boolean;
350
+ forbidden: boolean;
351
+ caseSensitive: boolean;
352
+ description?: string | undefined;
353
+ translations?: {
354
+ locale: string;
355
+ translation: string;
356
+ description?: string | undefined;
357
+ }[] | undefined;
358
+ }[] | undefined;
359
+ targetPluralForms?: ("zero" | "one" | "two" | "few" | "many" | "other")[] | undefined;
360
+ translationExamples?: {
361
+ sourceValue: string;
362
+ translatedValue: string;
363
+ }[] | undefined;
364
+ } | undefined;
365
+ metadata?: Record<string, z.core.util.JSONType> | undefined;
366
+ }, {
367
+ sourceLocale: string;
368
+ targetLocale: string;
369
+ options: {
370
+ optimize: "cost" | "quality";
371
+ };
372
+ contentUnits: {
373
+ id: string;
374
+ type: "segmented" | "plural";
375
+ segments: {
376
+ id: string;
377
+ value: string;
378
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
379
+ tmMatch?: {
380
+ sourceValue: string;
381
+ translatedValue: string;
382
+ } | undefined;
383
+ translationExamples?: {
384
+ sourceValue: string;
385
+ translatedValue: string;
386
+ }[] | undefined;
387
+ imageUrl?: string | undefined;
388
+ glossaryReferences?: number[] | undefined;
389
+ }[];
390
+ context?: {
391
+ description: string;
392
+ } | undefined;
393
+ characterLimit?: number | undefined;
394
+ }[];
395
+ tenantId?: string | undefined;
396
+ ownerId?: string | undefined;
397
+ integration?: "Claude" | "Claude-Bedrock" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | undefined;
398
+ forceIntegration?: boolean | undefined;
399
+ context?: {
400
+ description?: string | undefined;
401
+ styleGuide?: {
402
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
403
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
404
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
405
+ generalRule?: "active-voice" | "passive-voice" | undefined;
406
+ } | {
407
+ text: string;
408
+ } | undefined;
409
+ glossary?: {
410
+ term: string;
411
+ translatable: boolean;
412
+ forbidden: boolean;
413
+ caseSensitive: boolean;
414
+ description?: string | undefined;
415
+ translations?: {
416
+ locale: string;
417
+ translation: string;
418
+ description?: string | undefined;
419
+ }[] | undefined;
420
+ }[] | undefined;
421
+ targetPluralForms?: ("zero" | "one" | "two" | "few" | "many" | "other")[] | undefined;
422
+ translationExamples?: {
423
+ sourceValue: string;
424
+ translatedValue: string;
425
+ }[] | undefined;
426
+ } | undefined;
427
+ metadata?: Record<string, z.core.util.JSONType> | undefined;
428
+ }>>;
429
+ readonly requestHeaderSchema: z.ZodObject<{
430
+ 'x-fake-processing': z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
431
+ }, z.core.$strip>;
432
+ readonly summary: "Translate (sync)";
433
+ readonly description: "Translates a segmented text from source language to target language. Prefer to use Translate (async) in any cases which don't require a result in real-time.";
434
+ readonly tags: readonly ["Translation APIs"];
435
+ readonly responsesByStatusCode: {
436
+ readonly 200: z.ZodObject<{
437
+ data: z.ZodArray<z.ZodObject<{
438
+ contentUnitId: z.ZodString;
439
+ segmentId: z.ZodString;
440
+ pluralForm: z.ZodOptional<z.ZodEnum<{
441
+ readonly ZERO: "zero";
442
+ readonly ONE: "one";
443
+ readonly TWO: "two";
444
+ readonly FEW: "few";
445
+ readonly MANY: "many";
446
+ readonly OTHER: "other";
447
+ }>>;
448
+ integration: z.ZodString;
449
+ translation: z.ZodString;
450
+ polyglotRefId: z.ZodOptional<z.ZodString>;
451
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
452
+ kind: z.ZodEnum<{
453
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
454
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
455
+ CHARACTER_LIMIT_EXCEEDED: "CHARACTER_LIMIT_EXCEEDED";
456
+ MALFORMED_UNICODE: "MALFORMED_UNICODE";
457
+ }>;
458
+ }, z.core.$strip>>>;
459
+ }, z.core.$strip>>;
460
+ errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
461
+ message: z.ZodString;
462
+ errorCode: z.ZodString;
463
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
464
+ contentUnitId: z.ZodString;
465
+ segmentId: z.ZodString;
466
+ pluralForm: z.ZodOptional<z.ZodEnum<{
467
+ readonly ZERO: "zero";
468
+ readonly ONE: "one";
469
+ readonly TWO: "two";
470
+ readonly FEW: "few";
471
+ readonly MANY: "many";
472
+ readonly OTHER: "other";
473
+ }>>;
474
+ integration: z.ZodString;
475
+ }, z.core.$strip>>>;
476
+ }, z.core.$strip>;
477
+ readonly 400: z.ZodUnion<readonly [z.ZodObject<{
478
+ message: z.ZodString;
479
+ errorCode: z.ZodString;
480
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
481
+ }, z.core.$strip>, z.ZodObject<{
482
+ message: z.ZodString;
483
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
484
+ errorCode: z.ZodLiteral<"VALIDATION_ERROR">;
485
+ }, z.core.$strip>, z.ZodObject<{
486
+ message: z.ZodString;
487
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
488
+ errorCode: z.ZodLiteral<"LANGUAGE_PAIR_NOT_SUPPORTED">;
489
+ }, z.core.$strip>, z.ZodObject<{
490
+ message: z.ZodString;
491
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
492
+ errorCode: z.ZodLiteral<"CONTEXT_NOT_SUPPORTED">;
493
+ }, z.core.$strip>]>;
494
+ readonly 503: z.ZodUnion<readonly [z.ZodObject<{
495
+ message: z.ZodString;
496
+ errorCode: z.ZodString;
497
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
498
+ }, z.core.$strip>, z.ZodObject<{
499
+ message: z.ZodString;
500
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
501
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_AVAILABLE_ERROR">;
502
+ }, z.core.$strip>, z.ZodObject<{
503
+ message: z.ZodString;
504
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
505
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_ENABLED_ERROR">;
506
+ }, z.core.$strip>]>;
507
+ };
508
+ };
509
+ export declare const generateVariantsContract: {
510
+ readonly method: "post";
511
+ readonly pathResolver: () => string;
512
+ readonly requestBodySchema: z.ZodObject<{
513
+ ownerId: z.ZodOptional<z.ZodString>;
514
+ assets: z.ZodOptional<z.ZodObject<{
515
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
516
+ styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
517
+ text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
518
+ }, z.core.$strip>, z.ZodObject<{
519
+ targetAudience: z.ZodOptional<z.ZodEnum<{
520
+ general: "general";
521
+ technical: "technical";
522
+ "non-technical": "non-technical";
523
+ }>>;
524
+ toneOfVoice: z.ZodOptional<z.ZodEnum<{
525
+ friendly: "friendly";
526
+ empowering: "empowering";
527
+ informative: "informative";
528
+ supportive: "supportive";
529
+ elegant: "elegant";
530
+ }>>;
531
+ levelOfFormality: z.ZodOptional<z.ZodEnum<{
532
+ informal: "informal";
533
+ formal: "formal";
534
+ neutral: "neutral";
535
+ }>>;
536
+ generalRule: z.ZodOptional<z.ZodEnum<{
537
+ "active-voice": "active-voice";
538
+ "passive-voice": "passive-voice";
539
+ }>>;
540
+ }, z.core.$strip>]>>;
541
+ glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
542
+ term: z.ZodString;
543
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
544
+ translatable: z.ZodDefault<z.ZodBoolean>;
545
+ forbidden: z.ZodDefault<z.ZodBoolean>;
546
+ caseSensitive: z.ZodDefault<z.ZodBoolean>;
547
+ translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
548
+ locale: z.ZodString;
549
+ translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
550
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
551
+ }, z.core.$strip>>>;
552
+ }, z.core.$strip>>>;
553
+ targetPluralForms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
554
+ readonly ZERO: "zero";
555
+ readonly ONE: "one";
556
+ readonly TWO: "two";
557
+ readonly FEW: "few";
558
+ readonly MANY: "many";
559
+ readonly OTHER: "other";
560
+ }>>>;
561
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
562
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
563
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
564
+ }, z.core.$strip>>>;
565
+ }, z.core.$strip>>;
566
+ sourceLocale: z.ZodString;
567
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
568
+ targetLocale: z.ZodString;
569
+ targetValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
570
+ integration: z.ZodOptional<z.ZodEnum<{
571
+ readonly CLAUDE: "Claude";
572
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
573
+ readonly GPT: "GPT";
574
+ readonly GEMINI: "Gemini";
575
+ }>>;
576
+ forceIntegration: z.ZodOptional<z.ZodBoolean>;
577
+ options: z.ZodDefault<z.ZodObject<{
578
+ optimize: z.ZodDefault<z.ZodEnum<{
579
+ readonly COST: "cost";
580
+ readonly QUALITY: "quality";
581
+ }>>;
582
+ }, z.core.$strip>>;
583
+ history: z.ZodOptional<z.ZodArray<z.ZodObject<{
584
+ values: z.ZodPipe<z.ZodArray<z.ZodString>, z.ZodTransform<string[], string[]>>;
585
+ mode: z.ZodPipe<z.ZodString, z.ZodEnum<{
586
+ readonly REPHRASE: "rephrase";
587
+ readonly SHORTEN: "shorten";
588
+ }>>;
589
+ }, z.core.$strip>>>;
590
+ mode: z.ZodPipe<z.ZodString, z.ZodEnum<{
591
+ readonly REPHRASE: "rephrase";
592
+ readonly SHORTEN: "shorten";
593
+ }>>;
594
+ }, z.core.$strip>;
595
+ readonly requestHeaderSchema: z.ZodObject<{
596
+ 'x-fake-processing': z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
597
+ }, z.core.$strip>;
598
+ readonly summary: "Rephrase translation";
599
+ readonly description: "Generates several different variants of translation for a given text, while trying to avoid previously generated translations.";
600
+ readonly tags: readonly ["Translation APIs"];
601
+ readonly responsesByStatusCode: {
602
+ readonly 200: z.ZodObject<{
603
+ generatedAt: z.ZodISODateTime;
604
+ variants: z.ZodArray<z.ZodString>;
605
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
606
+ kind: z.ZodEnum<{
607
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
608
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
609
+ CHARACTER_LIMIT_EXCEEDED: "CHARACTER_LIMIT_EXCEEDED";
610
+ MALFORMED_UNICODE: "MALFORMED_UNICODE";
611
+ }>;
612
+ }, z.core.$strip>>>;
613
+ integration: z.ZodString;
614
+ }, z.core.$strip>;
615
+ readonly 400: z.ZodUnion<readonly [z.ZodObject<{
616
+ message: z.ZodString;
617
+ errorCode: z.ZodString;
618
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
619
+ }, z.core.$strip>, z.ZodObject<{
620
+ message: z.ZodString;
621
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
622
+ errorCode: z.ZodLiteral<"VALIDATION_ERROR">;
623
+ }, z.core.$strip>]>;
624
+ readonly 503: z.ZodUnion<readonly [z.ZodObject<{
625
+ message: z.ZodString;
626
+ errorCode: z.ZodString;
627
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
628
+ }, z.core.$strip>, z.ZodObject<{
629
+ message: z.ZodString;
630
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
631
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_AVAILABLE_ERROR">;
632
+ }, z.core.$strip>, z.ZodObject<{
633
+ message: z.ZodString;
634
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
635
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_ENABLED_ERROR">;
636
+ }, z.core.$strip>]>;
637
+ };
638
+ };
639
+ export declare const translateTextSegmentContract: {
640
+ readonly method: "post";
641
+ readonly pathResolver: () => string;
642
+ readonly requestBodySchema: z.ZodPipe<z.ZodObject<{
643
+ ownerId: z.ZodOptional<z.ZodString>;
644
+ sourceLocale: z.ZodString;
645
+ targetLocale: z.ZodString;
646
+ integration: z.ZodOptional<z.ZodEnum<{
647
+ readonly CLAUDE: "Claude";
648
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
649
+ readonly GPT: "GPT";
650
+ readonly GEMINI: "Gemini";
651
+ readonly DEEPL: "DeepL";
652
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
653
+ }>>;
654
+ forceIntegration: z.ZodOptional<z.ZodBoolean>;
655
+ context: z.ZodOptional<z.ZodObject<{
656
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
657
+ styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
658
+ text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
659
+ }, z.core.$strip>, z.ZodObject<{
660
+ targetAudience: z.ZodOptional<z.ZodEnum<{
661
+ general: "general";
662
+ technical: "technical";
663
+ "non-technical": "non-technical";
664
+ }>>;
665
+ toneOfVoice: z.ZodOptional<z.ZodEnum<{
666
+ friendly: "friendly";
667
+ empowering: "empowering";
668
+ informative: "informative";
669
+ supportive: "supportive";
670
+ elegant: "elegant";
671
+ }>>;
672
+ levelOfFormality: z.ZodOptional<z.ZodEnum<{
673
+ informal: "informal";
674
+ formal: "formal";
675
+ neutral: "neutral";
676
+ }>>;
677
+ generalRule: z.ZodOptional<z.ZodEnum<{
678
+ "active-voice": "active-voice";
679
+ "passive-voice": "passive-voice";
680
+ }>>;
681
+ }, z.core.$strip>]>>;
682
+ glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
683
+ term: z.ZodString;
684
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
685
+ translatable: z.ZodDefault<z.ZodBoolean>;
686
+ forbidden: z.ZodDefault<z.ZodBoolean>;
687
+ caseSensitive: z.ZodDefault<z.ZodBoolean>;
688
+ translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
689
+ locale: z.ZodString;
690
+ translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
691
+ description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
692
+ }, z.core.$strip>>>;
693
+ }, z.core.$strip>>>;
694
+ targetPluralForms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
695
+ readonly ZERO: "zero";
696
+ readonly ONE: "one";
697
+ readonly TWO: "two";
698
+ readonly FEW: "few";
699
+ readonly MANY: "many";
700
+ readonly OTHER: "other";
701
+ }>>>;
702
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
703
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
704
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
705
+ }, z.core.$strip>>>;
706
+ }, z.core.$strip>>;
707
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
708
+ options: z.ZodDefault<z.ZodObject<{
709
+ optimize: z.ZodDefault<z.ZodEnum<{
710
+ readonly COST: "cost";
711
+ readonly QUALITY: "quality";
712
+ }>>;
713
+ }, z.core.$strip>>;
714
+ mode: z.ZodEnum<{
715
+ readonly REPHRASE: "rephrase";
716
+ readonly SHORTEN: "shorten";
717
+ readonly TRANSLATE: "translate";
718
+ }>;
719
+ desiredVariantsCount: z.ZodOptional<z.ZodNumber>;
720
+ text: z.ZodObject<{
721
+ contentUnitId: z.ZodString;
722
+ segmentId: z.ZodOptional<z.ZodString>;
723
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
724
+ pluralForm: z.ZodOptional<z.ZodEnum<{
725
+ readonly ZERO: "zero";
726
+ readonly ONE: "one";
727
+ readonly TWO: "two";
728
+ readonly FEW: "few";
729
+ readonly MANY: "many";
730
+ readonly OTHER: "other";
731
+ }>>;
732
+ characterLimit: z.ZodOptional<z.ZodNumber>;
733
+ imageUrl: z.ZodOptional<z.ZodURL>;
734
+ translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
735
+ sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
736
+ translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
737
+ }, z.core.$strip>>>;
738
+ }, z.core.$strip>;
739
+ history: z.ZodOptional<z.ZodArray<z.ZodObject<{
740
+ mode: z.ZodEnum<{
741
+ readonly REPHRASE: "rephrase";
742
+ readonly SHORTEN: "shorten";
743
+ readonly TRANSLATE: "translate";
744
+ }>;
745
+ value: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
746
+ }, z.core.$strip>>>;
747
+ }, z.core.$strip>, z.ZodTransform<{
748
+ sourceLocale: string;
749
+ targetLocale: string;
750
+ options: {
751
+ optimize: "cost" | "quality";
752
+ };
753
+ mode: "rephrase" | "shorten" | "translate";
754
+ text: {
755
+ contentUnitId: string;
756
+ value: string;
757
+ segmentId?: string | undefined;
758
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
759
+ characterLimit?: number | undefined;
760
+ imageUrl?: string | undefined;
761
+ translationExamples?: {
762
+ sourceValue: string;
763
+ translatedValue: string;
764
+ }[] | undefined;
765
+ };
766
+ ownerId?: string | undefined;
767
+ integration?: "Claude" | "Claude-Bedrock" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | undefined;
768
+ forceIntegration?: boolean | undefined;
769
+ context?: {
770
+ description?: string | undefined;
771
+ styleGuide?: {
772
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
773
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
774
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
775
+ generalRule?: "active-voice" | "passive-voice" | undefined;
776
+ } | {
777
+ text: string;
778
+ } | undefined;
779
+ glossary?: {
780
+ term: string;
781
+ translatable: boolean;
782
+ forbidden: boolean;
783
+ caseSensitive: boolean;
784
+ description?: string | undefined;
785
+ translations?: {
786
+ locale: string;
787
+ translation: string;
788
+ description?: string | undefined;
789
+ }[] | undefined;
790
+ }[] | undefined;
791
+ targetPluralForms?: ("zero" | "one" | "two" | "few" | "many" | "other")[] | undefined;
792
+ translationExamples?: {
793
+ sourceValue: string;
794
+ translatedValue: string;
795
+ }[] | undefined;
796
+ } | undefined;
797
+ metadata?: Record<string, z.core.util.JSONType> | undefined;
798
+ desiredVariantsCount?: number | undefined;
799
+ history?: {
800
+ mode: "rephrase" | "shorten" | "translate";
801
+ value: string;
802
+ }[] | undefined;
803
+ }, {
804
+ sourceLocale: string;
805
+ targetLocale: string;
806
+ options: {
807
+ optimize: "cost" | "quality";
808
+ };
809
+ mode: "rephrase" | "shorten" | "translate";
810
+ text: {
811
+ contentUnitId: string;
812
+ value: string;
813
+ segmentId?: string | undefined;
814
+ pluralForm?: "zero" | "one" | "two" | "few" | "many" | "other" | undefined;
815
+ characterLimit?: number | undefined;
816
+ imageUrl?: string | undefined;
817
+ translationExamples?: {
818
+ sourceValue: string;
819
+ translatedValue: string;
820
+ }[] | undefined;
821
+ };
822
+ ownerId?: string | undefined;
823
+ integration?: "Claude" | "Claude-Bedrock" | "GPT" | "Gemini" | "DeepL" | "GoogleTranslate" | undefined;
824
+ forceIntegration?: boolean | undefined;
825
+ context?: {
826
+ description?: string | undefined;
827
+ styleGuide?: {
828
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
829
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
830
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
831
+ generalRule?: "active-voice" | "passive-voice" | undefined;
832
+ } | {
833
+ text: string;
834
+ } | undefined;
835
+ glossary?: {
836
+ term: string;
837
+ translatable: boolean;
838
+ forbidden: boolean;
839
+ caseSensitive: boolean;
840
+ description?: string | undefined;
841
+ translations?: {
842
+ locale: string;
843
+ translation: string;
844
+ description?: string | undefined;
845
+ }[] | undefined;
846
+ }[] | undefined;
847
+ targetPluralForms?: ("zero" | "one" | "two" | "few" | "many" | "other")[] | undefined;
848
+ translationExamples?: {
849
+ sourceValue: string;
850
+ translatedValue: string;
851
+ }[] | undefined;
852
+ } | undefined;
853
+ metadata?: Record<string, z.core.util.JSONType> | undefined;
854
+ desiredVariantsCount?: number | undefined;
855
+ history?: {
856
+ mode: "rephrase" | "shorten" | "translate";
857
+ value: string;
858
+ }[] | undefined;
859
+ }>>;
860
+ readonly requestHeaderSchema: z.ZodObject<{
861
+ 'x-fake-processing': z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodBoolean>>;
862
+ }, z.core.$strip>;
863
+ readonly summary: "Translate text segment";
864
+ readonly description: "Translates a single text segment from source language to target language and returns results via Server-Sent Events.";
865
+ readonly tags: readonly ["Translation APIs"];
866
+ readonly responsesByStatusCode: {
867
+ readonly 200: import("@lokalise/api-contracts").TypedSseResponse<{
868
+ translation: z.ZodObject<{
869
+ id: z.ZodString;
870
+ content: z.ZodString;
871
+ isComplete: z.ZodBoolean;
872
+ integration: z.ZodEnum<{
873
+ readonly FAKE: "Fake";
874
+ readonly CLAUDE: "Claude";
875
+ readonly CLAUDE_BEDROCK: "Claude-Bedrock";
876
+ readonly GPT: "GPT";
877
+ readonly GEMINI: "Gemini";
878
+ readonly DEEPL: "DeepL";
879
+ readonly GOOGLE_TRANSLATE: "GoogleTranslate";
880
+ }>;
881
+ polyglotRefId: z.ZodOptional<z.ZodString>;
882
+ warnings: z.ZodOptional<z.ZodArray<z.ZodObject<{
883
+ kind: z.ZodEnum<{
884
+ EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT";
885
+ EDITED_ICU_PLURALS: "EDITED_ICU_PLURALS";
886
+ CHARACTER_LIMIT_EXCEEDED: "CHARACTER_LIMIT_EXCEEDED";
887
+ MALFORMED_UNICODE: "MALFORMED_UNICODE";
888
+ }>;
889
+ }, z.core.$strip>>>;
890
+ }, z.core.$strip>;
891
+ error: z.ZodObject<{
892
+ message: z.ZodString;
893
+ errorCode: z.ZodString;
894
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
895
+ }, z.core.$strip>;
896
+ }>;
897
+ readonly 400: z.ZodUnion<readonly [z.ZodObject<{
898
+ message: z.ZodString;
899
+ errorCode: z.ZodString;
900
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
901
+ }, z.core.$strip>, z.ZodObject<{
902
+ message: z.ZodString;
903
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
904
+ errorCode: z.ZodLiteral<"VALIDATION_ERROR">;
905
+ }, z.core.$strip>]>;
906
+ readonly 503: z.ZodUnion<readonly [z.ZodObject<{
907
+ message: z.ZodString;
908
+ errorCode: z.ZodString;
909
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
910
+ }, z.core.$strip>, z.ZodObject<{
911
+ message: z.ZodString;
912
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
913
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_AVAILABLE_ERROR">;
914
+ }, z.core.$strip>, z.ZodObject<{
915
+ message: z.ZodString;
916
+ details: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
917
+ errorCode: z.ZodLiteral<"INTEGRATION_NOT_ENABLED_ERROR">;
918
+ }, z.core.$strip>]>;
919
+ };
920
+ };