@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,464 +1,168 @@
|
|
|
1
|
-
import z from 'zod';
|
|
2
|
-
declare const STRUCTURED_STYLE_GUIDE_SCHEMA: z.
|
|
3
|
-
targetAudience: z.ZodOptional<z.ZodEnum<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
levelOfFormality
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
26
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
27
|
-
}>;
|
|
1
|
+
import z from 'zod/v4';
|
|
2
|
+
declare const STRUCTURED_STYLE_GUIDE_SCHEMA: z.ZodObject<{
|
|
3
|
+
targetAudience: z.ZodOptional<z.ZodEnum<{
|
|
4
|
+
general: "general";
|
|
5
|
+
technical: "technical";
|
|
6
|
+
"non-technical": "non-technical";
|
|
7
|
+
}>>;
|
|
8
|
+
toneOfVoice: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
friendly: "friendly";
|
|
10
|
+
empowering: "empowering";
|
|
11
|
+
informative: "informative";
|
|
12
|
+
supportive: "supportive";
|
|
13
|
+
elegant: "elegant";
|
|
14
|
+
}>>;
|
|
15
|
+
levelOfFormality: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
informal: "informal";
|
|
17
|
+
formal: "formal";
|
|
18
|
+
neutral: "neutral";
|
|
19
|
+
}>>;
|
|
20
|
+
generalRule: z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
"active-voice": "active-voice";
|
|
22
|
+
"passive-voice": "passive-voice";
|
|
23
|
+
}>>;
|
|
24
|
+
}, z.core.$strip>;
|
|
28
25
|
export type StructuredStyleGuide = z.infer<typeof STRUCTURED_STYLE_GUIDE_SCHEMA>;
|
|
29
26
|
declare const FREEFORM_STYLE_GUIDE_SCHEMA: z.ZodObject<{
|
|
30
|
-
text: z.
|
|
31
|
-
},
|
|
32
|
-
text: string;
|
|
33
|
-
}, {
|
|
34
|
-
text: string;
|
|
35
|
-
}>;
|
|
27
|
+
text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
28
|
+
}, z.core.$strip>;
|
|
36
29
|
export type FreeformStyleGuide = z.infer<typeof FREEFORM_STYLE_GUIDE_SCHEMA>;
|
|
37
|
-
declare const STYLE_GUIDE_SCHEMA: z.ZodUnion<[z.ZodObject<{
|
|
38
|
-
text: z.
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
toneOfVoice: z.ZodOptional<z.ZodEnum<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
generalRule
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
63
|
-
}, {
|
|
64
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
65
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
66
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
67
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
68
|
-
}>]>;
|
|
30
|
+
declare const STYLE_GUIDE_SCHEMA: z.ZodUnion<readonly [z.ZodObject<{
|
|
31
|
+
text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
32
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
+
targetAudience: z.ZodOptional<z.ZodEnum<{
|
|
34
|
+
general: "general";
|
|
35
|
+
technical: "technical";
|
|
36
|
+
"non-technical": "non-technical";
|
|
37
|
+
}>>;
|
|
38
|
+
toneOfVoice: z.ZodOptional<z.ZodEnum<{
|
|
39
|
+
friendly: "friendly";
|
|
40
|
+
empowering: "empowering";
|
|
41
|
+
informative: "informative";
|
|
42
|
+
supportive: "supportive";
|
|
43
|
+
elegant: "elegant";
|
|
44
|
+
}>>;
|
|
45
|
+
levelOfFormality: z.ZodOptional<z.ZodEnum<{
|
|
46
|
+
informal: "informal";
|
|
47
|
+
formal: "formal";
|
|
48
|
+
neutral: "neutral";
|
|
49
|
+
}>>;
|
|
50
|
+
generalRule: z.ZodOptional<z.ZodEnum<{
|
|
51
|
+
"active-voice": "active-voice";
|
|
52
|
+
"passive-voice": "passive-voice";
|
|
53
|
+
}>>;
|
|
54
|
+
}, z.core.$strip>]>;
|
|
69
55
|
export type StyleGuideData = z.infer<typeof STYLE_GUIDE_SCHEMA>;
|
|
70
56
|
export declare function isStructuredStyleGuide(guide: Record<string, unknown>): guide is StructuredStyleGuide;
|
|
71
|
-
export declare const GLOSSARY_TERM_SCHEMA: z.
|
|
57
|
+
export declare const GLOSSARY_TERM_SCHEMA: z.ZodObject<{
|
|
72
58
|
term: z.ZodString;
|
|
73
|
-
description: z.ZodOptional<z.
|
|
59
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
74
60
|
translatable: z.ZodDefault<z.ZodBoolean>;
|
|
75
61
|
forbidden: z.ZodDefault<z.ZodBoolean>;
|
|
76
62
|
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
77
63
|
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
78
|
-
locale: z.
|
|
79
|
-
translation: z.
|
|
80
|
-
description: z.ZodOptional<z.
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
locale: string;
|
|
84
|
-
description?: string | undefined;
|
|
85
|
-
}, {
|
|
86
|
-
translation: string;
|
|
87
|
-
locale: string;
|
|
88
|
-
description?: string | undefined;
|
|
89
|
-
}>, "many">>;
|
|
90
|
-
}, "strip", z.ZodTypeAny, {
|
|
91
|
-
term: string;
|
|
92
|
-
translatable: boolean;
|
|
93
|
-
forbidden: boolean;
|
|
94
|
-
caseSensitive: boolean;
|
|
95
|
-
description?: string | undefined;
|
|
96
|
-
translations?: {
|
|
97
|
-
translation: string;
|
|
98
|
-
locale: string;
|
|
99
|
-
description?: string | undefined;
|
|
100
|
-
}[] | undefined;
|
|
101
|
-
}, {
|
|
102
|
-
term: string;
|
|
103
|
-
description?: string | undefined;
|
|
104
|
-
translatable?: boolean | undefined;
|
|
105
|
-
forbidden?: boolean | undefined;
|
|
106
|
-
caseSensitive?: boolean | undefined;
|
|
107
|
-
translations?: {
|
|
108
|
-
translation: string;
|
|
109
|
-
locale: string;
|
|
110
|
-
description?: string | undefined;
|
|
111
|
-
}[] | undefined;
|
|
112
|
-
}>, {
|
|
113
|
-
term: string;
|
|
114
|
-
translatable: boolean;
|
|
115
|
-
forbidden: boolean;
|
|
116
|
-
caseSensitive: boolean;
|
|
117
|
-
description?: string | undefined;
|
|
118
|
-
translations?: {
|
|
119
|
-
translation: string;
|
|
120
|
-
locale: string;
|
|
121
|
-
description?: string | undefined;
|
|
122
|
-
}[] | undefined;
|
|
123
|
-
}, {
|
|
124
|
-
term: string;
|
|
125
|
-
description?: string | undefined;
|
|
126
|
-
translatable?: boolean | undefined;
|
|
127
|
-
forbidden?: boolean | undefined;
|
|
128
|
-
caseSensitive?: boolean | undefined;
|
|
129
|
-
translations?: {
|
|
130
|
-
translation: string;
|
|
131
|
-
locale: string;
|
|
132
|
-
description?: string | undefined;
|
|
133
|
-
}[] | undefined;
|
|
134
|
-
}>;
|
|
64
|
+
locale: z.ZodString;
|
|
65
|
+
translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
66
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
67
|
+
}, z.core.$strip>>>;
|
|
68
|
+
}, z.core.$strip>;
|
|
135
69
|
export type GlossaryTerm = z.infer<typeof GLOSSARY_TERM_SCHEMA>;
|
|
136
70
|
export declare const TRANSLATION_CONTEXT_SCHEMA: z.ZodObject<{
|
|
137
|
-
description: z.ZodOptional<z.
|
|
138
|
-
styleGuide: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
139
|
-
text: z.
|
|
140
|
-
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
toneOfVoice: z.ZodOptional<z.ZodEnum<
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
generalRule
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}, {
|
|
165
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
166
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
167
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
168
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
169
|
-
}>]>>;
|
|
170
|
-
glossary: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
71
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
72
|
+
styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
73
|
+
text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
74
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
+
targetAudience: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
general: "general";
|
|
77
|
+
technical: "technical";
|
|
78
|
+
"non-technical": "non-technical";
|
|
79
|
+
}>>;
|
|
80
|
+
toneOfVoice: z.ZodOptional<z.ZodEnum<{
|
|
81
|
+
friendly: "friendly";
|
|
82
|
+
empowering: "empowering";
|
|
83
|
+
informative: "informative";
|
|
84
|
+
supportive: "supportive";
|
|
85
|
+
elegant: "elegant";
|
|
86
|
+
}>>;
|
|
87
|
+
levelOfFormality: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
informal: "informal";
|
|
89
|
+
formal: "formal";
|
|
90
|
+
neutral: "neutral";
|
|
91
|
+
}>>;
|
|
92
|
+
generalRule: z.ZodOptional<z.ZodEnum<{
|
|
93
|
+
"active-voice": "active-voice";
|
|
94
|
+
"passive-voice": "passive-voice";
|
|
95
|
+
}>>;
|
|
96
|
+
}, z.core.$strip>]>>;
|
|
97
|
+
glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
171
98
|
term: z.ZodString;
|
|
172
|
-
description: z.ZodOptional<z.
|
|
99
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
173
100
|
translatable: z.ZodDefault<z.ZodBoolean>;
|
|
174
101
|
forbidden: z.ZodDefault<z.ZodBoolean>;
|
|
175
102
|
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
176
103
|
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
177
|
-
locale: z.
|
|
178
|
-
translation: z.
|
|
179
|
-
description: z.ZodOptional<z.
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}
|
|
190
|
-
term: string;
|
|
191
|
-
translatable: boolean;
|
|
192
|
-
forbidden: boolean;
|
|
193
|
-
caseSensitive: boolean;
|
|
194
|
-
description?: string | undefined;
|
|
195
|
-
translations?: {
|
|
196
|
-
translation: string;
|
|
197
|
-
locale: string;
|
|
198
|
-
description?: string | undefined;
|
|
199
|
-
}[] | undefined;
|
|
200
|
-
}, {
|
|
201
|
-
term: string;
|
|
202
|
-
description?: string | undefined;
|
|
203
|
-
translatable?: boolean | undefined;
|
|
204
|
-
forbidden?: boolean | undefined;
|
|
205
|
-
caseSensitive?: boolean | undefined;
|
|
206
|
-
translations?: {
|
|
207
|
-
translation: string;
|
|
208
|
-
locale: string;
|
|
209
|
-
description?: string | undefined;
|
|
210
|
-
}[] | undefined;
|
|
211
|
-
}>, {
|
|
212
|
-
term: string;
|
|
213
|
-
translatable: boolean;
|
|
214
|
-
forbidden: boolean;
|
|
215
|
-
caseSensitive: boolean;
|
|
216
|
-
description?: string | undefined;
|
|
217
|
-
translations?: {
|
|
218
|
-
translation: string;
|
|
219
|
-
locale: string;
|
|
220
|
-
description?: string | undefined;
|
|
221
|
-
}[] | undefined;
|
|
222
|
-
}, {
|
|
223
|
-
term: string;
|
|
224
|
-
description?: string | undefined;
|
|
225
|
-
translatable?: boolean | undefined;
|
|
226
|
-
forbidden?: boolean | undefined;
|
|
227
|
-
caseSensitive?: boolean | undefined;
|
|
228
|
-
translations?: {
|
|
229
|
-
translation: string;
|
|
230
|
-
locale: string;
|
|
231
|
-
description?: string | undefined;
|
|
232
|
-
}[] | undefined;
|
|
233
|
-
}>, "many">>;
|
|
234
|
-
targetPluralForms: z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodEnum<["zero", "one", "two", "few", "many", "other"]>, "atleastone">>, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined>, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined>;
|
|
104
|
+
locale: z.ZodString;
|
|
105
|
+
translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
106
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
107
|
+
}, z.core.$strip>>>;
|
|
108
|
+
}, z.core.$strip>>>;
|
|
109
|
+
targetPluralForms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
110
|
+
zero: "zero";
|
|
111
|
+
one: "one";
|
|
112
|
+
two: "two";
|
|
113
|
+
few: "few";
|
|
114
|
+
many: "many";
|
|
115
|
+
other: "other";
|
|
116
|
+
}>>>;
|
|
235
117
|
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
236
|
-
sourceValue: z.
|
|
237
|
-
translatedValue: z.
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
translatedValue: string;
|
|
241
|
-
}, {
|
|
242
|
-
sourceValue: string;
|
|
243
|
-
translatedValue: string;
|
|
244
|
-
}>, "many">>;
|
|
245
|
-
}, "strip", z.ZodTypeAny, {
|
|
246
|
-
translationExamples?: {
|
|
247
|
-
sourceValue: string;
|
|
248
|
-
translatedValue: string;
|
|
249
|
-
}[] | undefined;
|
|
250
|
-
description?: string | undefined;
|
|
251
|
-
styleGuide?: {
|
|
252
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
253
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
254
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
255
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
256
|
-
} | {
|
|
257
|
-
text: string;
|
|
258
|
-
} | undefined;
|
|
259
|
-
glossary?: {
|
|
260
|
-
term: string;
|
|
261
|
-
translatable: boolean;
|
|
262
|
-
forbidden: boolean;
|
|
263
|
-
caseSensitive: boolean;
|
|
264
|
-
description?: string | undefined;
|
|
265
|
-
translations?: {
|
|
266
|
-
translation: string;
|
|
267
|
-
locale: string;
|
|
268
|
-
description?: string | undefined;
|
|
269
|
-
}[] | undefined;
|
|
270
|
-
}[] | undefined;
|
|
271
|
-
targetPluralForms?: ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined;
|
|
272
|
-
}, {
|
|
273
|
-
translationExamples?: {
|
|
274
|
-
sourceValue: string;
|
|
275
|
-
translatedValue: string;
|
|
276
|
-
}[] | undefined;
|
|
277
|
-
description?: string | undefined;
|
|
278
|
-
styleGuide?: {
|
|
279
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
280
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
281
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
282
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
283
|
-
} | {
|
|
284
|
-
text: string;
|
|
285
|
-
} | undefined;
|
|
286
|
-
glossary?: {
|
|
287
|
-
term: string;
|
|
288
|
-
description?: string | undefined;
|
|
289
|
-
translatable?: boolean | undefined;
|
|
290
|
-
forbidden?: boolean | undefined;
|
|
291
|
-
caseSensitive?: boolean | undefined;
|
|
292
|
-
translations?: {
|
|
293
|
-
translation: string;
|
|
294
|
-
locale: string;
|
|
295
|
-
description?: string | undefined;
|
|
296
|
-
}[] | undefined;
|
|
297
|
-
}[] | undefined;
|
|
298
|
-
targetPluralForms?: ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined;
|
|
299
|
-
}>;
|
|
118
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
119
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
120
|
+
}, z.core.$strip>>>;
|
|
121
|
+
}, z.core.$strip>;
|
|
300
122
|
export type TranslationContext = z.infer<typeof TRANSLATION_CONTEXT_SCHEMA>;
|
|
301
|
-
export declare const TEXT_REWRITING_CONTEXT: z.ZodObject<
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
text: string
|
|
309
|
-
}
|
|
310
|
-
targetAudience: z.ZodOptional<z.ZodEnum<
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
levelOfFormality
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
334
|
-
}>]>>;
|
|
335
|
-
glossary: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
|
|
123
|
+
export declare const TEXT_REWRITING_CONTEXT: z.ZodObject<{
|
|
124
|
+
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
sourceValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
126
|
+
translatedValue: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
127
|
+
}, z.core.$strip>>>;
|
|
128
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
129
|
+
styleGuide: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
130
|
+
text: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
131
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
132
|
+
targetAudience: z.ZodOptional<z.ZodEnum<{
|
|
133
|
+
general: "general";
|
|
134
|
+
technical: "technical";
|
|
135
|
+
"non-technical": "non-technical";
|
|
136
|
+
}>>;
|
|
137
|
+
toneOfVoice: z.ZodOptional<z.ZodEnum<{
|
|
138
|
+
friendly: "friendly";
|
|
139
|
+
empowering: "empowering";
|
|
140
|
+
informative: "informative";
|
|
141
|
+
supportive: "supportive";
|
|
142
|
+
elegant: "elegant";
|
|
143
|
+
}>>;
|
|
144
|
+
levelOfFormality: z.ZodOptional<z.ZodEnum<{
|
|
145
|
+
informal: "informal";
|
|
146
|
+
formal: "formal";
|
|
147
|
+
neutral: "neutral";
|
|
148
|
+
}>>;
|
|
149
|
+
generalRule: z.ZodOptional<z.ZodEnum<{
|
|
150
|
+
"active-voice": "active-voice";
|
|
151
|
+
"passive-voice": "passive-voice";
|
|
152
|
+
}>>;
|
|
153
|
+
}, z.core.$strip>]>>;
|
|
154
|
+
glossary: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
336
155
|
term: z.ZodString;
|
|
337
|
-
description: z.ZodOptional<z.
|
|
156
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
338
157
|
translatable: z.ZodDefault<z.ZodBoolean>;
|
|
339
158
|
forbidden: z.ZodDefault<z.ZodBoolean>;
|
|
340
159
|
caseSensitive: z.ZodDefault<z.ZodBoolean>;
|
|
341
160
|
translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
342
|
-
locale: z.
|
|
343
|
-
translation: z.
|
|
344
|
-
description: z.ZodOptional<z.
|
|
345
|
-
},
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
description?: string | undefined;
|
|
349
|
-
}, {
|
|
350
|
-
translation: string;
|
|
351
|
-
locale: string;
|
|
352
|
-
description?: string | undefined;
|
|
353
|
-
}>, "many">>;
|
|
354
|
-
}, "strip", z.ZodTypeAny, {
|
|
355
|
-
term: string;
|
|
356
|
-
translatable: boolean;
|
|
357
|
-
forbidden: boolean;
|
|
358
|
-
caseSensitive: boolean;
|
|
359
|
-
description?: string | undefined;
|
|
360
|
-
translations?: {
|
|
361
|
-
translation: string;
|
|
362
|
-
locale: string;
|
|
363
|
-
description?: string | undefined;
|
|
364
|
-
}[] | undefined;
|
|
365
|
-
}, {
|
|
366
|
-
term: string;
|
|
367
|
-
description?: string | undefined;
|
|
368
|
-
translatable?: boolean | undefined;
|
|
369
|
-
forbidden?: boolean | undefined;
|
|
370
|
-
caseSensitive?: boolean | undefined;
|
|
371
|
-
translations?: {
|
|
372
|
-
translation: string;
|
|
373
|
-
locale: string;
|
|
374
|
-
description?: string | undefined;
|
|
375
|
-
}[] | undefined;
|
|
376
|
-
}>, {
|
|
377
|
-
term: string;
|
|
378
|
-
translatable: boolean;
|
|
379
|
-
forbidden: boolean;
|
|
380
|
-
caseSensitive: boolean;
|
|
381
|
-
description?: string | undefined;
|
|
382
|
-
translations?: {
|
|
383
|
-
translation: string;
|
|
384
|
-
locale: string;
|
|
385
|
-
description?: string | undefined;
|
|
386
|
-
}[] | undefined;
|
|
387
|
-
}, {
|
|
388
|
-
term: string;
|
|
389
|
-
description?: string | undefined;
|
|
390
|
-
translatable?: boolean | undefined;
|
|
391
|
-
forbidden?: boolean | undefined;
|
|
392
|
-
caseSensitive?: boolean | undefined;
|
|
393
|
-
translations?: {
|
|
394
|
-
translation: string;
|
|
395
|
-
locale: string;
|
|
396
|
-
description?: string | undefined;
|
|
397
|
-
}[] | undefined;
|
|
398
|
-
}>, "many">>;
|
|
399
|
-
targetPluralForms: z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodEnum<["zero", "one", "two", "few", "many", "other"]>, "atleastone">>, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined>, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined, ["many" | "zero" | "one" | "two" | "few" | "other", ...("many" | "zero" | "one" | "two" | "few" | "other")[]] | undefined>;
|
|
400
|
-
translationExamples: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
401
|
-
sourceValue: z.ZodEffects<z.ZodString, string, string>;
|
|
402
|
-
translatedValue: z.ZodEffects<z.ZodString, string, string>;
|
|
403
|
-
}, "strip", z.ZodTypeAny, {
|
|
404
|
-
sourceValue: string;
|
|
405
|
-
translatedValue: string;
|
|
406
|
-
}, {
|
|
407
|
-
sourceValue: string;
|
|
408
|
-
translatedValue: string;
|
|
409
|
-
}>, "many">>;
|
|
410
|
-
}, "targetPluralForms">, "strip", z.ZodTypeAny, {
|
|
411
|
-
translationExamples?: {
|
|
412
|
-
sourceValue: string;
|
|
413
|
-
translatedValue: string;
|
|
414
|
-
}[] | undefined;
|
|
415
|
-
description?: string | undefined;
|
|
416
|
-
styleGuide?: {
|
|
417
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
418
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
419
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
420
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
421
|
-
} | {
|
|
422
|
-
text: string;
|
|
423
|
-
} | undefined;
|
|
424
|
-
glossary?: {
|
|
425
|
-
term: string;
|
|
426
|
-
translatable: boolean;
|
|
427
|
-
forbidden: boolean;
|
|
428
|
-
caseSensitive: boolean;
|
|
429
|
-
description?: string | undefined;
|
|
430
|
-
translations?: {
|
|
431
|
-
translation: string;
|
|
432
|
-
locale: string;
|
|
433
|
-
description?: string | undefined;
|
|
434
|
-
}[] | undefined;
|
|
435
|
-
}[] | undefined;
|
|
436
|
-
}, {
|
|
437
|
-
translationExamples?: {
|
|
438
|
-
sourceValue: string;
|
|
439
|
-
translatedValue: string;
|
|
440
|
-
}[] | undefined;
|
|
441
|
-
description?: string | undefined;
|
|
442
|
-
styleGuide?: {
|
|
443
|
-
targetAudience?: "general" | "technical" | "non-technical" | undefined;
|
|
444
|
-
toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
|
|
445
|
-
levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
|
|
446
|
-
generalRule?: "active-voice" | "passive-voice" | undefined;
|
|
447
|
-
} | {
|
|
448
|
-
text: string;
|
|
449
|
-
} | undefined;
|
|
450
|
-
glossary?: {
|
|
451
|
-
term: string;
|
|
452
|
-
description?: string | undefined;
|
|
453
|
-
translatable?: boolean | undefined;
|
|
454
|
-
forbidden?: boolean | undefined;
|
|
455
|
-
caseSensitive?: boolean | undefined;
|
|
456
|
-
translations?: {
|
|
457
|
-
translation: string;
|
|
458
|
-
locale: string;
|
|
459
|
-
description?: string | undefined;
|
|
460
|
-
}[] | undefined;
|
|
461
|
-
}[] | undefined;
|
|
462
|
-
}>;
|
|
161
|
+
locale: z.ZodString;
|
|
162
|
+
translation: z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>;
|
|
163
|
+
description: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>;
|
|
164
|
+
}, z.core.$strip>>>;
|
|
165
|
+
}, z.core.$strip>>>;
|
|
166
|
+
}, z.core.$strip>;
|
|
463
167
|
export type TextRewritingContext = z.infer<typeof TEXT_REWRITING_CONTEXT>;
|
|
464
168
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import z from 'zod';
|
|
1
|
+
import z from 'zod/v4';
|
|
2
2
|
import { removeUnicodeNullCharacters } from "../../helpers/removeUnicodeNullCharacters.js";
|
|
3
3
|
import { CONTENT_UNIT_DESCRIPTION_MAX_LENGTH } from "../translation/sharedSchemas.js";
|
|
4
4
|
import { LOCALE_SCHEMA, TRANSLATION_EXAMPLES_SCHEMA } from "./commonSchemas.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translationContextSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/common/translationContextSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"translationContextSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/common/translationContextSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,QAAQ,CAAA;AAEtB,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAC1F,OAAO,EAAE,mCAAmC,EAAE,MAAM,iCAAiC,CAAA;AACrF,OAAO,EAAE,aAAa,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAE/E,6CAA6C;AAC7C,cAAc;AACd,6CAA6C;AAE7C,MAAM,6BAA6B,GAAG,CAAC;KACpC,MAAM,CAAC;IACN,cAAc,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5E,WAAW,EAAE,CAAC;SACX,IAAI,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;SACxE,QAAQ,EAAE;IACb,gBAAgB,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,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