@lokalise/polyglot-sdk 8.0.1 → 9.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 (46) hide show
  1. package/dist/index.d.ts +12 -8
  2. package/dist/index.js +25 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/sdk/PolyglotClient.d.ts +11 -9
  5. package/dist/sdk/PolyglotClient.js.map +1 -1
  6. package/dist/sdk/schemas/common/commonSchemas.d.ts +14 -0
  7. package/dist/sdk/schemas/common/commonSchemas.js +5 -1
  8. package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
  9. package/dist/sdk/schemas/common/{requestContextSchemas.d.ts → translationContextSchemas.d.ts} +2 -2
  10. package/dist/sdk/schemas/common/{requestContextSchemas.js → translationContextSchemas.js} +3 -3
  11. package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -0
  12. package/dist/sdk/schemas/lqa/commonSchemas.d.ts +22 -0
  13. package/dist/sdk/{types/responses.js → schemas/lqa/commonSchemas.js} +9 -13
  14. package/dist/sdk/schemas/lqa/commonSchemas.js.map +1 -0
  15. package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.d.ts +646 -0
  16. package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.js +97 -0
  17. package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.js.map +1 -0
  18. package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.d.ts +619 -0
  19. package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.js +90 -0
  20. package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.js.map +1 -0
  21. package/dist/sdk/schemas/scoring/scoreV1Schemas.d.ts +178 -0
  22. package/dist/sdk/schemas/scoring/scoreV1Schemas.js +46 -0
  23. package/dist/sdk/schemas/scoring/scoreV1Schemas.js.map +1 -0
  24. package/dist/sdk/schemas/translation/generateVariantsV1.d.ts +352 -0
  25. package/dist/sdk/schemas/translation/generateVariantsV1.js +53 -0
  26. package/dist/sdk/schemas/translation/generateVariantsV1.js.map +1 -0
  27. package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.js → translateAsyncV2Schemas.js} +3 -3
  28. package/dist/sdk/schemas/translation/translateAsyncV2Schemas.js.map +1 -0
  29. package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.js → translateSyncV2Schemas.js} +3 -3
  30. package/dist/sdk/schemas/translation/translateSyncV2Schemas.js.map +1 -0
  31. package/dist/sdk/types/common.d.ts +1 -0
  32. package/dist/sdk/types/{requests.js → common.js} +1 -1
  33. package/dist/sdk/types/common.js.map +1 -0
  34. package/package.json +1 -1
  35. package/dist/sdk/schemas/common/requestContextSchemas.js.map +0 -1
  36. package/dist/sdk/schemas/translation/asyncTranslationV2Schemas.js.map +0 -1
  37. package/dist/sdk/schemas/translation/syncTranslationV2Schemas.js.map +0 -1
  38. package/dist/sdk/types/callbacks.d.ts +0 -28
  39. package/dist/sdk/types/callbacks.js +0 -3
  40. package/dist/sdk/types/callbacks.js.map +0 -1
  41. package/dist/sdk/types/requests.d.ts +0 -106
  42. package/dist/sdk/types/requests.js.map +0 -1
  43. package/dist/sdk/types/responses.d.ts +0 -116
  44. package/dist/sdk/types/responses.js.map +0 -1
  45. package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.d.ts → translateAsyncV2Schemas.d.ts} +13 -13
  46. package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.d.ts → translateSyncV2Schemas.d.ts} +4 -4
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LQA_SYNC_V2_RESPONSE_SCHEMA = exports.LQA_SYNC_V2_HEADERS_SCHEMA = exports.LQA_SYNC_V2_BODY_SCHEMA = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const zod_1 = tslib_1.__importDefault(require("zod"));
6
+ const commonSchemas_1 = require("../common/commonSchemas");
7
+ const translationContextSchemas_1 = require("../common/translationContextSchemas");
8
+ const commonSchemas_2 = require("./commonSchemas");
9
+ const LQA_TRANSLATION_VALUE_MAX_LENGTH = 5000;
10
+ const LQA_SEGMENT_SOURCE_VALUE_MAX_LENGTH = 5000;
11
+ const LQA_SEGMENT_TRANSLATIONS_MAX_LENGTH = 10;
12
+ const LQA_CONTENT_UNIT_DESCRIPTION_MAX_LENGTH = 500;
13
+ const LQA_CONTENT_UNIT_SEGMENTS_MAX_LENGTH = 500;
14
+ const LQA_CONTENT_UNITS_MAX_LENGTH = 1;
15
+ const LQA_TRANSLATION_ID_SCHEMA = zod_1.default.string().uuid().describe('Unique ID of the segment translation');
16
+ const TRANSLATION_SCHEMA = zod_1.default.object({
17
+ id: LQA_TRANSLATION_ID_SCHEMA,
18
+ locale: commonSchemas_1.LOCALE_SCHEMA,
19
+ value: zod_1.default
20
+ .string()
21
+ .min(1)
22
+ .max(LQA_TRANSLATION_VALUE_MAX_LENGTH)
23
+ .describe('Translation of this segment in target language'),
24
+ });
25
+ const SEGMENT_SCHEMA = zod_1.default.object({
26
+ sourceValue: zod_1.default
27
+ .string()
28
+ .min(1)
29
+ .max(LQA_SEGMENT_SOURCE_VALUE_MAX_LENGTH)
30
+ .describe('Text content of the segment in source language'),
31
+ translations: zod_1.default
32
+ .array(TRANSLATION_SCHEMA)
33
+ .nonempty()
34
+ .max(LQA_SEGMENT_TRANSLATIONS_MAX_LENGTH)
35
+ .describe('List of translations for this segment'),
36
+ tmMatch: commonSchemas_1.TM_MATCH_SCHEMA,
37
+ });
38
+ const LQA_CONTENT_UNIT_ID_SCHEMA = zod_1.default.string().uuid().describe('Unique ID of the content unit');
39
+ const CONTENT_UNIT_SCHEMA = zod_1.default.object({
40
+ id: LQA_CONTENT_UNIT_ID_SCHEMA,
41
+ context: zod_1.default
42
+ .object({
43
+ description: zod_1.default
44
+ .string()
45
+ .min(1)
46
+ .max(LQA_CONTENT_UNIT_DESCRIPTION_MAX_LENGTH)
47
+ .describe('Unit description, something that applies to each segment in a unit. This will be passed as a helpful context to LLM calls')
48
+ .optional(),
49
+ })
50
+ .optional(),
51
+ characterLimit: zod_1.default.number().optional(),
52
+ segments: zod_1.default
53
+ .array(SEGMENT_SCHEMA)
54
+ .nonempty()
55
+ .max(LQA_CONTENT_UNIT_SEGMENTS_MAX_LENGTH)
56
+ .describe('List of segments to be reviewed'),
57
+ });
58
+ exports.LQA_SYNC_V2_BODY_SCHEMA = zod_1.default.object({
59
+ sourceLocale: commonSchemas_1.LOCALE_SCHEMA,
60
+ context: translationContextSchemas_1.TRANSLATION_CONTEXT_SCHEMA.optional(),
61
+ integration: commonSchemas_1.AI_INTEGRATION_ENGINE_SCHEMA.optional(),
62
+ contentUnits: zod_1.default
63
+ .array(CONTENT_UNIT_SCHEMA)
64
+ .nonempty()
65
+ .max(LQA_CONTENT_UNITS_MAX_LENGTH)
66
+ .describe('A list of content units to be reviewed. Each unit might have 1 or more segments, but all segments in content unit are considered to be parts of the same piece of content.'),
67
+ });
68
+ exports.LQA_SYNC_V2_HEADERS_SCHEMA = commonSchemas_1.COMMON_REQUEST_HEADERS_SCHEMA;
69
+ exports.LQA_SYNC_V2_RESPONSE_SCHEMA = zod_1.default
70
+ .object({
71
+ integration: zod_1.default.string(),
72
+ data: zod_1.default.array(zod_1.default.object({
73
+ contentUnitId: LQA_CONTENT_UNIT_ID_SCHEMA,
74
+ translationId: LQA_TRANSLATION_ID_SCHEMA,
75
+ suggestion: zod_1.default.string().nullable(),
76
+ issues: zod_1.default.array(zod_1.default.object({
77
+ category: zod_1.default.nativeEnum(commonSchemas_2.LqaIssueCategoryEnum),
78
+ severity: zod_1.default.nativeEnum(commonSchemas_2.LqaIssueSeverityEnum),
79
+ comment: zod_1.default.string().nullable(),
80
+ })),
81
+ })),
82
+ errors: zod_1.default
83
+ .array(commonSchemas_1.COMMON_ERROR_RESPONSE_SCHEMA.extend({
84
+ contentUnitId: LQA_CONTENT_UNIT_ID_SCHEMA,
85
+ translationId: LQA_TRANSLATION_ID_SCHEMA,
86
+ }))
87
+ .optional(),
88
+ })
89
+ .describe('Results of the LQA sync operation');
90
+ //# sourceMappingURL=lqaSyncV2Schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lqaSyncV2Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/lqa/lqaSyncV2Schemas.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,178 @@
1
+ import { z } from 'zod';
2
+ export declare const SCORE_V1_BODY_SCHEMA: z.ZodObject<{
3
+ sentences: z.ZodArray<z.ZodObject<{
4
+ id: z.ZodString;
5
+ sourceText: z.ZodString;
6
+ translations: z.ZodArray<z.ZodObject<{
7
+ id: z.ZodString;
8
+ text: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ text: string;
11
+ id: string;
12
+ }, {
13
+ text: string;
14
+ id: string;
15
+ }>, "atleastone">;
16
+ }, "strip", z.ZodTypeAny, {
17
+ translations: [{
18
+ text: string;
19
+ id: string;
20
+ }, ...{
21
+ text: string;
22
+ id: string;
23
+ }[]];
24
+ id: string;
25
+ sourceText: string;
26
+ }, {
27
+ translations: [{
28
+ text: string;
29
+ id: string;
30
+ }, ...{
31
+ text: string;
32
+ id: string;
33
+ }[]];
34
+ id: string;
35
+ sourceText: string;
36
+ }>, "atleastone">;
37
+ }, "strip", z.ZodTypeAny, {
38
+ sentences: [{
39
+ translations: [{
40
+ text: string;
41
+ id: string;
42
+ }, ...{
43
+ text: string;
44
+ id: string;
45
+ }[]];
46
+ id: string;
47
+ sourceText: string;
48
+ }, ...{
49
+ translations: [{
50
+ text: string;
51
+ id: string;
52
+ }, ...{
53
+ text: string;
54
+ id: string;
55
+ }[]];
56
+ id: string;
57
+ sourceText: string;
58
+ }[]];
59
+ }, {
60
+ sentences: [{
61
+ translations: [{
62
+ text: string;
63
+ id: string;
64
+ }, ...{
65
+ text: string;
66
+ id: string;
67
+ }[]];
68
+ id: string;
69
+ sourceText: string;
70
+ }, ...{
71
+ translations: [{
72
+ text: string;
73
+ id: string;
74
+ }, ...{
75
+ text: string;
76
+ id: string;
77
+ }[]];
78
+ id: string;
79
+ sourceText: string;
80
+ }[]];
81
+ }>;
82
+ export declare const SCORE_V1_RESPONSE_SCHEMA: z.ZodObject<{
83
+ generatedAt: z.ZodString;
84
+ results: z.ZodArray<z.ZodObject<{
85
+ id: z.ZodString;
86
+ sourceText: z.ZodString;
87
+ scores: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ text: z.ZodString;
90
+ score: z.ZodNumber;
91
+ }, "strip", z.ZodTypeAny, {
92
+ text: string;
93
+ id: string;
94
+ score: number;
95
+ }, {
96
+ text: string;
97
+ id: string;
98
+ score: number;
99
+ }>, "many">;
100
+ }, "strip", z.ZodTypeAny, {
101
+ id: string;
102
+ sourceText: string;
103
+ scores: {
104
+ text: string;
105
+ id: string;
106
+ score: number;
107
+ }[];
108
+ }, {
109
+ id: string;
110
+ sourceText: string;
111
+ scores: {
112
+ text: string;
113
+ id: string;
114
+ score: number;
115
+ }[];
116
+ }>, "many">;
117
+ errors: z.ZodArray<z.ZodObject<{
118
+ errorCode: z.ZodString;
119
+ message: z.ZodString;
120
+ details: z.ZodOptional<z.ZodObject<{
121
+ id: z.ZodOptional<z.ZodString>;
122
+ }, "strip", z.ZodTypeAny, {
123
+ id?: string | undefined;
124
+ }, {
125
+ id?: string | undefined;
126
+ }>>;
127
+ }, "strip", z.ZodTypeAny, {
128
+ message: string;
129
+ errorCode: string;
130
+ details?: {
131
+ id?: string | undefined;
132
+ } | undefined;
133
+ }, {
134
+ message: string;
135
+ errorCode: string;
136
+ details?: {
137
+ id?: string | undefined;
138
+ } | undefined;
139
+ }>, "many">;
140
+ }, "strip", z.ZodTypeAny, {
141
+ errors: {
142
+ message: string;
143
+ errorCode: string;
144
+ details?: {
145
+ id?: string | undefined;
146
+ } | undefined;
147
+ }[];
148
+ generatedAt: string;
149
+ results: {
150
+ id: string;
151
+ sourceText: string;
152
+ scores: {
153
+ text: string;
154
+ id: string;
155
+ score: number;
156
+ }[];
157
+ }[];
158
+ }, {
159
+ errors: {
160
+ message: string;
161
+ errorCode: string;
162
+ details?: {
163
+ id?: string | undefined;
164
+ } | undefined;
165
+ }[];
166
+ generatedAt: string;
167
+ results: {
168
+ id: string;
169
+ sourceText: string;
170
+ scores: {
171
+ text: string;
172
+ id: string;
173
+ score: number;
174
+ }[];
175
+ }[];
176
+ }>;
177
+ export type ScoreV1Body = z.infer<typeof SCORE_V1_BODY_SCHEMA>;
178
+ export type ScoreV1Response = z.infer<typeof SCORE_V1_RESPONSE_SCHEMA>;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SCORE_V1_RESPONSE_SCHEMA = exports.SCORE_V1_BODY_SCHEMA = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.SCORE_V1_BODY_SCHEMA = zod_1.z.object({
6
+ sentences: zod_1.z
7
+ .array(zod_1.z.object({
8
+ id: zod_1.z.string().describe('Unique ID of the source text'),
9
+ sourceText: zod_1.z.string().describe('Text in source language'),
10
+ translations: zod_1.z
11
+ .array(zod_1.z.object({
12
+ id: zod_1.z.string().describe('Unique ID of a specific translation'),
13
+ text: zod_1.z.string().describe('Translated text'),
14
+ }))
15
+ .describe('Translations of the `sourceText` in various languages')
16
+ .nonempty()
17
+ .max(100),
18
+ }))
19
+ .describe('List of translations to evaluate')
20
+ .nonempty()
21
+ .max(15),
22
+ });
23
+ exports.SCORE_V1_RESPONSE_SCHEMA = zod_1.z
24
+ .object({
25
+ generatedAt: zod_1.z.string().datetime(),
26
+ results: zod_1.z.array(zod_1.z.object({
27
+ id: zod_1.z.string(),
28
+ sourceText: zod_1.z.string(),
29
+ scores: zod_1.z.array(zod_1.z.object({
30
+ id: zod_1.z.string(),
31
+ text: zod_1.z.string(),
32
+ score: zod_1.z.number(),
33
+ })),
34
+ })),
35
+ errors: zod_1.z.array(zod_1.z.object({
36
+ errorCode: zod_1.z.string(),
37
+ message: zod_1.z.string(),
38
+ details: zod_1.z
39
+ .object({
40
+ id: zod_1.z.string().optional(),
41
+ })
42
+ .optional(),
43
+ })),
44
+ })
45
+ .describe('Successfully scored sentences');
46
+ //# sourceMappingURL=scoreV1Schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scoreV1Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/scoring/scoreV1Schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAuB;AAEV,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,SAAS,EAAE,OAAC;SACT,KAAK,CACJ,OAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8BAA8B,CAAC;QACvD,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC;QAC1D,YAAY,EAAE,OAAC;aACZ,KAAK,CACJ,OAAC,CAAC,MAAM,CAAC;YACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;YAC9D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iBAAiB,CAAC;SAC7C,CAAC,CACH;aACA,QAAQ,CAAC,uDAAuD,CAAC;aACjE,QAAQ,EAAE;aACV,GAAG,CAAC,GAAG,CAAC;KACZ,CAAC,CACH;SACA,QAAQ,CAAC,kCAAkC,CAAC;SAC5C,QAAQ,EAAE;SACV,GAAG,CAAC,EAAE,CAAC;CACX,CAAC,CAAA;AAEW,QAAA,wBAAwB,GAAG,OAAC;KACtC,MAAM,CAAC;IACN,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,OAAO,EAAE,OAAC,CAAC,KAAK,CACd,OAAC,CAAC,MAAM,CAAC;QACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;QACtB,MAAM,EAAE,OAAC,CAAC,KAAK,CACb,OAAC,CAAC,MAAM,CAAC;YACP,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;YACd,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;YAChB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;SAClB,CAAC,CACH;KACF,CAAC,CACH;IACD,MAAM,EAAE,OAAC,CAAC,KAAK,CACb,OAAC,CAAC,MAAM,CAAC;QACP,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;QACnB,OAAO,EAAE,OAAC;aACP,MAAM,CAAC;YACN,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;SAC1B,CAAC;aACD,QAAQ,EAAE;KACd,CAAC,CACH;CACF,CAAC;KACD,QAAQ,CAAC,+BAA+B,CAAC,CAAA"}
@@ -0,0 +1,352 @@
1
+ import z from 'zod';
2
+ import type { ObjectValues } from '../../types/common';
3
+ export declare const VariantsModeEnum: {
4
+ readonly REPHRASE: "REPHRASE";
5
+ readonly SHORTEN: "SHORTEN";
6
+ };
7
+ export type VariantsModeEnum = ObjectValues<typeof VariantsModeEnum>;
8
+ declare const HISTORY_REQUEST_SCHEMA: z.ZodObject<{
9
+ values: z.ZodArray<z.ZodString, "atleastone">;
10
+ mode: z.ZodPipeline<z.ZodString, z.ZodNativeEnum<{
11
+ readonly REPHRASE: "REPHRASE";
12
+ readonly SHORTEN: "SHORTEN";
13
+ }>>;
14
+ }, "strip", z.ZodTypeAny, {
15
+ values: [string, ...string[]];
16
+ mode: "REPHRASE" | "SHORTEN";
17
+ }, {
18
+ values: [string, ...string[]];
19
+ mode: string;
20
+ }>;
21
+ export type History = z.infer<typeof HISTORY_REQUEST_SCHEMA>;
22
+ export declare const GENERATE_VARIANTS_V1_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
23
+ assets: z.ZodOptional<z.ZodObject<{
24
+ description: z.ZodOptional<z.ZodString>;
25
+ styleGuide: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
26
+ text: z.ZodString;
27
+ }, "strip", z.ZodTypeAny, {
28
+ text: string;
29
+ }, {
30
+ text: string;
31
+ }>, z.ZodEffects<z.ZodObject<{
32
+ targetAudience: z.ZodOptional<z.ZodEnum<["general", "technical", "non-technical"]>>;
33
+ toneOfVoice: z.ZodOptional<z.ZodEnum<["friendly", "empowering", "informative", "supportive", "elegant"]>>;
34
+ levelOfFormality: z.ZodOptional<z.ZodEnum<["informal", "formal", "neutral"]>>;
35
+ generalRule: z.ZodOptional<z.ZodEnum<["active-voice", "passive-voice"]>>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
38
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
39
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
40
+ generalRule?: "active-voice" | "passive-voice" | undefined;
41
+ }, {
42
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
43
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
44
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
45
+ generalRule?: "active-voice" | "passive-voice" | undefined;
46
+ }>, {
47
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
48
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
49
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
50
+ generalRule?: "active-voice" | "passive-voice" | undefined;
51
+ }, {
52
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
53
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
54
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
55
+ generalRule?: "active-voice" | "passive-voice" | undefined;
56
+ }>]>>;
57
+ glossary: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
58
+ term: z.ZodString;
59
+ description: z.ZodOptional<z.ZodString>;
60
+ translatable: z.ZodDefault<z.ZodBoolean>;
61
+ forbidden: z.ZodDefault<z.ZodBoolean>;
62
+ caseSensitive: z.ZodDefault<z.ZodBoolean>;
63
+ translations: z.ZodOptional<z.ZodArray<z.ZodObject<{
64
+ locale: z.ZodEffects<z.ZodString, string, string>;
65
+ translation: z.ZodString;
66
+ description: z.ZodOptional<z.ZodString>;
67
+ }, "strip", z.ZodTypeAny, {
68
+ locale: string;
69
+ translation: string;
70
+ description?: string | undefined;
71
+ }, {
72
+ locale: string;
73
+ translation: string;
74
+ description?: string | undefined;
75
+ }>, "many">>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ term: string;
78
+ translatable: boolean;
79
+ forbidden: boolean;
80
+ caseSensitive: boolean;
81
+ description?: string | undefined;
82
+ translations?: {
83
+ locale: string;
84
+ translation: string;
85
+ description?: string | undefined;
86
+ }[] | undefined;
87
+ }, {
88
+ term: string;
89
+ description?: string | undefined;
90
+ translatable?: boolean | undefined;
91
+ forbidden?: boolean | undefined;
92
+ caseSensitive?: boolean | undefined;
93
+ translations?: {
94
+ locale: string;
95
+ translation: string;
96
+ description?: string | undefined;
97
+ }[] | undefined;
98
+ }>, {
99
+ term: string;
100
+ translatable: boolean;
101
+ forbidden: boolean;
102
+ caseSensitive: boolean;
103
+ description?: string | undefined;
104
+ translations?: {
105
+ locale: string;
106
+ translation: string;
107
+ description?: string | undefined;
108
+ }[] | undefined;
109
+ }, {
110
+ term: string;
111
+ description?: string | undefined;
112
+ translatable?: boolean | undefined;
113
+ forbidden?: boolean | undefined;
114
+ caseSensitive?: boolean | undefined;
115
+ translations?: {
116
+ locale: string;
117
+ translation: string;
118
+ description?: string | undefined;
119
+ }[] | undefined;
120
+ }>, "many">>;
121
+ }, "strip", z.ZodTypeAny, {
122
+ description?: string | undefined;
123
+ styleGuide?: {
124
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
125
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
126
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
127
+ generalRule?: "active-voice" | "passive-voice" | undefined;
128
+ } | {
129
+ text: string;
130
+ } | undefined;
131
+ glossary?: {
132
+ term: string;
133
+ translatable: boolean;
134
+ forbidden: boolean;
135
+ caseSensitive: boolean;
136
+ description?: string | undefined;
137
+ translations?: {
138
+ locale: string;
139
+ translation: string;
140
+ description?: string | undefined;
141
+ }[] | undefined;
142
+ }[] | undefined;
143
+ }, {
144
+ description?: string | undefined;
145
+ styleGuide?: {
146
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
147
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
148
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
149
+ generalRule?: "active-voice" | "passive-voice" | undefined;
150
+ } | {
151
+ text: string;
152
+ } | undefined;
153
+ glossary?: {
154
+ term: string;
155
+ description?: string | undefined;
156
+ translatable?: boolean | undefined;
157
+ forbidden?: boolean | undefined;
158
+ caseSensitive?: boolean | undefined;
159
+ translations?: {
160
+ locale: string;
161
+ translation: string;
162
+ description?: string | undefined;
163
+ }[] | undefined;
164
+ }[] | undefined;
165
+ }>>;
166
+ sourceLocale: z.ZodEffects<z.ZodString, string, string>;
167
+ sourceValue: z.ZodString;
168
+ targetLocale: z.ZodEffects<z.ZodString, string, string>;
169
+ targetValue: z.ZodString;
170
+ integration: z.ZodOptional<z.ZodNativeEnum<{
171
+ readonly CLAUDE: "Claude";
172
+ readonly CHAT_GPT4: "ChatGPT-4";
173
+ readonly GEMINI: "Gemini";
174
+ }>>;
175
+ history: z.ZodOptional<z.ZodArray<z.ZodObject<{
176
+ values: z.ZodArray<z.ZodString, "atleastone">;
177
+ mode: z.ZodPipeline<z.ZodString, z.ZodNativeEnum<{
178
+ readonly REPHRASE: "REPHRASE";
179
+ readonly SHORTEN: "SHORTEN";
180
+ }>>;
181
+ }, "strip", z.ZodTypeAny, {
182
+ values: [string, ...string[]];
183
+ mode: "REPHRASE" | "SHORTEN";
184
+ }, {
185
+ values: [string, ...string[]];
186
+ mode: string;
187
+ }>, "many">>;
188
+ mode: z.ZodPipeline<z.ZodString, z.ZodNativeEnum<{
189
+ readonly REPHRASE: "REPHRASE";
190
+ readonly SHORTEN: "SHORTEN";
191
+ }>>;
192
+ }, "strip", z.ZodTypeAny, {
193
+ sourceValue: string;
194
+ sourceLocale: string;
195
+ mode: "REPHRASE" | "SHORTEN";
196
+ targetLocale: string;
197
+ targetValue: string;
198
+ integration?: "Claude" | "ChatGPT-4" | "Gemini" | undefined;
199
+ assets?: {
200
+ description?: string | undefined;
201
+ styleGuide?: {
202
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
203
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
204
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
205
+ generalRule?: "active-voice" | "passive-voice" | undefined;
206
+ } | {
207
+ text: string;
208
+ } | undefined;
209
+ glossary?: {
210
+ term: string;
211
+ translatable: boolean;
212
+ forbidden: boolean;
213
+ caseSensitive: boolean;
214
+ description?: string | undefined;
215
+ translations?: {
216
+ locale: string;
217
+ translation: string;
218
+ description?: string | undefined;
219
+ }[] | undefined;
220
+ }[] | undefined;
221
+ } | undefined;
222
+ history?: {
223
+ values: [string, ...string[]];
224
+ mode: "REPHRASE" | "SHORTEN";
225
+ }[] | undefined;
226
+ }, {
227
+ sourceValue: string;
228
+ sourceLocale: string;
229
+ mode: string;
230
+ targetLocale: string;
231
+ targetValue: string;
232
+ integration?: "Claude" | "ChatGPT-4" | "Gemini" | undefined;
233
+ assets?: {
234
+ description?: string | undefined;
235
+ styleGuide?: {
236
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
237
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
238
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
239
+ generalRule?: "active-voice" | "passive-voice" | undefined;
240
+ } | {
241
+ text: string;
242
+ } | undefined;
243
+ glossary?: {
244
+ term: string;
245
+ description?: string | undefined;
246
+ translatable?: boolean | undefined;
247
+ forbidden?: boolean | undefined;
248
+ caseSensitive?: boolean | undefined;
249
+ translations?: {
250
+ locale: string;
251
+ translation: string;
252
+ description?: string | undefined;
253
+ }[] | undefined;
254
+ }[] | undefined;
255
+ } | undefined;
256
+ history?: {
257
+ values: [string, ...string[]];
258
+ mode: string;
259
+ }[] | undefined;
260
+ }>, {
261
+ sourceValue: string;
262
+ sourceLocale: string;
263
+ mode: "REPHRASE" | "SHORTEN";
264
+ targetLocale: string;
265
+ targetValue: string;
266
+ integration?: "Claude" | "ChatGPT-4" | "Gemini" | undefined;
267
+ assets?: {
268
+ description?: string | undefined;
269
+ styleGuide?: {
270
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
271
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
272
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
273
+ generalRule?: "active-voice" | "passive-voice" | undefined;
274
+ } | {
275
+ text: string;
276
+ } | undefined;
277
+ glossary?: {
278
+ term: string;
279
+ translatable: boolean;
280
+ forbidden: boolean;
281
+ caseSensitive: boolean;
282
+ description?: string | undefined;
283
+ translations?: {
284
+ locale: string;
285
+ translation: string;
286
+ description?: string | undefined;
287
+ }[] | undefined;
288
+ }[] | undefined;
289
+ } | undefined;
290
+ history?: {
291
+ values: [string, ...string[]];
292
+ mode: "REPHRASE" | "SHORTEN";
293
+ }[] | undefined;
294
+ }, {
295
+ sourceValue: string;
296
+ sourceLocale: string;
297
+ mode: string;
298
+ targetLocale: string;
299
+ targetValue: string;
300
+ integration?: "Claude" | "ChatGPT-4" | "Gemini" | undefined;
301
+ assets?: {
302
+ description?: string | undefined;
303
+ styleGuide?: {
304
+ targetAudience?: "general" | "technical" | "non-technical" | undefined;
305
+ toneOfVoice?: "friendly" | "empowering" | "informative" | "supportive" | "elegant" | undefined;
306
+ levelOfFormality?: "informal" | "formal" | "neutral" | undefined;
307
+ generalRule?: "active-voice" | "passive-voice" | undefined;
308
+ } | {
309
+ text: string;
310
+ } | undefined;
311
+ glossary?: {
312
+ term: string;
313
+ description?: string | undefined;
314
+ translatable?: boolean | undefined;
315
+ forbidden?: boolean | undefined;
316
+ caseSensitive?: boolean | undefined;
317
+ translations?: {
318
+ locale: string;
319
+ translation: string;
320
+ description?: string | undefined;
321
+ }[] | undefined;
322
+ }[] | undefined;
323
+ } | undefined;
324
+ history?: {
325
+ values: [string, ...string[]];
326
+ mode: string;
327
+ }[] | undefined;
328
+ }>;
329
+ export declare const GENERATE_VARIANTS_V1_HEADERS_SCHEMA: z.ZodObject<{
330
+ 'x-fake-processing': z.ZodOptional<z.ZodEffects<z.ZodBoolean, boolean, unknown>>;
331
+ }, "strip", z.ZodTypeAny, {
332
+ 'x-fake-processing'?: boolean | undefined;
333
+ }, {
334
+ 'x-fake-processing'?: unknown;
335
+ }>;
336
+ export declare const GENERATE_VARIANTS_V1_RESPONSE_SCHEMA: z.ZodObject<{
337
+ generatedAt: z.ZodString;
338
+ variants: z.ZodArray<z.ZodString, "many">;
339
+ integration: z.ZodString;
340
+ }, "strip", z.ZodTypeAny, {
341
+ integration: string;
342
+ generatedAt: string;
343
+ variants: string[];
344
+ }, {
345
+ integration: string;
346
+ generatedAt: string;
347
+ variants: string[];
348
+ }>;
349
+ export type GenerateVariantsV1Body = z.infer<typeof GENERATE_VARIANTS_V1_BODY_SCHEMA>;
350
+ export type GenerateVariantsV1Headers = z.infer<typeof GENERATE_VARIANTS_V1_HEADERS_SCHEMA>;
351
+ export type GenerateVariantsV1Response = z.infer<typeof GENERATE_VARIANTS_V1_RESPONSE_SCHEMA>;
352
+ export {};