Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

deps: upgrade meilisearch client package

Mohamed Bassemaf3677a16ddd
diff --git a/packages/plugins/package.json b/packages/plugins/package.json
index dbd42b3a..aab7ab30 100644
--- a/packages/plugins/package.json
+++ b/packages/plugins/package.json
@@ -25,7 +25,7 @@
"@restatedev/restate-sdk-clients": "^1.10.3",
"async-mutex": "^0.4.1",
"liteque": "^0.8.0",
- "meilisearch": "^0.45.0",
+ "meilisearch": "^0.58.0",
"redis": "^5.11.0"
},
"devDependencies": {
diff --git a/packages/plugins/search-meilisearch/src/index.ts b/packages/plugins/search-meilisearch/src/index.ts
index 5374a4ec..5fee747e 100644
--- a/packages/plugins/search-meilisearch/src/index.ts
+++ b/packages/plugins/search-meilisearch/src/index.ts
@@ -1,6 +1,6 @@
import type { Index } from "meilisearch";
import { Mutex } from "async-mutex";
-import { MeiliSearch } from "meilisearch";
+import { Meilisearch } from "meilisearch";
import type {
BookmarkSearchDocument,
@@ -196,9 +196,9 @@ class BatchingDocumentQueue {
}
private async ensureTaskSuccess(taskUid: number): Promise<void> {
- const task = await this.index.waitForTask(taskUid, {
- intervalMs: 200,
- timeOutMs: this.jobTimeoutSec * 1000 * 0.9,
+ const task = await this.index.tasks.waitForTask(taskUid, {
+ interval: 200,
+ timeout: this.jobTimeoutSec * 1000 * 0.9,
});
if (task.error) {
throw new Error(`Search task failed: ${task.error.message}`);
@@ -286,9 +286,9 @@ class MeiliSearchIndexClient implements SearchIndexClient {
}
private async ensureTaskSuccess(taskUid: number): Promise<void> {
- const task = await this.index.waitForTask(taskUid, {
- intervalMs: 200,
- timeOutMs: this.jobTimeoutSec * 1000 * 0.9,
+ const task = await this.index.tasks.waitForTask(taskUid, {
+ interval: 200,
+ timeout: this.jobTimeoutSec * 1000 * 0.9,
});
if (task.error) {
throw new Error(`Search task failed: ${task.error.message}`);
@@ -297,14 +297,14 @@ class MeiliSearchIndexClient implements SearchIndexClient {
}
export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
- private client: MeiliSearch | undefined;
+ private client: Meilisearch | undefined;
private indexClient: SearchIndexClient | undefined;
private initPromise: Promise<SearchIndexClient | null> | undefined;
private readonly indexName = "bookmarks";
constructor() {
if (MeiliSearchProvider.isConfigured()) {
- this.client = new MeiliSearch({
+ this.client = new Meilisearch({
host: envConfig.MEILI_ADDR!,
apiKey: envConfig.MEILI_MASTER_KEY,
});
@@ -339,10 +339,11 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
let indexFound = indices.results.find((i) => i.uid === this.indexName);
if (!indexFound) {
- const idx = await this.client.createIndex(this.indexName, {
- primaryKey: "id",
- });
- await this.client.waitForTask(idx.taskUid);
+ await this.client
+ .createIndex(this.indexName, {
+ primaryKey: "id",
+ })
+ .waitTask();
indexFound = await this.client.getIndex<BookmarkSearchDocument>(
this.indexName,
);
@@ -373,10 +374,9 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
console.log(
`[meilisearch] Updating desired filterable attributes to ${desiredFilterableAttributes} from ${settings.filterableAttributes}`,
);
- const taskId = await index.updateFilterableAttributes(
- desiredFilterableAttributes,
- );
- await this.client!.waitForTask(taskId.taskUid);
+ await index
+ .updateFilterableAttributes(desiredFilterableAttributes)
+ .waitTask();
}
if (
@@ -386,10 +386,9 @@ export class MeiliSearchProvider implements PluginProvider<SearchIndexClient> {
console.log(
`[meilisearch] Updating desired sortable attributes to ${desiredSortableAttributes} from ${settings.sortableAttributes}`,
);
- const taskId = await index.updateSortableAttributes(
- desiredSortableAttributes,
- );
- await this.client!.waitForTask(taskId.taskUid);
+ await index
+ .updateSortableAttributes(desiredSortableAttributes)
+ .waitTask();
}
}
}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index e466d125..edff8327 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -1275,8 +1275,8 @@ importers:
specifier: ^0.8.0
meilisearch:
- specifier: ^0.45.0
- version: 0.45.0
+ specifier: ^0.58.0
+ version: 0.58.0
redis:
specifier: ^5.11.0
version: 5.11.0
@@ -12016,8 +12016,9 @@ packages:
resolution: {integrity: sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==}
engines: {node: '>= 0.8'}
- resolution: {integrity: sha512-+zCzEqE+CumY4icB0Vox180adZqaNtnr60hJWGiEdmol5eWmksfY8rYsTcz87styXC2ZOg+2yF56gdH6oyIBTA==}
+ resolution: {integrity: sha512-MXFlU+JVG2I3tDI4brS3UHxEv2fjOROP24TPP16c8dGHTulb1kxMgXvKP0x4ImvUcsVVJFi4QXP0JNDS/TaWaw==}
+ engines: {node: ^20.19.0 || >=22.12.0}
resolution: {integrity: sha512-UERzLsxzllchadvbPs5aolHh65ISpKpM+ccLbOJ8/vvpBKmAWf+la7dXFy7Mr0ySHbdHrFv5kGFCUHHe6GFEmw==}
@@ -29931,7 +29932,7 @@ snapshots:
dependencies:
diff --git a/tooling/typescript/node.json b/tooling/typescript/node.json
index 288f6e63..441a9c5a 100644
--- a/tooling/typescript/node.json
+++ b/tooling/typescript/node.json
@@ -5,7 +5,7 @@
"exclude": ["node_modules", "build", "dist", ".next", ".expo"],
"compilerOptions": {
"module": "ESNext",
- "moduleResolution": "node",
+ "moduleResolution": "bundler",
"incremental": true,
"isolatedModules": true,
"strict": true,