@lokalise/tm-sdk 2.3.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -7
- package/dist/index.js.map +1 -1
- package/dist/sdk/TranslationMemoryClient.d.ts +2 -2
- package/dist/sdk/TranslationMemoryClient.js +16 -21
- package/dist/sdk/TranslationMemoryClient.js.map +1 -1
- package/dist/sdk/errors/TranslationMemoryClientError.js +2 -6
- package/dist/sdk/errors/TranslationMemoryClientError.js.map +1 -1
- package/dist/sdk/types/apiResponses.d.ts +1 -1
- package/dist/sdk/types/apiResponses.js +1 -2
- package/dist/sdk/types/models.js +1 -2
- package/dist/sdk/types/requests.js +1 -2
- package/package.json +55 -59
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './sdk/TranslationMemoryClient';
|
|
2
|
-
export * from './sdk/errors/TranslationMemoryClientError';
|
|
3
|
-
export * from './sdk/types/requests';
|
|
4
|
-
export * from './sdk/types/models';
|
|
1
|
+
export * from './sdk/TranslationMemoryClient.js';
|
|
2
|
+
export * from './sdk/errors/TranslationMemoryClientError.js';
|
|
3
|
+
export * from './sdk/types/requests.js';
|
|
4
|
+
export * from './sdk/types/models.js';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
tslib_1.__exportStar(require("./sdk/errors/TranslationMemoryClientError"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./sdk/types/requests"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./sdk/types/models"), exports);
|
|
1
|
+
export * from './sdk/TranslationMemoryClient.js';
|
|
2
|
+
export * from './sdk/errors/TranslationMemoryClientError.js';
|
|
3
|
+
export * from './sdk/types/requests.js';
|
|
4
|
+
export * from './sdk/types/models.js';
|
|
8
5
|
//# 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":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAA;AAChD,cAAc,8CAA8C,CAAA;AAC5D,cAAc,yBAAyB,CAAA;AACvC,cAAc,uBAAuB,CAAA"}
|
|
@@ -2,8 +2,8 @@ import type { MandatoryPaginationParams } from '@lokalise/api-common';
|
|
|
2
2
|
import type { RequestContext } from '@lokalise/fastify-extras';
|
|
3
3
|
import type { ErrorReporter } from '@lokalise/node-core';
|
|
4
4
|
import type { RetryConfig } from 'undici-retry';
|
|
5
|
-
import type { BulkTranslationMemoryMatches, TranslationMemoryMatch, TranslationMemoryRecordsResponse, UpsertRecordDto } from './types/models';
|
|
6
|
-
import type { BulkFindMatchesRequest, FindMatchesRequest } from './types/requests';
|
|
5
|
+
import type { BulkTranslationMemoryMatches, TranslationMemoryMatch, TranslationMemoryRecordsResponse, UpsertRecordDto } from './types/models.js';
|
|
6
|
+
import type { BulkFindMatchesRequest, FindMatchesRequest } from './types/requests.js';
|
|
7
7
|
export type TranslationMemoryClientConfig = {
|
|
8
8
|
baseUrl: string;
|
|
9
9
|
jwtToken: string;
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
const zod_1 = require("zod");
|
|
8
|
-
const TranslationMemoryClientError_1 = require("./errors/TranslationMemoryClientError");
|
|
9
|
-
const ANY_SCHEMA = zod_1.z.any();
|
|
10
|
-
class TranslationMemoryClient {
|
|
1
|
+
import { buildClient, isResponseStatusError, sendGet, sendPost, sendPut, } from '@lokalise/backend-http-client';
|
|
2
|
+
import { InternalError, chunk, transformToKebabCase } from '@lokalise/node-core';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { TranslationMemoryClientError } from './errors/TranslationMemoryClientError.js';
|
|
5
|
+
const ANY_SCHEMA = z.any();
|
|
6
|
+
export class TranslationMemoryClient {
|
|
11
7
|
maxFindMatchesRequestSize = 20; // TODO: TBD
|
|
12
8
|
isEnabled;
|
|
13
9
|
httpClient;
|
|
@@ -16,7 +12,7 @@ class TranslationMemoryClient {
|
|
|
16
12
|
errorReporter;
|
|
17
13
|
constructor(config) {
|
|
18
14
|
this.isEnabled = config.isEnabled ?? true;
|
|
19
|
-
this.httpClient =
|
|
15
|
+
this.httpClient = buildClient(config.baseUrl);
|
|
20
16
|
this.headers = {
|
|
21
17
|
'Content-Type': 'application/json',
|
|
22
18
|
Authorization: `Bearer ${config.jwtToken}`,
|
|
@@ -42,14 +38,14 @@ class TranslationMemoryClient {
|
|
|
42
38
|
return [];
|
|
43
39
|
}
|
|
44
40
|
try {
|
|
45
|
-
const response = await
|
|
41
|
+
const response = await sendGet(this.httpClient, `/v1/groups/${groupId}/actions/find-matches`, {
|
|
46
42
|
reqContext: context.reqContext,
|
|
47
43
|
headers: this.headers,
|
|
48
44
|
responseSchema: ANY_SCHEMA,
|
|
49
45
|
validateResponse: false,
|
|
50
46
|
retryConfig: this.retryConfig,
|
|
51
47
|
requestLabel: '(tm-sdk) Find matches',
|
|
52
|
-
query:
|
|
48
|
+
query: transformToKebabCase(request),
|
|
53
49
|
});
|
|
54
50
|
return response.result.body.data;
|
|
55
51
|
}
|
|
@@ -59,7 +55,7 @@ class TranslationMemoryClient {
|
|
|
59
55
|
}
|
|
60
56
|
async bulkFindMatches(groupId, { filters, options }, context = {}) {
|
|
61
57
|
const response = [];
|
|
62
|
-
for (const part of
|
|
58
|
+
for (const part of chunk(filters, this.maxFindMatchesRequestSize)) {
|
|
63
59
|
const partialResponse = await this.internalBulkFindMatches(groupId, {
|
|
64
60
|
filters: part,
|
|
65
61
|
options,
|
|
@@ -69,7 +65,7 @@ class TranslationMemoryClient {
|
|
|
69
65
|
return response;
|
|
70
66
|
}
|
|
71
67
|
async *bulkFindMatchesIterative(groupId, { filters, options }, context = {}) {
|
|
72
|
-
for (const part of
|
|
68
|
+
for (const part of chunk(filters, this.maxFindMatchesRequestSize)) {
|
|
73
69
|
yield await this.internalBulkFindMatches(groupId, { filters: part, options }, context);
|
|
74
70
|
}
|
|
75
71
|
}
|
|
@@ -81,7 +77,7 @@ class TranslationMemoryClient {
|
|
|
81
77
|
};
|
|
82
78
|
}
|
|
83
79
|
try {
|
|
84
|
-
const response = await
|
|
80
|
+
const response = await sendGet(this.httpClient, `/v1/groups/${groupId}/records`, {
|
|
85
81
|
reqContext: context.reqContext,
|
|
86
82
|
headers: this.headers,
|
|
87
83
|
validateResponse: false,
|
|
@@ -109,7 +105,7 @@ class TranslationMemoryClient {
|
|
|
109
105
|
return;
|
|
110
106
|
}
|
|
111
107
|
try {
|
|
112
|
-
await
|
|
108
|
+
await sendPut(this.httpClient, `/v1/groups/${groupId}/records`, recordsToInsert, {
|
|
113
109
|
reqContext: context.reqContext,
|
|
114
110
|
headers: this.headers,
|
|
115
111
|
responseSchema: ANY_SCHEMA,
|
|
@@ -147,7 +143,7 @@ class TranslationMemoryClient {
|
|
|
147
143
|
request.filters = nonEmptyFilters;
|
|
148
144
|
}
|
|
149
145
|
try {
|
|
150
|
-
const response = await
|
|
146
|
+
const response = await sendPost(this.httpClient, `/v1/groups/${groupId}/actions/bulk-find-matches`, request, {
|
|
151
147
|
reqContext: context.reqContext,
|
|
152
148
|
headers: this.headers,
|
|
153
149
|
responseSchema: ANY_SCHEMA,
|
|
@@ -165,10 +161,10 @@ class TranslationMemoryClient {
|
|
|
165
161
|
handleError(e, context) {
|
|
166
162
|
let error;
|
|
167
163
|
if (e instanceof Error) {
|
|
168
|
-
error =
|
|
164
|
+
error = isResponseStatusError(e) ? new TranslationMemoryClientError(e) : e;
|
|
169
165
|
}
|
|
170
166
|
else {
|
|
171
|
-
error = new
|
|
167
|
+
error = new InternalError({
|
|
172
168
|
message: 'Unknown error',
|
|
173
169
|
errorCode: 'UNKNOWN_ERROR',
|
|
174
170
|
details: { error: JSON.stringify(e) },
|
|
@@ -184,5 +180,4 @@ class TranslationMemoryClient {
|
|
|
184
180
|
return error;
|
|
185
181
|
}
|
|
186
182
|
}
|
|
187
|
-
exports.TranslationMemoryClient = TranslationMemoryClient;
|
|
188
183
|
//# sourceMappingURL=TranslationMemoryClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationMemoryClient.js","sourceRoot":"","sources":["../../src/sdk/TranslationMemoryClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TranslationMemoryClient.js","sourceRoot":"","sources":["../../src/sdk/TranslationMemoryClient.ts"],"names":[],"mappings":"AACA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,OAAO,EACP,QAAQ,EACR,OAAO,GACR,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAGhF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AA+BvF,MAAM,UAAU,GAAG,CAAC,CAAC,GAAG,EAAE,CAAA;AAE1B,MAAM,OAAO,uBAAuB;IACjB,yBAAyB,GAAG,EAAE,CAAA,CAAC,YAAY;IAE3C,SAAS,CAAS;IAClB,UAAU,CAAQ;IAClB,OAAO,CAAyB;IAChC,WAAW,CAAa;IAExB,aAAa,CAAgB;IAE9C,YAAY,MAAqC;QAC/C,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,CAAA;QACzC,IAAI,CAAC,UAAU,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QAC7C,IAAI,CAAC,OAAO,GAAG;YACb,cAAc,EAAE,kBAAkB;YAClC,aAAa,EAAE,UAAU,MAAM,CAAC,QAAQ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C1B,gBAAgB,EAAE,KAAK;gBACvB,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,YAAY,EAAE,4BAA4B;aAC3C,CACF,CAAA;YACD,MAAM,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;YACzC,OAAO,MAAM,CAAA;QACf,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,MAAM,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;IAEO,WAAW,CAAC,CAAU,EAAE,OAAuC;QACrE,IAAI,KAAwB,CAAA;QAC5B,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;YACvB,KAAK,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,4BAA4B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC5E,CAAC;aAAM,CAAC;YACN,KAAK,GAAG,IAAI,aAAa,CAAC;gBACxB,OAAO,EAAE,eAAe;gBACxB,SAAS,EAAE,eAAe;gBAC1B,OAAO,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;aACtC,CAAC,CAAA;QACJ,CAAC;QAED,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC;YACzB,KAAK;YACL,OAAO,EAAE;gBACP,KAAK,EAAE,OAAO,CAAC,UAAU,EAAE,KAAK;gBAChC,GAAG,OAAO,CAAC,QAAQ;aACpB;SACF,CAAC,CAAA;QACF,OAAO,KAAK,CAAA;IACd,CAAC;CACF"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.TranslationMemoryClientError = void 0;
|
|
4
|
-
const node_core_1 = require("@lokalise/node-core");
|
|
5
|
-
class TranslationMemoryClientError extends node_core_1.InternalError {
|
|
1
|
+
import { InternalError } from '@lokalise/node-core';
|
|
2
|
+
export class TranslationMemoryClientError extends InternalError {
|
|
6
3
|
constructor(error) {
|
|
7
4
|
super({
|
|
8
5
|
message: `Translation memory service failed with error: ${error.message}`,
|
|
@@ -14,5 +11,4 @@ class TranslationMemoryClientError extends node_core_1.InternalError {
|
|
|
14
11
|
});
|
|
15
12
|
}
|
|
16
13
|
}
|
|
17
|
-
exports.TranslationMemoryClientError = TranslationMemoryClientError;
|
|
18
14
|
//# sourceMappingURL=TranslationMemoryClientError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TranslationMemoryClientError.js","sourceRoot":"","sources":["../../../src/sdk/errors/TranslationMemoryClientError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TranslationMemoryClientError.js","sourceRoot":"","sources":["../../../src/sdk/errors/TranslationMemoryClientError.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAEnD,MAAM,OAAO,4BAA6B,SAAQ,aAAa;IAC7D,YAAY,KAA0B;QACpC,KAAK,CAAC;YACJ,OAAO,EAAE,iDAAiD,KAAK,CAAC,OAAO,EAAE;YACzE,OAAO,EAAE;gBACP,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACjD,OAAO,EAAE,KAAK,CAAC,OAAO;aACvB;YACD,SAAS,EAAE,KAAK,CAAC,SAAS;SAC3B,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PaginationMeta } from '@lokalise/api-common';
|
|
2
|
-
import type { BulkTranslationMemoryMatches, TranslationMemoryMatch, TranslationMemoryRecord } from './models';
|
|
2
|
+
import type { BulkTranslationMemoryMatches, TranslationMemoryMatch, TranslationMemoryRecord } from './models.js';
|
|
3
3
|
export type GetFindMatchesResponse = {
|
|
4
4
|
data: TranslationMemoryMatch[];
|
|
5
5
|
};
|
package/dist/sdk/types/models.js
CHANGED
package/package.json
CHANGED
|
@@ -1,61 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"typescript": "5.4.3",
|
|
58
|
-
"vitest": "^1.2.2",
|
|
59
|
-
"zod": "^3.23.8"
|
|
60
|
-
}
|
|
2
|
+
"name": "@lokalise/tm-sdk",
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Lokalise",
|
|
7
|
+
"url": "https://lokalise.com/"
|
|
8
|
+
},
|
|
9
|
+
"description": "REST API client for the Lokalise Translation Memory service",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**"
|
|
12
|
+
],
|
|
13
|
+
"license": "Apache-2.0",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git://github.com/lokalise/tm-service.git"
|
|
17
|
+
},
|
|
18
|
+
"main": "dist/index.js",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "shx rm -rf ./dist && tsc",
|
|
25
|
+
"build:publish": "shx rm -rf ./dist && tsc -p tsconfig.publish.json",
|
|
26
|
+
"lint": "biome check && tsc --noEmit",
|
|
27
|
+
"lint:fix": "biome check --write",
|
|
28
|
+
"test": "vitest",
|
|
29
|
+
"test:coverage": "npm test -- --coverage",
|
|
30
|
+
"test:ci": "npm run test:coverage",
|
|
31
|
+
"package-version": "echo $npm_package_version",
|
|
32
|
+
"prepublishOnly": "npm run build:publish"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@lokalise/api-common": "^3.2.5",
|
|
36
|
+
"@lokalise/backend-http-client": "^2.4.0",
|
|
37
|
+
"@lokalise/id-utils": "^2.2.0",
|
|
38
|
+
"@lokalise/node-core": "^13.0.2",
|
|
39
|
+
"undici": "^6.19.8",
|
|
40
|
+
"undici-retry": "^5.0.3"
|
|
41
|
+
},
|
|
42
|
+
"peerDependencies": {
|
|
43
|
+
"zod": "^3.23.8"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@biomejs/biome": "^1.9.4",
|
|
47
|
+
"@lokalise/biome-config": "^1.5.0",
|
|
48
|
+
"@lokalise/fastify-extras": "^18.0.0",
|
|
49
|
+
"@types/node": "22.7.7",
|
|
50
|
+
"@vitest/coverage-v8": "^2.1.3",
|
|
51
|
+
"mockttp": "^3.15.3",
|
|
52
|
+
"shx": "^0.3.4",
|
|
53
|
+
"typescript": "5.6.3",
|
|
54
|
+
"vitest": "^2.1.3",
|
|
55
|
+
"zod": "^3.23.8"
|
|
56
|
+
}
|
|
61
57
|
}
|