@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.
- package/dist/index.d.ts +12 -8
- package/dist/index.js +25 -13
- package/dist/index.js.map +1 -1
- package/dist/sdk/PolyglotClient.d.ts +11 -9
- package/dist/sdk/PolyglotClient.js.map +1 -1
- package/dist/sdk/schemas/common/commonSchemas.d.ts +14 -0
- package/dist/sdk/schemas/common/commonSchemas.js +5 -1
- package/dist/sdk/schemas/common/commonSchemas.js.map +1 -1
- package/dist/sdk/schemas/common/{requestContextSchemas.d.ts → translationContextSchemas.d.ts} +2 -2
- package/dist/sdk/schemas/common/{requestContextSchemas.js → translationContextSchemas.js} +3 -3
- package/dist/sdk/schemas/common/translationContextSchemas.js.map +1 -0
- package/dist/sdk/schemas/lqa/commonSchemas.d.ts +22 -0
- package/dist/sdk/{types/responses.js → schemas/lqa/commonSchemas.js} +9 -13
- package/dist/sdk/schemas/lqa/commonSchemas.js.map +1 -0
- package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.d.ts +646 -0
- package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.js +97 -0
- package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.js.map +1 -0
- package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.d.ts +619 -0
- package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.js +90 -0
- package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.js.map +1 -0
- package/dist/sdk/schemas/scoring/scoreV1Schemas.d.ts +178 -0
- package/dist/sdk/schemas/scoring/scoreV1Schemas.js +46 -0
- package/dist/sdk/schemas/scoring/scoreV1Schemas.js.map +1 -0
- package/dist/sdk/schemas/translation/generateVariantsV1.d.ts +352 -0
- package/dist/sdk/schemas/translation/generateVariantsV1.js +53 -0
- package/dist/sdk/schemas/translation/generateVariantsV1.js.map +1 -0
- package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.js → translateAsyncV2Schemas.js} +3 -3
- package/dist/sdk/schemas/translation/translateAsyncV2Schemas.js.map +1 -0
- package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.js → translateSyncV2Schemas.js} +3 -3
- package/dist/sdk/schemas/translation/translateSyncV2Schemas.js.map +1 -0
- package/dist/sdk/types/common.d.ts +1 -0
- package/dist/sdk/types/{requests.js → common.js} +1 -1
- package/dist/sdk/types/common.js.map +1 -0
- package/package.json +1 -1
- package/dist/sdk/schemas/common/requestContextSchemas.js.map +0 -1
- package/dist/sdk/schemas/translation/asyncTranslationV2Schemas.js.map +0 -1
- package/dist/sdk/schemas/translation/syncTranslationV2Schemas.js.map +0 -1
- package/dist/sdk/types/callbacks.d.ts +0 -28
- package/dist/sdk/types/callbacks.js +0 -3
- package/dist/sdk/types/callbacks.js.map +0 -1
- package/dist/sdk/types/requests.d.ts +0 -106
- package/dist/sdk/types/requests.js.map +0 -1
- package/dist/sdk/types/responses.d.ts +0 -116
- package/dist/sdk/types/responses.js.map +0 -1
- package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.d.ts → translateAsyncV2Schemas.d.ts} +13 -13
- package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.d.ts → translateSyncV2Schemas.d.ts} +4 -4
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GENERATE_VARIANTS_V1_RESPONSE_SCHEMA = exports.GENERATE_VARIANTS_V1_HEADERS_SCHEMA = exports.GENERATE_VARIANTS_V1_BODY_SCHEMA = exports.VariantsModeEnum = 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 sharedSchemas_1 = require("./sharedSchemas");
|
|
9
|
+
exports.VariantsModeEnum = {
|
|
10
|
+
REPHRASE: 'REPHRASE',
|
|
11
|
+
SHORTEN: 'SHORTEN',
|
|
12
|
+
};
|
|
13
|
+
const HISTORY_REQUEST_SCHEMA = zod_1.default.object({
|
|
14
|
+
values: zod_1.default
|
|
15
|
+
.array(zod_1.default.string().min(1))
|
|
16
|
+
.nonempty()
|
|
17
|
+
.describe('Previously generated translation variants'),
|
|
18
|
+
mode: zod_1.default
|
|
19
|
+
.string()
|
|
20
|
+
.toUpperCase()
|
|
21
|
+
.pipe(zod_1.default.nativeEnum(exports.VariantsModeEnum))
|
|
22
|
+
.describe('Previously used generation mode'),
|
|
23
|
+
});
|
|
24
|
+
exports.GENERATE_VARIANTS_V1_BODY_SCHEMA = zod_1.default
|
|
25
|
+
.object({
|
|
26
|
+
assets: translationContextSchemas_1.TRANSLATION_CONTEXT_SCHEMA.optional(),
|
|
27
|
+
sourceLocale: commonSchemas_1.LOCALE_SCHEMA,
|
|
28
|
+
sourceValue: zod_1.default.string().min(1).describe('Text in source language'),
|
|
29
|
+
targetLocale: commonSchemas_1.LOCALE_SCHEMA,
|
|
30
|
+
targetValue: zod_1.default
|
|
31
|
+
.string()
|
|
32
|
+
.describe('Current translation of the text in target language. AI translator will do its best to avoid returning the same value'),
|
|
33
|
+
integration: commonSchemas_1.AI_INTEGRATION_ENGINE_SCHEMA.optional(),
|
|
34
|
+
history: zod_1.default
|
|
35
|
+
.array(HISTORY_REQUEST_SCHEMA)
|
|
36
|
+
.describe('A list of other previously created variations for this text')
|
|
37
|
+
.optional(),
|
|
38
|
+
mode: zod_1.default
|
|
39
|
+
.string()
|
|
40
|
+
.toUpperCase()
|
|
41
|
+
.pipe(zod_1.default.nativeEnum(exports.VariantsModeEnum))
|
|
42
|
+
.describe('A specific way of how a new variant is generated. If `rephrase`, it simply gets reworded, if `shorten` - AI tries to also make the translation shorter.'),
|
|
43
|
+
})
|
|
44
|
+
.refine(...sharedSchemas_1.refineDifferentSourceAndTargetLang);
|
|
45
|
+
exports.GENERATE_VARIANTS_V1_HEADERS_SCHEMA = commonSchemas_1.COMMON_REQUEST_HEADERS_SCHEMA;
|
|
46
|
+
exports.GENERATE_VARIANTS_V1_RESPONSE_SCHEMA = zod_1.default
|
|
47
|
+
.object({
|
|
48
|
+
generatedAt: zod_1.default.string().datetime(),
|
|
49
|
+
variants: zod_1.default.array(zod_1.default.string()).max(3),
|
|
50
|
+
integration: zod_1.default.string(),
|
|
51
|
+
})
|
|
52
|
+
.describe('Generated variants');
|
|
53
|
+
//# sourceMappingURL=generateVariantsV1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateVariantsV1.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/generateVariantsV1.ts"],"names":[],"mappings":";;;;AAAA,sDAAmB;AAGnB,2DAIgC;AAChC,mFAAgF;AAEhF,mDAAoE;AAEvD,QAAA,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;CACV,CAAA;AAGV,MAAM,sBAAsB,GAAG,aAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,aAAC;SACN,KAAK,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;SACxB,QAAQ,EAAE;SACV,QAAQ,CAAC,2CAA2C,CAAC;IACxD,IAAI,EAAE,aAAC;SACJ,MAAM,EAAE;SACR,WAAW,EAAE;SACb,IAAI,CAAC,aAAC,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;SACpC,QAAQ,CAAC,iCAAiC,CAAC;CAC/C,CAAC,CAAA;AAGW,QAAA,gCAAgC,GAAG,aAAC;KAC9C,MAAM,CAAC;IACN,MAAM,EAAE,sDAA0B,CAAC,QAAQ,EAAE;IAC7C,YAAY,EAAE,6BAAa;IAC3B,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;IAClE,YAAY,EAAE,6BAAa;IAC3B,WAAW,EAAE,aAAC;SACX,MAAM,EAAE;SACR,QAAQ,CACP,sHAAsH,CACvH;IACH,WAAW,EAAE,4CAA4B,CAAC,QAAQ,EAAE;IACpD,OAAO,EAAE,aAAC;SACP,KAAK,CAAC,sBAAsB,CAAC;SAC7B,QAAQ,CAAC,6DAA6D,CAAC;SACvE,QAAQ,EAAE;IACb,IAAI,EAAE,aAAC;SACJ,MAAM,EAAE;SACR,WAAW,EAAE;SACb,IAAI,CAAC,aAAC,CAAC,UAAU,CAAC,wBAAgB,CAAC,CAAC;SACpC,QAAQ,CACP,yJAAyJ,CAC1J;CACJ,CAAC;KACD,MAAM,CAAC,GAAG,kDAAkC,CAAC,CAAA;AAEnC,QAAA,mCAAmC,GAAG,6CAA6B,CAAA;AAEnE,QAAA,oCAAoC,GAAG,aAAC;KAClD,MAAM,CAAC;IACN,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,QAAQ,EAAE,aAAC,CAAC,KAAK,CAAC,aAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACpC,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;CACxB,CAAC;KACD,QAAQ,CAAC,oBAAoB,CAAC,CAAA"}
|
package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.js → translateAsyncV2Schemas.js}
RENAMED
|
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const zod_1 = tslib_1.__importDefault(require("zod"));
|
|
6
6
|
const asyncRequestSchemas_1 = require("../common/asyncRequestSchemas");
|
|
7
7
|
const commonSchemas_1 = require("../common/commonSchemas");
|
|
8
|
-
const
|
|
8
|
+
const translationContextSchemas_1 = require("../common/translationContextSchemas");
|
|
9
9
|
const sharedSchemas_1 = require("./sharedSchemas");
|
|
10
10
|
const SEGMENT_ID_MAX_LENGTH = 100;
|
|
11
11
|
const SEGMENT_VALUE_MAX_LENGTH = 5000;
|
|
@@ -42,7 +42,7 @@ exports.TRANSLATE_ASYNC_V2_BODY_SCHEMA = asyncRequestSchemas_1.ASYNC_REQUEST_SCH
|
|
|
42
42
|
targetLocale: commonSchemas_1.LOCALE_SCHEMA,
|
|
43
43
|
integration: commonSchemas_1.REAL_INTEGRATION_ENGINE_SCHEMA.optional(),
|
|
44
44
|
pickIntegrationByScore: zod_1.default.boolean().default(false),
|
|
45
|
-
context:
|
|
45
|
+
context: translationContextSchemas_1.TRANSLATION_CONTEXT_SCHEMA.optional(),
|
|
46
46
|
contentUnits: zod_1.default
|
|
47
47
|
.array(exports.TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA)
|
|
48
48
|
.nonempty()
|
|
@@ -84,4 +84,4 @@ exports.TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA = zod_1.default
|
|
|
84
84
|
.optional(),
|
|
85
85
|
})
|
|
86
86
|
.describe('Callback with results.');
|
|
87
|
-
//# sourceMappingURL=
|
|
87
|
+
//# sourceMappingURL=translateAsyncV2Schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translateAsyncV2Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/translateAsyncV2Schemas.ts"],"names":[],"mappings":";;;;AAAA,sDAAmB;AAEnB,uEAAoE;AACpE,2DAMgC;AAChC,mFAAgF;AAEhF,mDAAoE;AAEpE,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AACrC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AACtC,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAC/C,MAAM,gCAAgC,GAAG,GAAG,CAAA;AAC5C,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAEnC,MAAM,oCAAoC,GAAG,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,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C,CAAC,MAAM,EAAE;QACvB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;QACvB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC,CACH;IACD,MAAM,EAAE,aAAC;SACN,KAAK,CACJ,4CAA4B,CAAC,MAAM,CAAC;QAClC,aAAa,EAAE,oCAAoC;QACnD,SAAS,EAAE,oCAAoC;QAC/C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE;QACzB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;KACxB,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,CAAC,wBAAwB,CAAC,CAAA"}
|
package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.js → translateSyncV2Schemas.js}
RENAMED
|
@@ -4,7 +4,7 @@ exports.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA = exports.TRANSLATE_SYNC_V2_HEADERS_SC
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const zod_1 = tslib_1.__importDefault(require("zod"));
|
|
6
6
|
const commonSchemas_1 = require("../common/commonSchemas");
|
|
7
|
-
const
|
|
7
|
+
const translationContextSchemas_1 = require("../common/translationContextSchemas");
|
|
8
8
|
const sharedSchemas_1 = require("./sharedSchemas");
|
|
9
9
|
const SEGMENT_ID_MAX_LENGTH = 100;
|
|
10
10
|
const SEGMENT_VALUE_MAX_LENGTH = 5000;
|
|
@@ -37,7 +37,7 @@ exports.TRANSLATE_SYNC_V2_BODY_SCHEMA = zod_1.default
|
|
|
37
37
|
sourceLocale: commonSchemas_1.LOCALE_SCHEMA,
|
|
38
38
|
targetLocale: commonSchemas_1.LOCALE_SCHEMA,
|
|
39
39
|
integration: commonSchemas_1.REAL_INTEGRATION_ENGINE_SCHEMA.optional(),
|
|
40
|
-
context:
|
|
40
|
+
context: translationContextSchemas_1.TRANSLATION_CONTEXT_SCHEMA.optional(),
|
|
41
41
|
contentUnits: zod_1.default
|
|
42
42
|
.array(exports.TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA)
|
|
43
43
|
.nonempty()
|
|
@@ -62,4 +62,4 @@ exports.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA = zod_1.default
|
|
|
62
62
|
.optional(),
|
|
63
63
|
})
|
|
64
64
|
.describe('Results of the sync translation');
|
|
65
|
-
//# sourceMappingURL=
|
|
65
|
+
//# sourceMappingURL=translateSyncV2Schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translateSyncV2Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/translateSyncV2Schemas.ts"],"names":[],"mappings":";;;;AAAA,sDAAmB;AAEnB,2DAMgC;AAChC,mFAAgF;AAEhF,mDAAoE;AAEpE,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AACrC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AACtC,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAC/C,MAAM,gCAAgC,GAAG,GAAG,CAAA;AAC5C,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAEnC,MAAM,mCAAmC,GAAG,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAE3E,QAAA,gCAAgC,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,EAAE,EAAE,mCAAmC;IACvC,OAAO,EAAE,+BAAe;IACxB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC;CACvD,CAAC,CAAA;AAEF,MAAM,wCAAwC,GAAG,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;AAErF,QAAA,qCAAqC,GAAG,aAAC,CAAC,MAAM,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xB,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,CAAC,iCAAiC,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type ObjectValues<T> = T[keyof T];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/sdk/types/common.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requestContextSchemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/common/requestContextSchemas.ts"],"names":[],"mappings":";;;AAwCA,wDASC;;AAjDD,sDAAmB;AAEnB,mDAA+C;AAE/C,6CAA6C;AAC7C,cAAc;AACd,6CAA6C;AAE7C,MAAM,6BAA6B,GAAG,aAAC;KACpC,MAAM,CAAC;IACN,cAAc,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC5E,WAAW,EAAE,aAAC;SACX,IAAI,CAAC,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,CAAC,CAAC;SACxE,QAAQ,EAAE;IACb,gBAAgB,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtE,WAAW,EAAE,aAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE;CAClE,CAAC;KACD,QAAQ,CAAC,gDAAgD,CAAC;KAC1D,MAAM,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,sBAAsB,CAAC,UAAU,CAAC,EAAE;IAC1D,OAAO,EAAE,4CAA4C;CACtD,CAAC,CAAA;AAIJ,MAAM,2BAA2B,GAAG,aAAC;KAClC,MAAM,CAAC;IACN,IAAI,EAAE,aAAC,CAA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AAqC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9E,WAAW,EAAE,aAAC;aACX,MAAM,EAAE;aACR,QAAQ,CAAC,iDAAiD,CAAC;aAC3D,QAAQ,EAAE;KACd,CAAC,CACH;SACA,QAAQ,CAAC,iFAAiF,CAAC;SAC3F,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,CAAC,eAAe,CAAC;KACzB,MAAM,CACL,CAAC,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,YAAY,IAAI,SAAS,EAC3F;IACE,OAAO,EACL,kHAAkH;CACrH,CACF,CAAA;AAEU,QAAA,sBAAsB,GAAG,aAAC;KACpC,MAAM,CAAC;IACN,WAAW,EAAE,aAAC;SACX,MAAM,EAAE;SACR,GAAG,CAAC,CAAC,CAAC;SACN,QAAQ,CACP,qFAAqF,CACtF;SACA,QAAQ,EAAE;IACb,UAAU,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IACzC,QAAQ,EAAE,aAAC,CAAC,KAAK,CAAC,4BAAoB,CAAC,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;CACtF,CAAC;KACD,QAAQ,CAAC,6BAA6B,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"asyncTranslationV2Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/asyncTranslationV2Schemas.ts"],"names":[],"mappings":";;;;AAAA,sDAAmB;AAEnB,uEAAoE;AACpE,2DAMgC;AAChC,2EAAwE;AAExE,mDAAoE;AAEpE,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AACrC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AACtC,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAC/C,MAAM,gCAAgC,GAAG,GAAG,CAAA;AAC5C,MAAM,wBAAw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CAAC,MAAM,CAAC;QACP,aAAa,EAAE,oCAAoC;QACnD,SAAS,EAAE,oCAAoC;QAC/C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE;QACzB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;QACvB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;QACvB,KAAK,EAAE,aAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;KAC7B,CAAC,CACH;IACD,MAAM,EAAE,aAAC;SACN,KAAK,CACJ,4CAA4B,CAAC,MAAM,CAAC;QAClC,aAAa,EAAE,oCAAoC;QACnD,SAAS,EAAE,oCAAoC;QAC/C,aAAa,EAAE,aAAC,CAAC,MAAM,EAAE;QACzB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;KACxB,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,CAAC,wBAAwB,CAAC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"syncTranslationV2Schemas.js","sourceRoot":"","sources":["../../../../src/sdk/schemas/translation/syncTranslationV2Schemas.ts"],"names":[],"mappings":";;;;AAAA,sDAAmB;AAEnB,2DAMgC;AAChC,2EAAwE;AAExE,mDAAoE;AAEpE,MAAM,qBAAqB,GAAG,GAAG,CAAA;AACjC,MAAM,wBAAwB,GAAG,IAAI,CAAA;AACrC,MAAM,0BAA0B,GAAG,GAAG,CAAA;AACtC,MAAM,mCAAmC,GAAG,GAAG,CAAA;AAC/C,MAAM,gCAAgC,GAAG,GAAG,CAAA;AAC5C,MAAM,wBAAwB,GAAG,EAAE,CAAA;AAEnC,MAAM,mCAAmC,GAAG,aAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAA;AAE3E,QAAA,gCAAgC,GAAG,aAAC,CAAC,MAAM,CAAC;IACvD,EAAE,EAAE,mCAAmC;IACvC,OAAO,EAAE,+BAAe;IACxB,K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AE,mCAAmC;QAC9C,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;QACvB,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;KACxB,CAAC,CACH;IACD,MAAM,EAAE,aAAC;SACN,KAAK,CACJ,4CAA4B,CAAC,MAAM,CAAC;QAClC,aAAa,EAAE,mCAAmC;QAClD,SAAS,EAAE,mCAAmC;QAC9C,WAAW,EAAE,aAAC,CAAC,MAAM,EAAE;KACxB,CAAC,CACH;SACA,QAAQ,EAAE;CACd,CAAC;KACD,QAAQ,CAAC,iCAAiC,CAAC,CAAA"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { CommonErrorType, ContentUnitTranslationResponse, LqaIssue } from './responses';
|
|
2
|
-
export type TranslateAsyncCallbackRequestBody = {
|
|
3
|
-
data: {
|
|
4
|
-
originCorrelationId: string;
|
|
5
|
-
sourceLocale: string;
|
|
6
|
-
targetLocale: string;
|
|
7
|
-
contentUnits: ContentUnitTranslationResponse[];
|
|
8
|
-
errors?: CommonErrorType[];
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export type LqaAsyncCallbackData = {
|
|
12
|
-
contentUnitId: string;
|
|
13
|
-
translationId: string;
|
|
14
|
-
suggestion: string | null;
|
|
15
|
-
issues: LqaIssue[];
|
|
16
|
-
};
|
|
17
|
-
export type LqaAsyncCallbackError = {
|
|
18
|
-
contentUnitId: string;
|
|
19
|
-
translationId: string;
|
|
20
|
-
errorCode: string;
|
|
21
|
-
message: string;
|
|
22
|
-
details?: Record<string, unknown>;
|
|
23
|
-
};
|
|
24
|
-
export type LqaAsyncCallbackRequestBody = {
|
|
25
|
-
originCorrelationId: string;
|
|
26
|
-
data: LqaAsyncCallbackData[];
|
|
27
|
-
errors?: LqaAsyncCallbackError[];
|
|
28
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"callbacks.js","sourceRoot":"","sources":["../../../src/sdk/types/callbacks.ts"],"names":[],"mappings":""}
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
type AsyncRequestCommons = {
|
|
2
|
-
tenantId: string;
|
|
3
|
-
ownerId: string;
|
|
4
|
-
callbackUrl: string;
|
|
5
|
-
callbackToken: string;
|
|
6
|
-
originCorrelationId: string;
|
|
7
|
-
};
|
|
8
|
-
export type TranslateSyncRequest = {
|
|
9
|
-
sourceLocale: string;
|
|
10
|
-
targetLocale: string;
|
|
11
|
-
contentUnits: TranslateSyncContentUnits[];
|
|
12
|
-
context?: PolyglotAssetsRequest;
|
|
13
|
-
integration?: IntegrationKind;
|
|
14
|
-
};
|
|
15
|
-
export type TranslateAsyncRequestBody = TranslateSyncRequest & AsyncRequestCommons;
|
|
16
|
-
export type TranslateSyncContentUnits = {
|
|
17
|
-
id: string;
|
|
18
|
-
context?: {
|
|
19
|
-
description: string;
|
|
20
|
-
};
|
|
21
|
-
characterLimit?: number;
|
|
22
|
-
segments: {
|
|
23
|
-
id: string;
|
|
24
|
-
position: number;
|
|
25
|
-
value: string;
|
|
26
|
-
}[];
|
|
27
|
-
};
|
|
28
|
-
export type LqaTranslation = {
|
|
29
|
-
id: string;
|
|
30
|
-
locale: string;
|
|
31
|
-
value: string;
|
|
32
|
-
};
|
|
33
|
-
export type LqaSegment = {
|
|
34
|
-
sourceValue: string;
|
|
35
|
-
translations: LqaTranslation[];
|
|
36
|
-
};
|
|
37
|
-
export type LqaContentUnit = {
|
|
38
|
-
id: string;
|
|
39
|
-
context?: {
|
|
40
|
-
description?: string;
|
|
41
|
-
};
|
|
42
|
-
characterLimit?: number;
|
|
43
|
-
segments: LqaSegment[];
|
|
44
|
-
};
|
|
45
|
-
export type LqaSyncRequestBody = {
|
|
46
|
-
sourceLocale: string;
|
|
47
|
-
context?: PolyglotAssetsRequest;
|
|
48
|
-
integration?: AiIntegrationKind;
|
|
49
|
-
contentUnits: LqaContentUnit[];
|
|
50
|
-
};
|
|
51
|
-
export type LqaAsyncRequestBody = AsyncRequestCommons & LqaSyncRequestBody;
|
|
52
|
-
type SegmentVariantsMode = 'REPHRASE' | 'SHORTEN';
|
|
53
|
-
type SegmentVariantsHistory = {
|
|
54
|
-
values: string[];
|
|
55
|
-
mode: SegmentVariantsMode;
|
|
56
|
-
};
|
|
57
|
-
export type GenerateVariantsRequest = {
|
|
58
|
-
mode: SegmentVariantsMode;
|
|
59
|
-
sourceLocale: string;
|
|
60
|
-
sourceValue: string;
|
|
61
|
-
targetLocale: string;
|
|
62
|
-
targetValue: string;
|
|
63
|
-
history?: SegmentVariantsHistory[];
|
|
64
|
-
assets?: PolyglotAssetsRequest;
|
|
65
|
-
integration?: AiIntegrationKind;
|
|
66
|
-
};
|
|
67
|
-
export type AiIntegrationKind = 'Claude' | 'ChatGPT-4' | 'Gemini';
|
|
68
|
-
export type MtIntegrationKind = 'DeepL' | 'GoogleTranslate' | 'MicrosoftTranslator';
|
|
69
|
-
export type IntegrationKind = 'Fake' | AiIntegrationKind | MtIntegrationKind;
|
|
70
|
-
export type StructuredStyleGuide = {
|
|
71
|
-
targetAudience: string;
|
|
72
|
-
toneOfVoice: string;
|
|
73
|
-
levelOfFormality: string;
|
|
74
|
-
generalRule: string;
|
|
75
|
-
};
|
|
76
|
-
export type FreeformStyleGuide = {
|
|
77
|
-
text: string;
|
|
78
|
-
};
|
|
79
|
-
export type PolyglotAssetsRequest = {
|
|
80
|
-
description?: string;
|
|
81
|
-
styleGuide?: StructuredStyleGuide | FreeformStyleGuide;
|
|
82
|
-
glossary?: PolyglotGlossaryTermRequest[];
|
|
83
|
-
};
|
|
84
|
-
export type PolyglotGlossaryTermRequest = {
|
|
85
|
-
term: string;
|
|
86
|
-
description?: string;
|
|
87
|
-
translatable?: boolean;
|
|
88
|
-
forbidden?: boolean;
|
|
89
|
-
caseSensitive?: boolean;
|
|
90
|
-
translations: {
|
|
91
|
-
locale: string;
|
|
92
|
-
translation: string;
|
|
93
|
-
description?: string;
|
|
94
|
-
}[];
|
|
95
|
-
};
|
|
96
|
-
export type ScoreTranslationsRequest = {
|
|
97
|
-
sentences: Array<{
|
|
98
|
-
id: string;
|
|
99
|
-
sourceText: string;
|
|
100
|
-
translations: Array<{
|
|
101
|
-
id: string;
|
|
102
|
-
text: string;
|
|
103
|
-
}>;
|
|
104
|
-
}>;
|
|
105
|
-
};
|
|
106
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"requests.js","sourceRoot":"","sources":["../../../src/sdk/types/requests.ts"],"names":[],"mappings":""}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import type { IntegrationKind } from './requests';
|
|
2
|
-
type ObjectValues<T> = T[keyof T];
|
|
3
|
-
export type PolyglotClientSyncIterativeResponse<T extends ContentUnitTranslationResponse> = {
|
|
4
|
-
segmentIdsProcessedByContentUnitId: Record<string, string[]>;
|
|
5
|
-
response: T[];
|
|
6
|
-
};
|
|
7
|
-
export type PolyglotSyncResponse<T extends object> = {
|
|
8
|
-
generatedAt: string;
|
|
9
|
-
sourceLocale: string;
|
|
10
|
-
contentUnits: T[];
|
|
11
|
-
errors?: CommonErrorType[];
|
|
12
|
-
integration: string;
|
|
13
|
-
};
|
|
14
|
-
export declare const ErrorCodeEnum: {
|
|
15
|
-
readonly EDITED_NON_TRANSLATABLE_CONTENT: "EDITED_NON_TRANSLATABLE_CONTENT_ERROR";
|
|
16
|
-
readonly TRANSLATION_FAILED: "TRANSLATION_FAILED";
|
|
17
|
-
};
|
|
18
|
-
export type ErrorCodeEnum = ObjectValues<typeof ErrorCodeEnum>;
|
|
19
|
-
export type CommonErrorType = {
|
|
20
|
-
errorCode: string;
|
|
21
|
-
message: string;
|
|
22
|
-
details?: {
|
|
23
|
-
segmentId?: string;
|
|
24
|
-
actualFailedSegmentId?: string;
|
|
25
|
-
cause?: string;
|
|
26
|
-
options?: Record<string, unknown>;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
29
|
-
export type ContentUnitTranslationResponse = {
|
|
30
|
-
id: string;
|
|
31
|
-
locale: string;
|
|
32
|
-
segments: {
|
|
33
|
-
id: string;
|
|
34
|
-
position: number;
|
|
35
|
-
translation: string;
|
|
36
|
-
integration: string;
|
|
37
|
-
score?: number | null;
|
|
38
|
-
polyglotRefId?: string;
|
|
39
|
-
}[];
|
|
40
|
-
};
|
|
41
|
-
export declare const LqaSeverityResponseEnum: {
|
|
42
|
-
readonly NEUTRAL: "neutral";
|
|
43
|
-
readonly MINOR: "minor";
|
|
44
|
-
readonly MAJOR: "major";
|
|
45
|
-
readonly CRITICAL: "critical";
|
|
46
|
-
};
|
|
47
|
-
export type LqaSeverityResponseEnum = ObjectValues<typeof LqaSeverityResponseEnum>;
|
|
48
|
-
export declare const LqaCategoryResponseEnum: {
|
|
49
|
-
readonly ACCURACY: "accuracy";
|
|
50
|
-
readonly FLUENCY: "fluency";
|
|
51
|
-
readonly TERMINOLOGY: "terminology";
|
|
52
|
-
readonly LOCALE_CONVENTION: "locale convention";
|
|
53
|
-
readonly STYLE: "style";
|
|
54
|
-
readonly CONSISTENCY: "consistency";
|
|
55
|
-
readonly COHERENCE: "coherence";
|
|
56
|
-
readonly DESIGN: "design";
|
|
57
|
-
readonly MARKUP: "markup";
|
|
58
|
-
readonly INTERNATIONALIZATION: "internationalization";
|
|
59
|
-
readonly VERITY: "verity";
|
|
60
|
-
};
|
|
61
|
-
export type LqaCategoryResponseEnum = ObjectValues<typeof LqaCategoryResponseEnum>;
|
|
62
|
-
export type LqaIssue = {
|
|
63
|
-
severity: LqaSeverityResponseEnum;
|
|
64
|
-
category: LqaCategoryResponseEnum;
|
|
65
|
-
comment: string | null;
|
|
66
|
-
};
|
|
67
|
-
export type PolyglotGenerateVariantsResponse = {
|
|
68
|
-
variants: string[];
|
|
69
|
-
integration: string;
|
|
70
|
-
};
|
|
71
|
-
export type ScoreTranslationsResponse = {
|
|
72
|
-
generatedAt: string;
|
|
73
|
-
results: Array<{
|
|
74
|
-
id: string;
|
|
75
|
-
sourceText: string;
|
|
76
|
-
scores: Array<{
|
|
77
|
-
id: string;
|
|
78
|
-
text: string;
|
|
79
|
-
score: number;
|
|
80
|
-
}>;
|
|
81
|
-
}>;
|
|
82
|
-
errors?: Array<{
|
|
83
|
-
errorCode: string;
|
|
84
|
-
message: string;
|
|
85
|
-
details?: {
|
|
86
|
-
id?: string;
|
|
87
|
-
};
|
|
88
|
-
}>;
|
|
89
|
-
};
|
|
90
|
-
export type AsyncResponse = {
|
|
91
|
-
requestId: string;
|
|
92
|
-
expectedAt: string;
|
|
93
|
-
};
|
|
94
|
-
export type TranslateAsyncResponse = AsyncResponse;
|
|
95
|
-
export type LqaAsyncResponse = TranslateAsyncResponse;
|
|
96
|
-
export type LqaSyncResponse = {
|
|
97
|
-
integration: IntegrationKind;
|
|
98
|
-
data: Array<{
|
|
99
|
-
contentUnitId: string;
|
|
100
|
-
translationId: string;
|
|
101
|
-
suggestion: null | string;
|
|
102
|
-
issues: Array<{
|
|
103
|
-
category: LqaCategoryResponseEnum;
|
|
104
|
-
severity: LqaSeverityResponseEnum;
|
|
105
|
-
comment: null | string;
|
|
106
|
-
}>;
|
|
107
|
-
}>;
|
|
108
|
-
errors?: Array<{
|
|
109
|
-
contentUnitId: string;
|
|
110
|
-
translationId: string;
|
|
111
|
-
message: string;
|
|
112
|
-
errorCode: string;
|
|
113
|
-
details?: Record<string, unknown>;
|
|
114
|
-
}>;
|
|
115
|
-
};
|
|
116
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"responses.js","sourceRoot":"","sources":["../../../src/sdk/types/responses.ts"],"names":[],"mappings":";;;AAiBa,QAAA,aAAa,GAAG;IAC3B,+BAA+B,EAAE,uCAAuC;IACxE,kBAAkB,EAAE,oBAAoB;CAChC,CAAA;AA2BG,QAAA,uBAAuB,GAAG;IACrC,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;CACZ,CAAA;AAGG,QAAA,uBAAuB,GAAG;IACrC,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;IAC1B,iBAAiB,EAAE,mBAAmB;IACtC,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,oBAAoB,EAAE,sBAAsB;IAC5C,MAAM,EAAE,QAAQ;CACR,CAAA"}
|
package/dist/sdk/schemas/translation/{asyncTranslationV2Schemas.d.ts → translateAsyncV2Schemas.d.ts}
RENAMED
|
@@ -497,8 +497,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
497
497
|
callbackUrl: string;
|
|
498
498
|
callbackToken: string;
|
|
499
499
|
sourceLocale: string;
|
|
500
|
-
targetLocale: string;
|
|
501
|
-
pickIntegrationByScore: boolean;
|
|
502
500
|
contentUnits: [{
|
|
503
501
|
id: string;
|
|
504
502
|
segments: [{
|
|
@@ -542,6 +540,8 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
542
540
|
} | undefined;
|
|
543
541
|
characterLimit?: number | undefined;
|
|
544
542
|
}[]];
|
|
543
|
+
targetLocale: string;
|
|
544
|
+
pickIntegrationByScore: boolean;
|
|
545
545
|
context?: {
|
|
546
546
|
description?: string | undefined;
|
|
547
547
|
styleGuide?: {
|
|
@@ -573,7 +573,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
573
573
|
callbackUrl: string;
|
|
574
574
|
callbackToken: string;
|
|
575
575
|
sourceLocale: string;
|
|
576
|
-
targetLocale: string;
|
|
577
576
|
contentUnits: [{
|
|
578
577
|
id: string;
|
|
579
578
|
segments: [{
|
|
@@ -617,6 +616,7 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
617
616
|
} | undefined;
|
|
618
617
|
characterLimit?: number | undefined;
|
|
619
618
|
}[]];
|
|
619
|
+
targetLocale: string;
|
|
620
620
|
context?: {
|
|
621
621
|
description?: string | undefined;
|
|
622
622
|
styleGuide?: {
|
|
@@ -649,8 +649,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
649
649
|
callbackUrl: string;
|
|
650
650
|
callbackToken: string;
|
|
651
651
|
sourceLocale: string;
|
|
652
|
-
targetLocale: string;
|
|
653
|
-
pickIntegrationByScore: boolean;
|
|
654
652
|
contentUnits: [{
|
|
655
653
|
id: string;
|
|
656
654
|
segments: [{
|
|
@@ -694,6 +692,8 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
694
692
|
} | undefined;
|
|
695
693
|
characterLimit?: number | undefined;
|
|
696
694
|
}[]];
|
|
695
|
+
targetLocale: string;
|
|
696
|
+
pickIntegrationByScore: boolean;
|
|
697
697
|
context?: {
|
|
698
698
|
description?: string | undefined;
|
|
699
699
|
styleGuide?: {
|
|
@@ -725,7 +725,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
725
725
|
callbackUrl: string;
|
|
726
726
|
callbackToken: string;
|
|
727
727
|
sourceLocale: string;
|
|
728
|
-
targetLocale: string;
|
|
729
728
|
contentUnits: [{
|
|
730
729
|
id: string;
|
|
731
730
|
segments: [{
|
|
@@ -769,6 +768,7 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
769
768
|
} | undefined;
|
|
770
769
|
characterLimit?: number | undefined;
|
|
771
770
|
}[]];
|
|
771
|
+
targetLocale: string;
|
|
772
772
|
context?: {
|
|
773
773
|
description?: string | undefined;
|
|
774
774
|
styleGuide?: {
|
|
@@ -801,8 +801,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
801
801
|
callbackUrl: string;
|
|
802
802
|
callbackToken: string;
|
|
803
803
|
sourceLocale: string;
|
|
804
|
-
targetLocale: string;
|
|
805
|
-
pickIntegrationByScore: boolean;
|
|
806
804
|
contentUnits: [{
|
|
807
805
|
id: string;
|
|
808
806
|
segments: [{
|
|
@@ -846,6 +844,8 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
846
844
|
} | undefined;
|
|
847
845
|
characterLimit?: number | undefined;
|
|
848
846
|
}[]];
|
|
847
|
+
targetLocale: string;
|
|
848
|
+
pickIntegrationByScore: boolean;
|
|
849
849
|
context?: {
|
|
850
850
|
description?: string | undefined;
|
|
851
851
|
styleGuide?: {
|
|
@@ -877,7 +877,6 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
877
877
|
callbackUrl: string;
|
|
878
878
|
callbackToken: string;
|
|
879
879
|
sourceLocale: string;
|
|
880
|
-
targetLocale: string;
|
|
881
880
|
contentUnits: [{
|
|
882
881
|
id: string;
|
|
883
882
|
segments: [{
|
|
@@ -921,6 +920,7 @@ export declare const TRANSLATE_ASYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodEffects<z
|
|
|
921
920
|
} | undefined;
|
|
922
921
|
characterLimit?: number | undefined;
|
|
923
922
|
}[]];
|
|
923
|
+
targetLocale: string;
|
|
924
924
|
context?: {
|
|
925
925
|
description?: string | undefined;
|
|
926
926
|
styleGuide?: {
|
|
@@ -977,16 +977,16 @@ export declare const TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA: z.ZodObject<{
|
|
|
977
977
|
translation: string;
|
|
978
978
|
integration: string;
|
|
979
979
|
contentUnitId: string;
|
|
980
|
+
score: number | null;
|
|
980
981
|
segmentId: string;
|
|
981
982
|
polyglotRefId: string;
|
|
982
|
-
score: number | null;
|
|
983
983
|
}, {
|
|
984
984
|
translation: string;
|
|
985
985
|
integration: string;
|
|
986
986
|
contentUnitId: string;
|
|
987
|
+
score: number | null;
|
|
987
988
|
segmentId: string;
|
|
988
989
|
polyglotRefId: string;
|
|
989
|
-
score: number | null;
|
|
990
990
|
}>, "many">;
|
|
991
991
|
errors: z.ZodOptional<z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
|
|
992
992
|
message: z.ZodString;
|
|
@@ -1020,9 +1020,9 @@ export declare const TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA: z.ZodObject<{
|
|
|
1020
1020
|
translation: string;
|
|
1021
1021
|
integration: string;
|
|
1022
1022
|
contentUnitId: string;
|
|
1023
|
+
score: number | null;
|
|
1023
1024
|
segmentId: string;
|
|
1024
1025
|
polyglotRefId: string;
|
|
1025
|
-
score: number | null;
|
|
1026
1026
|
}[];
|
|
1027
1027
|
errors?: {
|
|
1028
1028
|
message: string;
|
|
@@ -1039,9 +1039,9 @@ export declare const TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA: z.ZodObject<{
|
|
|
1039
1039
|
translation: string;
|
|
1040
1040
|
integration: string;
|
|
1041
1041
|
contentUnitId: string;
|
|
1042
|
+
score: number | null;
|
|
1042
1043
|
segmentId: string;
|
|
1043
1044
|
polyglotRefId: string;
|
|
1044
|
-
score: number | null;
|
|
1045
1045
|
}[];
|
|
1046
1046
|
errors?: {
|
|
1047
1047
|
message: string;
|
package/dist/sdk/schemas/translation/{syncTranslationV2Schemas.d.ts → translateSyncV2Schemas.d.ts}
RENAMED
|
@@ -345,7 +345,6 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
345
345
|
}>, "atleastone">;
|
|
346
346
|
}, "strip", z.ZodTypeAny, {
|
|
347
347
|
sourceLocale: string;
|
|
348
|
-
targetLocale: string;
|
|
349
348
|
contentUnits: [{
|
|
350
349
|
id: string;
|
|
351
350
|
segments: [{
|
|
@@ -389,6 +388,7 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
389
388
|
} | undefined;
|
|
390
389
|
characterLimit?: number | undefined;
|
|
391
390
|
}[]];
|
|
391
|
+
targetLocale: string;
|
|
392
392
|
context?: {
|
|
393
393
|
description?: string | undefined;
|
|
394
394
|
styleGuide?: {
|
|
@@ -415,7 +415,6 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
415
415
|
integration?: "Claude" | "ChatGPT-4" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | undefined;
|
|
416
416
|
}, {
|
|
417
417
|
sourceLocale: string;
|
|
418
|
-
targetLocale: string;
|
|
419
418
|
contentUnits: [{
|
|
420
419
|
id: string;
|
|
421
420
|
segments: [{
|
|
@@ -459,6 +458,7 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
459
458
|
} | undefined;
|
|
460
459
|
characterLimit?: number | undefined;
|
|
461
460
|
}[]];
|
|
461
|
+
targetLocale: string;
|
|
462
462
|
context?: {
|
|
463
463
|
description?: string | undefined;
|
|
464
464
|
styleGuide?: {
|
|
@@ -485,7 +485,6 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
485
485
|
integration?: "Claude" | "ChatGPT-4" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | undefined;
|
|
486
486
|
}>, {
|
|
487
487
|
sourceLocale: string;
|
|
488
|
-
targetLocale: string;
|
|
489
488
|
contentUnits: [{
|
|
490
489
|
id: string;
|
|
491
490
|
segments: [{
|
|
@@ -529,6 +528,7 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
529
528
|
} | undefined;
|
|
530
529
|
characterLimit?: number | undefined;
|
|
531
530
|
}[]];
|
|
531
|
+
targetLocale: string;
|
|
532
532
|
context?: {
|
|
533
533
|
description?: string | undefined;
|
|
534
534
|
styleGuide?: {
|
|
@@ -555,7 +555,6 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
555
555
|
integration?: "Claude" | "ChatGPT-4" | "Gemini" | "DeepL" | "GoogleTranslate" | "MicrosoftTranslator" | undefined;
|
|
556
556
|
}, {
|
|
557
557
|
sourceLocale: string;
|
|
558
|
-
targetLocale: string;
|
|
559
558
|
contentUnits: [{
|
|
560
559
|
id: string;
|
|
561
560
|
segments: [{
|
|
@@ -599,6 +598,7 @@ export declare const TRANSLATE_SYNC_V2_BODY_SCHEMA: z.ZodEffects<z.ZodObject<{
|
|
|
599
598
|
} | undefined;
|
|
600
599
|
characterLimit?: number | undefined;
|
|
601
600
|
}[]];
|
|
601
|
+
targetLocale: string;
|
|
602
602
|
context?: {
|
|
603
603
|
description?: string | undefined;
|
|
604
604
|
styleGuide?: {
|