@lokalise/polyglot-sdk 6.0.1 → 6.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.
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.REQUEST_SIZE_LIMIT_TRANSLATE_SYNC = void 0;
|
|
4
|
+
exports.getChunkedTranslationRequest = getChunkedTranslationRequest;
|
|
4
5
|
const node_core_1 = require("@lokalise/node-core");
|
|
5
6
|
/**
|
|
6
7
|
* Polyglot synchronous APIs are limited to X items at once - to keep the response time reasonable and not hit
|
|
@@ -44,5 +45,4 @@ function* getChunkedTranslationRequest(request, polyglotSegmentMaxProcessLimit =
|
|
|
44
45
|
yield (0, node_core_1.deepClone)(chunkedRequest);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
|
-
exports.getChunkedTranslationRequest = getChunkedTranslationRequest;
|
|
48
48
|
//# sourceMappingURL=polyglotChunkHandler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"polyglotChunkHandler.js","sourceRoot":"","sources":["../../src/sdk/polyglotChunkHandler.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"polyglotChunkHandler.js","sourceRoot":"","sources":["../../src/sdk/polyglotChunkHandler.ts"],"names":[],"mappings":";;;AAYA,oEA+CC;AA3DD,mDAA+C;AAI/C;;;GAGG;AACU,QAAA,iCAAiC,GAAG,EAAE,CAAA;AAEnD,kFAAkF;AAClF,0CAA0C;AAC1C,QAAe,CAAC,CAAC,4BAA4B,CAC3C,OAA6B,EAC7B,iCAAyC,yCAAiC;IAE1E,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAA;IAClG,IAAI,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tils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.groupTranslationSegmentIdsProcessedByContentUnitId =
|
|
3
|
+
exports.groupTranslationSegmentIdsProcessedByContentUnitId = groupTranslationSegmentIdsProcessedByContentUnitId;
|
|
4
4
|
function groupTranslationSegmentIdsProcessedByContentUnitId(contentUnits) {
|
|
5
5
|
return contentUnits.reduce((acc, cu) => {
|
|
6
6
|
if (!acc[cu.id])
|
|
@@ -9,5 +9,4 @@ function groupTranslationSegmentIdsProcessedByContentUnitId(contentUnits) {
|
|
|
9
9
|
return acc;
|
|
10
10
|
}, {});
|
|
11
11
|
}
|
|
12
|
-
exports.groupTranslationSegmentIdsProcessedByContentUnitId = groupTranslationSegmentIdsProcessedByContentUnitId;
|
|
13
12
|
//# sourceMappingURL=segmentUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"segmentUtils.js","sourceRoot":"","sources":["../../src/sdk/segmentUtils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"segmentUtils.js","sourceRoot":"","sources":["../../src/sdk/segmentUtils.ts"],"names":[],"mappings":";;AAEA,gHAWC;AAXD,SAAgB,kDAAkD,CAChE,YAAkD;IAElD,OAAO,YAAY,CAAC,MAAM,CACxB,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;QACV,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;YAAE,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,EAAE,CAAA;QAChC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAChD,OAAO,GAAG,CAAA;IACZ,CAAC,EACD,EAA8B,CAC/B,CAAA;AACH,CAAC"}
|
|
@@ -18,6 +18,7 @@ export type TranslateSyncContentUnits = {
|
|
|
18
18
|
context?: {
|
|
19
19
|
description: string;
|
|
20
20
|
};
|
|
21
|
+
characterLimit?: number;
|
|
21
22
|
segments: {
|
|
22
23
|
id: string;
|
|
23
24
|
position: number;
|
|
@@ -38,6 +39,7 @@ export type LqaContentUnit = {
|
|
|
38
39
|
context?: {
|
|
39
40
|
description?: string;
|
|
40
41
|
};
|
|
42
|
+
characterLimit?: number;
|
|
41
43
|
segments: LqaSegment[];
|
|
42
44
|
};
|
|
43
45
|
export type LqaSyncRequestBody = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lokalise/polyglot-sdk",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "Lokalise",
|
|
6
6
|
"url": "https://lokalise.com/"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"zod": "^3.23.4"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "^20.14.
|
|
45
|
+
"@types/node": "^20.14.9",
|
|
46
46
|
"@typescript-eslint/eslint-plugin": "^7.4.0",
|
|
47
47
|
"@typescript-eslint/parser": "^7.4.0",
|
|
48
48
|
"@vitest/coverage-v8": "^1.6.0",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"prettier": "^3.2.5",
|
|
55
55
|
"shx": "^0.3.4",
|
|
56
56
|
"ts-deepmerge": "^7.0.0",
|
|
57
|
-
"typescript": "5.
|
|
57
|
+
"typescript": "5.5.2",
|
|
58
58
|
"vitest": "^1.6.0"
|
|
59
59
|
}
|
|
60
60
|
}
|