@lokalise/tm-sdk 5.0.1 → 7.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 +3 -4
- package/dist/index.js +3 -4
- package/dist/index.js.map +1 -1
- package/dist/sdk/TranslationMemoryClient.d.ts +3 -3
- package/dist/sdk/TranslationMemoryClient.js +14 -18
- package/dist/sdk/TranslationMemoryClient.js.map +1 -1
- package/package.json +21 -18
- package/dist/sdk/types/apiResponses.d.ts +0 -12
- package/dist/sdk/types/apiResponses.js +0 -2
- package/dist/sdk/types/apiResponses.js.map +0 -1
- package/dist/sdk/types/models.d.ts +0 -24
- package/dist/sdk/types/models.js +0 -2
- package/dist/sdk/types/models.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './sdk/
|
|
2
|
-
export * from './sdk/
|
|
3
|
-
export * from './sdk/types/requests.
|
|
4
|
-
export * from './sdk/types/models.js';
|
|
1
|
+
export * from './sdk/errors/TranslationMemoryClientError.ts';
|
|
2
|
+
export * from './sdk/TranslationMemoryClient.ts';
|
|
3
|
+
export * from './sdk/types/requests.ts';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from './sdk/types/models.js';
|
|
1
|
+
export * from "./sdk/errors/TranslationMemoryClientError.js";
|
|
2
|
+
export * from "./sdk/TranslationMemoryClient.js";
|
|
3
|
+
export * from "./sdk/types/requests.js";
|
|
5
4
|
//# 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,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,8CAA8C,CAAA;AAC5D,cAAc,kCAAkC,CAAA;AAChD,cAAc,yBAAyB,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
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
|
+
import { type BulkTranslationMemoryMatches, type TranslationMemoryRecord, type TranslationMemoryRecordsResponse, type UpsertTranslationMemoryRecordDto } from '@lokalise/tm-api-schemas';
|
|
4
5
|
import type { RetryConfig } from 'undici-retry';
|
|
5
|
-
import type {
|
|
6
|
-
import type { BulkFindMatchesRequest, FindMatchesRequest } from './types/requests.js';
|
|
6
|
+
import type { BulkFindMatchesRequest, FindMatchesRequest } from './types/requests.ts';
|
|
7
7
|
export type TranslationMemoryClientConfig = {
|
|
8
8
|
baseUrl: string;
|
|
9
9
|
jwtToken: string;
|
|
@@ -27,7 +27,7 @@ export declare class TranslationMemoryClient {
|
|
|
27
27
|
bulkFindMatches(groupId: string, { filters, options }: BulkFindMatchesRequest, context?: TranslationMemoryClientContext): Promise<BulkTranslationMemoryMatches[]>;
|
|
28
28
|
bulkFindMatchesIterative(groupId: string, { filters, options }: BulkFindMatchesRequest, context?: TranslationMemoryClientContext): AsyncGenerator<BulkTranslationMemoryMatches[]>;
|
|
29
29
|
getRecords(groupId: string, pagination?: MandatoryPaginationParams, context?: TranslationMemoryClientContext): Promise<TranslationMemoryRecordsResponse>;
|
|
30
|
-
upsertRecords(groupId: string, records:
|
|
30
|
+
upsertRecords(groupId: string, records: UpsertTranslationMemoryRecordDto[], context?: TranslationMemoryClientContext): Promise<void>;
|
|
31
31
|
private internalBulkFindMatches;
|
|
32
32
|
private handleError;
|
|
33
33
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { buildClient, isResponseStatusError, sendGet, sendPost, sendPut, } from '@lokalise/backend-http-client';
|
|
2
2
|
import { InternalError } from '@lokalise/node-core';
|
|
3
|
+
import { GET_FIND_MATCHES_RESPONSE_SCHEMA, GET_TRANSLATION_MEMORY_RECORDS_RESPONSE_SCHEMA, POST_BULK_FIND_MATCHES_RESPONSE_SCHEMA, } from '@lokalise/tm-api-schemas';
|
|
3
4
|
import { chunk, transformToKebabCase } from '@lokalise/universal-ts-utils/node';
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
import { TranslationMemoryClientError } from
|
|
6
|
-
const ANY_SCHEMA = z.any();
|
|
5
|
+
import { z } from 'zod/v4';
|
|
6
|
+
import { TranslationMemoryClientError } from "./errors/TranslationMemoryClientError.js";
|
|
7
7
|
export class TranslationMemoryClient {
|
|
8
8
|
maxFindMatchesRequestSize = 20;
|
|
9
9
|
isEnabled;
|
|
@@ -35,15 +35,14 @@ export class TranslationMemoryClient {
|
|
|
35
35
|
this.errorReporter = config.errorReporter;
|
|
36
36
|
}
|
|
37
37
|
async findMatches(groupId, request, context = {}) {
|
|
38
|
-
if (!this.isEnabled)
|
|
38
|
+
if (!this.isEnabled)
|
|
39
39
|
return [];
|
|
40
|
-
}
|
|
41
40
|
try {
|
|
42
41
|
const response = await sendGet(this.httpClient, `/v1/groups/${groupId}/actions/find-matches`, {
|
|
43
42
|
reqContext: context.reqContext,
|
|
44
43
|
headers: this.headers,
|
|
45
|
-
responseSchema:
|
|
46
|
-
validateResponse:
|
|
44
|
+
responseSchema: GET_FIND_MATCHES_RESPONSE_SCHEMA,
|
|
45
|
+
validateResponse: true,
|
|
47
46
|
retryConfig: this.retryConfig,
|
|
48
47
|
requestLabel: '(tm-sdk) Find matches',
|
|
49
48
|
query: transformToKebabCase(request),
|
|
@@ -81,8 +80,8 @@ export class TranslationMemoryClient {
|
|
|
81
80
|
const response = await sendGet(this.httpClient, `/v1/groups/${groupId}/records`, {
|
|
82
81
|
reqContext: context.reqContext,
|
|
83
82
|
headers: this.headers,
|
|
84
|
-
validateResponse:
|
|
85
|
-
responseSchema:
|
|
83
|
+
validateResponse: true,
|
|
84
|
+
responseSchema: GET_TRANSLATION_MEMORY_RECORDS_RESPONSE_SCHEMA,
|
|
86
85
|
retryConfig: this.retryConfig,
|
|
87
86
|
requestLabel: '(tm-sdk) Get records',
|
|
88
87
|
query: pagination,
|
|
@@ -94,19 +93,17 @@ export class TranslationMemoryClient {
|
|
|
94
93
|
}
|
|
95
94
|
}
|
|
96
95
|
async upsertRecords(groupId, records, context = {}) {
|
|
97
|
-
if (!this.isEnabled)
|
|
96
|
+
if (!this.isEnabled)
|
|
98
97
|
return;
|
|
99
|
-
}
|
|
100
98
|
// Avoiding sending empty records
|
|
101
99
|
const recordsToInsert = records.filter((record) => record.sourceText.trim().length > 0 && record.targetText.trim().length > 0);
|
|
102
|
-
if (recordsToInsert.length === 0)
|
|
100
|
+
if (recordsToInsert.length === 0)
|
|
103
101
|
return;
|
|
104
|
-
}
|
|
105
102
|
try {
|
|
106
103
|
await sendPut(this.httpClient, `/v1/groups/${groupId}/records`, recordsToInsert, {
|
|
107
104
|
reqContext: context.reqContext,
|
|
108
105
|
headers: this.headers,
|
|
109
|
-
responseSchema:
|
|
106
|
+
responseSchema: z.any(),
|
|
110
107
|
validateResponse: false,
|
|
111
108
|
retryConfig: this.retryConfig,
|
|
112
109
|
requestLabel: '(tm-sdk) Create or update records',
|
|
@@ -118,9 +115,8 @@ export class TranslationMemoryClient {
|
|
|
118
115
|
}
|
|
119
116
|
async internalBulkFindMatches(groupId, request, context) {
|
|
120
117
|
const result = [];
|
|
121
|
-
if (!this.isEnabled)
|
|
118
|
+
if (!this.isEnabled)
|
|
122
119
|
return result;
|
|
123
|
-
}
|
|
124
120
|
if (request.options?.ignoreEmptyFilters) {
|
|
125
121
|
const { emptyFilters, nonEmptyFilters } = request.filters.reduce((acc, filter) => {
|
|
126
122
|
const list = filter.sourceText.trim().length === 0 ? acc.emptyFilters : acc.nonEmptyFilters;
|
|
@@ -140,8 +136,8 @@ export class TranslationMemoryClient {
|
|
|
140
136
|
const response = await sendPost(this.httpClient, `/v1/groups/${groupId}/actions/bulk-find-matches`, request, {
|
|
141
137
|
reqContext: context.reqContext,
|
|
142
138
|
headers: this.headers,
|
|
143
|
-
responseSchema:
|
|
144
|
-
validateResponse:
|
|
139
|
+
responseSchema: POST_BULK_FIND_MATCHES_RESPONSE_SCHEMA,
|
|
140
|
+
validateResponse: true,
|
|
145
141
|
retryConfig: this.retryConfig,
|
|
146
142
|
requestLabel: '(tm-sdk) Bulk find matches',
|
|
147
143
|
});
|
|
@@ -1 +1 @@
|
|
|
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;AAEtC,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAG/E,OAAO,EAAE,CAAC,EAAE,MAAM,
|
|
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;AAEtC,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAEL,gCAAgC,EAChC,8CAA8C,EAC9C,sCAAsC,GAIvC,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAA;AAG/E,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAC1B,OAAO,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAA;AAoBvF,MAAM,OAAO,uBAAuB;IACjB,yBAAyB,GAAG,EAAE,CAAA;IAE9B,SAAS,CAAS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1
1
|
{
|
|
2
2
|
"name": "@lokalise/tm-sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Lokalise",
|
|
7
7
|
"url": "https://lokalise.com/"
|
|
8
8
|
},
|
|
9
9
|
"description": "REST API client for the Lokalise Translation Memory service",
|
|
10
|
-
"files": [
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**"
|
|
12
|
+
],
|
|
11
13
|
"license": "Apache-2.0",
|
|
12
14
|
"repository": {
|
|
13
15
|
"type": "git",
|
|
@@ -34,29 +36,30 @@
|
|
|
34
36
|
"postversion": "biome check --write package.json"
|
|
35
37
|
},
|
|
36
38
|
"dependencies": {
|
|
37
|
-
"@lokalise/api-common": "^
|
|
38
|
-
"@lokalise/backend-http-client": "^
|
|
39
|
-
"@lokalise/id-utils": "^3.0.
|
|
40
|
-
"@lokalise/node-core": "^14.
|
|
41
|
-
"@lokalise/
|
|
42
|
-
"
|
|
39
|
+
"@lokalise/api-common": "^6.0.0",
|
|
40
|
+
"@lokalise/backend-http-client": "^7.0.0",
|
|
41
|
+
"@lokalise/id-utils": "^3.0.1",
|
|
42
|
+
"@lokalise/node-core": "^14.4.1",
|
|
43
|
+
"@lokalise/tm-api-schemas": "*",
|
|
44
|
+
"@lokalise/universal-ts-utils": "^4.5.1",
|
|
45
|
+
"undici": "^7.15.0",
|
|
43
46
|
"undici-retry": "^6.0.0"
|
|
44
47
|
},
|
|
45
48
|
"peerDependencies": {
|
|
46
|
-
"zod": "
|
|
49
|
+
"zod": ">=3.25.76 <5.0.0"
|
|
47
50
|
},
|
|
48
51
|
"devDependencies": {
|
|
49
|
-
"@biomejs/biome": "^
|
|
50
|
-
"@lokalise/biome-config": "^
|
|
51
|
-
"@lokalise/
|
|
52
|
-
"@lokalise/
|
|
53
|
-
"@types/node": "
|
|
54
|
-
"@vitest/coverage-v8": "^3.
|
|
52
|
+
"@biomejs/biome": "^2.2.0",
|
|
53
|
+
"@lokalise/biome-config": "^3.1.0",
|
|
54
|
+
"@lokalise/fastify-extras": "^29.0.0",
|
|
55
|
+
"@lokalise/tsconfig": "^2.0.0",
|
|
56
|
+
"@types/node": "24.3.0",
|
|
57
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
55
58
|
"mockttp": "^3.17.1",
|
|
56
59
|
"rimraf": "^6.0.1",
|
|
57
|
-
"shx": "^0.
|
|
58
|
-
"typescript": "5.
|
|
60
|
+
"shx": "^0.4.0",
|
|
61
|
+
"typescript": "5.9.2",
|
|
59
62
|
"vitest": "^3.0.2",
|
|
60
|
-
"zod": "^3.
|
|
63
|
+
"zod": "^3.25.76"
|
|
61
64
|
}
|
|
62
65
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { PaginationMeta } from '@lokalise/api-common';
|
|
2
|
-
import type { BulkTranslationMemoryMatches, TranslationMemoryRecord } from './models.js';
|
|
3
|
-
export type GetFindMatchesResponse = {
|
|
4
|
-
data: TranslationMemoryRecord[];
|
|
5
|
-
};
|
|
6
|
-
export type PostBulkFindMatchesResponse = {
|
|
7
|
-
data: BulkTranslationMemoryMatches[];
|
|
8
|
-
};
|
|
9
|
-
export type GetRecordsResponse = {
|
|
10
|
-
data: TranslationMemoryRecord[];
|
|
11
|
-
meta: PaginationMeta;
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apiResponses.js","sourceRoot":"","sources":["../../../src/sdk/types/apiResponses.ts"],"names":[],"mappings":""}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { PaginationMeta } from '@lokalise/api-common';
|
|
2
|
-
import type { MayOmit } from '@lokalise/node-core';
|
|
3
|
-
export type TranslationMemoryRecord = {
|
|
4
|
-
id: string;
|
|
5
|
-
groupId: string;
|
|
6
|
-
ownerId: string;
|
|
7
|
-
sourceText: string;
|
|
8
|
-
targetText: string;
|
|
9
|
-
sourceLocale: string;
|
|
10
|
-
targetLocale: string;
|
|
11
|
-
sourcePrevContent?: string;
|
|
12
|
-
sourceNextContent?: string;
|
|
13
|
-
createdAt: Date;
|
|
14
|
-
updatedAt: Date;
|
|
15
|
-
};
|
|
16
|
-
export type UpsertRecordDto = Omit<MayOmit<TranslationMemoryRecord, 'id'>, 'groupId' | 'createdAt' | 'updatedAt'>;
|
|
17
|
-
export type BulkTranslationMemoryMatches = {
|
|
18
|
-
filterId?: string;
|
|
19
|
-
matches: TranslationMemoryRecord[];
|
|
20
|
-
};
|
|
21
|
-
export type TranslationMemoryRecordsResponse = {
|
|
22
|
-
records: TranslationMemoryRecord[];
|
|
23
|
-
meta: PaginationMeta;
|
|
24
|
-
};
|
package/dist/sdk/types/models.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/sdk/types/models.ts"],"names":[],"mappings":""}
|