Skip to content

Commit af3677a

Browse files
committed
deps: upgrade meilisearch client package
1 parent 8463ad0 commit af3677a

4 files changed

Lines changed: 28 additions & 28 deletions

File tree

‎packages/plugins/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@restatedev/restate-sdk-clients": "^1.10.3",
2626
"async-mutex": "^0.4.1",
2727
"liteque": "^0.8.0",
28-
"meilisearch": "^0.45.0",
28+
"meilisearch": "^0.58.0",
2929
"redis": "^5.11.0"
3030
},
3131
"devDependencies": {

‎packages/plugins/search-meilisearch/src/index.ts‎

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Index } from "meilisearch";
22
import { Mutex } from "async-mutex";
3-
import { MeiliSearch } from "meilisearch";
3+
import { Meilisearch } from "meilisearch";
44

55
import type {
66
BookmarkSearchDocument,
@@ -196,9 +196,9 @@ class BatchingDocumentQueue {
196196
}
197197

198198
private async ensureTaskSuccess(taskUid: number): Promise<void> {
199-
const task = await this.index.waitForTask(taskUid, {
200-
intervalMs: 200,
201-
timeOutMs: this.jobTimeoutSec * 1000 * 0.9,
199+
const task = await this.index.tasks.waitForTask(taskUid, {
200+
interval: 200,
201+
timeout: this.jobTimeoutSec * 1000 * 0.9,
202202
});
203203
if (task.error) {
204204
throw new Error(`Search task failed: ${task.error.message}`);
@@ -286,9 +286,9 @@ class MeiliSearchIndexClient implements SearchIndexClient {
286286
}
287287

288288
private async ensureTaskSuccess(taskUid: number): Promise<void> {
289-
const task = await this.index.waitForTask(taskUid, {
290-
intervalMs: 200,
291-
timeOutMs: this.jobTimeoutSec * 1000 * 0.9,
289+
const task = await this.index.tasks.waitForTask(taskUid, {
290+
interval: 200,
291+
timeout: this.jobTimeoutSec * 1000 * 0.9,
292292
});
293293
if (task.error) {
294294
throw new Error(`Search task failed: ${task.error.message}`);
@@ -297,14 +297,14 @@ class MeiliSearchIndexClient implements SearchIndexClient {
297297
}
298298

299299
export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
300-
private client: MeiliSearch | undefined;
300+
private client: Meilisearch | undefined;
301301
private indexClient: SearchIndexClient | undefined;
302302
private initPromise: Promise<SearchIndexClient | null> | undefined;
303303
private readonly indexName = "bookmarks";
304304

305305
constructor() {
306306
if (MeiliSearchProvider.isConfigured()) {
307-
this.client = new MeiliSearch({
307+
this.client = new Meilisearch({
308308
host: envConfig.MEILI_ADDR!,
309309
apiKey: envConfig.MEILI_MASTER_KEY,
310310
});
@@ -339,10 +339,11 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
339339
let indexFound = indices.results.find((i) => i.uid === this.indexName);
340340

341341
if (!indexFound) {
342-
const idx = await this.client.createIndex(this.indexName, {
343-
primaryKey: "id",
344-
});
345-
await this.client.waitForTask(idx.taskUid);
342+
await this.client
343+
.createIndex(this.indexName, {
344+
primaryKey: "id",
345+
})
346+
.waitTask();
346347
indexFound = await this.client.getIndex<BookmarkSearchDocument>(
347348
this.indexName,
348349
);
@@ -373,10 +374,9 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
373374
console.log(
374375
`[meilisearch] Updating desired filterable attributes to ${desiredFilterableAttributes} from ${settings.filterableAttributes}`,
375376
);
376-
const taskId = await index.updateFilterableAttributes(
377-
desiredFilterableAttributes,
378-
);
379-
await this.client!.waitForTask(taskId.taskUid);
377+
await index
378+
.updateFilterableAttributes(desiredFilterableAttributes)
379+
.waitTask();
380380
}
381381

382382
if (
@@ -386,10 +386,9 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
386386
console.log(
387387
`[meilisearch] Updating desired sortable attributes to ${desiredSortableAttributes} from ${settings.sortableAttributes}`,
388388
);
389-
const taskId = await index.updateSortableAttributes(
390-
desiredSortableAttributes,
391-
);
392-
await this.client!.waitForTask(taskId.taskUid);
389+
await index
390+
.updateSortableAttributes(desiredSortableAttributes)
391+
.waitTask();
393392
}
394393
}
395394
}

‎pnpm-lock.yaml‎

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tooling/typescript/node.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"exclude": ["node_modules", "build", "dist", ".next", ".expo"],
66
"compilerOptions": {
77
"module": "ESNext",
8-
"moduleResolution": "node",
8+
"moduleResolution": "bundler",
99
"incremental": true,
1010
"isolatedModules": true,
1111
"strict": true,

0 commit comments

Comments
 (0)