@lokalise/tm-sdk 9.0.0 → 10.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/README.md CHANGED
@@ -19,7 +19,7 @@ import { TranslationMemoryClient } from '@lokalise/tm-sdk'
19
19
 
20
20
  const client = new TranslationMemoryClient({
21
21
  isEnabled: true,
22
- baseUrl: 'https://<tm-service-server-url>',
22
+ baseUrl: 'https://<translation-memory-server-url>',
23
23
  jwtToken: '<JWT auth token provided by the TM service>',
24
24
  // Undici retry config (see RetryConfig in https://github.com/kibertoad/undici-retry)
25
25
  retryConfig: {},
@@ -1,8 +1,9 @@
1
1
  import type { RequestContext } from '@lokalise/fastify-extras';
2
2
  import { type ErrorReporter } from '@lokalise/node-core';
3
- import { type BulkTranslationMemoryMatches, type GetTranslationMemoryRecordsQueryInput, type TranslationMemoryRecord, type TranslationMemoryRecordsResponse, type UpsertTranslationMemoryRecordDto } from '@lokalise/tm-api-schemas';
3
+ import type { TmOwnerGroupId } from '@lokalise/tm-api-schemas';
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 { BulkFindMatchesRequest, FindMatchesRequest } from './types/requests.ts';
6
+ import type { BulkFindMatchesRequest, FindMatchesRequest, GetRecordsQuery } from './types/requests.ts';
6
7
  export type TranslationMemoryClientConfig = {
7
8
  baseUrl: string;
8
9
  jwtToken: string;
@@ -11,7 +12,7 @@ export type TranslationMemoryClientConfig = {
11
12
  isEnabled?: boolean;
12
13
  };
13
14
  export type TranslationMemoryClientContext = {
14
- reqContext?: RequestContext;
15
+ reqContext: RequestContext;
15
16
  metadata?: Record<string, unknown>;
16
17
  };
17
18
  export declare class TranslationMemoryClient {
@@ -22,12 +23,12 @@ export declare class TranslationMemoryClient {
22
23
  private readonly retryConfig;
23
24
  private readonly errorReporter?;
24
25
  constructor(config: TranslationMemoryClientConfig);
25
- findMatches(groupId: string, request: FindMatchesRequest, context?: TranslationMemoryClientContext): Promise<TranslationMemoryRecord[]>;
26
- bulkFindMatches(groupId: string, { filters, options }: BulkFindMatchesRequest, context?: TranslationMemoryClientContext): Promise<BulkTranslationMemoryMatches[]>;
27
- bulkFindMatchesIterative(groupId: string, { filters, options }: BulkFindMatchesRequest, context?: TranslationMemoryClientContext): AsyncGenerator<BulkTranslationMemoryMatches[]>;
28
- getRecords(groupId: string, query?: GetTranslationMemoryRecordsQueryInput, context?: TranslationMemoryClientContext): Promise<TranslationMemoryRecordsResponse>;
29
- upsertRecords(groupId: string, records: UpsertTranslationMemoryRecordDto[], context?: TranslationMemoryClientContext): Promise<void>;
30
- deleteRecords(groupId: string, recordIds: string[], context?: TranslationMemoryClientContext): Promise<void>;
26
+ findMatches(context: TranslationMemoryClientContext, ownerId: string, request: FindMatchesRequest): Promise<TranslationMemoryRecord[]>;
27
+ bulkFindMatches(context: TranslationMemoryClientContext, ownerId: string, { filters, options }: BulkFindMatchesRequest): Promise<BulkTranslationMemoryMatches[]>;
28
+ bulkFindMatchesIterative(context: TranslationMemoryClientContext, ownerId: string, { filters, options }: BulkFindMatchesRequest): AsyncGenerator<BulkTranslationMemoryMatches[]>;
29
+ getRecords(context: TranslationMemoryClientContext, ownerId: string, query?: GetRecordsQuery): Promise<TranslationMemoryRecordsResponse>;
30
+ upsertRecords(context: TranslationMemoryClientContext, ownerGroupId: TmOwnerGroupId, records: UpsertTranslationMemoryRecordDto[]): Promise<void>;
31
+ deleteRecords(context: TranslationMemoryClientContext, ownerId: string, recordIds: string[]): Promise<void>;
31
32
  private internalBulkFindMatches;
32
33
  private handleError;
33
34
  }
@@ -33,12 +33,12 @@ export class TranslationMemoryClient {
33
33
  };
34
34
  this.errorReporter = config.errorReporter;
35
35
  }
36
- async findMatches(groupId, request, context = {}) {
36
+ async findMatches(context, ownerId, request) {
37
37
  if (!this.isEnabled)
38
38
  return [];
39
39
  try {
40
40
  const response = await sendByGetRoute(this.httpClient, getTranslationMemoryMatchesContract, {
41
- pathParams: { groupId },
41
+ pathParams: { ownerId },
42
42
  headers: this.headers,
43
43
  queryParams: transformToKebabCase(request),
44
44
  }, {
@@ -54,23 +54,23 @@ export class TranslationMemoryClient {
54
54
  throw this.handleError(e, context);
55
55
  }
56
56
  }
57
- async bulkFindMatches(groupId, { filters, options }, context = {}) {
57
+ async bulkFindMatches(context, ownerId, { filters, options }) {
58
58
  const response = [];
59
59
  for (const part of chunk(filters, this.maxFindMatchesRequestSize)) {
60
- const partialResponse = await this.internalBulkFindMatches(groupId, {
60
+ const partialResponse = await this.internalBulkFindMatches(context, ownerId, {
61
61
  filters: part,
62
62
  options,
63
- }, context);
63
+ });
64
64
  response.push(...partialResponse);
65
65
  }
66
66
  return response;
67
67
  }
68
- async *bulkFindMatchesIterative(groupId, { filters, options }, context = {}) {
68
+ async *bulkFindMatchesIterative(context, ownerId, { filters, options }) {
69
69
  for (const part of chunk(filters, this.maxFindMatchesRequestSize)) {
70
- yield await this.internalBulkFindMatches(groupId, { filters: part, options }, context);
70
+ yield await this.internalBulkFindMatches(context, ownerId, { filters: part, options });
71
71
  }
72
72
  }
73
- async getRecords(groupId, query, context = {}) {
73
+ async getRecords(context, ownerId, query) {
74
74
  if (!this.isEnabled) {
75
75
  return {
76
76
  records: [],
@@ -79,8 +79,8 @@ export class TranslationMemoryClient {
79
79
  }
80
80
  try {
81
81
  const response = await sendByGetRoute(this.httpClient, getTranslationMemoryRecordsContract, {
82
- pathParams: { groupId },
83
- queryParams: query ?? {},
82
+ pathParams: { ownerId },
83
+ queryParams: transformToKebabCase(query) ?? {},
84
84
  headers: this.headers,
85
85
  }, {
86
86
  reqContext: context.reqContext,
@@ -95,7 +95,7 @@ export class TranslationMemoryClient {
95
95
  throw this.handleError(e, context);
96
96
  }
97
97
  }
98
- async upsertRecords(groupId, records, context = {}) {
98
+ async upsertRecords(context, ownerGroupId, records) {
99
99
  if (!this.isEnabled)
100
100
  return;
101
101
  // Avoiding sending empty records
@@ -104,7 +104,7 @@ export class TranslationMemoryClient {
104
104
  return;
105
105
  try {
106
106
  await sendByPayloadRoute(this.httpClient, putTranslationMemoryRecordsContract, {
107
- pathParams: { groupId },
107
+ pathParams: ownerGroupId,
108
108
  body: recordsToInsert,
109
109
  headers: this.headers,
110
110
  }, {
@@ -119,7 +119,7 @@ export class TranslationMemoryClient {
119
119
  throw this.handleError(e, context);
120
120
  }
121
121
  }
122
- async deleteRecords(groupId, recordIds, context = {}) {
122
+ async deleteRecords(context, ownerId, recordIds) {
123
123
  if (!this.isEnabled)
124
124
  return;
125
125
  // Avoid sending empty requests
@@ -127,7 +127,7 @@ export class TranslationMemoryClient {
127
127
  return;
128
128
  try {
129
129
  await sendByPayloadRoute(this.httpClient, postDeleteTranslationMemoryRecordsContract, {
130
- pathParams: { groupId },
130
+ pathParams: { ownerId },
131
131
  body: { recordIds },
132
132
  headers: this.headers,
133
133
  }, {
@@ -142,7 +142,7 @@ export class TranslationMemoryClient {
142
142
  throw this.handleError(e, context);
143
143
  }
144
144
  }
145
- async internalBulkFindMatches(groupId, request, context) {
145
+ async internalBulkFindMatches(context, ownerId, request) {
146
146
  const result = [];
147
147
  if (!this.isEnabled)
148
148
  return result;
@@ -163,7 +163,7 @@ export class TranslationMemoryClient {
163
163
  }
164
164
  try {
165
165
  const response = await sendByPayloadRoute(this.httpClient, postBulkFindMatchesContract, {
166
- pathParams: { groupId },
166
+ pathParams: { ownerId },
167
167
  body: request,
168
168
  headers: this.headers,
169
169
  }, {
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationMemoryClient.js","sourceRoot":"","sources":["../../src/sdk/TranslationMemoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,cAAc,EACd,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EAAsB,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACvE,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put } from '@lokalise/tm-api-schemas';
1
2
  export type FindMatchesFilter = {
3
+ groupId?: string;
2
4
  sourceText: string;
3
5
  sourceLocale: string;
4
6
  targetLocale: string;
@@ -17,3 +19,7 @@ export type BulkFindMatchesRequest = {
17
19
  filters: BulkFindMatchesFilter[];
18
20
  options?: FindMatchesOptions;
19
21
  };
22
+ export type GetRecordsQuery = Omit<GetTranslationMemoryRecordsQueryInput, 'group-id' | 'flex-search-query'> & {
23
+ groupId?: GetTranslationMemoryRecordsQueryInput['group-id'];
24
+ flexSearchQuery?: GetTranslationMemoryRecordsQueryInput['flex-search-query'];
25
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lokalise/tm-sdk",
3
- "version": "9.0.0",
3
+ "version": "10.0.0",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Lokalise",
@@ -13,7 +13,7 @@
13
13
  "license": "Apache-2.0",
14
14
  "repository": {
15
15
  "type": "git",
16
- "url": "git://github.com/lokalise/tm-service.git"
16
+ "url": "git://github.com/lokalise/translation-memory.git"
17
17
  },
18
18
  "main": "dist/index.js",
19
19
  "exports": {
@@ -46,7 +46,7 @@
46
46
  "undici-retry": "^6.1.0"
47
47
  },
48
48
  "devDependencies": {
49
- "@biomejs/biome": "^2.2.4",
49
+ "@biomejs/biome": "^2.3.1",
50
50
  "@lokalise/biome-config": "^3.1.0",
51
51
  "@lokalise/fastify-extras": "^30.2.1",
52
52
  "@lokalise/tsconfig": "^3.0.0",