@lokalise/polyglot-sdk 9.1.0 → 10.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 +5 -5
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/sdk/PolyglotClient.d.ts +13 -11
- package/dist/sdk/PolyglotClient.js +80 -115
- package/dist/sdk/PolyglotClient.js.map +1 -1
- package/dist/sdk/errors/PolyglotError.d.ts +1 -1
- package/dist/sdk/schemas/lqa/lqaAsyncV1Schemas.d.ts +200 -0
- package/dist/sdk/schemas/lqa/lqaSyncV2Schemas.d.ts +200 -0
- package/dist/sdk/schemas/translation/translateAsyncV2Schemas.d.ts +2 -0
- package/dist/sdk/schemas/translation/translateSyncV2Schemas.d.ts +2 -0
- package/dist/sdk/types/client.d.ts +0 -10
- package/package.json +12 -11
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { PolyglotClient } from './sdk/PolyglotClient';
|
|
2
2
|
export { PolyglotError } from './sdk/errors/PolyglotError';
|
|
3
|
-
export
|
|
3
|
+
export type { ClientOptions, PolyglotClientConfig } from './sdk/types/client';
|
|
4
4
|
export { AiIntegrationEngineEnum, MtIntegrationEngineEnum, RealIntegrationEngineEnum, IntegrationEngineEnum, } from './sdk/schemas/common/commonSchemas';
|
|
5
5
|
export { TRANSLATION_CONTEXT_SCHEMA, isStructuredStyleGuide, } from './sdk/schemas/common/translationContextSchemas';
|
|
6
6
|
export type { StructuredStyleGuide, FreeformStyleGuide, StyleGuideData, TranslationContext, } from './sdk/schemas/common/translationContextSchemas';
|
|
@@ -9,7 +9,7 @@ export * from './sdk/schemas/lqa/lqaAsyncV1Schemas';
|
|
|
9
9
|
export * from './sdk/schemas/lqa/lqaSyncV2Schemas';
|
|
10
10
|
export * from './sdk/schemas/scoring/scoreV1Schemas';
|
|
11
11
|
export * from './sdk/schemas/translation/generateVariantsV1';
|
|
12
|
-
export { TRANSLATE_SYNC_V2_BODY_SCHEMA, TRANSLATE_SYNC_V2_HEADERS_SCHEMA, TRANSLATE_SYNC_V2_RESPONSE_SCHEMA, } from './sdk/schemas/translation/translateSyncV2Schemas';
|
|
13
|
-
export type { TranslateSyncV2Body, TranslateSyncV2Headers, TranslateSyncV2Response, } from './sdk/schemas/translation/translateSyncV2Schemas';
|
|
14
|
-
export { TRANSLATE_ASYNC_V2_BODY_SCHEMA, TRANSLATE_ASYNC_V2_HEADERS_SCHEMA, TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA, TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA, } from './sdk/schemas/translation/translateAsyncV2Schemas';
|
|
15
|
-
export type { TranslateAsyncV2Body, TranslateAsyncV2Headers, TranslateAsyncV2Response, TranslateAsyncV2Callback, } from './sdk/schemas/translation/translateAsyncV2Schemas';
|
|
12
|
+
export { TRANSLATE_SYNC_V2_BODY_SCHEMA, TRANSLATE_SYNC_V2_HEADERS_SCHEMA, TRANSLATE_SYNC_V2_RESPONSE_SCHEMA, TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA, TRANSLATE_SYNC_V2_SEGMENT_SCHEMA, } from './sdk/schemas/translation/translateSyncV2Schemas';
|
|
13
|
+
export type { TranslateSyncV2Body, TranslateSyncV2Headers, TranslateSyncV2Response, TranslateSyncV2ContentUnit, TranslateSyncV2Segment, } from './sdk/schemas/translation/translateSyncV2Schemas';
|
|
14
|
+
export { TRANSLATE_ASYNC_V2_BODY_SCHEMA, TRANSLATE_ASYNC_V2_HEADERS_SCHEMA, TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA, TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA, TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA, TRANSLATE_ASYNC_V2_SEGMENT_SCHEMA, } from './sdk/schemas/translation/translateAsyncV2Schemas';
|
|
15
|
+
export type { TranslateAsyncV2Body, TranslateAsyncV2Headers, TranslateAsyncV2Response, TranslateAsyncV2Callback, TranslateAsyncV2ContentUnit, TranslateAsyncV2Segment, } from './sdk/schemas/translation/translateAsyncV2Schemas';
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA = exports.TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA = exports.TRANSLATE_ASYNC_V2_HEADERS_SCHEMA = exports.TRANSLATE_ASYNC_V2_BODY_SCHEMA = exports.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA = exports.TRANSLATE_SYNC_V2_HEADERS_SCHEMA = exports.TRANSLATE_SYNC_V2_BODY_SCHEMA = exports.LqaIssueSeverityEnum = exports.LqaIssueCategoryEnum = exports.isStructuredStyleGuide = exports.TRANSLATION_CONTEXT_SCHEMA = exports.IntegrationEngineEnum = exports.RealIntegrationEngineEnum = exports.MtIntegrationEngineEnum = exports.AiIntegrationEngineEnum = exports.PolyglotError = exports.PolyglotClient = void 0;
|
|
3
|
+
exports.TRANSLATE_ASYNC_V2_SEGMENT_SCHEMA = exports.TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA = exports.TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA = exports.TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA = exports.TRANSLATE_ASYNC_V2_HEADERS_SCHEMA = exports.TRANSLATE_ASYNC_V2_BODY_SCHEMA = exports.TRANSLATE_SYNC_V2_SEGMENT_SCHEMA = exports.TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA = exports.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA = exports.TRANSLATE_SYNC_V2_HEADERS_SCHEMA = exports.TRANSLATE_SYNC_V2_BODY_SCHEMA = exports.LqaIssueSeverityEnum = exports.LqaIssueCategoryEnum = exports.isStructuredStyleGuide = exports.TRANSLATION_CONTEXT_SCHEMA = exports.IntegrationEngineEnum = exports.RealIntegrationEngineEnum = exports.MtIntegrationEngineEnum = exports.AiIntegrationEngineEnum = exports.PolyglotError = exports.PolyglotClient = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var PolyglotClient_1 = require("./sdk/PolyglotClient");
|
|
6
6
|
Object.defineProperty(exports, "PolyglotClient", { enumerable: true, get: function () { return PolyglotClient_1.PolyglotClient; } });
|
|
7
7
|
var PolyglotError_1 = require("./sdk/errors/PolyglotError");
|
|
8
8
|
Object.defineProperty(exports, "PolyglotError", { enumerable: true, get: function () { return PolyglotError_1.PolyglotError; } });
|
|
9
|
-
tslib_1.__exportStar(require("./sdk/types/client"), exports);
|
|
10
9
|
var commonSchemas_1 = require("./sdk/schemas/common/commonSchemas");
|
|
11
10
|
Object.defineProperty(exports, "AiIntegrationEngineEnum", { enumerable: true, get: function () { return commonSchemas_1.AiIntegrationEngineEnum; } });
|
|
12
11
|
Object.defineProperty(exports, "MtIntegrationEngineEnum", { enumerable: true, get: function () { return commonSchemas_1.MtIntegrationEngineEnum; } });
|
|
@@ -26,9 +25,13 @@ var translateSyncV2Schemas_1 = require("./sdk/schemas/translation/translateSyncV
|
|
|
26
25
|
Object.defineProperty(exports, "TRANSLATE_SYNC_V2_BODY_SCHEMA", { enumerable: true, get: function () { return translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_BODY_SCHEMA; } });
|
|
27
26
|
Object.defineProperty(exports, "TRANSLATE_SYNC_V2_HEADERS_SCHEMA", { enumerable: true, get: function () { return translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_HEADERS_SCHEMA; } });
|
|
28
27
|
Object.defineProperty(exports, "TRANSLATE_SYNC_V2_RESPONSE_SCHEMA", { enumerable: true, get: function () { return translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA; } });
|
|
28
|
+
Object.defineProperty(exports, "TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA", { enumerable: true, get: function () { return translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA; } });
|
|
29
|
+
Object.defineProperty(exports, "TRANSLATE_SYNC_V2_SEGMENT_SCHEMA", { enumerable: true, get: function () { return translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_SEGMENT_SCHEMA; } });
|
|
29
30
|
var translateAsyncV2Schemas_1 = require("./sdk/schemas/translation/translateAsyncV2Schemas");
|
|
30
31
|
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_BODY_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_BODY_SCHEMA; } });
|
|
31
32
|
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_HEADERS_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_HEADERS_SCHEMA; } });
|
|
32
33
|
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA; } });
|
|
33
34
|
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA; } });
|
|
35
|
+
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA; } });
|
|
36
|
+
Object.defineProperty(exports, "TRANSLATE_ASYNC_V2_SEGMENT_SCHEMA", { enumerable: true, get: function () { return translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_SEGMENT_SCHEMA; } });
|
|
34
37
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uDAAqD;AAA5C,gHAAA,cAAc,OAAA;AACvB,4DAA0D;AAAjD,8GAAA,aAAa,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,uDAAqD;AAA5C,gHAAA,cAAc,OAAA;AACvB,4DAA0D;AAAjD,8GAAA,aAAa,OAAA;AAGtB,oEAK2C;AAJzC,wHAAA,uBAAuB,OAAA;AACvB,wHAAA,uBAAuB,OAAA;AACvB,0HAAA,yBAAyB,OAAA;AACzB,sHAAA,qBAAqB,OAAA;AAEvB,4FAGuD;AAFrD,uIAAA,0BAA0B,OAAA;AAC1B,mIAAA,sBAAsB,OAAA;AASxB,iEAA4F;AAAnF,qHAAA,oBAAoB,OAAA;AAAE,qHAAA,oBAAoB,OAAA;AACnD,8EAAmD;AACnD,6EAAkD;AAClD,+EAAoD;AACpD,uFAA4D;AAE5D,2FAMyD;AALvD,uIAAA,6BAA6B,OAAA;AAC7B,0IAAA,gCAAgC,OAAA;AAChC,2IAAA,iCAAiC,OAAA;AACjC,+IAAA,qCAAqC,OAAA;AACrC,0IAAA,gCAAgC,OAAA;AAUlC,6FAO0D;AANxD,yIAAA,8BAA8B,OAAA;AAC9B,4IAAA,iCAAiC,OAAA;AACjC,6IAAA,kCAAkC,OAAA;AAClC,6IAAA,kCAAkC,OAAA;AAClC,iJAAA,sCAAsC,OAAA;AACtC,4IAAA,iCAAiC,OAAA"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import type { Either } from '@lokalise/node-core';
|
|
2
|
-
import
|
|
2
|
+
import { InternalError } from '@lokalise/node-core';
|
|
3
|
+
import { PolyglotError } from './errors/PolyglotError';
|
|
3
4
|
import type { LqaAsyncV1Body, LqaAsyncV1Response } from './schemas/lqa/lqaAsyncV1Schemas';
|
|
4
5
|
import type { LqaSyncV2Body, LqaSyncV2Response } from './schemas/lqa/lqaSyncV2Schemas';
|
|
5
6
|
import type { ScoreV1Body, ScoreV1Response } from './schemas/scoring/scoreV1Schemas';
|
|
6
|
-
import type { GenerateVariantsV1Body } from './schemas/translation/generateVariantsV1';
|
|
7
|
+
import type { GenerateVariantsV1Body, GenerateVariantsV1Response } from './schemas/translation/generateVariantsV1';
|
|
7
8
|
import type { TranslateAsyncV2Body, TranslateAsyncV2Response } from './schemas/translation/translateAsyncV2Schemas';
|
|
8
9
|
import type { TranslateSyncV2Body, TranslateSyncV2Response } from './schemas/translation/translateSyncV2Schemas';
|
|
9
|
-
import type { ClientOptions,
|
|
10
|
+
import type { ClientOptions, PolyglotClientConfig } from './types/client';
|
|
11
|
+
type InstrumentationOutput<T> = Either<PolyglotError | InternalError, T>;
|
|
10
12
|
export declare class PolyglotClient {
|
|
11
13
|
private readonly client;
|
|
12
14
|
private readonly clientHeaders;
|
|
@@ -17,17 +19,16 @@ export declare class PolyglotClient {
|
|
|
17
19
|
* Re-translates a given translation pair and provides several different variants. Can take previously generated
|
|
18
20
|
* variants as an input - in attempt to avoid repetition.
|
|
19
21
|
*/
|
|
20
|
-
generateVariants(request: GenerateVariantsV1Body, options?: ClientOptions): Promise<
|
|
22
|
+
generateVariants(request: GenerateVariantsV1Body, options?: ClientOptions): Promise<InstrumentationOutput<GenerateVariantsV1Response>>;
|
|
21
23
|
/**
|
|
22
24
|
* Scores passed translations
|
|
23
25
|
*/
|
|
24
|
-
scoreTranslations(request: ScoreV1Body, options?: ClientOptions): Promise<ScoreV1Response
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
lqaAsync(requestBody: LqaAsyncV1Body, options
|
|
28
|
-
lqaSync(requestBody: LqaSyncV2Body, options
|
|
29
|
-
private
|
|
30
|
-
private wrapWithErrorHandling;
|
|
26
|
+
scoreTranslations(request: ScoreV1Body, options?: ClientOptions): Promise<InstrumentationOutput<ScoreV1Response>>;
|
|
27
|
+
translateAsync(requestBody: TranslateAsyncV2Body, options?: ClientOptions): Promise<InstrumentationOutput<TranslateAsyncV2Response>>;
|
|
28
|
+
translateSync(requestBody: TranslateSyncV2Body, options?: ClientOptions): Promise<InstrumentationOutput<TranslateSyncV2Response>>;
|
|
29
|
+
lqaAsync(requestBody: LqaAsyncV1Body, options?: ClientOptions): Promise<InstrumentationOutput<LqaAsyncV1Response>>;
|
|
30
|
+
lqaSync(requestBody: LqaSyncV2Body, options?: ClientOptions): Promise<InstrumentationOutput<LqaSyncV2Response>>;
|
|
31
|
+
private getRequestOptions;
|
|
31
32
|
/**
|
|
32
33
|
* Calls the provided request function and logs the execution time and metadata with the provided logger
|
|
33
34
|
* @private
|
|
@@ -35,3 +36,4 @@ export declare class PolyglotClient {
|
|
|
35
36
|
private wrapWithInstrumentation;
|
|
36
37
|
private wrapError;
|
|
37
38
|
}
|
|
39
|
+
export {};
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PolyglotClient = void 0;
|
|
4
|
+
const backend_http_client_1 = require("@lokalise/backend-http-client");
|
|
4
5
|
const node_core_1 = require("@lokalise/node-core");
|
|
5
|
-
const typeUtils_1 = require("@lokalise/node-core/dist/src/utils/typeUtils");
|
|
6
6
|
const PolyglotError_1 = require("./errors/PolyglotError");
|
|
7
|
+
const lqaSyncV2Schemas_1 = require("./schemas/lqa/lqaSyncV2Schemas");
|
|
8
|
+
const scoreV1Schemas_1 = require("./schemas/scoring/scoreV1Schemas");
|
|
9
|
+
const generateVariantsV1_1 = require("./schemas/translation/generateVariantsV1");
|
|
10
|
+
const translateAsyncV2Schemas_1 = require("./schemas/translation/translateAsyncV2Schemas");
|
|
11
|
+
const translateSyncV2Schemas_1 = require("./schemas/translation/translateSyncV2Schemas");
|
|
7
12
|
const DEFAULT_CLIENT_OPTIONS = {
|
|
8
13
|
timeout: 30000,
|
|
9
14
|
};
|
|
@@ -19,7 +24,7 @@ class PolyglotClient {
|
|
|
19
24
|
retryConfig;
|
|
20
25
|
logger;
|
|
21
26
|
constructor({ baseUrl, jwtToken, retryConfig, logger }) {
|
|
22
|
-
this.client = (0,
|
|
27
|
+
this.client = (0, backend_http_client_1.buildClient)(baseUrl);
|
|
23
28
|
this.clientHeaders = {
|
|
24
29
|
'Content-Type': 'application/json',
|
|
25
30
|
Authorization: `Bearer ${jwtToken}`,
|
|
@@ -46,20 +51,12 @@ class PolyglotClient {
|
|
|
46
51
|
*/
|
|
47
52
|
async generateVariants(request, options = DEFAULT_CLIENT_OPTIONS) {
|
|
48
53
|
const resolvedOptions = resolveOptions(options);
|
|
49
|
-
if (request.sourceValue.trim() === '' || request.targetValue.trim() === '') {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
54
|
const requestLabel = 'Generate variants (Polyglot)';
|
|
53
|
-
|
|
54
|
-
return (0,
|
|
55
|
-
|
|
56
|
-
retryConfig: this.retryConfig,
|
|
57
|
-
timeout: resolvedOptions.timeout,
|
|
58
|
-
headers: {
|
|
59
|
-
...this.clientHeaders,
|
|
60
|
-
'x-fake-processing': resolvedOptions.fakeProcessing ? 'true' : undefined,
|
|
61
|
-
},
|
|
55
|
+
return await this.wrapWithInstrumentation(() => {
|
|
56
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v1/content/actions/generate-variants', request, {
|
|
57
|
+
...this.getRequestOptions(resolvedOptions),
|
|
62
58
|
requestLabel,
|
|
59
|
+
responseSchema: generateVariantsV1_1.GENERATE_VARIANTS_V1_RESPONSE_SCHEMA,
|
|
63
60
|
});
|
|
64
61
|
}, {
|
|
65
62
|
requestLabel,
|
|
@@ -72,7 +69,6 @@ class PolyglotClient {
|
|
|
72
69
|
}),
|
|
73
70
|
},
|
|
74
71
|
});
|
|
75
|
-
return response.body.variants;
|
|
76
72
|
}
|
|
77
73
|
/**
|
|
78
74
|
* Scores passed translations
|
|
@@ -80,16 +76,11 @@ class PolyglotClient {
|
|
|
80
76
|
async scoreTranslations(request, options = DEFAULT_CLIENT_OPTIONS) {
|
|
81
77
|
const resolvedOptions = resolveOptions(options);
|
|
82
78
|
const requestLabel = 'Score translations (Polyglot)';
|
|
83
|
-
|
|
84
|
-
return (0,
|
|
85
|
-
|
|
86
|
-
retryConfig: this.retryConfig,
|
|
87
|
-
timeout: resolvedOptions.timeout,
|
|
88
|
-
headers: {
|
|
89
|
-
...this.clientHeaders,
|
|
90
|
-
'x-fake-processing': resolvedOptions.fakeProcessing ? 'true' : undefined,
|
|
91
|
-
},
|
|
79
|
+
return await this.wrapWithInstrumentation(() => {
|
|
80
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v1/content/actions/score', request, {
|
|
81
|
+
...this.getRequestOptions(resolvedOptions),
|
|
92
82
|
requestLabel,
|
|
83
|
+
responseSchema: scoreV1Schemas_1.SCORE_V1_RESPONSE_SCHEMA,
|
|
93
84
|
});
|
|
94
85
|
}, {
|
|
95
86
|
requestLabel,
|
|
@@ -100,21 +91,15 @@ class PolyglotClient {
|
|
|
100
91
|
}),
|
|
101
92
|
},
|
|
102
93
|
});
|
|
103
|
-
return response.body;
|
|
104
94
|
}
|
|
105
|
-
async
|
|
95
|
+
async translateAsync(requestBody, options = DEFAULT_CLIENT_OPTIONS) {
|
|
106
96
|
const resolvedOptions = resolveOptions(options);
|
|
107
|
-
const requestLabel = 'Translate
|
|
97
|
+
const requestLabel = 'Translate asynchronously (Polyglot)';
|
|
108
98
|
return await this.wrapWithInstrumentation(() => {
|
|
109
|
-
return (0,
|
|
110
|
-
|
|
111
|
-
retryConfig: this.retryConfig,
|
|
112
|
-
timeout: resolvedOptions.timeout,
|
|
113
|
-
headers: {
|
|
114
|
-
...this.clientHeaders,
|
|
115
|
-
'x-fake-processing': resolvedOptions.fakeProcessing ? 'true' : undefined,
|
|
116
|
-
},
|
|
99
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v2/content/actions/translate-async', requestBody, {
|
|
100
|
+
...this.getRequestOptions(resolvedOptions),
|
|
117
101
|
requestLabel,
|
|
102
|
+
responseSchema: translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA,
|
|
118
103
|
});
|
|
119
104
|
}, {
|
|
120
105
|
requestLabel,
|
|
@@ -127,49 +112,34 @@ class PolyglotClient {
|
|
|
127
112
|
},
|
|
128
113
|
});
|
|
129
114
|
}
|
|
130
|
-
async
|
|
131
|
-
const
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
tenantId: requestBody.tenantId,
|
|
139
|
-
ownerId: requestBody.ownerId,
|
|
140
|
-
},
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
async lqaAsync(requestBody, options) {
|
|
146
|
-
const result = await this.callAsyncApi('/v1/content/actions/lqa-async', requestBody, options, 'LQA asynchronously (Polyglot)');
|
|
147
|
-
if (result.error === null) {
|
|
148
|
-
result.error = new node_core_1.InternalError({
|
|
149
|
-
message: 'Failed to schedule asynchronous LQA',
|
|
150
|
-
errorCode: 'FAILED_TO_SCHEDULE_ASYNC_LQA',
|
|
151
|
-
details: {
|
|
152
|
-
originCorrelationId: requestBody.originCorrelationId,
|
|
153
|
-
tenantId: requestBody.tenantId,
|
|
154
|
-
ownerId: requestBody.ownerId,
|
|
155
|
-
},
|
|
115
|
+
async translateSync(requestBody, options = DEFAULT_CLIENT_OPTIONS) {
|
|
116
|
+
const resolvedOptions = resolveOptions(options);
|
|
117
|
+
const requestLabel = 'Translate synchronously (Polyglot)';
|
|
118
|
+
return await this.wrapWithInstrumentation(() => {
|
|
119
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v2/content/actions/translate-sync', requestBody, {
|
|
120
|
+
...this.getRequestOptions(resolvedOptions),
|
|
121
|
+
requestLabel,
|
|
122
|
+
responseSchema: translateSyncV2Schemas_1.TRANSLATE_SYNC_V2_RESPONSE_SCHEMA,
|
|
156
123
|
});
|
|
157
|
-
}
|
|
158
|
-
|
|
124
|
+
}, {
|
|
125
|
+
requestLabel,
|
|
126
|
+
callMetadata: {
|
|
127
|
+
...resolvedOptions.metadata,
|
|
128
|
+
fakeProcessing: JSON.stringify(resolvedOptions.fakeProcessing),
|
|
129
|
+
reqContext: JSON.stringify({
|
|
130
|
+
reqId: resolvedOptions.reqContext?.reqId,
|
|
131
|
+
}),
|
|
132
|
+
},
|
|
133
|
+
});
|
|
159
134
|
}
|
|
160
|
-
async
|
|
135
|
+
async lqaAsync(requestBody, options = DEFAULT_CLIENT_OPTIONS) {
|
|
161
136
|
const resolvedOptions = resolveOptions(options);
|
|
162
|
-
const requestLabel = 'LQA
|
|
137
|
+
const requestLabel = 'LQA asynchronously (Polyglot)';
|
|
163
138
|
return await this.wrapWithInstrumentation(() => {
|
|
164
|
-
return (0,
|
|
165
|
-
|
|
166
|
-
retryConfig: this.retryConfig,
|
|
167
|
-
timeout: resolvedOptions.timeout,
|
|
168
|
-
headers: {
|
|
169
|
-
...this.clientHeaders,
|
|
170
|
-
'x-fake-processing': resolvedOptions.fakeProcessing ? 'true' : undefined,
|
|
171
|
-
},
|
|
139
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v1/content/actions/lqa-async', requestBody, {
|
|
140
|
+
...this.getRequestOptions(resolvedOptions),
|
|
172
141
|
requestLabel,
|
|
142
|
+
responseSchema: translateAsyncV2Schemas_1.TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA,
|
|
173
143
|
});
|
|
174
144
|
}, {
|
|
175
145
|
requestLabel,
|
|
@@ -182,36 +152,36 @@ class PolyglotClient {
|
|
|
182
152
|
},
|
|
183
153
|
});
|
|
184
154
|
}
|
|
185
|
-
async
|
|
155
|
+
async lqaSync(requestBody, options = DEFAULT_CLIENT_OPTIONS) {
|
|
186
156
|
const resolvedOptions = resolveOptions(options);
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
throwOnError: false,
|
|
192
|
-
timeout: resolvedOptions.timeout,
|
|
193
|
-
headers: {
|
|
194
|
-
...this.clientHeaders,
|
|
195
|
-
'x-fake-processing': resolvedOptions.fakeProcessing ? 'true' : undefined,
|
|
196
|
-
},
|
|
157
|
+
const requestLabel = 'LQA synchronously (Polyglot)';
|
|
158
|
+
return await this.wrapWithInstrumentation(() => {
|
|
159
|
+
return (0, backend_http_client_1.sendPost)(this.client, '/v2/content/actions/lqa-sync', requestBody, {
|
|
160
|
+
...this.getRequestOptions(resolvedOptions),
|
|
197
161
|
requestLabel,
|
|
162
|
+
responseSchema: lqaSyncV2Schemas_1.LQA_SYNC_V2_RESPONSE_SCHEMA,
|
|
198
163
|
});
|
|
164
|
+
}, {
|
|
165
|
+
requestLabel,
|
|
166
|
+
callMetadata: {
|
|
167
|
+
...resolvedOptions.metadata,
|
|
168
|
+
fakeProcessing: JSON.stringify(resolvedOptions.fakeProcessing),
|
|
169
|
+
reqContext: JSON.stringify({
|
|
170
|
+
reqId: resolvedOptions.reqContext?.reqId,
|
|
171
|
+
}),
|
|
172
|
+
},
|
|
199
173
|
});
|
|
200
|
-
if (result.error)
|
|
201
|
-
return result;
|
|
202
|
-
return result.result.statusCode === 202 ? (0, node_core_1.success)(result.result.body) : (0, node_core_1.failure)(null);
|
|
203
174
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
175
|
+
getRequestOptions(options) {
|
|
176
|
+
return {
|
|
177
|
+
reqContext: options.reqContext,
|
|
178
|
+
retryConfig: this.retryConfig,
|
|
179
|
+
timeout: options.timeout,
|
|
180
|
+
headers: {
|
|
181
|
+
...this.clientHeaders,
|
|
182
|
+
'x-fake-processing': options.fakeProcessing ? 'true' : undefined,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
215
185
|
}
|
|
216
186
|
/**
|
|
217
187
|
* Calls the provided request function and logs the execution time and metadata with the provided logger
|
|
@@ -224,14 +194,13 @@ class PolyglotClient {
|
|
|
224
194
|
const { result, error } = await innerFn();
|
|
225
195
|
// We might receive an non-satisfactory response, but it might not be an Error object - so we have to wrap it
|
|
226
196
|
if (error) {
|
|
227
|
-
|
|
228
|
-
throw error;
|
|
197
|
+
return { error: this.wrapError(error) };
|
|
229
198
|
}
|
|
230
199
|
successful = true;
|
|
231
|
-
return result;
|
|
200
|
+
return { result: result.body };
|
|
232
201
|
}
|
|
233
|
-
catch (
|
|
234
|
-
|
|
202
|
+
catch (err) {
|
|
203
|
+
return { error: this.wrapError(err) };
|
|
235
204
|
}
|
|
236
205
|
finally {
|
|
237
206
|
this.logger?.info({
|
|
@@ -242,19 +211,15 @@ class PolyglotClient {
|
|
|
242
211
|
});
|
|
243
212
|
}
|
|
244
213
|
}
|
|
245
|
-
wrapError(
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
error = (0, node_core_1.isResponseStatusError)(e) ? new PolyglotError_1.PolyglotError(e) : e;
|
|
214
|
+
wrapError(err) {
|
|
215
|
+
if ((0, backend_http_client_1.isResponseStatusError)(err)) {
|
|
216
|
+
return new PolyglotError_1.PolyglotError(err);
|
|
249
217
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
return error;
|
|
218
|
+
return new node_core_1.InternalError({
|
|
219
|
+
message: 'Unknown error',
|
|
220
|
+
errorCode: 'UNKNOWN_ERROR',
|
|
221
|
+
details: { error: JSON.stringify(err) },
|
|
222
|
+
});
|
|
258
223
|
}
|
|
259
224
|
}
|
|
260
225
|
exports.PolyglotClient = PolyglotClient;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PolyglotClient.js","sourceRoot":"","sources":["../../src/sdk/PolyglotClient.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"PolyglotClient.js","sourceRoot":"","sources":["../../src/sdk/PolyglotClient.ts"],"names":[],"mappings":";;;AAAA,uEAA4F;AAE5F,mDA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AAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAA;QACvC,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC;gBAChB,GAAG,YAAY;gBACf,UAAU;gBACV,GAAG,EAAE,aAAa,YAAY,EAAE;gBAChC,QAAQ,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS;aACxC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;IAEO,SAAS,CAAC,GAAY;QAC5B,IAAI,IAAA,2CAAqB,EAAC,GAAG,CAAC,EAAE,CAAC;YAC/B,OAAO,IAAI,6BAAa,CAAC,GAAG,CAAC,CAAA;QAC/B,CAAC;QAED,OAAO,IAAI,yBAAa,CAAC;YACvB,OAAO,EAAE,eAAe;YACxB,SAAS,EAAE,eAAe;YAC1B,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;SACxC,CAAC,CAAA;IACJ,CAAC;CACF;AApQD,wCAoQC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ResponseStatusError } from '@lokalise/
|
|
1
|
+
import type { ResponseStatusError } from '@lokalise/backend-http-client';
|
|
2
2
|
import { InternalError } from '@lokalise/node-core';
|
|
3
3
|
export declare class PolyglotError extends InternalError {
|
|
4
4
|
constructor(error: ResponseStatusError);
|
|
@@ -1,4 +1,201 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
declare const LQA_SEGMENT_SCHEMA: z.ZodObject<{
|
|
3
|
+
sourceValue: z.ZodString;
|
|
4
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
locale: z.ZodEffects<z.ZodString, string, string>;
|
|
7
|
+
value: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
value: string;
|
|
10
|
+
locale: string;
|
|
11
|
+
id: string;
|
|
12
|
+
}, {
|
|
13
|
+
value: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
sourceValue: z.ZodString;
|
|
19
|
+
translatedValue: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
sourceValue: string;
|
|
22
|
+
translatedValue: string;
|
|
23
|
+
}, {
|
|
24
|
+
sourceValue: string;
|
|
25
|
+
translatedValue: string;
|
|
26
|
+
}>>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
sourceValue: string;
|
|
29
|
+
translations: [{
|
|
30
|
+
value: string;
|
|
31
|
+
locale: string;
|
|
32
|
+
id: string;
|
|
33
|
+
}, ...{
|
|
34
|
+
value: string;
|
|
35
|
+
locale: string;
|
|
36
|
+
id: string;
|
|
37
|
+
}[]];
|
|
38
|
+
tmMatch?: {
|
|
39
|
+
sourceValue: string;
|
|
40
|
+
translatedValue: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
sourceValue: string;
|
|
44
|
+
translations: [{
|
|
45
|
+
value: string;
|
|
46
|
+
locale: string;
|
|
47
|
+
id: string;
|
|
48
|
+
}, ...{
|
|
49
|
+
value: string;
|
|
50
|
+
locale: string;
|
|
51
|
+
id: string;
|
|
52
|
+
}[]];
|
|
53
|
+
tmMatch?: {
|
|
54
|
+
sourceValue: string;
|
|
55
|
+
translatedValue: string;
|
|
56
|
+
} | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
declare const LQA_CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
}>>;
|
|
67
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
68
|
+
sourceValue: z.ZodString;
|
|
69
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
locale: z.ZodEffects<z.ZodString, string, string>;
|
|
72
|
+
value: z.ZodString;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
value: string;
|
|
75
|
+
locale: string;
|
|
76
|
+
id: string;
|
|
77
|
+
}, {
|
|
78
|
+
value: string;
|
|
79
|
+
locale: string;
|
|
80
|
+
id: string;
|
|
81
|
+
}>, "atleastone">;
|
|
82
|
+
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
83
|
+
sourceValue: z.ZodString;
|
|
84
|
+
translatedValue: z.ZodString;
|
|
85
|
+
}, "strip", z.ZodTypeAny, {
|
|
86
|
+
sourceValue: string;
|
|
87
|
+
translatedValue: string;
|
|
88
|
+
}, {
|
|
89
|
+
sourceValue: string;
|
|
90
|
+
translatedValue: string;
|
|
91
|
+
}>>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
sourceValue: string;
|
|
94
|
+
translations: [{
|
|
95
|
+
value: string;
|
|
96
|
+
locale: string;
|
|
97
|
+
id: string;
|
|
98
|
+
}, ...{
|
|
99
|
+
value: string;
|
|
100
|
+
locale: string;
|
|
101
|
+
id: string;
|
|
102
|
+
}[]];
|
|
103
|
+
tmMatch?: {
|
|
104
|
+
sourceValue: string;
|
|
105
|
+
translatedValue: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
}, {
|
|
108
|
+
sourceValue: string;
|
|
109
|
+
translations: [{
|
|
110
|
+
value: string;
|
|
111
|
+
locale: string;
|
|
112
|
+
id: string;
|
|
113
|
+
}, ...{
|
|
114
|
+
value: string;
|
|
115
|
+
locale: string;
|
|
116
|
+
id: string;
|
|
117
|
+
}[]];
|
|
118
|
+
tmMatch?: {
|
|
119
|
+
sourceValue: string;
|
|
120
|
+
translatedValue: string;
|
|
121
|
+
} | undefined;
|
|
122
|
+
}>, "atleastone">;
|
|
123
|
+
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
id: string;
|
|
126
|
+
segments: [{
|
|
127
|
+
sourceValue: string;
|
|
128
|
+
translations: [{
|
|
129
|
+
value: string;
|
|
130
|
+
locale: string;
|
|
131
|
+
id: string;
|
|
132
|
+
}, ...{
|
|
133
|
+
value: string;
|
|
134
|
+
locale: string;
|
|
135
|
+
id: string;
|
|
136
|
+
}[]];
|
|
137
|
+
tmMatch?: {
|
|
138
|
+
sourceValue: string;
|
|
139
|
+
translatedValue: string;
|
|
140
|
+
} | undefined;
|
|
141
|
+
}, ...{
|
|
142
|
+
sourceValue: string;
|
|
143
|
+
translations: [{
|
|
144
|
+
value: string;
|
|
145
|
+
locale: string;
|
|
146
|
+
id: string;
|
|
147
|
+
}, ...{
|
|
148
|
+
value: string;
|
|
149
|
+
locale: string;
|
|
150
|
+
id: string;
|
|
151
|
+
}[]];
|
|
152
|
+
tmMatch?: {
|
|
153
|
+
sourceValue: string;
|
|
154
|
+
translatedValue: string;
|
|
155
|
+
} | undefined;
|
|
156
|
+
}[]];
|
|
157
|
+
context?: {
|
|
158
|
+
description?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
characterLimit?: number | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
id: string;
|
|
163
|
+
segments: [{
|
|
164
|
+
sourceValue: string;
|
|
165
|
+
translations: [{
|
|
166
|
+
value: string;
|
|
167
|
+
locale: string;
|
|
168
|
+
id: string;
|
|
169
|
+
}, ...{
|
|
170
|
+
value: string;
|
|
171
|
+
locale: string;
|
|
172
|
+
id: string;
|
|
173
|
+
}[]];
|
|
174
|
+
tmMatch?: {
|
|
175
|
+
sourceValue: string;
|
|
176
|
+
translatedValue: string;
|
|
177
|
+
} | undefined;
|
|
178
|
+
}, ...{
|
|
179
|
+
sourceValue: string;
|
|
180
|
+
translations: [{
|
|
181
|
+
value: string;
|
|
182
|
+
locale: string;
|
|
183
|
+
id: string;
|
|
184
|
+
}, ...{
|
|
185
|
+
value: string;
|
|
186
|
+
locale: string;
|
|
187
|
+
id: string;
|
|
188
|
+
}[]];
|
|
189
|
+
tmMatch?: {
|
|
190
|
+
sourceValue: string;
|
|
191
|
+
translatedValue: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
}[]];
|
|
194
|
+
context?: {
|
|
195
|
+
description?: string | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
characterLimit?: number | undefined;
|
|
198
|
+
}>;
|
|
2
199
|
export declare const LQA_ASYNC_V1_BODY_SCHEMA: z.ZodObject<z.objectUtil.extendShape<{
|
|
3
200
|
originCorrelationId: z.ZodString;
|
|
4
201
|
ownerId: z.ZodString;
|
|
@@ -644,3 +841,6 @@ export type LqaAsyncV1Body = z.infer<typeof LQA_ASYNC_V1_BODY_SCHEMA>;
|
|
|
644
841
|
export type LqaAsyncV1Headers = z.infer<typeof LQA_ASYNC_V1_HEADERS_SCHEMA>;
|
|
645
842
|
export type LqaAsyncV1Response = z.infer<typeof LQA_ASYNC_V1_RESPONSE_SCHEMA>;
|
|
646
843
|
export type LqaAsyncV1CallbackBody = z.infer<typeof LQA_ASYNC_V1_CALLBACK_SCHEMA>;
|
|
844
|
+
export type LqaAsyncV1ContentUnit = z.infer<typeof LQA_CONTENT_UNIT_SCHEMA>;
|
|
845
|
+
export type LqaAsyncV1Segment = z.infer<typeof LQA_SEGMENT_SCHEMA>;
|
|
846
|
+
export {};
|
|
@@ -1,4 +1,201 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
declare const SEGMENT_SCHEMA: z.ZodObject<{
|
|
3
|
+
sourceValue: z.ZodString;
|
|
4
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
5
|
+
id: z.ZodString;
|
|
6
|
+
locale: z.ZodEffects<z.ZodString, string, string>;
|
|
7
|
+
value: z.ZodString;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
value: string;
|
|
10
|
+
locale: string;
|
|
11
|
+
id: string;
|
|
12
|
+
}, {
|
|
13
|
+
value: string;
|
|
14
|
+
locale: string;
|
|
15
|
+
id: string;
|
|
16
|
+
}>, "atleastone">;
|
|
17
|
+
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
18
|
+
sourceValue: z.ZodString;
|
|
19
|
+
translatedValue: z.ZodString;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
sourceValue: string;
|
|
22
|
+
translatedValue: string;
|
|
23
|
+
}, {
|
|
24
|
+
sourceValue: string;
|
|
25
|
+
translatedValue: string;
|
|
26
|
+
}>>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
sourceValue: string;
|
|
29
|
+
translations: [{
|
|
30
|
+
value: string;
|
|
31
|
+
locale: string;
|
|
32
|
+
id: string;
|
|
33
|
+
}, ...{
|
|
34
|
+
value: string;
|
|
35
|
+
locale: string;
|
|
36
|
+
id: string;
|
|
37
|
+
}[]];
|
|
38
|
+
tmMatch?: {
|
|
39
|
+
sourceValue: string;
|
|
40
|
+
translatedValue: string;
|
|
41
|
+
} | undefined;
|
|
42
|
+
}, {
|
|
43
|
+
sourceValue: string;
|
|
44
|
+
translations: [{
|
|
45
|
+
value: string;
|
|
46
|
+
locale: string;
|
|
47
|
+
id: string;
|
|
48
|
+
}, ...{
|
|
49
|
+
value: string;
|
|
50
|
+
locale: string;
|
|
51
|
+
id: string;
|
|
52
|
+
}[]];
|
|
53
|
+
tmMatch?: {
|
|
54
|
+
sourceValue: string;
|
|
55
|
+
translatedValue: string;
|
|
56
|
+
} | undefined;
|
|
57
|
+
}>;
|
|
58
|
+
declare const CONTENT_UNIT_SCHEMA: z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
context: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
description: z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
description?: string | undefined;
|
|
64
|
+
}, {
|
|
65
|
+
description?: string | undefined;
|
|
66
|
+
}>>;
|
|
67
|
+
characterLimit: z.ZodOptional<z.ZodNumber>;
|
|
68
|
+
segments: z.ZodArray<z.ZodObject<{
|
|
69
|
+
sourceValue: z.ZodString;
|
|
70
|
+
translations: z.ZodArray<z.ZodObject<{
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
locale: z.ZodEffects<z.ZodString, string, string>;
|
|
73
|
+
value: z.ZodString;
|
|
74
|
+
}, "strip", z.ZodTypeAny, {
|
|
75
|
+
value: string;
|
|
76
|
+
locale: string;
|
|
77
|
+
id: string;
|
|
78
|
+
}, {
|
|
79
|
+
value: string;
|
|
80
|
+
locale: string;
|
|
81
|
+
id: string;
|
|
82
|
+
}>, "atleastone">;
|
|
83
|
+
tmMatch: z.ZodOptional<z.ZodObject<{
|
|
84
|
+
sourceValue: z.ZodString;
|
|
85
|
+
translatedValue: z.ZodString;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
sourceValue: string;
|
|
88
|
+
translatedValue: string;
|
|
89
|
+
}, {
|
|
90
|
+
sourceValue: string;
|
|
91
|
+
translatedValue: string;
|
|
92
|
+
}>>;
|
|
93
|
+
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
sourceValue: string;
|
|
95
|
+
translations: [{
|
|
96
|
+
value: string;
|
|
97
|
+
locale: string;
|
|
98
|
+
id: string;
|
|
99
|
+
}, ...{
|
|
100
|
+
value: string;
|
|
101
|
+
locale: string;
|
|
102
|
+
id: string;
|
|
103
|
+
}[]];
|
|
104
|
+
tmMatch?: {
|
|
105
|
+
sourceValue: string;
|
|
106
|
+
translatedValue: string;
|
|
107
|
+
} | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
sourceValue: string;
|
|
110
|
+
translations: [{
|
|
111
|
+
value: string;
|
|
112
|
+
locale: string;
|
|
113
|
+
id: string;
|
|
114
|
+
}, ...{
|
|
115
|
+
value: string;
|
|
116
|
+
locale: string;
|
|
117
|
+
id: string;
|
|
118
|
+
}[]];
|
|
119
|
+
tmMatch?: {
|
|
120
|
+
sourceValue: string;
|
|
121
|
+
translatedValue: string;
|
|
122
|
+
} | undefined;
|
|
123
|
+
}>, "atleastone">;
|
|
124
|
+
}, "strip", z.ZodTypeAny, {
|
|
125
|
+
id: string;
|
|
126
|
+
segments: [{
|
|
127
|
+
sourceValue: string;
|
|
128
|
+
translations: [{
|
|
129
|
+
value: string;
|
|
130
|
+
locale: string;
|
|
131
|
+
id: string;
|
|
132
|
+
}, ...{
|
|
133
|
+
value: string;
|
|
134
|
+
locale: string;
|
|
135
|
+
id: string;
|
|
136
|
+
}[]];
|
|
137
|
+
tmMatch?: {
|
|
138
|
+
sourceValue: string;
|
|
139
|
+
translatedValue: string;
|
|
140
|
+
} | undefined;
|
|
141
|
+
}, ...{
|
|
142
|
+
sourceValue: string;
|
|
143
|
+
translations: [{
|
|
144
|
+
value: string;
|
|
145
|
+
locale: string;
|
|
146
|
+
id: string;
|
|
147
|
+
}, ...{
|
|
148
|
+
value: string;
|
|
149
|
+
locale: string;
|
|
150
|
+
id: string;
|
|
151
|
+
}[]];
|
|
152
|
+
tmMatch?: {
|
|
153
|
+
sourceValue: string;
|
|
154
|
+
translatedValue: string;
|
|
155
|
+
} | undefined;
|
|
156
|
+
}[]];
|
|
157
|
+
context?: {
|
|
158
|
+
description?: string | undefined;
|
|
159
|
+
} | undefined;
|
|
160
|
+
characterLimit?: number | undefined;
|
|
161
|
+
}, {
|
|
162
|
+
id: string;
|
|
163
|
+
segments: [{
|
|
164
|
+
sourceValue: string;
|
|
165
|
+
translations: [{
|
|
166
|
+
value: string;
|
|
167
|
+
locale: string;
|
|
168
|
+
id: string;
|
|
169
|
+
}, ...{
|
|
170
|
+
value: string;
|
|
171
|
+
locale: string;
|
|
172
|
+
id: string;
|
|
173
|
+
}[]];
|
|
174
|
+
tmMatch?: {
|
|
175
|
+
sourceValue: string;
|
|
176
|
+
translatedValue: string;
|
|
177
|
+
} | undefined;
|
|
178
|
+
}, ...{
|
|
179
|
+
sourceValue: string;
|
|
180
|
+
translations: [{
|
|
181
|
+
value: string;
|
|
182
|
+
locale: string;
|
|
183
|
+
id: string;
|
|
184
|
+
}, ...{
|
|
185
|
+
value: string;
|
|
186
|
+
locale: string;
|
|
187
|
+
id: string;
|
|
188
|
+
}[]];
|
|
189
|
+
tmMatch?: {
|
|
190
|
+
sourceValue: string;
|
|
191
|
+
translatedValue: string;
|
|
192
|
+
} | undefined;
|
|
193
|
+
}[]];
|
|
194
|
+
context?: {
|
|
195
|
+
description?: string | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
characterLimit?: number | undefined;
|
|
198
|
+
}>;
|
|
2
199
|
export declare const LQA_SYNC_V2_BODY_SCHEMA: z.ZodObject<{
|
|
3
200
|
sourceLocale: z.ZodEffects<z.ZodString, string, string>;
|
|
4
201
|
context: z.ZodOptional<z.ZodObject<{
|
|
@@ -617,3 +814,6 @@ export declare const LQA_SYNC_V2_RESPONSE_SCHEMA: z.ZodObject<{
|
|
|
617
814
|
export type LqaSyncV2Body = z.infer<typeof LQA_SYNC_V2_BODY_SCHEMA>;
|
|
618
815
|
export type LqaSyncV2Headers = z.infer<typeof LQA_SYNC_V2_HEADERS_SCHEMA>;
|
|
619
816
|
export type LqaSyncV2Response = z.infer<typeof LQA_SYNC_V2_RESPONSE_SCHEMA>;
|
|
817
|
+
export type LqaSyncV2ContentUnit = z.infer<typeof CONTENT_UNIT_SCHEMA>;
|
|
818
|
+
export type LqaSyncV2Segment = z.infer<typeof SEGMENT_SCHEMA>;
|
|
819
|
+
export {};
|
|
@@ -1057,3 +1057,5 @@ export type TranslateAsyncV2Body = z.infer<typeof TRANSLATE_ASYNC_V2_BODY_SCHEMA
|
|
|
1057
1057
|
export type TranslateAsyncV2Headers = z.infer<typeof TRANSLATE_ASYNC_V2_HEADERS_SCHEMA>;
|
|
1058
1058
|
export type TranslateAsyncV2Response = z.infer<typeof TRANSLATE_ASYNC_V2_RESPONSE_SCHEMA>;
|
|
1059
1059
|
export type TranslateAsyncV2Callback = z.infer<typeof TRANSLATE_ASYNC_V2_CALLBACK_SCHEMA>;
|
|
1060
|
+
export type TranslateAsyncV2ContentUnit = z.infer<typeof TRANSLATE_ASYNC_V2_CONTENT_UNIT_SCHEMA>;
|
|
1061
|
+
export type TranslateAsyncV2Segment = z.infer<typeof TRANSLATE_ASYNC_V2_SEGMENT_SCHEMA>;
|
|
@@ -705,3 +705,5 @@ export declare const TRANSLATE_SYNC_V2_RESPONSE_SCHEMA: z.ZodObject<{
|
|
|
705
705
|
export type TranslateSyncV2Body = z.infer<typeof TRANSLATE_SYNC_V2_BODY_SCHEMA>;
|
|
706
706
|
export type TranslateSyncV2Headers = z.infer<typeof TRANSLATE_SYNC_V2_HEADERS_SCHEMA>;
|
|
707
707
|
export type TranslateSyncV2Response = z.infer<typeof TRANSLATE_SYNC_V2_RESPONSE_SCHEMA>;
|
|
708
|
+
export type TranslateSyncV2ContentUnit = z.infer<typeof TRANSLATE_SYNC_V2_CONTENT_UNIT_SCHEMA>;
|
|
709
|
+
export type TranslateSyncV2Segment = z.infer<typeof TRANSLATE_SYNC_V2_SEGMENT_SCHEMA>;
|
|
@@ -7,16 +7,6 @@ export type ClientOptions = {
|
|
|
7
7
|
metadata?: Record<string, string>;
|
|
8
8
|
timeout?: number;
|
|
9
9
|
};
|
|
10
|
-
export type ClientOptionsWithRequestContext = {
|
|
11
|
-
fakeProcessing?: boolean;
|
|
12
|
-
reqContext: RequestContext;
|
|
13
|
-
metadata?: Record<string, string>;
|
|
14
|
-
timeout?: number;
|
|
15
|
-
};
|
|
16
|
-
export type InstrumentationOptions = {
|
|
17
|
-
requestLabel: string;
|
|
18
|
-
callMetadata?: Record<string, string>;
|
|
19
|
-
};
|
|
20
10
|
export type PolyglotClientConfig = {
|
|
21
11
|
baseUrl: string;
|
|
22
12
|
jwtToken: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/polyglot-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Lokalise",
|
|
6
6
|
"url": "https://lokalise.com/"
|
|
@@ -33,20 +33,21 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@amplitude/analytics-types": "^2.6.0",
|
|
36
|
-
"@lokalise/
|
|
36
|
+
"@lokalise/backend-http-client": "^2.0.1",
|
|
37
|
+
"@lokalise/fastify-extras": "^21.4.1",
|
|
37
38
|
"@lokalise/id-utils": "^2.1.0",
|
|
38
|
-
"@lokalise/node-core": "^
|
|
39
|
+
"@lokalise/node-core": "^11.2.0",
|
|
39
40
|
"@lokalise/supported-languages": "^2.0.0",
|
|
40
41
|
"@lokalise/zod-extras": "^2.1.0",
|
|
41
|
-
"undici": "^6.19.
|
|
42
|
-
"undici-retry": "^5.0.
|
|
43
|
-
"zod": "^3.23.
|
|
42
|
+
"undici": "^6.19.4",
|
|
43
|
+
"undici-retry": "^5.0.3",
|
|
44
|
+
"zod": "^3.23.8"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^20.14.
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^7.
|
|
48
|
-
"@typescript-eslint/parser": "^7.
|
|
49
|
-
"@vitest/coverage-v8": "^
|
|
47
|
+
"@types/node": "^20.14.11",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^7.17.0",
|
|
49
|
+
"@typescript-eslint/parser": "^7.17.0",
|
|
50
|
+
"@vitest/coverage-v8": "^2.0.4",
|
|
50
51
|
"auto-changelog": "^2.4.0",
|
|
51
52
|
"eslint": "^8.57.0",
|
|
52
53
|
"eslint-plugin-import": "^2.29.1",
|
|
@@ -56,6 +57,6 @@
|
|
|
56
57
|
"shx": "^0.3.4",
|
|
57
58
|
"ts-deepmerge": "^7.0.0",
|
|
58
59
|
"typescript": "5.5.3",
|
|
59
|
-
"vitest": "^
|
|
60
|
+
"vitest": "^2.0.4"
|
|
60
61
|
}
|
|
61
62
|
}
|